:root{--theme-light:#e8e8cd;--theme-dark:#7f9b7a;--theme-background:#f4f3ec}
body{background:var(--theme-background)}
.board .square{background:var(--theme-light);color:#111;text-shadow:0 0 2px #fff,1px 1px #fff,-1px -1px #fff}
.board .square.dark{background:var(--theme-dark)}
.board .square.white-piece{color:#fff;text-shadow:0 0 2px #111,1px 1px #111,-1px -1px #111}
.board .coordinate{background:#fff;color:#172c24;padding:0 2px;text-shadow:none;border-radius:2px}
.board .square:hover{box-shadow:inset 0 0 0 3px #172c24}
.board .square.selected{box-shadow:inset 0 0 0 4px #111,inset 0 0 0 6px #fff}
.theme-controls{color:#183a31;background:#fffefa;border:1px solid #acb6a6;padding:16px;border-radius:12px;margin-block:20px}
.theme-controls p{color:#3d5146}.theme-controls button,.theme-controls input{min-height:44px}.theme-controls button{white-space:normal;margin:4px;transition:none}.theme-controls button:disabled{cursor:not-allowed;opacity:1;color:#566057;background:#eee;border-color:#b0b7ae}
.theme-controls :focus-visible{outline:3px solid #3156b5;outline-offset:3px}.theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px;margin-block:16px}.theme-grid[hidden]{display:none}.theme-card{min-width:0;border:1px solid #a7b2a2;border-radius:8px;padding:12px}.theme-card h3{margin:0;font-size:16px}.theme-card p{font-size:13px}.theme-swatch{height:72px;background:conic-gradient(var(--sample-dark) 25%,var(--sample-light) 0 50%,var(--sample-dark) 0 75%,var(--sample-light) 0);background-size:36px 36px;border:1px solid #4a5549}.theme-swatch.theme-preview{height:144px;background-size:72px 72px;outline:3px solid #3156b5;outline-offset:2px}.theme-controls fieldset{margin-top:16px;border:1px solid #a7b2a2;min-width:0}.theme-controls label{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#183a31;max-width:420px;font-size:14px}.theme-controls input[type=range]{width:55%;padding:0}.theme-controls input[type=checkbox]{width:24px;accent-color:#244839}
html[data-reduced-distraction=true] .board{box-shadow:none}
@media(prefers-reduced-motion:reduce) and (scripting:none){.theme-controls *,.board *{animation:none!important;transition:none!important}}
@media(max-width:420px){.theme-controls{padding:10px}.theme-card button{display:block;width:100%;margin:6px 0}}

/* High-contrast silhouettes and inset focus remain stable across all palettes. */
.board .square{color:#111;text-shadow:-1px -1px 0 #fff,0 -1px 0 #fff,1px -1px 0 #fff,-1px 0 0 #fff,1px 0 0 #fff,-1px 1px 0 #fff,0 1px 0 #fff,1px 1px 0 #fff}
.board .square.white-piece{color:#fff;text-shadow:-1px -1px 0 #111,0 -1px 0 #111,1px -1px 0 #111,-1px 0 0 #111,1px 0 0 #111,-1px 1px 0 #111,0 1px 0 #111,1px 1px 0 #111}
.board .square.target:after{background:#111;border:2px solid #fff}.board .square.target:has(.piece):after{background:transparent;border:3px solid #111;box-shadow:0 0 0 2px #fff}
.board .square:focus-visible{outline:3px solid #111;outline-offset:-4px;box-shadow:inset 0 0 0 6px #fff;z-index:2}
.theme-controls input[type=checkbox]{min-width:24px;flex-shrink:0}.theme-controls input[type=range]{min-width:0}.theme-controls label{min-height:44px}.theme-controls fieldset{padding:12px}.theme-card button{max-width:calc(100% - 8px)}
@media(max-width:420px){.theme-card button{max-width:100%}.theme-controls label{flex-wrap:wrap}.theme-controls input[type=range]{width:100%}}

/* Approved Everwake shell: supplied scene is scenery only; controls stay live HTML. */
:root{--theme-light:#ece3c6;--theme-dark:#315e50;--theme-background:#e9eee6;--realm-panel:#14232a;--realm-text:#f4edda;--realm-muted:#c4cfc9;--realm-gold:#d8b76c}
body{background-color:var(--theme-background);background-image:linear-gradient(#ffffff0a,#ffffff0a),var(--theme-art,none);background-size:cover;background-position:center top;background-attachment:fixed}
header{background:#102029;color:var(--realm-text);border-bottom:1px solid var(--realm-gold);box-shadow:0 2px 10px #10202955}
header .brand,header nav{color:var(--realm-text)}header .brand>span{font-family:Georgia,serif;letter-spacing:.5px;font-size:24px;color:#f0d38b}header .brand img{display:block;width:48px;height:48px;object-fit:contain;border-radius:4px}header #connection{color:#b9e5b5}header select{background:#1a3035;color:var(--realm-text);border-color:#8b784d}
.card,.theme-controls{background:var(--realm-panel);color:var(--realm-text);border:1px solid #9c8757;border-radius:8px;box-shadow:0 4px 14px #10202930}
.card p,.card small,.card label,.card .muted,.card #moves,.theme-controls p,.theme-controls label,.card .eyebrow{color:var(--realm-muted)}.card h2,.card h3{color:var(--realm-text)}.card a{color:#a9dfee}.card .entry{border-color:#50615e}
.card button,.card select,.card input,.card textarea,.theme-controls button,.theme-controls input{background:#243a3e;color:var(--realm-text);border-color:#82918a}.card button:hover,.theme-controls button:hover{background:#38514f}.card button.primary{color:#201c12;background:linear-gradient(#f4d894,#c69a49);border-color:#ffe6ad}.card button.primary:hover{background:#edce83}.card button:disabled{opacity:1;color:#a9b5b0;background:#293638;border-color:#65716e;cursor:not-allowed}.card .badge{background:#30473f;color:#f4edda}
.theme-card{border-color:#6b795f}.theme-controls fieldset{border-color:#82918a}.theme-controls button:disabled{color:#c4cfc9;background:#293638;border-color:#65716e}
.hero{background:#14232a;color:var(--realm-text);border:1px solid #9c8757;border-radius:6px;padding:6px 12px;align-items:center;min-height:44px}.hero h1,.hero .eyebrow,.hero>div>p:last-child{display:none}.hero #accountIdentity{margin:0;width:100%;display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.hero #accountIdentity button{margin:0;background:#243a3e;color:var(--realm-text);border-color:#82918a}.hero p{color:var(--realm-muted)}
.play-area{width:100%;justify-self:center}.play-area>.board{position:relative;border:18px solid #ac843a;border-image:url('/assets/ornaments/dragon-frame.svg') 30 stretch;border-radius:0;box-shadow:0 6px 22px #10202966}.play-area>.playerbar{background:#14232a;color:var(--realm-text);border:1px solid #9c8757;border-radius:6px;padding:6px 10px;margin:6px 0}.playerbar .clock{font-size:26px;line-height:1;min-width:100px;padding:6px 10px;background:#0b171d;color:#f4edda;border:1px solid #9c8757}.playerbar .clock.running{background:#23473b;color:#fff1b9}.play-area>.game-details{margin-top:12px}
.board .coordinate{background:#fff5d9;color:#172c24}.board .square{background-image:none}.board .square.dark{background-image:none}
#sectionNav{display:flex;gap:8px;padding:8px 12px;background:#14232a;color:var(--realm-text);border:1px solid #9c8757}#sectionNav a,#sectionNav button{display:flex;align-items:center;min-height:44px;padding:10px 14px;color:var(--realm-text);text-decoration:none;border:1px solid transparent;border-radius:4px;background:transparent}#sectionNav a:hover,#sectionNav button:hover,#sectionNav [aria-current=page]{border-color:var(--realm-gold);background:#31443d;color:#ffe6ad}
.card :focus-visible,.hero :focus-visible,header :focus-visible,#sectionNav :focus-visible{outline:3px solid #ffe6ad;outline-offset:2px}.board .square:focus-visible{outline:3px solid #111;outline-offset:-4px;box-shadow:inset 0 0 0 6px #fff}
#loading,.loading-screen{position:fixed;inset:0;z-index:1000;background:#073025;color:#f4edda;display:grid;place-content:center;justify-items:center;gap:14px;padding:24px;text-align:center}#loading[hidden],.loading-screen[hidden]{display:none}.loading-logo,#loading img,.loading-screen img{display:block;width:min(70vw,280px);height:auto;max-height:55dvh;object-fit:contain}.loading-screen p,#loading p{color:#f4edda}.loading-progress{height:4px;width:min(70vw,280px);background:#c8ac63;border-radius:2px}
/* Keep the grid's middle track equal to the board, rather than centering a capped
   board in a viewport-wide 1fr track. Budgets include both clocks and profile. */
:root{--desktop-board-size:clamp(320px,calc(100dvh - 344px),720px);--tablet-board-size:clamp(320px,calc(100dvh - 404px),720px)}
.hero .badge{background:#30473f;color:#f4edda;border:1px solid #82918a}
@media(min-width:801px){.layout{align-items:start;margin-inline:auto}.layout>.play-area{max-width:none;justify-self:stretch}.hero{margin-bottom:8px}main{padding-top:8px}.card{padding:16px}header{min-height:64px;padding-top:6px;padding-bottom:6px}.play-area>.playerbar{min-height:48px;padding:4px 10px;margin:4px 0}.playerbar .clock{font-size:24px;padding:4px 10px}.layout>aside .card{margin-bottom:12px}.layout>aside .card small{font-size:12px;line-height:1.5;margin-top:10px}.layout>aside label{font-size:13px}.layout>aside h2{margin-bottom:10px}.layout>aside button,.layout>aside select{margin-top:8px}}
@media(min-width:1201px){#sectionNav{position:fixed;left:0;top:108px;bottom:0;width:156px;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;padding:18px 8px;border-left:0;border-bottom:0;overflow:auto}body:has(#sectionNav) main{margin-left:168px;max-width:calc(100% - 168px);padding-left:16px;padding-right:16px}.layout{width:min(100%,calc(var(--desktop-board-size) + 562px));grid-template-columns:250px minmax(320px,1fr) 280px;gap:16px}.hero{max-width:calc(var(--desktop-board-size) + 562px);margin-inline:auto}.layout>aside:last-child{display:block;grid-column:auto}}
@media(min-width:801px) and (max-width:1200px){.layout{width:min(100%,calc(var(--tablet-board-size) + 226px));grid-template-columns:210px minmax(320px,1fr);gap:16px}.layout>aside:last-child{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:16px}#sectionNav{flex-wrap:wrap;justify-content:center}}
@media(max-width:800px){body{background-attachment:scroll}header .brand>span{font-size:21px}header .brand img{width:36px;height:36px}.play-area>.board{border-width:10px}.play-area>.playerbar{margin:4px 0;padding:4px 8px}.playerbar .clock{font-size:22px;min-width:90px}.hero{padding:6px 8px}.hero #accountIdentity{justify-content:flex-start}#sectionNav{flex-wrap:wrap;justify-content:flex-start;gap:4px;padding:4px 10px}#sectionNav a,#sectionNav button{padding:8px 10px;font-size:13px}.card{padding:14px}}
@media(max-width:420px){header .brand{flex-basis:auto}header{gap:6px}header nav{flex:1 1 100%;width:100%}.play-area>.board{border-width:8px}.theme-controls .theme-card{padding:10px}}
html[data-reduced-distraction=true] body{background-image:none}html[data-reduced-distraction=true] .play-area>.board{box-shadow:none}

/* Restrained opt-in feedback and readable native dialogs. */
dialog{color:#f4edda;background:#14232a;border:1px solid #c8ac63;border-radius:12px;max-width:min(92vw,560px);max-height:85dvh;overflow:auto;padding:24px;box-shadow:0 12px 60px #0008}dialog::backdrop{background:#06120dcc}dialog button{min-height:44px;background:#243a3e;color:#f4edda;border:1px solid #82918a}dialog :focus-visible{outline:3px solid #ffe6ad;outline-offset:3px}dialog img{max-width:100%;object-fit:contain}dialog img.result-crest{width:120px;height:120px;display:block;margin:0 auto}.theme-card img{display:block;width:100%;max-height:160px;object-fit:cover;border-radius:6px}.board .piece img,.board img.piece{width:86%;height:86%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 1px 1px #0005)}.board[data-effect=move]{outline:2px solid #e3c47c;outline-offset:2px}.board[data-effect=capture]{outline:3px solid #d8ae61;outline-offset:2px}.board[data-effect=check]{outline:3px solid #e78e7d;outline-offset:2px}.board[data-effect=victory]{outline:3px solid #f9dc82;outline-offset:3px}@media(prefers-reduced-motion:reduce) and (scripting:none){.board[data-effect]{outline:none}}html[data-reduced-distraction=true] .board[data-effect]{outline:none}.reward-icon{width:32px;height:32px;object-fit:contain;vertical-align:middle}footer a{color:#f4edda}

.board .piece{display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0}.dialog-reward{display:block;margin:0 auto}.dialog-reward[hidden]{display:none}.rating-history{text-align:left;max-height:200px;overflow:auto}.promotion-options button{flex:1 1 80px}.effects-controls input{min-height:24px;width:24px;height:24px;vertical-align:middle}.effects-controls label{display:flex;gap:10px;align-items:center}

header{height:auto;min-height:64px}@media(max-width:800px){html:not([data-reduced-distraction=true]) body{background-image:linear-gradient(#ffffff0a,#ffffff0a),var(--theme-art-small,var(--theme-art,none))}}

.cup-controls{min-width:0}.cup-controls ol{padding-left:22px}.cup-controls article,.cup-controls li{overflow-wrap:anywhere}.cup-controls button{margin:4px}.cup-controls label{display:flex;gap:10px;align-items:center}.cup-controls input[type=checkbox]{width:24px;height:24px;min-height:24px;flex:none}.cup-controls section{border-top:1px solid #65716e;padding-top:12px;margin-top:12px}.cup-controls [role=status]{min-height:1.5em}

.result-view{width:min(92vw,480px);max-height:85dvh;overflow:auto;text-align:center}.result-view .result-crest{width:110px;height:110px}.result-view .result-trophy{width:56px;height:56px}.result-rating{font-size:22px;color:#c8efba}.result-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.result-actions button{flex:1 1 130px;min-height:44px}.result-view .result-awards{border-top:1px solid #65716e;padding-top:12px}.result-view .result-actions .primary{background:#c69a49;color:#201c12}
/* Override the light-page paragraph rule on dark native dialogs. */
dialog p,dialog label,dialog small{color:#c4cfc9}.result-view .result-rating{color:#c8efba}

/* Optional feedback uses the existing data-effect controller, never a new overlay. */
.board[data-effect]{--feedback-glow:#e3c47c66;--feedback-duration:240ms;outline:2px solid #e3c47c;outline-offset:2px;animation:realm-border-glow var(--feedback-duration) ease-out 1}
.board[data-effect=intro]{--feedback-glow:#b9d9c866;--feedback-duration:300ms;outline-color:#b9d9c8}
.board[data-effect=move]{--feedback-duration:220ms}
.board[data-effect=capture]{--feedback-glow:#d8ae6166;--feedback-duration:300ms;outline-color:#d8ae61}
.board[data-effect=check]{--feedback-glow:#e78e7d66;--feedback-duration:350ms;outline-color:#e78e7d}
.board[data-effect=victory]{--feedback-glow:#f9dc8266;--feedback-duration:480ms;outline-color:#f9dc82}
.board[data-effect=defeat]{--feedback-glow:#c4a3bd66;--feedback-duration:350ms;outline-color:#c4a3bd}
.board[data-effect=draw]{--feedback-glow:#b6ced866;--feedback-duration:300ms;outline-color:#b6ced8}
@keyframes realm-border-glow{0%,100%{box-shadow:0 6px 22px #10202966}45%{box-shadow:0 0 0 3px var(--feedback-glow),0 0 12px var(--feedback-glow)}}
@media(prefers-reduced-motion:reduce) and (scripting:none){.board[data-effect]{animation:none!important;outline:none;box-shadow:none}}
html[data-reduced-distraction=true] .board[data-effect]{animation:none!important;outline:none;box-shadow:none}
.ai-badge{display:inline-block;background:#30473f;color:#f4edda;border:1px solid #82918a;border-radius:4px;padding:2px 6px;font-size:12px;line-height:1.4;font-weight:700}
/* Realm Premium chip: a gem in the tier's colour and the tier name (the gem alone where room is tight). */
.member-badge{--mb-ink:#f6d98c;--mb-line:rgba(233,196,94,.62);--mb-fill:rgba(233,196,94,.15);--mb-gem:linear-gradient(135deg,#fff3c4,#e9c45e 45%,#a87b22);display:inline-flex;align-items:center;gap:5px;flex:none;box-sizing:border-box;height:20px;padding:0 7px 0 6px;border:1px solid var(--mb-line);border-radius:999px;background:var(--mb-fill);color:var(--mb-ink);font:800 10.5px/1 system-ui,'Segoe UI',sans-serif;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;vertical-align:middle}
.member-badge[data-tier=platinum]{--mb-ink:#e6eff4;--mb-line:rgba(214,228,236,.6);--mb-fill:rgba(214,228,236,.12);--mb-gem:linear-gradient(135deg,#ffffff,#c9d6de 45%,#7f95a3)}
.member-badge[data-tier=diamond]{--mb-ink:#b4ecff;--mb-line:rgba(143,216,255,.65);--mb-fill:rgba(143,216,255,.13);--mb-gem:linear-gradient(135deg,#e8fbff,#8fd8ff 40%,#7d7dff)}
.member-gem{width:8px;height:8px;flex:none;border-radius:2px;background:var(--mb-gem);transform:rotate(45deg);box-shadow:0 0 6px var(--mb-line)}
.member-badge-compact{width:20px;padding:0;justify-content:center}
html[lang=ko] .member-badge{letter-spacing:0}

/* Focused app sections retain their native controls and normal document flow. */
.app-view[hidden]{display:none!important}
.app-view[data-view=lobby],.app-view[data-view=history],.app-view[data-view=themes],.app-view[data-view=cups],.app-view[data-view=settings]{width:100%;max-width:1100px;margin-inline:auto}
#settingsView{max-width:800px}
#settingsView #audio fieldset{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;min-width:0;padding:14px;border:1px solid #82918a;border-radius:6px}
#settingsView #audio legend{padding-inline:6px;color:#f4edda}
#settingsView #audio label{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;min-width:0;margin:0;font-size:14px}
#settingsView #audio input[type=range]{width:45%;min-width:72px;max-width:160px;padding:0;flex-shrink:0}
#settingsView #audio input[type=checkbox]{width:24px;height:24px;min-height:24px;flex-shrink:0;accent-color:#d8b76c}
#settingsView #audio>button{margin:10px 8px 0 0;max-width:100%;white-space:normal}
#playSidebar #social .card{padding:12px}
@media(max-width:600px){#settingsView #audio fieldset{grid-template-columns:minmax(0,1fr)}#settingsView #audio>button{display:block;width:100%;margin-right:0}}

/* Completed-game review: live board DOM is reused, not duplicated. */
/* Full transparent wordmark is contained; taller masthead is budgeted above. */
body>header{min-height:108px;padding-top:6px;padding-bottom:6px}
body>header .brand img.brand-logo{width:96px;height:96px;object-fit:contain;border:0;border-radius:0;background:transparent}
#loading img.loading-logo{width:min(60vw,180px);height:auto;max-height:45dvh;object-fit:contain;background:transparent;border:0}
@media(max-width:800px){body>header{min-height:92px}body>header .brand img.brand-logo{width:80px;height:80px}}
#reviewView{--review-board-size:clamp(320px,calc(100dvh - 500px),680px);display:block;width:min(100%,calc(var(--review-board-size) + 336px));margin-inline:auto}
#reviewView>.review-workspace{display:grid;grid-template-columns:minmax(320px,1fr) 320px;gap:16px;align-items:start}
#reviewView>.review-back{display:flex;gap:8px;min-height:44px;margin-bottom:8px}#reviewView>.review-back a{display:flex;align-items:center;min-height:44px;padding:6px 12px;background:#14232a;color:#f4edda;border:1px solid #82918a;border-radius:6px}
#reviewBoardHost,#reviewSidebar{min-width:0}
#reviewBoardHost>.play-area{max-width:none;width:100%}
#reviewView #actions,#reviewView #inviteLink,#reviewView #gameStatus,#reviewView #moves{display:none}
#reviewView .game-details{padding:10px;margin-top:8px;margin-bottom:8px}
#reviewView #replay{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
#reviewView #replay>p{flex:1 1 100%;margin:0;font-size:12px;line-height:1.5}
#reviewView #replay>button{flex:1 1 64px;min-height:44px;padding:6px 8px;font-size:12px;line-height:1.3;margin:0}
#reviewView #flipBoard{min-height:44px;margin-top:6px;padding:6px 10px;font-size:12px}
#reviewView #annotationControls{margin-top:6px}
#reviewSidebar{background:#14232a;color:#f4edda;border:1px solid #9c8757;border-radius:8px;padding:14px;max-height:calc(100dvh - 180px);overflow-y:auto;overflow-wrap:anywhere;scrollbar-gutter:stable}
#reviewSidebar h2,#reviewSidebar h3{font-size:16px;margin:0 0 10px}
#reviewSidebar p,#reviewSidebar label,#reviewSidebar small{color:#c4cfc9;font-size:13px;line-height:1.5}
#reviewSidebar button,#reviewSidebar select{background:#243a3e;color:#f4edda;border-color:#82918a;min-height:44px;max-width:100%;white-space:normal}
#reviewSidebar button:disabled{color:#a9b5b0;background:#293638;opacity:1}
#reviewSidebar :focus-visible,#reviewView #replay :focus-visible{outline:3px solid #ffe6ad;outline-offset:2px}
#reviewMoveList{display:flex;flex-wrap:wrap;gap:4px;align-content:flex-start;padding:4px;max-height:36dvh;overflow-y:auto;scrollbar-gutter:stable}
#reviewMoveList button{flex:1 1 88px;margin:0;padding:6px 8px;text-align:left;font-size:13px}
#reviewMoveList button[aria-current=true],#reviewMoveList button[aria-current=step],#reviewMoveList button[aria-pressed=true],#reviewMoveList button.selected{background:#d8b76c;color:#201c12;border-color:#ffe6ad;font-weight:700}
#reviewSidebar #reviewControls{margin-top:12px;padding-top:10px}
#reviewSidebar #reviewControls ol{max-height:32dvh;overflow-y:auto;padding:4px 4px 4px 24px}
#reviewSidebar [data-review-panel][hidden]{display:none!important}
#reviewSidebar [data-review-tab]{margin:0 4px 8px 0}
#reviewSidebar [data-review-tab][aria-selected=true],#reviewSidebar [data-review-tab][aria-pressed=true]{background:#d8b76c;color:#201c12;border-color:#ffe6ad}
@media(max-width:800px){#reviewView{width:100%}#reviewView>.review-workspace{display:flex;flex-direction:column;gap:12px}#reviewBoardHost,#reviewSidebar{width:100%}#reviewSidebar{max-height:none;padding:12px}#reviewMoveList{max-height:240px}#reviewSidebar #reviewControls ol{max-height:320px}#reviewView #replay{gap:4px}#reviewView #replay>button{flex-basis:72px}#reviewSidebar[data-tab=moves] #reviewAnalysisHost,#reviewSidebar[data-tab=analysis] #reviewMoveList{display:none}}

/* Signed-out welcome uses the approved Everwake scene, never a raster UI. */
body[data-signed-out=true],body:has(#club[hidden]){background-color:#14232a;background-image:linear-gradient(#10202988,#102029bb),url('/assets/themes/everwake.webp');background-size:cover;background-position:center top}
body[data-signed-out=true] main,body:has(#club[hidden]) main{margin-inline:auto;max-width:1200px;padding-inline:max(14px,env(safe-area-inset-left));padding-top:20px}
#identity.welcome-panel{width:100%;max-width:520px;margin:12px auto 28px;padding:24px;background:#14232a;color:#f4edda;border:1px solid #d8b76c;border-radius:14px;box-shadow:0 12px 40px #07141b66}
#identity .welcome-copy{display:block;text-align:center;min-height:0;height:auto;padding:0;margin:0 0 18px;background:transparent;border:0;box-shadow:none}
#identity .welcome-copy h1{color:#f4edda;font-size:clamp(26px,4vw,34px);line-height:1.2;margin:8px 0}
#identity .welcome-copy p,#identity .welcome-guest p,#identity .welcome-provider,#identity .welcome-status{color:#c4cfc9;line-height:1.5}
#identity .welcome-logo{display:block;text-align:center;margin:0 auto 10px}
#identity .welcome-logo img,#identity img.welcome-logo{display:block;width:min(54vw,180px);height:auto;object-fit:contain;margin-inline:auto;background:transparent;border:0;border-radius:0}
#identity .welcome-tabs{display:flex;gap:8px;align-items:stretch;margin:16px 0}
#identity .welcome-tabs button{flex:1 1 0;min-height:44px;white-space:normal;background:#243a3e;color:#f4edda;border-color:#82918a}
#identity .welcome-tabs [aria-selected=true]{background:#d8b76c;color:#201c12;border-color:#ffe6ad}
#identity .welcome-form label,#identity .welcome-guest label{color:#c4cfc9;font-size:14px}
#identity .welcome-form input,#identity .welcome-guest input{width:100%;min-width:0;min-height:44px;background:#243a3e;color:#f4edda;border-color:#82918a}
#identity .welcome-password{display:flex;align-items:flex-start;gap:8px;min-width:0}
#identity .welcome-password input{flex:1 1 auto;width:0}
#identity .welcome-password button{flex:0 0 auto;min-height:44px;background:#243a3e;color:#f4edda;border-color:#82918a}
#identity .welcome-form>button,#identity .welcome-guest button{width:100%;min-height:44px;white-space:normal}
#identity .welcome-guest{margin-top:20px;padding-top:18px;border-top:1px solid #65716e}
#identity .welcome-guest h2{margin-bottom:8px}
#identity .welcome-provider{margin-top:16px;font-size:13px}
#identity .welcome-provider summary{min-height:44px;cursor:pointer}
#identity .welcome-status{min-height:1.5em;overflow-wrap:anywhere}
#identity :focus-visible{outline:3px solid #ffe6ad;outline-offset:2px}
@media(max-width:800px){body[data-signed-out=true],body:has(#club[hidden]){background-image:linear-gradient(#10202988,#102029bb),url('/assets/themes/everwake-640.webp')}}
@media(max-width:420px){#identity.welcome-panel{padding:18px;margin-top:4px}#identity .welcome-logo img,#identity img.welcome-logo{width:150px}#identity .welcome-password{flex-wrap:wrap}#identity .welcome-password input{flex-basis:100%;width:100%}}
html[data-reduced-distraction=true] body[data-signed-out=true],html[data-reduced-distraction=true] body:has(#club[hidden]){background-image:none}

/* Shared UI tokens are independent of collectible scenery and square palettes. */
:root{--realm-control:#243a3e;--realm-control-hover:#38514f;--realm-border:#82918a;--realm-frame:#9c8757;--realm-focus:#ffe6ad;--realm-disabled:#293638;--realm-disabled-text:#a9b5b0;--realm-radius:8px;--realm-space:16px;--realm-target:44px}
.app-view .card,.theme-controls,#reviewSidebar,dialog{background:var(--realm-panel);color:var(--realm-text);border-color:var(--realm-frame);border-radius:var(--realm-radius)}
.app-view button,.app-view select,.app-view input,.app-view textarea,dialog button,dialog select{min-height:var(--realm-target);background:var(--realm-control);color:var(--realm-text);border-color:var(--realm-border)}
.app-view .board .square{min-height:0;background:var(--theme-light)}
.app-view .board .square.dark{background:var(--theme-dark)}
.app-view button:not(.square):not(.primary):hover:not(:disabled),dialog button:not(.primary):hover:not(:disabled){background-color:var(--realm-control-hover)}
.app-view button:disabled,dialog button:disabled{color:var(--realm-disabled-text);background:var(--realm-disabled);opacity:1}
.app-view p,.app-view small,.app-view label,dialog p,dialog label,dialog small{color:var(--realm-muted)}
.app-view :focus-visible,dialog :focus-visible{outline:3px solid var(--realm-focus);outline-offset:2px}
.app-view .board .square:focus-visible{outline:3px solid #111;outline-offset:-4px;box-shadow:inset 0 0 0 6px #fff}
.app-view .primary,dialog .primary{background:#d8b76c;color:#201c12;border-color:var(--realm-focus)}
#sectionNav{background:var(--realm-panel);border-color:var(--realm-frame)}
#sectionNav [aria-current=page]{border-color:var(--realm-gold);color:var(--realm-focus)}

.app-view button.primary:hover:not(:disabled),dialog button.primary:hover:not(:disabled){background:#edce83;color:#201c12}
/* Independent cosmetic draft preview; live game variables change only after Save. */
.theme-selection-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}.theme-selection-fields label{display:grid;gap:6px}.theme-selection-fields select{min-height:44px;max-width:100%;width:100%}.theme-selection-actions{display:flex;flex-wrap:wrap;gap:8px;margin-block:12px}.theme-selection-actions button{min-height:44px}.theme-mix-preview{background-size:cover;background-position:center;padding:clamp(12px,4vw,40px);border-radius:12px;margin-block:16px}.theme-sample-board{display:grid;grid-template-columns:repeat(8,1fr);width:min(100%,360px);aspect-ratio:1;margin-inline:auto;box-shadow:0 0 0 4px #947640,0 6px 18px #0008}.theme-sample-square{display:grid;place-items:center;aspect-ratio:1;min-width:0}.theme-sample-square img{width:86%;height:86%;object-fit:contain}.theme-customizer{max-width:850px}.theme-selection-fields select:focus-visible{outline:3px solid #f2d581;outline-offset:2px}
/* A single composited preview keeps the board and all 32 pieces over the selected artwork. */
.theme-mix-preview{position:relative;isolation:isolate;overflow:hidden}.theme-preview-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1;pointer-events:none}.theme-sample-board{position:relative;flex:none}.theme-sample-square{overflow:hidden;min-height:0}.theme-sample-square img{display:block;max-width:86%;max-height:86%}.theme-controls dialog{width:min(760px,calc(100vw - 32px))}.theme-controls dialog .theme-modal-scene{padding:clamp(24px,6vw,64px);margin:16px 0}.theme-controls dialog .theme-sample-board{width:min(100%,380px)}

/* Responsive reflow contract: ordinary document scrolling, never a tiny height-fit board. */
html{scroll-padding-block:16px}body{min-width:0}main,.app-view,.review-workspace,.theme-selection-fields{min-width:0}.app-view{overflow-wrap:anywhere}.app-view input,.app-view textarea,.app-view select{scroll-margin-block:24px}.playerbar>span{min-width:0;overflow-wrap:anywhere}.playerbar .clock{flex-shrink:0}.theme-selection-fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr))}.theme-selection-fields label{min-width:0}
.cup-round-picker{display:none}
@media(max-width:1100px){
 body:has(#sectionNav) main{margin-inline:auto;max-width:100%;padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right));padding-bottom:max(24px,env(safe-area-inset-bottom))}
 #sectionNav{position:static;width:auto;flex-direction:row;flex-wrap:wrap;gap:4px;padding:4px 10px}#sectionNav a,#sectionNav button{min-height:44px}
 .layout{display:flex;flex-direction:column;width:100%;gap:12px}.layout>.play-area{order:-1;width:100%;max-width:720px;align-self:center}.layout>aside{width:100%}.layout>aside:last-child{display:block;grid-column:auto}
 #reviewView{width:100%;max-width:720px}#reviewView>.review-workspace{display:flex;flex-direction:column;gap:12px}#reviewBoardHost,#reviewSidebar{width:100%}#reviewSidebar{max-height:none;overflow:visible;padding:12px}#reviewMoveList{max-height:320px;max-height:min(45dvh,320px)}#reviewSidebar #reviewControls ol{max-height:360px;max-height:min(55dvh,360px)}
 #reviewSidebar[data-tab=moves] #reviewAnalysisHost,#reviewSidebar[data-tab=analysis] #reviewMoveList{display:none}
 #reviewView #replay{display:flex;flex-wrap:wrap;gap:6px}#reviewView #replay>button{flex:1 1 72px;min-height:44px}#reviewView .game-details{overflow:visible}
 .play-area>.board{border-width:10px}.play-area>.playerbar{min-height:48px;gap:8px;padding:4px 8px;margin:4px 0}.playerbar .clock{font-size:clamp(20px,3vw,24px);min-width:90px}
}
@media(max-width:760px){.cup-round-picker{display:grid;gap:6px;min-width:0}.cup-round-picker select{width:100%;min-width:0;min-height:44px}.cup-round-card[data-selected=false]{display:none}.cup-round-card,.cup-round-card ol,.cup-round-card ul{display:block;min-width:0;max-width:100%}.cup-match-card{min-width:0;overflow-wrap:anywhere}}
@media(max-width:480px){
 body>header{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}body>header nav{flex-wrap:wrap;gap:8px}body>header nav>*{min-width:0}body>header select{min-height:44px}
 .layout>.play-area,#reviewView{max-width:none}.play-area>.board{border-width:8px}.hero #accountIdentity{justify-content:flex-start;flex-wrap:wrap}.hero #accountIdentity>*{max-width:100%}.app-view .card{padding:12px}.theme-selection-actions button{flex:1 1 120px}.app-view input:not([type=checkbox]):not([type=radio]),.app-view textarea,.app-view select{font-size:16px}
}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
 body>header{min-height:64px;padding-block:4px}body>header .brand img.brand-logo{width:56px;height:56px}body>header nav{width:auto;flex:1 1 auto;justify-content:flex-end}
 .layout>.play-area,#reviewView{max-width:none;width:100%}.play-area>.board{border-width:8px}#reviewMoveList,#reviewSidebar #reviewControls ol{max-height:240px}dialog,.result-view{max-height:calc(100dvh - 24px);padding:12px}
}
/* Welcome credentials follow the same phone input-size contract. */
@media(max-width:480px){#identity input,#identity select,#identity textarea{font-size:16px}}
/* Compact phone masthead and scrollable section row preserve board space. */
@media(max-width:480px){body>header{min-height:76px;height:auto;gap:8px;padding-block:6px}body>header .brand{flex:0 0 auto}body>header .brand img.brand-logo{width:64px;height:64px}body>header nav{width:auto;flex:1 1 180px;justify-content:flex-end}#sectionNav{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;max-width:100%;scroll-padding-inline:12px}#sectionNav a,#sectionNav button{flex-shrink:0;white-space:nowrap}}

/* Approved reference alignment: decorative icons preserve translated link names. */
#sectionNav{border-radius:16px;gap:6px}#sectionNav a{gap:9px;border-radius:10px}#sectionNav a::before{content:"";display:block;flex:0 0 22px;width:22px;height:22px;background:currentColor;mask:var(--nav-icon) center/contain no-repeat;-webkit-mask:var(--nav-icon) center/contain no-repeat}#sectionNav [aria-current=page]{box-shadow:inset 0 -3px var(--realm-gold)}
#navPlay{--nav-icon:url("/assets/icons/play.svg")}
#navReview{--nav-icon:url("/assets/icons/review.svg")}
#navLobby{--nav-icon:url("/assets/icons/lobby.svg")}
#navHistory{--nav-icon:url("/assets/icons/history.svg")}
#navThemes{--nav-icon:url("/assets/icons/themes.svg")}
#navCups{--nav-icon:url("/assets/icons/cups.svg")}
#navSettings{--nav-icon:url("/assets/icons/settings.svg")}

.app-view .card,.theme-controls,#reviewSidebar{border-radius:16px;box-shadow:0 6px 20px #001b1833}
.app-view h2,.app-view h3{line-height:1.25}.app-view h2{font-size:clamp(20px,2.1vw,28px)}
.play-area>.playerbar{border-radius:14px;padding:8px 12px}.playerbar .clock{border-radius:10px;border-width:2px;font-variant-numeric:tabular-nums}
.review-tabs{gap:8px}.review-tabs button{border-radius:12px;min-height:48px}.review-tabs [aria-pressed=true]{box-shadow:inset 0 -3px var(--realm-gold)}
#settingsView,#themesView{max-width:960px;margin-inline:auto}
@media(max-width:760px){#sectionNav a{flex-direction:column;gap:4px;padding:8px 12px;font-size:13px;min-width:68px}#sectionNav a::before{flex-basis:22px}.app-view h2{font-size:22px}.play-area>.playerbar{padding:6px 8px}}

/* Focused Home and Profile: the approved composition uses live account data. */
#navHome{--nav-icon:url('/assets/icons/play.svg')}#navProfile{--nav-icon:url('/assets/icons/lobby.svg')}
.dashboard-view{max-width:1180px;margin:24px auto}.dashboard-view a{color:var(--realm-text);text-underline-offset:4px}.dashboard-view h1{font-size:clamp(30px,4vw,54px);color:var(--realm-text);margin-block:12px 24px}.dashboard-home-header{display:flex;align-items:center;gap:32px;margin-bottom:24px}.dashboard-home-header>img{width:clamp(150px,26vw,280px);height:auto;object-fit:contain}.dashboard-home-header h1{margin:0 0 16px;overflow-wrap:anywhere}.dashboard-home-header p{color:var(--realm-muted)}.dashboard-profile-link,.dashboard-back{display:inline-flex;align-items:center;min-height:44px}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:24px}.dashboard-grid>*{min-width:0}.dashboard-number{display:block;font-size:clamp(38px,6vw,64px);line-height:1.2;color:var(--realm-text);font-variant-numeric:tabular-nums}.dashboard-actions{display:grid;gap:16px;margin-block:20px}.dashboard-actions>a,.dashboard-actions>button{display:flex;align-items:center;justify-content:space-between;min-height:84px;padding:20px 24px;border:1px solid var(--realm-gold);border-radius:16px;font-size:clamp(20px,2.4vw,30px);font-weight:700;text-decoration:none;background:var(--realm-panel);color:var(--realm-text);text-align:left}.dashboard-actions>.dashboard-play{background:linear-gradient(120deg,#075b38,#06362d);border:2px solid var(--realm-gold);color:#fff4d9;box-shadow:inset 0 0 0 4px #d9bd6522}.dashboard-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.dashboard-section-heading h2{margin:0}.dashboard-section-heading a{min-height:44px;display:inline-flex;align-items:center}.dashboard-games{list-style:none;margin:0;padding:0}.dashboard-games li+li{border-top:1px solid var(--realm-border)}.dashboard-games button{width:100%;display:flex;align-items:center;gap:12px;text-align:left;padding:14px 0;border:0;background:transparent!important;border-radius:0}.dashboard-games button>span:nth-child(2){flex:1;min-width:0}.dashboard-games button span span,.dashboard-games small{display:block;margin:3px 0}.dashboard-game-mark{display:grid;place-items:center;flex:0 0 44px;min-height:44px;border:1px solid var(--realm-frame);border-radius:8px;font-size:20px;color:var(--realm-focus)}.dashboard-delta{font-variant-numeric:tabular-nums}.dashboard-event{display:flex;gap:16px;align-items:center;padding:12px 0;text-decoration:none}.dashboard-event+ .dashboard-event{border-top:1px solid var(--realm-border)}.dashboard-event img{flex-shrink:0;object-fit:contain}.dashboard-event>span:nth-child(2){flex:1;min-width:0}.dashboard-event small{display:block;margin:4px 0}.dashboard-empty{padding-block:16px}.dashboard-identity{display:flex;align-items:center;gap:24px;margin:24px 0}.dashboard-identity h2{font-size:clamp(28px,4vw,44px);margin:0}.dashboard-avatar{display:grid;place-items:center;width:112px;height:112px;flex-shrink:0;border:3px solid var(--realm-gold);border-radius:50%;background:var(--realm-panel);color:var(--realm-focus);font:48px Georgia,serif}.dashboard-records dl{display:grid;gap:16px}.dashboard-records dl>div{display:flex;justify-content:space-between;gap:12px}.dashboard-records dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums}.dashboard-status{padding:16px;border:1px solid var(--realm-gold);border-radius:12px;background:var(--realm-panel);color:var(--realm-text);margin-bottom:20px}.dashboard-status button{margin-inline-start:12px}.dashboard-view :focus-visible{outline:3px solid var(--realm-focus);outline-offset:4px}
@media(max-width:800px){.dashboard-grid{grid-template-columns:1fr;gap:0}.dashboard-view{margin-block:16px}.dashboard-home-header{gap:20px}.dashboard-home-header>img{width:clamp(120px,34vw,220px)}.dashboard-actions>a,.dashboard-actions>button{min-height:76px}.dashboard-identity{gap:18px}.dashboard-avatar{width:88px;height:88px;font-size:38px}}
@media(max-width:420px){.dashboard-home-header{flex-direction:column;align-items:flex-start;gap:8px}.dashboard-home-header>img{width:180px;align-self:center}.dashboard-home-header h1{font-size:30px}.dashboard-event{gap:10px}.dashboard-event img{width:48px;height:48px}.dashboard-actions>a,.dashboard-actions>button{padding:18px;font-size:22px}.dashboard-identity h2{font-size:28px}.dashboard-games button{gap:8px}}

/* Shared phone landscape reflow: CSS viewport, safe areas, no state remount. */
@media (min-width:680px) and (max-width:1100px) and (max-height:520px) and (orientation:landscape){
 body>header{min-height:48px;padding-block:2px}body>header .brand img.brand-logo{width:44px;height:44px}.hero{margin-bottom:4px}#sectionNav{flex-wrap:nowrap;overflow-x:auto;padding-block:2px;margin-bottom:8px}#sectionNav a{flex-direction:row;min-height:40px;padding:4px 10px;flex-shrink:0}#sectionNav a::before{width:18px;height:18px;flex-basis:18px}
 .layout{display:grid;grid-template-columns:minmax(260px,1.2fr) minmax(220px,1fr);gap:12px;align-items:start}.layout>.play-area{grid-column:1;grid-row:1 / span 2;order:0;min-width:0}.layout>aside:first-child{grid-column:2;grid-row:1}.layout>aside:last-child{grid-column:2;grid-row:2;display:block}.layout>aside .card{padding:12px;margin-bottom:10px}.layout>aside button,.layout>aside select{min-height:44px;margin-top:6px}.play-area>.board{width:min(100%,max(260px,calc(100dvh - 150px)));margin-inline:auto;border-width:6px}.play-area>.playerbar{min-height:40px;padding:4px 8px}.playerbar .clock{font-size:20px;min-width:84px;padding:4px 8px}
 .review-workspace{display:grid;grid-template-columns:minmax(260px,1.2fr) minmax(220px,1fr);gap:12px}.review-workspace>*{min-width:0}#reviewSidebar{padding:12px}#reviewMoveList{max-height:220px}
 .dashboard-home-header{gap:16px}.dashboard-home-header>img{width:130px}.dashboard-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}.dashboard-view{margin-block:12px}.dashboard-avatar{width:72px;height:72px}.dashboard-view .card{padding:14px}
}

#navLearn{--nav-icon:url('/assets/icons/history.svg')}#learnView{max-width:1100px;margin:24px auto;color:var(--realm-text)}#learnView>div>a{display:inline-flex;min-height:44px;align-items:center;color:var(--realm-text)}.learn-layout{display:grid;grid-template-columns:minmax(180px,280px) minmax(0,1fr);gap:24px}.learn-list{display:flex;flex-direction:column;align-items:stretch;gap:8px}.learn-list button{text-align:left;min-height:48px}.learn-list [aria-pressed=true]{border-color:var(--realm-gold);box-shadow:inset 3px 0 var(--realm-gold)}.learn-lesson p{font-size:17px;line-height:1.7}.learn-lesson fieldset{border:1px solid var(--realm-border);border-radius:10px;padding:16px;min-width:0;margin-block:20px}.learn-lesson legend{font-size:17px}.learn-lesson label{display:flex;align-items:center;gap:12px;min-height:48px;margin:8px 0;font-size:16px}.learn-lesson input[type=radio]{width:24px;height:24px;min-height:24px;flex-shrink:0}.learn-lesson form+button{margin-top:12px}@media(max-width:680px){.learn-layout{grid-template-columns:1fr;gap:16px}.learn-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.learn-list button{font-size:14px}.learn-lesson p{font-size:16px}}@media(max-width:380px){.learn-list{grid-template-columns:1fr}}

#navMessages{--nav-icon:url('/assets/icons/lobby.svg')}#messagesView{max-width:1100px;margin:24px auto;color:var(--realm-text)}.inbox-layout{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,1.5fr);gap:20px;align-items:start}.inbox-layout>*{min-width:0}.inbox-list input,.inbox-list button{width:100%;margin-bottom:10px}.inbox-list button{text-align:left}.inbox-list [aria-pressed=true]{border-color:var(--realm-gold)}.inbox-conversation>.buttons{display:flex;flex-wrap:wrap;gap:8px}.dm-log{list-style:none;padding:0;max-height:55dvh;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.dm-log li{max-width:90%;padding:12px 16px;border:1px solid var(--realm-border);border-radius:16px;margin:12px 0;background:var(--realm-panel);overflow-wrap:anywhere}.dm-log li.dm-own{margin-left:auto;background:#365247}.dm-log p{white-space:pre-wrap;margin:6px 0;color:var(--realm-text);font-size:16px}.dm-log time{font-size:12px;color:var(--realm-muted)}.dm-log button{display:block;margin-top:8px}.dm-composer textarea,.inbox-conversation textarea{width:100%;font-size:16px;resize:vertical;min-height:90px}.dm-composer{padding-bottom:env(safe-area-inset-bottom)}.inbox-conversation form button{margin:8px 8px 0 0}.inbox-conversation label{font-size:14px}.inbox-conversation [role=status]{overflow-wrap:anywhere}@media(max-width:680px){.inbox-layout{display:block}.inbox-layout[data-conversation=true]>.inbox-list{display:none}.inbox-layout[data-conversation=false]>.inbox-conversation:has(.dm-log){display:none}.dm-log{max-height:48dvh}.dm-log li{max-width:94%}.inbox-conversation{padding:12px}#messagesView{margin-block:12px}}

/* Optional chibi identity hints keep ornate kings/queens distinct on small boards. */
.board .piece-role,.theme-sample-square .piece-role{position:absolute;right:2px;top:2px;z-index:2;display:grid;place-items:center;min-width:12px;height:13px;padding:0 1px;border-radius:3px;background:#17231e;color:#fff;font:700 10px/1 system-ui;pointer-events:none;box-shadow:0 0 0 1px #eee}
.board .white-piece .piece-role,.theme-sample-square .white-role{background:#fff;color:#17231e;box-shadow:0 0 0 1px #17231e}

.theme-sample-square{position:relative}

.puzzle-layout{display:grid;grid-template-columns:minmax(240px,440px) minmax(180px,1fr);gap:20px;align-items:start}.puzzle-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1;width:100%;border:2px solid #596b58}.puzzle-board .puzzle-square{position:relative;display:grid;place-items:center;aspect-ratio:1;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:#e9e1cc;color:#17231e;font-size:clamp(20px,4vw,40px)}.puzzle-board .puzzle-square.dark{background:#667d65}.puzzle-square img{width:86%;height:86%;object-fit:contain}.puzzle-square small{position:absolute;bottom:1px;left:2px;font:9px/1 system-ui;background:#ffffffc9;padding:1px;color:#17231e}.puzzle-board .puzzle-square[aria-pressed=true]{box-shadow:inset 0 0 0 3px #d19d22}.puzzle-layout input{font-size:16px;min-height:44px}.puzzle-layout form{display:grid;gap:10px}.puzzle-layout button:not(.puzzle-square){min-height:44px;margin:4px}.puzzle-square:focus-visible{outline:3px solid #cf9100;outline-offset:-3px;z-index:1}.puzzle-square:disabled{opacity:1}
@media(max-width:600px){.puzzle-layout{grid-template-columns:minmax(0,1fr)}.puzzle-board{max-width:440px;margin:auto}}
/* Text stays readable over every optional landscape background. */
#learnContent,#inboxContent{background:#10232af5;border:1px solid #b79b58;border-radius:14px;padding:20px;margin-bottom:18px;color:#f4edda}#learnContent>p,#inboxContent>p{color:#dce4dc}.hero a{color:#f6dfa2}.hero a:visited{color:#f6dfa2}
.board .piece-role,.theme-sample-square .piece-role{text-shadow:none;font-weight:800;letter-spacing:0}
/* Dashboard headings remain readable over every theme background. */
#homeContent,#profileContent{background:#10232af5;border:1px solid #b79b58;border-radius:14px;padding:20px;color:#f4edda}#homeContent>p,#profileContent>p{color:#dce4dc}#homeContent a,#profileContent a{color:#f6dfa2}#profileContent .profile-name{color:#f4edda}

@media(orientation:portrait){html:not([data-reduced-distraction=true]) body{background-image:linear-gradient(#ffffff0a,#ffffff0a),var(--theme-art-portrait,var(--theme-art,none))}}
@media(orientation:portrait) and (max-width:800px){html:not([data-reduced-distraction=true]) body{background-image:linear-gradient(#ffffff0a,#ffffff0a),var(--theme-art-portrait-small,var(--theme-art-small,none))}}


.theme-preview-caption{position:relative;margin:12px 0 0;padding:6px 9px;background:#071e25ed;color:#f1e7c5!important;border-radius:5px;font-size:12px;line-height:1.45;order:2}.theme-mix-preview{display:flex;flex-direction:column}.theme-mix-preview>.theme-sample-board{order:1}
