:root{--bg-dark-top:#0f0d0b;--bg-dark-mid:#191512;--bg-dark-bot:#0a0907;--surface:#1e1a16;--surface-elevated:#28221c;--surface-hud:#181411eb;--gold-imperial:#d4af37;--gold-light:#f3e5ab;--gold-border:#d4af375c;--gold-border-strong:#d4af37b8;--roman-crimson:#5a1827;--crimson-alert:#9b2234;--marble-white:#f9f7f2;--text-muted:#b8ae9f;--verdigris:#4a7c6d;--font-display:"Cinzel", Georgia, serif;--font-sans:"Plus Jakarta Sans", system-ui, -apple-system, sans-serif;--font-mono:"JetBrains Mono", ui-monospace, monospace}*,:before,:after{box-sizing:border-box}html,body{background:radial-gradient(circle at 50% 35%, var(--bg-dark-mid) 0%, var(--bg-dark-top) 58%, var(--bg-dark-bot) 100%);width:100%;height:100%;color:var(--marble-white);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-webkit-user-select:none;user-select:none;margin:0;padding:0;overflow:hidden}.hidden{display:none!important}.viewport-root{width:100vw;height:100vh;position:relative;overflow:hidden}#canvas-container{z-index:1;width:100%;height:100%;position:absolute;inset:0}#canvas-container canvas{outline:none;width:100%;height:100%;display:block}.webgl-fallback{z-index:50;background:#0a0907f0;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.hud-layer{z-index:10;pointer-events:none;position:absolute;inset:0}.hud-top,.hud-camera-rail,.hud-bottom{pointer-events:auto}.hud-top{background:var(--surface-hud);border:1px solid var(--gold-border);border-radius:10px;justify-content:space-between;align-items:center;gap:16px;padding:10px 18px;display:flex;position:fixed;top:14px;left:16px;right:16px;box-shadow:0 12px 32px #0000008c}.hud-brand{flex-shrink:0;align-items:center;gap:12px;min-width:0;display:flex}.brand-emblem{width:28px;height:28px;color:var(--gold-imperial);flex-shrink:0}.brand-text{flex-direction:column;gap:2px;display:flex}.brand-title{font-family:var(--font-display);letter-spacing:.08em;color:var(--gold-light);white-space:nowrap;margin:0;font-size:1.05rem;font-weight:700}.brand-subtitle{color:var(--text-muted);white-space:nowrap;margin:0;font-size:.78rem}.hud-status-group{flex-wrap:wrap;justify-content:center;align-items:center;gap:14px;min-width:0;display:flex}.status-turn{color:var(--marble-white);white-space:nowrap;align-items:center;gap:9px;font-size:.9rem;font-weight:500;display:flex}.material-swatch{border:1px solid var(--gold-imperial);border-radius:3px;flex-shrink:0;width:13px;height:13px;display:inline-block}.swatch-white{background:linear-gradient(135deg,#faf8f3 0%,#c7bda9 100%)}.swatch-black{background:linear-gradient(135deg,#5b4a3a 0%,#1e1813 60%,#3f6f61 100%)}.status-ai{color:var(--gold-light);white-space:nowrap;border-left:1px solid #d4af3740;align-items:center;gap:8px;padding-left:12px;font-size:.84rem;display:flex}.imperial-spinner{border:2px solid #d4af3747;border-top-color:var(--gold-imperial);border-radius:50%;width:14px;height:14px;animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.status-check{background:var(--roman-crimson);border:1px solid var(--crimson-alert);letter-spacing:.04em;color:#fce7ea;white-space:nowrap;border-radius:6px;align-items:center;gap:6px;padding:4px 10px;font-size:.8rem;font-weight:600;display:flex}.alert-icon{width:15px;height:15px;color:var(--gold-light)}.hud-top-actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.opponent-switch{background:var(--surface);border:1px solid var(--gold-border);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.opponent-btn{color:var(--text-muted);font-family:var(--font-sans);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;padding:6px 11px;font-size:.78rem;font-weight:600;transition:background-color .15s,color .15s}.opponent-btn:hover{color:var(--marble-white)}.opponent-btn.is-active{color:var(--gold-light);background:#d4af3733}.auth-top-btn{background:var(--surface);height:40px;color:var(--gold-light);border:1px solid var(--gold-border);font-family:var(--font-sans);cursor:pointer;white-space:nowrap;border-radius:8px;align-items:center;gap:7px;padding:0 12px;font-size:.8rem;font-weight:600;transition:background-color .16s,border-color .16s,transform .16s;display:inline-flex}.auth-top-btn svg{flex-shrink:0;width:17px;height:17px}.auth-top-btn span{text-overflow:ellipsis;max-width:155px;overflow:hidden}.auth-top-btn:hover{background:var(--surface-elevated);border-color:var(--gold-border-strong);transform:translateY(-1px)}.auth-top-btn.is-logged-in{color:var(--marble-white);background:#4a7c6d38;border-color:#6ea997}.icon-btn{background:var(--surface);width:40px;height:40px;color:var(--gold-light);border:1px solid var(--gold-border);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;padding:0;transition:background-color .16s,border-color .16s,transform .16s;display:inline-flex}.icon-btn svg{width:20px;height:20px}.icon-btn:hover{background:var(--surface-elevated);border-color:var(--gold-border-strong);transform:translateY(-1px)}.hud-camera-rail{background:var(--surface-hud);border:1px solid var(--gold-border);border-radius:10px;flex-direction:column;gap:8px;padding:8px;display:flex;position:fixed;top:50%;right:16px;transform:translateY(-50%);box-shadow:0 12px 28px #00000080}.cam-btn{min-width:78px;min-height:54px;color:var(--text-muted);font-family:var(--font-sans);cursor:pointer;white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:7px;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:8px 10px;font-size:.72rem;font-weight:500;transition:background-color .16s,color .16s,border-color .16s;display:flex}.cam-btn svg{width:19px;height:19px}.cam-btn:hover{color:var(--marble-white);background:#ffffff0d}.cam-btn.is-active{color:var(--gold-light);border-color:var(--gold-border-strong);background:#d4af3724}.hud-bottom{background:var(--surface-hud);border:1px solid var(--gold-border);border-radius:10px;justify-content:space-between;align-items:center;gap:16px;padding:10px 18px;display:flex;position:fixed;bottom:14px;left:16px;right:16px;box-shadow:0 12px 32px #0000008c}.captured-strip{flex-wrap:wrap;align-items:center;gap:10px 14px;min-width:0;font-size:.82rem;display:flex}.captured-side{align-items:center;gap:6px;min-width:0;display:flex}.captured-label{color:var(--gold-light);white-space:nowrap;font-weight:600}.captured-list{color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;max-width:280px;overflow:hidden}.captured-sep{color:#d4af3759}.hud-bottom-actions{flex-shrink:0;align-items:center;gap:10px;display:flex}.action-btn{background:var(--surface);min-height:40px;color:var(--marble-white);border:1px solid var(--gold-border);font-family:var(--font-sans);white-space:nowrap;cursor:pointer;border-radius:8px;justify-content:center;align-items:center;gap:7px;padding:8px 16px;font-size:.85rem;font-weight:500;transition:background-color .16s,border-color .16s,opacity .16s;display:inline-flex}.action-btn svg{width:16px;height:16px;color:var(--gold-imperial)}.action-btn:hover:not(:disabled){background:var(--surface-elevated);border-color:var(--gold-border-strong)}.action-btn:disabled{opacity:.42;cursor:not-allowed}.action-btn-gold{border-color:var(--gold-border-strong);color:var(--gold-light)}.modal-backdrop{z-index:40;background:#0a0907cc;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.modal-card{border:1px solid var(--gold-border-strong);background:linear-gradient(#231e19 0%,#181411 100%);border-radius:12px;flex-direction:column;width:100%;max-width:680px;max-height:90vh;display:flex;overflow:hidden;box-shadow:0 24px 64px #000000c7}.modal-reference-card{max-width:980px}.modal-history-card{max-width:520px}.modal-promo-card,.modal-gameover-card{max-width:500px}.modal-header{border-bottom:1px solid #d4af373d;justify-content:space-between;align-items:center;gap:16px;padding:18px 22px;display:flex}.modal-kicker{letter-spacing:.08em;text-transform:uppercase;color:var(--gold-imperial);margin:0 0 3px;font-size:.74rem}.modal-title{font-family:var(--font-display);color:var(--gold-light);margin:0;font-size:1.35rem;font-weight:700}.modal-close{width:38px;height:38px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #d4af3740;border-radius:8px;justify-content:center;align-items:center;font-size:1.4rem;line-height:1;transition:color .15s,border-color .15s;display:inline-flex}.modal-close:hover{color:var(--marble-white);border-color:var(--gold-imperial)}.modal-body{padding:20px 22px;overflow-y:auto}.modal-desc{color:var(--text-muted);margin:0 0 16px;font-size:.94rem;line-height:1.6}.modal-footer{background:#0f0d0ba6;border-top:1px solid #d4af3738;justify-content:flex-end;align-items:center;gap:12px;padding:14px 22px;display:flex}.btn-primary,.btn-secondary{min-height:42px;font-family:var(--font-sans);cursor:pointer;white-space:nowrap;border-radius:8px;padding:10px 20px;font-size:.9rem;font-weight:600;transition:transform .15s,background-color .15s,border-color .15s}.btn-primary{color:#16120e;background:linear-gradient(#dfc052 0%,#c19a28 100%);border:1px solid #f3e5ab}.btn-primary:hover{background:linear-gradient(#ebd06b 0%,#cca431 100%);transform:translateY(-1px)}.btn-secondary{background:var(--surface);color:var(--marble-white);border:1px solid var(--gold-border)}.btn-secondary:hover{background:var(--surface-elevated);border-color:var(--gold-border-strong)}.form-section{margin-bottom:18px}.form-section:last-child{margin-bottom:0}.form-label{color:var(--gold-light);margin-bottom:8px;font-size:.84rem;font-weight:600;display:block}.segmented-grid{gap:10px;display:grid}.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}.three-cols{grid-template-columns:repeat(3,minmax(0,1fr))}.choice-card{text-align:left;color:var(--marble-white);font-family:var(--font-sans);cursor:pointer;background:#0f0d0b8c;border:1px solid #d4af3740;border-radius:8px;flex-direction:column;align-items:flex-start;gap:5px;padding:12px 14px;transition:border-color .16s,background-color .16s;display:flex}.choice-card strong{color:var(--marble-white);font-size:.92rem;font-weight:600}.choice-card span{color:var(--text-muted);font-size:.78rem;line-height:1.4}.choice-swatch-row{align-items:center;gap:8px;display:inline-flex}.choice-card:hover{border-color:var(--gold-border-strong);background:#2a231db3}.choice-card.is-selected{border-color:var(--gold-imperial);background:#d4af371f}.choice-card.is-selected strong{color:var(--gold-light)}.reference-header-controls{align-items:center;gap:12px;display:flex}.material-toggle{border:1px solid var(--gold-border);background:#120f0c;border-radius:8px;padding:3px;display:inline-flex}.toggle-tab{min-height:34px;color:var(--text-muted);font-family:var(--font-sans);white-space:nowrap;cursor:pointer;background:0 0;border:none;border-radius:6px;padding:6px 12px;font-size:.8rem;font-weight:600;transition:background-color .15s,color .15s}.toggle-tab.is-active{color:var(--gold-light);background:#d4af3733}.reference-stage-wrap{background:#120f0c;border:1px solid #d4af3747;border-radius:8px;width:100%;margin-bottom:16px;overflow:hidden}#reference-canvas{aspect-ratio:3;width:100%;height:auto;display:block}.reference-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.ref-item{background:#0f0d0b8c;border:1px solid #d4af3733;border-radius:8px;padding:12px 14px}.ref-item-title{font-family:var(--font-display);color:var(--gold-light);margin:0 0 2px;font-size:.94rem;font-weight:600}.ref-item-latin{color:var(--gold-imperial);margin:0 0 6px;font-size:.74rem;font-style:italic}.ref-item-desc{color:var(--text-muted);margin:0;font-size:.79rem;line-height:1.5}.history-empty{text-align:center;color:var(--text-muted);padding:28px 16px;font-size:.9rem}.history-table-wrap{border:1px solid #d4af3738;border-radius:8px;max-height:50vh;overflow-y:auto}.history-table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%}.history-table th,.history-table td{text-align:left;border-bottom:1px solid #d4af3724;padding:9px 14px;font-size:.88rem}.history-table th{color:var(--gold-light);background:#1b1713;font-weight:600;position:sticky;top:0}.history-table td:first-child{width:64px;color:var(--text-muted);font-family:var(--font-mono)}.history-table td:not(:first-child){font-family:var(--font-mono);color:var(--marble-white)}.history-table tr.is-latest-row td{background:#d4af371a}.promo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.promo-choice{border:1px solid var(--gold-border);color:var(--marble-white);cursor:pointer;background:#0f0d0b99;border-radius:8px;flex-direction:column;align-items:flex-start;gap:4px;padding:14px 16px;transition:border-color .15s,background-color .15s;display:flex}.promo-choice:hover{border-color:var(--gold-imperial);background:#d4af3724}.promo-name{font-family:var(--font-display);color:var(--gold-light);font-size:1rem;font-weight:700}.promo-sub{color:var(--text-muted);font-size:.8rem}.gameover-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;display:grid}.stat-item{text-align:center;background:#0f0d0b8c;border:1px solid #d4af3733;border-radius:8px;padding:12px}.stat-label{color:var(--text-muted);margin-bottom:4px;font-size:.75rem;display:block}.stat-value{font-family:var(--font-display);color:var(--gold-light);font-variant-numeric:tabular-nums;font-size:1.25rem}button:focus-visible{outline:2px solid var(--gold-light);outline-offset:2px}@media (width<=900px){.hud-top{flex-wrap:wrap;gap:8px 12px;padding:8px 12px}.hud-status-group{border-top:1px solid #d4af3726;order:3;justify-content:flex-start;width:100%;padding-top:6px}.hud-camera-rail{padding:6px;right:10px}.cam-btn{min-width:64px;min-height:46px;padding:6px;font-size:.68rem}.hud-bottom{flex-direction:column;align-items:stretch;gap:10px;padding:10px 12px}.hud-bottom-actions{justify-content:flex-end}.three-cols,.reference-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=600px){.two-cols,.three-cols,.reference-grid{grid-template-columns:1fr}.reference-header-controls{flex-direction:column;align-items:flex-end}.captured-sep{display:none}.opponent-btn{padding:5px 8px;font-size:.72rem}}.action-btn.is-active{color:var(--gold-light);background:#4a7c6d40;border-color:#6ea997}.learning-panel{z-index:20;background:var(--surface-hud);border:1px solid var(--gold-border-strong);pointer-events:auto;border-radius:10px;flex-direction:column;width:320px;max-width:calc(100vw - 32px);max-height:calc(100vh - 178px);display:flex;position:fixed;top:84px;left:auto;right:128px;overflow:hidden;box-shadow:0 14px 36px #0000009e}.learning-panel.is-dragging{border-color:var(--gold-imperial);box-shadow:0 20px 46px #000000c7}.learning-header{cursor:grab;touch-action:none;border-bottom:1px solid #d4af3738;justify-content:space-between;align-items:center;gap:10px;padding:12px 14px;display:flex}.learning-panel.is-dragging .learning-header{cursor:grabbing}.learning-title-row{align-items:center;gap:9px;min-width:0;display:flex}.learning-drag-grip{color:#d4af3799;flex-shrink:0;width:10px;height:16px}.learning-icon{color:#6ea997;flex-shrink:0;width:22px;height:22px}.learning-title{font-family:var(--font-display);color:var(--gold-light);margin:0;font-size:.94rem;font-weight:700}.learning-meta{color:var(--text-muted);margin:2px 0 0;font-size:.74rem}.learning-close{width:30px;height:30px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #d4af373d;border-radius:6px;justify-content:center;align-items:center;font-size:1.15rem;display:inline-flex}.learning-close:hover{color:var(--marble-white);border-color:var(--gold-imperial)}.learning-body{flex-direction:column;gap:10px;padding:12px 14px;display:flex;overflow-y:auto}.learning-section{background:#0f0d0b8f;border:1px solid #d4af372e;border-radius:8px;padding:10px 12px}.learning-section.grade-excellent{background:#2d524742;border-color:#5a9181a6}.learning-section.grade-good{border-color:#d4af3773}.learning-section.grade-inaccuracy{background:#784a123d;border-color:#d9913a99}.learning-section.grade-mistake,.learning-threat-box{background:#5a182757;border-color:#b03042a6}.learning-coach-head{justify-content:space-between;align-items:center;gap:8px;margin-bottom:4px;display:flex}.learning-section-title{letter-spacing:.05em;text-transform:uppercase;color:var(--gold-imperial);margin-bottom:4px;font-size:.72rem;font-weight:600;display:block}.learning-coach-head .learning-section-title{margin-bottom:0}.learning-eval{font-family:var(--font-mono);color:var(--gold-light);font-variant-numeric:tabular-nums;font-size:.76rem}.learning-recommended-move{font-family:var(--font-display);color:var(--marble-white);margin:0 0 5px;font-size:.96rem;font-weight:600}.learning-text{color:var(--text-muted);margin:0;font-size:.8rem;line-height:1.5}.learning-actions{border-top:1px solid #d4af372e;align-items:center;gap:8px;padding:10px 14px 12px;display:flex}.btn-hint-primary,.btn-hint-secondary{min-height:38px;font-family:var(--font-sans);white-space:nowrap;cursor:pointer;border-radius:7px;padding:7px 12px;font-size:.8rem;font-weight:600}.btn-hint-primary{color:var(--gold-light);background:#4a7c6d52;border:1px solid #6ea997;flex:1}.btn-hint-primary:hover{background:#4a7c6d7a}.btn-hint-secondary{background:var(--surface);color:var(--text-muted);border:1px solid var(--gold-border)}.btn-hint-secondary:hover{color:var(--marble-white);border-color:var(--gold-border-strong)}@media (width<=900px){.learning-panel:not(.is-positioned){inset:auto 12px 112px auto}.learning-panel{width:min(320px,100vw - 24px);max-height:44vh}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}.campaign-auth-banner{background:#0f0d0b8f;border:1px solid #d4af373d;border-radius:8px;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;padding:10px 12px;display:flex}.campaign-auth-status{color:var(--text-muted);font-size:.8rem;line-height:1.4}.btn-compact{white-space:nowrap;flex-shrink:0;min-height:34px;padding:7px 12px;font-size:.78rem}.modal-auth-card{max-width:440px}.auth-tabs{background:var(--surface);border:1px solid var(--gold-border);border-radius:8px;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-bottom:16px;padding:3px;display:grid}.auth-tab{min-height:36px;color:var(--text-muted);font-family:var(--font-sans);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:7px 12px;font-size:.84rem;font-weight:600;transition:background-color .15s,color .15s}.auth-tab.is-active{color:var(--gold-light);background:#d4af3733}.auth-form{flex-direction:column;gap:13px;display:flex}.auth-field{flex-direction:column;gap:5px;display:flex}.auth-label{color:var(--gold-light);font-size:.8rem;font-weight:600}.auth-input{width:100%;min-height:40px;color:var(--marble-white);border:1px solid var(--gold-border);font-family:var(--font-sans);background:#0c0a08d1;border-radius:7px;outline:none;padding:9px 12px;font-size:.9rem;transition:border-color .15s}.auth-input:focus{border-color:var(--gold-imperial)}.auth-hint{color:var(--text-muted);font-size:.74rem}.auth-feedback{color:#fce7ea;background:#5a182773;border:1px solid #b03042b8;border-radius:7px;margin:0;padding:9px 12px;font-size:.82rem;line-height:1.4}.auth-feedback.is-success{color:#e4f5ef;background:#2d524766;border-color:#6ea997b3}.auth-submit-btn{width:100%;margin-top:2px}.profile-banner{background:#4a7c6d29;border:1px solid #6ea9978c;border-radius:8px;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;padding:12px 14px;display:flex}.profile-label{text-transform:uppercase;letter-spacing:.06em;color:var(--gold-imperial);font-size:.72rem;display:block}.profile-username{font-family:var(--font-display);color:var(--gold-light);word-break:break-word;font-size:1rem}.auth-link-row{justify-content:flex-end;margin-top:2px;display:flex}.auth-link-btn{color:var(--gold-imperial);font-family:var(--font-sans);text-underline-offset:3px;cursor:pointer;background:0 0;border:none;padding:2px 0;font-size:.78rem;font-weight:500;text-decoration:underline}.auth-link-btn:hover{color:var(--gold-light)}.auth-subview-desc{color:var(--text-muted);margin:0 0 14px;font-size:.85rem;line-height:1.55}.auth-smtp-note{color:var(--gold-light);background:#d4af371a;border:1px solid #d4af374d;border-radius:7px;margin:0;padding:8px 11px;font-size:.76rem;line-height:1.45}.auth-smtp-note code{font-family:var(--font-mono);font-size:.74rem}.profile-created{color:var(--text-muted);font-size:.76rem}@media (width<=600px){.auth-top-btn span{text-overflow:ellipsis;max-width:82px;overflow:hidden}.campaign-auth-banner{flex-direction:column;align-items:stretch}}.voice-btn.is-listening{color:var(--gold-light);background:#4a7c6d4d;border-color:#6ea997}.voice-status-bar{z-index:15;background:var(--surface-hud);pointer-events:none;border:1px solid #6ea997b8;border-radius:8px;align-items:center;gap:9px;max-width:min(540px,100vw - 32px);padding:8px 14px;display:inline-flex;position:fixed;bottom:76px;left:50%;transform:translate(-50%);box-shadow:0 10px 26px #00000094}.voice-status-bar.is-error{background:#3a1019f0;border-color:#b03042cc}.voice-status-icon{color:#6ea997;flex-shrink:0;width:17px;height:17px}.voice-status-bar.is-error .voice-status-icon{color:#f3a6b0}.voice-status-text{color:var(--marble-white);white-space:nowrap;text-overflow:ellipsis;font-size:.82rem;overflow:hidden}@media (width<=900px){.voice-status-bar{bottom:126px}}
