:root{color:#1f2933;font-synthesis:none;text-rendering:optimizelegibility;background:#eef1f4;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}html{overflow-y:scroll}*{box-sizing:border-box}body{overflow-anchor:none;min-width:320px;margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{grid-template-columns:260px 1fr;min-height:100vh;display:grid}.sidebar{color:#f4f6f8;background:#172026;flex-direction:column;gap:28px;padding:24px;display:flex}.brand{align-items:center;gap:12px;display:flex}.brand-logo{object-fit:cover;object-position:center calc(50% + 3px);background:#fff;border-radius:8px;width:72px;height:72px;padding:0;display:block}.brand strong,.brand span{display:block}.brand span{color:#aab5bf;margin-top:3px;font-size:13px}.nav{gap:8px;display:grid}.nav button,.actions button,.lesson-footer button{border:0;border-radius:8px;justify-content:center;align-items:center;gap:10px;display:inline-flex}.nav button{color:#dbe2e8;background:0 0;justify-content:flex-start;min-height:44px;padding:0 12px}.nav button.active{color:#fff;background:#26333c}.quick-stats{border-top:1px solid #2f3d46;gap:14px;margin-top:auto;padding-top:22px;display:grid}.quick-stats div{color:#cad4dd;align-items:center;gap:10px;display:flex}.workspace{overflow-anchor:none;flex-direction:column;gap:24px;min-width:0;padding:28px;display:flex}.topbar{justify-content:space-between;align-items:center;gap:20px;display:flex}.eyebrow{color:#66717b;letter-spacing:0;text-transform:uppercase;margin:0 0 4px;font-size:13px;font-weight:700}h1,h2,h3,p{margin-top:0}h1{margin-bottom:0;font-size:30px;line-height:1.12}.actions{gap:8px;display:flex}.actions button,.lesson-footer button{color:#1f2933;background:#fff;border:1px solid #d8dee5;width:42px;height:42px}.topbar .actions button{width:auto;padding:0 12px}.play-layout{overflow-anchor:none;grid-template-columns:minmax(0,1fr) minmax(280px,360px);align-items:start;gap:24px;display:grid}.board-panel,.side-panel section,.lesson-card,.lesson-form,.publishing-panel{background:#fff;border:1px solid #d8dee5;border-radius:8px}.board-panel{overflow-anchor:none;align-self:start;min-width:0;padding:18px}.game-header{justify-content:space-between;align-items:center;gap:16px;min-height:74px;margin-bottom:16px;display:flex}.game-header>div{flex:1;min-width:0}.game-header h2{text-overflow:ellipsis;white-space:nowrap;min-height:27px;margin-bottom:0;font-size:22px;line-height:1.22;overflow:hidden}.game-header .muted{text-overflow:ellipsis;white-space:nowrap;min-height:20px;margin:0;overflow:hidden}.mode-pill{color:#66717b;text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:6px;margin-bottom:8px;font-size:13px;font-weight:700;display:inline-flex;overflow:hidden}.result-banner{border-radius:8px;align-items:flex-start;gap:3px;max-width:100%;margin-top:8px;padding:6px 10px;font-size:14px;font-weight:800;animation:.35s ease-out resultBannerPop;display:inline-grid;position:relative;overflow:hidden;transform:translateZ(0)}@keyframes resultBannerPop{0%{opacity:.8;transform:scale(.98)translateY(2px)}to{opacity:1;transform:scale(1)translateY(0)}}.result-banner-sub{color:#26333c;opacity:.85;overflow-wrap:anywhere;gap:1px;min-width:0;font-size:12px;font-weight:700;line-height:1.25;display:grid}.result-banner-sub>span{min-width:0}.result-banner-win{color:#0f5132;background:linear-gradient(90deg,#dff6e6,#c8f0cf);border:1px solid #95d3a7}.result-banner-loss{color:#9f2a12;background:linear-gradient(90deg,#fee4df,#f8d0c9);border:1px solid #f5ac97}.result-banner-draw{color:#4b5563;background:#f5f7f9;border:1px solid #ccd4dc}.text-button,.primary-button{white-space:nowrap;border:0;border-radius:8px;justify-content:center;align-items:center;gap:8px;min-height:40px;padding:0 14px;display:inline-flex}.text-button{color:#26333c;background:#eef1f4}.danger-button{color:#9f2a12;background:#fee4df}.success-button{color:#0f5132;background:#dff6e6}button:disabled{cursor:not-allowed;opacity:.55}.room-panel{overflow-anchor:none;background:#f8fafb;border:1px solid #d8dee5;border-radius:8px;gap:12px;min-height:398px;margin-bottom:16px;padding:14px;display:grid}.room-summary{grid-template-columns:repeat(4,minmax(140px,1fr));grid-auto-rows:32px;gap:8px;min-height:112px;max-height:112px;display:grid;overflow:hidden}.room-summary span{color:#47525d;text-overflow:ellipsis;white-space:nowrap;background:#fff;border:1px solid #d8dee5;border-radius:8px;align-items:center;min-height:32px;padding:6px 10px;font-size:13px;font-weight:700;display:inline-flex;overflow:hidden}.status-badge{background:#fff;border-color:#d8dee5}.room-summary .status-badge{background:inherit}.status-badge-success,.room-summary .status-badge-success{color:#0f5f2e;background:#e8f7ec;border-color:#a8e1b2}.status-badge-warn{color:#8d4f0f;background:#fff4e5;border-color:#ffd18f}.room-summary .ai-turn-chip{text-overflow:ellipsis;min-width:0;overflow:hidden}.reset-button{border:1px solid #f5c4b8}.room-actions{overflow-anchor:none;grid-template-columns:repeat(auto-fill,150px);grid-auto-rows:40px;align-items:stretch;gap:10px;min-height:140px;display:grid}.room-actions form{grid-column:span 2;align-items:center;gap:8px;width:310px;display:flex}.room-actions>.text-button,.room-actions>.time-control-select,.room-actions>.compact-select{flex:0 0 150px;width:150px;min-width:150px;max-width:150px}.room-actions>.text-button{padding-left:10px;padding-right:10px}.room-actions input{color:#1f2933;text-transform:uppercase;background:#fff;border:1px solid #ccd4dc;border-radius:8px;flex:0 0 150px;width:150px;min-width:150px;max-width:150px;min-height:40px;padding:8px 10px}.room-actions>.primary-button,.room-actions>.text-button,.room-actions>.time-control-select,.room-actions>.compact-select,.room-actions>.compact-button{min-height:40px;max-height:40px}.room-actions>form .primary-button{flex:0 0 150px;width:150px;min-width:150px;max-width:150px}.time-control-select{color:#1f2933;background:#fff;border:1px solid #ccd4dc;border-radius:8px;min-height:40px;padding:8px 10px}.compact-select{height:40px;min-height:32px;padding:6px 9px}.compact-button{min-height:32px;padding:0 10px}.save-status{flex:0 0 230px;grid-column:span 2;align-items:center;width:230px;min-height:40px;font-weight:700;display:inline-flex}.save-status.empty,.room-error-line.empty{visibility:hidden}.room-error-line{min-height:18px}.open-rooms{border-top:1px solid #d8dee5;gap:10px;min-height:76px;padding-top:12px;display:grid}.open-rooms-header{justify-content:space-between;align-items:center;gap:12px;display:flex}.open-rooms-actions{align-items:center;gap:8px;display:flex}.open-rooms-header strong{color:#26333c;font-size:14px}.open-room-list{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px;display:grid}.recent-room-list,.history-room-list{grid-template-columns:1fr;gap:8px;display:grid}.open-room{color:#1f2933;text-align:left;background:#fff;border:1px solid #d8dee5;border-radius:8px;gap:4px;min-height:78px;padding:10px;display:grid}.open-room:hover:not(:disabled){border-color:#d9643a}.open-room.active-game,.open-room.waiting-player{border-color:#c3d6ff}.open-room.active-game .open-room-status,.open-room.waiting-player .open-room-status{font-weight:800}.open-room strong{font-size:15px}.open-room span,.open-room small{color:#66717b;text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.open-room-status{color:#66717b;font-size:12px;font-weight:700}.current-room{opacity:.65}.open-room.active-game .open-room-status{color:#9f2a12}.open-room.waiting-player .open-room-status{color:#0f5132}.clock-panel{overflow-anchor:none;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:14px;display:grid}.clock-box{background:#f5f7f9;border:1px solid #d8dee5;border-radius:8px;gap:6px;padding:12px;display:grid}.clock-box.active{border-color:#d9643a;box-shadow:0 0 0 2px #d9643a29}.clock-box span{color:#66717b;font-size:13px;font-weight:800}.clock-box em{color:#47525d;text-overflow:ellipsis;white-space:nowrap;min-height:18px;font-size:14px;font-style:normal;font-weight:800;overflow:hidden}.clock-box strong{color:#172026;font-size:28px;line-height:1}.time-extension-panel{color:#0f5132;background:#e7f7ed;border:1px solid #8bd3a5;border-radius:8px;justify-content:space-between;align-items:center;gap:10px;min-height:46px;margin:-2px 0 14px;padding:8px 10px;font-size:14px;font-weight:800;display:flex}.form-error{color:#b42318;margin:0;font-size:14px;font-weight:700}.wide-message{grid-column:1/-1}.board-settings{justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;display:flex}.board-settings>span{color:#47525d;font-size:14px;font-weight:800}.theme-options{gap:8px;display:flex}.theme-button{background:#fff;border:1px solid #ccd4dc;border-radius:8px;place-items:center;width:48px;height:36px;padding:3px;display:grid}.theme-button.active{border-color:#d9643a;box-shadow:0 0 0 2px #d9643a38}.theme-swatch{background:linear-gradient(135deg, var(--swatch-light) 0 50%, var(--swatch-dark) 50% 100%);border-radius:5px;width:100%;height:100%;display:block}.captures-bar{background:#f5f7f9;border:1px solid #d8dee5;border-radius:8px;grid-template-columns:116px 1fr;align-items:center;gap:10px;min-height:56px;padding:10px 12px;display:grid}.captures-bar.top{margin-bottom:10px}.captures-bar.bottom{margin-top:10px}.captures-bar span{color:#47525d;white-space:nowrap;font-size:13px;font-weight:800}.captures-bar div{align-items:center;gap:8px;min-width:0;min-height:38px;display:flex;overflow:hidden}.captures-bar strong{--piece-size:38px;height:var(--piece-size);width:var(--piece-size);flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}.captures-bar em{color:#8a96a3;font-size:13px;font-style:normal;font-weight:700}.check-alert{color:#9f2a12;letter-spacing:0;opacity:0;pointer-events:none;visibility:hidden;background:#fff5d6;border:1px solid #f4c95d;border-radius:8px;justify-content:center;align-items:center;min-height:34px;margin:8px 0;font-size:15px;font-weight:900;display:flex}.check-alert.visible{opacity:1;visibility:visible;animation:.9s ease-in-out infinite check-flash}@keyframes check-flash{0%,to{box-shadow:0 0 #d9643a52}50%{box-shadow:0 0 0 4px #d9643a2e}}.board{aspect-ratio:1;grid-template-rows:repeat(8,1fr);grid-template-columns:repeat(8,1fr);width:100%;max-width:760px;max-height:min(78vh,760px);margin-inline:auto;display:grid;overflow:hidden}.square{border:0;place-items:center;min-width:0;min-height:0;padding:0;display:grid;position:relative}.square.light{background:var(--board-light,#e7d7bd)}.square.dark{background:var(--board-dark,#58735f)}.square.selected{box-shadow:inset 0 0 0 5px #f4c95d}.square.target:after{content:"";background:#1f293347;border-radius:999px;width:22%;height:22%;position:absolute;top:39%;left:39%}.square span{--piece-size:clamp(30px, 8.4vw, 54px);height:var(--piece-size);-webkit-user-select:none;user-select:none;width:var(--piece-size);justify-content:center;align-items:center;line-height:1;display:inline-flex;transform:translateY(-1px)}.chess-piece-img{object-fit:contain;pointer-events:none;width:100%;height:100%;display:block}.black-piece{filter:drop-shadow(0 1px #ffffff4d)drop-shadow(0 3px 5px #0000003d)}.white-piece{filter:drop-shadow(0 1px 1px #1118276b)drop-shadow(0 2px 4px #11182738)}.square small{color:#1f29338c;font-size:10px;font-weight:700;position:absolute;bottom:4px;left:6px}.side-panel{overflow-anchor:none;gap:16px;min-width:0;display:grid}.side-panel section{padding:18px}.side-panel h3{align-items:center;gap:8px;margin-bottom:14px;font-size:18px;display:flex}.move-list{overflow-anchor:none;gap:8px;min-height:300px;max-height:300px;display:grid;overflow:auto}.move-list p{background:#f5f7f9;border-radius:6px;margin:0;padding:8px 10px}.saved-games{overflow-anchor:none;gap:8px;display:grid}.saved-game{background:#f5f7f9;border:1px solid #e2e8ee;border-radius:8px;gap:4px;padding:10px;display:grid}.saved-game strong{color:#1f2933;font-size:14px}.saved-game span,.saved-game small{color:#66717b;font-size:13px}.muted{color:#66717b}.learning-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;display:grid}.lesson-card{cursor:pointer;flex-direction:column;min-height:170px;padding:20px;transition:border-color .16s,box-shadow .16s,transform .16s;display:flex}.lesson-card:hover,.lesson-card.expanded{border-color:#b9c4ce;box-shadow:0 10px 28px #1f293314}.lesson-card:hover{transform:translateY(-1px)}.lesson-card.expanded{min-height:220px}.lesson-meta,.lesson-footer,.pipeline{justify-content:space-between;align-items:center;gap:10px;display:flex}.lesson-meta span,.lesson-footer span,.pipeline span{color:#47525d;background:#eef1f4;border-radius:999px;padding:6px 10px;font-size:13px;font-weight:700}.lesson-card h2{margin:18px 0 10px;font-size:22px}.lesson-card p{color:#56616b;line-height:1.5}.lesson-footer{margin-top:auto}.admin-layout{grid-template-columns:minmax(320px,560px) 1fr;gap:24px;display:grid}.lesson-form,.publishing-panel{padding:22px}.lesson-form,.auth-form,.profile-panel{gap:16px;display:grid}.lesson-form label,.auth-form label{color:#47525d;gap:7px;font-size:14px;font-weight:700;display:grid}.lesson-form input,.lesson-form select,.lesson-form textarea,.auth-form input{color:#1f2933;background:#f8fafb;border:1px solid #ccd4dc;border-radius:8px;min-height:42px;padding:9px 11px}.lesson-form textarea{resize:vertical;min-height:110px}.form-row{grid-template-columns:repeat(2,1fr);gap:12px;display:grid}.primary-button{color:#fff;background:#d9643a;justify-content:center;font-weight:800}.publishing-panel p{line-height:1.55}.pipeline{margin-top:22px}.account-layout{max-width:780px}.auth-form,.profile-panel{background:#fff;border:1px solid #d8dee5;border-radius:8px;padding:22px}.auth-switch{background:#eef1f4;border-radius:8px;grid-template-columns:repeat(2,1fr);gap:4px;padding:4px;display:grid}.auth-switch button{color:#47525d;background:0 0;border:0;border-radius:6px;min-height:38px;font-weight:800}.auth-switch button.active{color:#172026;background:#fff}.profile-grid{grid-template-columns:repeat(3,1fr);gap:12px;display:grid}.profile-grid div{background:#f5f7f9;border:1px solid #e2e8ee;border-radius:8px;gap:6px;padding:12px;display:grid}.profile-grid span{color:#66717b;font-size:13px;font-weight:700}.profile-grid strong{color:#1f2933;overflow-wrap:anywhere}.profile-header{align-items:center;gap:14px;display:flex}.profile-header h2{margin-bottom:4px}.profile-header span{color:#66717b;overflow-wrap:anywhere}.profile-avatar{color:#172026;background:#f4c95d;border-radius:8px;flex:0 0 56px;place-items:center;width:56px;height:56px;font-size:28px;font-weight:900;display:grid}.profile-edit{background:#f8fafb;border:1px solid #e2e8ee;border-radius:8px;gap:12px;padding:14px;display:grid}.profile-edit label{color:#47525d;gap:7px;font-size:14px;font-weight:700;display:grid}.profile-edit input{color:#1f2933;background:#fff;border:1px solid #ccd4dc;border-radius:8px;min-height:42px;padding:9px 11px}.profile-meta{grid-template-columns:repeat(2,1fr);gap:12px;display:grid}.profile-meta div{background:#f5f7f9;border:1px solid #e2e8ee;border-radius:8px;gap:6px;padding:12px;display:grid}.profile-meta span{color:#66717b;font-size:13px;font-weight:700}.profile-meta strong{color:#1f2933;overflow-wrap:anywhere}.profile-history{gap:12px;display:grid}.profile-history h3{align-items:center;gap:8px;margin-bottom:0;display:flex}.profile-actions{justify-content:flex-start;display:flex}@media (width<=980px){.app-shell{grid-template-columns:1fr}.sidebar{gap:16px}.nav{grid-template-columns:repeat(4,1fr)}.quick-stats{display:none}.play-layout,.admin-layout{grid-template-columns:1fr}}@media (width<=620px){.workspace,.sidebar{padding:18px}.topbar,.game-header{flex-direction:column;align-items:flex-start}.topbar .actions{grid-template-columns:1fr;width:100%;display:grid}.topbar .actions button{white-space:normal;width:100%;height:auto;min-height:42px}.nav{grid-template-columns:1fr}h1{font-size:24px}.board-panel{padding:10px}.form-row,.profile-grid{grid-template-columns:1fr}.profile-header{align-items:flex-start}.profile-meta{grid-template-columns:1fr}.room-summary{grid-template-columns:1fr;min-height:152px;max-height:152px}.room-actions,.room-actions form{grid-template-columns:1fr;align-items:stretch;width:100%}.room-actions>.text-button,.room-actions>.time-control-select,.room-actions>.compact-select,.room-actions>.primary-button,.room-actions>.compact-button,.room-actions>form .primary-button,.save-status{width:100%;min-width:0;max-width:none}.room-actions input,.room-actions button,.time-control-select{width:100%;max-width:none}.room-actions form,.room-actions form .primary-button,.room-actions form input{width:100%;min-width:0}.room-actions form,.room-actions .save-status{grid-column:auto}.clock-panel{grid-template-columns:1fr}.time-extension-panel{flex-direction:column;align-items:stretch}.board-settings{flex-direction:column;align-items:flex-start}.square span{--piece-size:clamp(30px, 12vmin, 48px);font-size:var(--piece-size);transform:translateY(-2px)}.captures-bar{grid-template-columns:1fr;min-height:72px}.captures-bar div{min-height:34px}.captures-bar strong{font-size:34px}.theme-options{width:100%}.theme-button{flex:1}}
