:root {
    color-scheme: light;
    --page: #f7f9fc;
    --surface: #ffffff;
    --soft: #eff3f8;
    --ink: #243046;
    --muted: #7b8495;
    --line: #e4e9f0;
    --accent: #417bd7;
    --accent-strong: #2864bf;
    --blue-soft: #eaf2fe;
    --blue-mid: #cee1fc;
    --grid: #dce3ec;
    --grid-strong: #8898ae;
    --picross-guide: #cbd4e0;
    --green: #559b8b;
    --error: #cf5360;
    --yellow: #fff5dc;
    --yellow-ink: #967736;
    --shadow: 0 8px 30px #24304605;
    --r0: #eaf2ff; --r1: #fff1d8; --r2: #f0eaff;
    --r3: #e4f4ec; --r4: #ffe9e8; --r5: #e5f4f7;
    --r6: #f6eaf2; --r7: #eef1dd; --r8: #fbeadc;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--page);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #171e2b; --surface: #202938; --soft: #283344;
    --ink: #e0e7f3; --muted: #99a7bb; --line: #344155;
    --accent: #8bb8fc; --accent-strong: #a5c7fc;
    --blue-soft: #293f5f; --blue-mid: #385c88;
    --grid: #3c495d; --grid-strong: #6a809a; --picross-guide: #48576c;
    --green: #89c8b6; --error: #ff8d98;
    --yellow: #3b3427; --yellow-ink: #e6c789;
    --r0: #263953; --r1: #453d2b; --r2: #3b3150;
    --r3: #283f37; --r4: #4b3237; --r5: #273f49;
    --r6: #423244; --r7: #3b402c; --r8: #48382d;
}
* { box-sizing: border-box; }
html { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { margin: 0; min-width: 320px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .4; }
button, a { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
h1, h2, h3, p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-button { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 10px; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.language-button { font-size: 11px; font-weight: 700; letter-spacing: .5px; flex-shrink: 0; }
.skip-link { position: fixed; z-index: 30; top: -60px; left: 16px; padding: 12px; background: var(--surface); border: 2px solid var(--accent); }
.skip-link:focus { top: 10px; }
.site-header { height: 72px; flex: 0 0 auto; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; padding: 0 36px; margin: auto; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 27px 'Outfit', sans-serif; letter-spacing: -1.2px; }
.brand img { width: 39px; height: 39px; border-radius: 11px; }
.brand-club { font-weight: 400; color: var(--muted); }
.brand-dot { color: var(--accent); }
.main-nav { height: 100%; display: flex; align-items: stretch; gap: 34px; }
.nav-link { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 550; position: relative; color: var(--muted); padding: 0; }
.nav-link .icon { width: 16px; height: 16px; }
.nav-link:hover, .nav-link.is-current { color: var(--accent); }
.nav-link.is-current::after { content: ''; position: absolute; width: 23px; height: 3px; border-radius: 4px 4px 0 0; background: var(--accent); bottom: 0; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.streak { display: flex; align-items: center; gap: 7px; color: #a97c43; font-size: 12px; padding: 8px 0; }
.streak .icon { width: 18px; color: #d6a461; }
.streak strong { font-weight: 700; }
.app-shell { flex: 1; min-height: 0; width: 100%; padding: 24px 32px; display: flex; }
.app-screen { min-width: 0; min-height: 0; width: 100%; }
.setup-screen { display: flex; align-items: center; justify-content: center; }
.setup-content { width: min(100%, 760px); display: flex; flex-direction: column; gap: 24px; }
.setup-heading { text-align: center; margin-bottom: 10px; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 9px; font-weight: 600; letter-spacing: 1.7px; color: var(--muted); margin-bottom: 17px; }
.step-dots { display: inline-flex; gap: 4px; }
.step-dots i { width: 5px; height: 5px; background: var(--line); border-radius: 50%; }
.step-dots i.is-current { background: var(--accent); }
h1 { font: 500 clamp(28px, 3.6vw, 43px)/1.2 'Outfit', sans-serif; letter-spacing: -1.4px; }
h1 span { color: var(--accent); }
.setup-heading p { margin-top: 12px; font-size: 13px; color: var(--muted); }
.setup-heading p strong { color: var(--ink); font-weight: 500; }
.setup-separator { margin: 0 8px; }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-option { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding: 28px; text-align: left; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: background .18s, border-color .18s, transform .18s; position: relative; }
.mode-option:hover { border-color: var(--accent); transform: translateY(-3px); }
.mode-option.is-selected { border-color: #9ebfec; background: var(--blue-soft); }
.mode-art { display: grid; grid-template-columns: repeat(3, 1fr); width: 48px; height: 48px; gap: 4px; flex-shrink: 0; }
.mode-art i { border-radius: 3px; background: #9bc3ef; }
.classic-art i:nth-child(2n) { background: #d4e4f8; }
.jigsaw-art i { background: #b9d9b9; }
.jigsaw-art i:nth-child(-n+2), .jigsaw-art i:nth-child(4) { background: #f1ce85; }
.jigsaw-art i:nth-child(3n) { background: #c6b5e5; }
.diagonal-art i { background: #e3dcf2; }
.diagonal-art i:nth-child(2n+1) { background: #b5a2db; }
.mode-copy { display: flex; flex-direction: column; gap: 9px; }
.mode-copy strong { font: 500 23px 'Outfit', sans-serif; }
.mode-copy small { font-size: 11px; line-height: 1.8; color: var(--muted); }
.option-arrow { position: absolute; right: 24px; top: 41px; width: 17px; color: var(--muted); }
.resume-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 17px 21px; background: var(--blue-soft); border-radius: 12px; color: var(--accent-strong); text-align: left; }
.resume-card > span { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.resume-card strong { font-size: 12px; font-weight: 600; }
.resume-card small { font-size: 10px; color: var(--muted); }
.resume-card > .icon { width: 19px; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--yellow-ink); font-size: 12px; font-weight: 550; padding: 0; }
.daily-link .icon { width: 17px; height: 17px; }
.setup-status { font-size: 11px; text-align: center; color: var(--muted); }
.setup-status:empty { display: none; }
.difficulty-content { max-width: 600px; }
.back-link { display: inline-flex; align-items: center; align-self: flex-start; gap: 9px; min-height: 44px; padding: 0; font-size: 12px; color: var(--muted); }
.back-link .icon, .back-button .icon { transform: rotate(180deg); }
.difficulty-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.difficulty-options button { position: relative; display: flex; align-items: center; gap: 18px; min-height: 122px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; text-align: left; background: var(--surface); transition: border-color .18s, background .18s; }
.difficulty-options button:hover, .difficulty-options button.is-selected { background: var(--blue-soft); border-color: #afc9ee; }
.difficulty-copy { display: flex; flex-direction: column; gap: 6px; }
.difficulty-copy strong { font: 500 20px 'Outfit', sans-serif; }
.difficulty-copy small { font-size: 10px; color: var(--muted); }
.points-badge { position: absolute; right: 14px; top: 13px; font-size: 8px; color: var(--muted); }
.level-art { display: flex; align-items: flex-end; gap: 3px; height: 30px; flex-shrink: 0; }
.level-art i { width: 5px; height: 12px; border-radius: 2px; background: var(--line); }
.level-art i:nth-child(2) { height: 18px; }
.level-art i:nth-child(3) { height: 24px; }
.level-art i:nth-child(4) { height: 30px; }
.level-easy i:first-child, .level-medium i:nth-child(-n+2), .level-hard i:nth-child(-n+3), .level-expert i { background: var(--accent); }
.setup-reassurance { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 11px; }
.setup-reassurance .icon { width: 15px; height: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 12px 18px; border-radius: 9px; font-size: 12px; font-weight: 600; transition: transform .15s, background .15s; }
.button:active { transform: translateY(1px); }
.button-dark { background: #28384e; color: #fff; }
.button-dark:hover { background: #3a506e; }
.button-primary { background: var(--accent-strong); color: var(--surface); }
.button-secondary { background: var(--soft); }
.game-screen { max-width: 820px; max-height: 760px; margin: auto; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 218px; grid-template-rows: 44px 70px minmax(0, 1fr) 20px; gap: 14px 36px; }
.game-toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.game-toolbar > .icon-button { width: 44px; height: 44px; }
.puzzle-heading { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.puzzle-heading h2 { font: 500 23px 'Outfit', sans-serif; letter-spacing: -.4px; }
.difficulty-badge { padding: 4px 9px; border-radius: 5px; color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); font-size: 10px; font-weight: 600; }
.pause-button { background: var(--soft); }
.pause-button .icon { width: 15px; height: 15px; fill: currentColor; stroke-width: 0; }
.game-metrics { grid-column: 1; grid-row: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; padding: 10px 5px; }
.metric { padding: 0 18px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-label { display: flex; align-items: center; gap: 5px; font-size: 8px; font-weight: 600; letter-spacing: 1.2px; color: var(--muted); }
.metric-label .icon { width: 13px; height: 13px; }
.metric strong { display: flex; align-items: baseline; gap: 5px; font: 500 25px 'Outfit', sans-serif; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.metric strong > span { font: 400 9px 'DM Sans', sans-serif; letter-spacing: 0; color: var(--muted); }
.board-stage { grid-column: 1; grid-row: 3; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.board-shell { width: min(100cqw, 100cqh, 560px); aspect-ratio: 1; flex: 0 0 auto; container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 10px; position: relative; box-shadow: var(--shadow); }
.toolkit { grid-column: 2; grid-row: 2 / 5; align-self: center; min-width: 0; }
.number-heading { display: flex; justify-content: space-between; align-items: center; margin: 25px 0 12px; }
.number-heading h3 { font-size: 12px; font-weight: 550; }
.connection-banner { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 24px); width: max-content; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 14px; font-size: 12px; }
.connection-banner .button { flex-shrink: 0; }
.sudoku-board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); aspect-ratio: 1; width: 100%; border: 2px solid var(--grid-strong); border-radius: 3px; overflow: hidden; background: var(--surface); user-select: none; -webkit-user-select: none; }
.cell { --cell-bg: var(--surface); background: var(--cell-bg); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 0; position: relative; font: 400 clamp(14px, 6cqw, 34px) 'Outfit', sans-serif; display: flex; align-items: center; justify-content: center; color: var(--accent-strong); min-width: 0; min-height: 0; transition: background-color .12s; }
.cell.is-given { color: var(--ink); font-weight: 400; }
.cell.edge-right { border-right: 2px solid var(--grid-strong); }
.cell.edge-bottom { border-bottom: 2px solid var(--grid-strong); }
.sudoku-board:not(.placement-board) .cell:nth-child(9n), .cell.is-last-col { border-right: 0; }
.sudoku-board:not(.placement-board) .cell:nth-child(n+73), .cell.is-last-row { border-bottom: 0; }
.cell.is-diagonal { --cell-bg: var(--r2); }
.cell.is-peer { background: color-mix(in srgb, var(--blue-soft) 70%, var(--cell-bg)); }
.cell.is-match { background: color-mix(in srgb, var(--blue-mid) 86%, var(--cell-bg)); color: var(--accent-strong); font-weight: 500; }
.cell.is-selected { background: var(--blue-mid); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-strong); z-index: 1; }
.cell.is-invalid { color: var(--error); }
.cell.is-invalid::after { content: ''; position: absolute; bottom: 5px; height: 3px; width: 3px; background: currentColor; border-radius: 50%; }
.cell.is-revealed:not(.is-given) { color: var(--green); }
.cell:disabled { opacity: 1; }
.cell:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); z-index: 2; }
.cell-notes { position: absolute; inset: 3px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.cell-notes span { display: flex; align-items: center; justify-content: center; font: 500 clamp(6px, 2.1cqw, 11px) 'DM Sans', sans-serif; color: var(--muted); border-radius: 2px; }
.cell-notes span.note-match { color: var(--accent-strong); background: var(--blue-mid); font-weight: 700; }
.board-overlay { position: absolute; inset: 0; z-index: 5; background: var(--surface); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 25px; text-align: center; }
.board-overlay[hidden] { display: none; }
.board-overlay > .icon { width: 37px; height: 37px; color: var(--accent); margin-bottom: 5px; }
.board-overlay h3 { font: 500 24px 'Outfit', sans-serif; }
.board-overlay p { font-size: 12px; color: var(--muted); max-width: 300px; line-height: 1.7; }
.board-overlay .button { margin-top: 8px; }
.loading-spinner { width: 30px; height: 30px; border: 3px solid var(--blue-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.board-footer { grid-column: 1; grid-row: 4; display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.live-dot { width: 5px; height: 5px; background: #77b9a4; border-radius: 50%; }
.progress-track { height: 4px; background: var(--line); border-radius: 6px; overflow: hidden; flex: 1; max-width: 95px; margin-left: auto; }
.progress-track > span { display: block; height: 100%; background: #9cbae8; border-radius: 6px; transition: width .3s; }
#progress-percent { font-size: 9px; font-variant-numeric: tabular-nums; }
.board-tip { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 10px; margin-top: 24px; text-align: center; line-height: 1.5; }
.board-tip .icon { width: 15px; height: 15px; }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tool-button { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 82px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; }
.tool-button > .icon { color: #6c7f9b; width: 22px; height: 22px; }
.tool-button > span { font-size: 10px; display: flex; align-items: center; gap: 4px; }
.tool-button small { background: var(--soft); border-radius: 3px; padding: 2px 3px; color: var(--muted); font-size: 7px; font-weight: 600; }
.tool-button .hint-spark { background: none; color: #d3a658; font-size: 10px; padding: 0; }
.tool-button:not(:disabled):hover { background: var(--soft); }
.tool-button.is-active { border-color: #9ebfec; background: var(--blue-soft); color: var(--accent-strong); }
.tool-button.is-active > .icon { color: var(--accent); }
.tool-button.is-active small { background: var(--accent); color: var(--surface); }
.number-heading { margin-top: 25px; }
.number-heading > span { color: var(--muted); font-size: 7px; letter-spacing: .6px; }
.number-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.number-key { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; height: 71px; border-radius: 10px; background: var(--blue-soft); color: var(--accent-strong); transition: background .12s, transform .12s; padding: 0; }
.number-key > span { font: 400 30px 'Outfit', sans-serif; }
.number-key > small { font-size: 8px; color: #8d9bb1; }
.number-key:not(:disabled):hover, .number-key.is-highlighted { background: var(--blue-mid); }
.number-key:active { transform: scale(.95); }
.number-key.is-complete:not(:disabled) { opacity: .35; }
.number-pad.notes-active .number-key > span { font-size: 20px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; font-size: 10px; color: var(--muted); padding: 8px; }
.text-button .icon { width: 13px; height: 13px; }
.scoring-link { width: 100%; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: #28384e; color: #fff; padding: 13px 20px; border-radius: 10px; box-shadow: 0 8px 35px #0002; font-size: 12px; max-width: calc(100% - 30px); width: max-content; z-index: 50; transition: opacity .2s, transform .2s; text-align: center; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.app-dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 36px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 90px #17233626; }
.app-dialog::backdrop { background: #18263d70; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; right: 12px; top: 12px; }
.dialog-emblem { display: inline-flex; justify-content: center; align-items: center; width: 52px; height: 52px; background: var(--blue-soft); color: var(--accent); border-radius: 15px; margin-bottom: 20px; }
.dialog-emblem .icon { width: 25px; height: 25px; }
.app-dialog h2 { font: 500 28px 'Outfit', sans-serif; letter-spacing: -.6px; margin-bottom: 10px; }
.dialog-lead { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 23px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 25px; }
.dialog-actions .button { flex: 1; min-width: 0; }
.dialog-kicker { color: var(--muted); font-size: 11px; line-height: 1.6; margin-bottom: 10px; }
.dialog-pager { align-items: center; }
.dialog-pager > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.language-options { display: grid; gap: 10px; }
.language-options button { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; min-height: 52px; text-align: left; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; }
.language-options button:hover, .language-options button[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--accent); color: var(--accent-strong); }
.rule-list { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 17px; counter-reset: rule; }
.rule-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 12px; line-height: 1.75; color: var(--muted); }
.rule-list li::before { counter-increment: rule; content: counter(rule); width: 25px; height: 25px; border-radius: 7px; background: var(--blue-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600; }
.rule-list strong { color: var(--ink); font-weight: 600; }
.dialog-note { font-size: 11px; line-height: 1.8; padding: 14px; background: var(--soft); border-radius: 9px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.stat-tile { border-radius: 10px; background: var(--soft); padding: 18px; }
.stat-tile strong { display: block; font: 500 28px 'Outfit', sans-serif; color: var(--accent); }
.stat-tile span { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; }
.recent-heading { font-size: 12px; margin: 24px 0 10px; }
.recent-game { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.recent-game small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.empty-stats { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; background: var(--soft); border-radius: 10px; line-height: 1.8; }
.points-table { display: grid; gap: 0; margin: 20px 0; }
.points-table > div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.points-table strong { color: var(--accent); font-weight: 600; }
.celebration { text-align: center; }
.celebration .dialog-emblem { width: 70px; height: 70px; border-radius: 50%; background: var(--yellow); color: var(--yellow-ink); }
.celebration .dialog-emblem .icon { width: 34px; height: 34px; }
.celebration .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.celebration .stat-tile { min-width: 0; padding: 16px 8px; overflow-wrap: anywhere; }
.celebration .stat-tile strong { font-size: 25px; }
.noscript { position: fixed; bottom: 0; left: 0; right: 0; padding: 20px; background: var(--ink); color: var(--surface); text-align: center; z-index: 100; }
@media (max-width: 900px) {
    .header-inner { padding: 0 24px; gap: 16px; }
    .main-nav { gap: 20px; }
    .header-actions { gap: 12px; }
    .game-screen { column-gap: 24px; grid-template-columns: minmax(0, 1fr) 190px; }
    .mode-option { padding: 22px; }
}
@media (max-width: 760px) {
    .site-header { height: 58px; }
    .header-inner { padding: 0 16px; gap: 6px; }
    .brand { font-size: 23px; gap: 6px; letter-spacing: -.9px; }
    .brand img { width: 30px; height: 30px; border-radius: 8px; }
    .main-nav { gap: 0; margin-left: auto; }
    .nav-link { font-size: 0; gap: 0; width: 40px; }
    .nav-link .icon { width: 19px; height: 19px; }
    .nav-link.is-current { display: none; }
    .header-actions { gap: 0; }
    .streak { display: none; }
    .icon-button { width: 40px; height: 44px; }
    .app-shell { padding: 14px 16px; }
    .setup-content { max-width: 420px; gap: 18px; }
    .setup-heading { margin-bottom: 7px; }
    .eyebrow { font-size: 8px; letter-spacing: 1.3px; margin-bottom: 14px; }
    h1 { font-size: 32px; letter-spacing: -1px; }
    .setup-heading p { font-size: 12px; margin-top: 10px; }
    .mode-options { grid-template-columns: 1fr; gap: 12px; }
    .mode-option { flex-direction: row; align-items: center; gap: 19px; min-height: 98px; padding: 17px 20px; border-radius: 14px; }
    .mode-art { width: 42px; height: 42px; gap: 3px; }
    .mode-copy { gap: 4px; }
    .mode-copy strong { font-size: 20px; }
    .mode-copy small { font-size: 10px; line-height: 1.6; }
    .option-arrow { position: static; margin-left: auto; width: 16px; }
    .resume-card { padding: 14px 17px; }
    .setup-footer { flex-direction: column; gap: 0; }
    .setup-footer .text-button { min-height: 32px; font-size: 9px; }
    .difficulty-content { gap: 22px; }
    .difficulty-content .setup-heading h1 { max-width: 340px; margin: auto; }
    .difficulty-options { gap: 12px; }
    .difficulty-options button { min-height: 135px; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
    .difficulty-copy strong { font-size: 19px; }
    .difficulty-copy small { font-size: 10px; }
    .points-badge { top: 18px; right: 15px; }
    .setup-reassurance { font-size: 10px; }
    .game-screen { max-width: 480px; max-height: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 58px minmax(0, 1fr) 18px auto; gap: 10px; }
    .game-toolbar { gap: 5px; grid-column: 1; }
    .puzzle-heading { gap: 2px; flex-direction: column; align-items: flex-start; }
    .puzzle-heading h2 { font-size: clamp(14px, 4.2vw, 20px); }
    .difficulty-badge { font-size: 9px; padding: 2px 7px; }
    #game-info { display: none; }
    .game-metrics { padding: 7px 3px; border-radius: 10px; }
    .metric { padding: 0 13px; }
    .metric-label { font-size: 7px; letter-spacing: .7px; gap: 4px; }
    .metric-label .icon { width: 12px; height: 12px; }
    .metric strong { font-size: 23px; }
    .metric strong > span { font-size: 8px; }
    .board-shell { padding: 6px; border-radius: 10px; }
    .cell-notes { inset: 1px; }
    .board-footer { font-size: 9px; gap: 5px; }
    .progress-track { max-width: 85px; }
    .toolkit { grid-column: 1; grid-row: 5; align-self: stretch; display: flex; flex-direction: column; gap: 10px; }
    .number-heading, .board-tip, .scoring-link { display: none; }
    .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; order: 1; }
    .tool-button { min-height: 58px; gap: 5px; border-radius: 9px; }
    .tool-button > .icon { width: 20px; height: 20px; }
    .tool-button > span { font-size: 10px; }
    .number-pad { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; order: 2; }
    .number-key { height: 58px; border-radius: 8px; gap: 2px; }
    .number-key > span { font-size: 26px; }
    .number-key > small { font-size: 7px; }
    .app-dialog { padding: 28px 23px; }
    .app-dialog h2 { font-size: 25px; }
    .board-overlay { padding: 16px; gap: 8px; }
    .board-overlay h3 { font-size: 22px; }
    .toast { bottom: auto; top: calc(65px + env(safe-area-inset-top)); font-size: 11px; }
}
@media (max-height: 700px) and (max-width: 760px) {
    .site-header { height: 52px; }
    .app-shell { padding: 8px 12px; }
    .setup-content { gap: 12px; }
    .setup-heading { margin-bottom: 0; }
    .eyebrow { margin-bottom: 9px; font-size: 7px; }
    h1 { font-size: 28px; }
    .setup-heading p { margin-top: 6px; font-size: 11px; }
    .mode-options { gap: 9px; }
    .mode-option { min-height: 73px; padding: 12px 17px; gap: 15px; }
    .mode-art { width: 34px; height: 34px; }
    .mode-copy strong { font-size: 18px; }
    .mode-copy small { font-size: 9px; line-height: 1.5; }
    .resume-card { padding: 11px 15px; }
    .resume-card strong { font-size: 11px; }
    .setup-footer { flex-direction: row; gap: 6px; }
    .setup-footer .text-button { max-width: 90px; padding: 0; text-align: left; line-height: 1.5; }
    .daily-link { font-size: 10px; gap: 5px; }
    .daily-link .icon { width: 14px; }
    .difficulty-options button { min-height: 110px; padding: 16px; gap: 9px; }
    .difficulty-copy small { font-size: 9px; }
    .game-screen { grid-template-rows: 40px 50px minmax(0, 1fr) 16px auto; gap: 7px; }
    .game-toolbar > .icon-button { height: 40px; flex-shrink: 0; }
    .puzzle-heading h2 { font-size: clamp(14px, 4.2vw, 18px); }
    .metric strong { font-size: 21px; margin-top: 1px; }
    .toolkit { gap: 8px; }
    .tool-button { min-height: 50px; gap: 3px; }
    .tool-button > .icon { width: 18px; height: 18px; }
    .number-key { height: 52px; }
    .number-key > span { font-size: 24px; }
}
@media (max-width: 380px) {
    .header-inner { padding: 0 12px; }
    .brand-club { display: none; }
    .number-key > small { font-size: 6px; }
    .dialog-actions { gap: 6px; }
    .dialog-actions .button { padding: 10px 8px; font-size: 11px; gap: 5px; }
    .celebration .stat-tile { padding: 14px 5px; }
    .celebration .stat-tile strong { font-size: 21px; }
}
@media (max-height: 700px) {
    .app-dialog { padding: 22px 20px; }
    .app-dialog h2 { font-size: 23px; }
    .dialog-emblem, .celebration .dialog-emblem { width: 40px; height: 40px; margin-bottom: 12px; }
    .dialog-emblem .icon, .celebration .dialog-emblem .icon { width: 24px; height: 24px; }
    .dialog-lead { font-size: 12px; line-height: 1.6; margin-bottom: 14px; }
    .dialog-note { padding: 10px; line-height: 1.6; }
    .dialog-actions { margin-top: 16px; }
    .stat-tile { padding: 14px; }
    .stat-tile strong { font-size: 24px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .site-header { height: 42px; }
    .header-actions .icon-button { height: 40px; }
    .header-inner { padding: 0 18px; }
    .brand { font-size: 21px; }
    .brand img { width: 27px; height: 27px; }
    .app-shell { padding: 7px 16px; }
    .setup-content { max-width: 700px; gap: 9px; }
    .setup-heading { margin: 0; }
    h1 { font-size: 24px; }
    .eyebrow, .setup-heading p, .setup-footer .text-button { display: none; }
    .mode-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .mode-option { flex-direction: row; min-height: 90px; padding: 14px; gap: 12px; }
    .mode-copy strong { font-size: 17px; }
    .mode-copy small { font-size: 9px; }
    .mode-copy small br, .option-arrow { display: none; }
    .mode-art { width: 30px; height: 30px; gap: 2px; }
    .resume-card { padding: 9px 16px; }
    .resume-card > span { flex-direction: row; align-items: center; gap: 12px; }
    .setup-footer { justify-content: center; }
    .daily-link { min-height: 32px; }
    .difficulty-content { position: relative; }
    .back-link { min-height: 28px; }
    .difficulty-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .difficulty-options button { min-height: 105px; padding: 15px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .difficulty-copy strong { font-size: 17px; }
    .difficulty-copy small { font-size: 8px; }
    .level-art { transform: scale(.8); transform-origin: left bottom; height: 24px; }
    .points-badge { top: 12px; right: 10px; }
    .game-screen { max-width: 740px; max-height: none; grid-template-columns: minmax(0, 1fr) 190px; grid-template-rows: 36px 44px minmax(0, 1fr) 16px; gap: 6px 24px; }
    .game-toolbar { grid-column: 1 / -1; }
    .game-toolbar > .icon-button { height: 36px; }
    .puzzle-heading { flex-direction: row; align-items: center; gap: 8px; }
    .puzzle-heading h2 { font-size: 18px; }
    .game-metrics { grid-column: 2; grid-row: 2; padding: 4px 0; }
    .metric { padding: 0 7px; }
    .metric-label { font-size: 6px; letter-spacing: .1px; }
    .metric-label .icon, .metric strong > span { display: none; }
    .metric strong { font-size: 18px; margin-top: 2px; }
    .board-stage { grid-column: 1; grid-row: 2 / 5; }
    .board-shell { padding: 5px; }
    .board-footer { display: none; }
    .toolkit { grid-column: 2; grid-row: 3 / 5; display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
    .number-heading, .board-tip, .scoring-link { display: none; }
    .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
    .tool-button { min-height: 40px; gap: 2px; border-radius: 6px; }
    .tool-button > .icon { width: 15px; height: 15px; }
    .tool-button > span { font-size: 8px; gap: 1px; }
    .tool-button small { font-size: 6px; padding: 0 1px; }
    .number-pad { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 4px; flex: 1; min-height: 0; }
    .number-key { height: auto; min-height: 28px; border-radius: 6px; }
    .number-key > span { font-size: 22px; }
    .number-key > small { display: none; }
    .board-overlay h3 { font-size: 18px; }
    .board-overlay p { font-size: 10px; }
    .board-overlay > .icon { width: 23px; height: 23px; margin: 0; }
    .board-overlay .button { min-height: 36px; font-size: 10px; padding: 7px 12px; }
    .app-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 16px); padding: 18px 22px; border-radius: 14px; }
    .dialog-emblem, .celebration .dialog-emblem { display: none; }
    .dialog-close { top: 4px; right: 5px; height: 40px; }
    .app-dialog h2 { font-size: 22px; margin-bottom: 8px; padding-right: 28px; }
    .dialog-kicker { font-size: 10px; margin-bottom: 6px; padding-right: 28px; }
    .dialog-lead { margin-bottom: 10px; line-height: 1.55; }
    .dialog-note { padding: 8px 10px; font-size: 11px; line-height: 1.5; }
    .dialog-actions { margin-top: 12px; }
    .dialog-actions .button { min-height: 44px; padding: 10px 12px; }
    .points-table { margin: 8px 0; }
    .points-table > div { padding: 7px 0; font-size: 11px; }
    .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0; gap: 8px; }
    .stat-tile, .celebration .stat-tile { padding: 10px 8px; }
    .stat-tile strong, .celebration .stat-tile strong { font-size: 22px; }
    .stat-tile span { font-size: 8px; line-height: 1.4; }
    .language-options { grid-template-columns: 1fr 1fr; }
}
.picross-art i { background: var(--ink); }
.picross-art i:nth-child(2), .picross-art i:nth-child(4), .picross-art i:nth-child(9) { background: var(--line); }
.cat-art { display: flex; align-items: center; justify-content: center; background: var(--r2); color: var(--ink); border-radius: 10px; }
.cat-art .icon { width: 80%; height: 80%; }
.board-layout { width: 100%; aspect-ratio: 1; }
.placement-board { grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr)); grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr)); }
.picross-layout { display: grid; grid-template-columns: var(--clue-space) minmax(0, 1fr); grid-template-rows: var(--clue-space) minmax(0, 1fr); }
.picross-layout .sudoku-board { grid-column: 2; grid-row: 2; height: 100%; min-height: 0; }
.column-clues { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr)); padding: 0 2px; }
.row-clues { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr)); padding: 2px 0; }
.nonogram-clue { display: flex; align-items: center; justify-content: flex-end; gap: .25em; padding: 2px; font: 600 clamp(8px, var(--clue-font), 20px)/1.1 'DM Sans', sans-serif; color: var(--ink); min-width: 0; min-height: 0; }
.column-clues .nonogram-clue { flex-direction: column; padding-bottom: 4px; }
.row-clues .nonogram-clue { padding-right: 4px; }
.nonogram-clue.is-complete { color: var(--muted); font-weight: 400; }
.nonogram-clue.is-active { background: var(--blue-soft); border-radius: 3px; }
.placement-cell .icon { width: 68%; height: 68%; pointer-events: none; }
.placement-cell .filled-square { width: 76%; height: 76%; border-radius: 2px; background: currentColor; pointer-events: none; }
.placement-cell { color: var(--ink); }
.placement-cell.is-peer { background: color-mix(in srgb, var(--blue-mid) 30%, var(--cell-bg)); }
.placement-cell.is-selected { background: color-mix(in srgb, var(--blue-mid) 45%, var(--cell-bg)); }
.placement-board[data-mode="picross"] .edge-right { border-right-color: var(--picross-guide); }
.placement-board[data-mode="picross"] .edge-bottom { border-bottom-color: var(--picross-guide); }
.placement-board[data-mode="meowdoku"] .is-peer { background: var(--cell-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent); }
.placement-board[data-mode="meowdoku"] .is-selected { background: var(--cell-bg); box-shadow: inset 0 0 0 2px var(--ink); }
.placement-cell.is-invalid { color: var(--error); }
.placement-cell.is-invalid::after { bottom: 1px; width: 2px; height: 2px; }
.placement-game .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.placement-game .tool-button { min-height: 68px; padding: 3px; }
.placement-game .tool-button > span { font-size: 10px; }
:root[data-theme="dark"] .number-key > small, :root[data-theme="dark"] .resume-card small { color: var(--ink); }
:root[data-theme="dark"] .streak { color: #d6a461; }
@media (max-width: 760px) and (orientation: portrait) {
    .placement-game .tools-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .placement-game .tool-button { min-height: 54px; }
    .placement-game .tool-button > span { font-size: 9px; }
    .placement-game .board-tip { display: flex; order: 2; margin: 0; font-size: 9px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .placement-game .tools-grid { flex: 1; grid-template-rows: repeat(2, minmax(44px, 1fr)); }
    .placement-game .tool-button { min-height: 44px; gap: 4px; }
    .placement-game .board-tip { display: flex; order: 2; font-size: 9px; margin: 0; }
    .mode-copy { min-width: 0; }
    .mode-copy strong { font-size: 16px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.picross-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.campaign-content { max-width: 700px; gap: 16px; }
.campaign-content .setup-heading { margin: 0; }
.stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stage-card { display: flex; align-items: center; gap: 14px; text-align: left; min-height: 110px; padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; min-width: 0; }
.stage-card:not(:disabled):hover { border-color: var(--accent); background: var(--blue-soft); }
.stage-card:disabled { opacity: .6; }
.stage-art, .stage-placeholder { width: 54px; height: 54px; flex: 0 0 auto; }
.stage-art { background: #edf1f6; border-radius: 6px; padding: 5px; }
.stage-placeholder { display: flex; align-items: center; justify-content: center; color: var(--accent); background: var(--soft); border-radius: 10px; font: 500 30px 'Outfit', sans-serif; }
.stage-placeholder .icon { width: 22px; height: 22px; }
.stage-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.stage-copy strong { font: 500 18px 'Outfit', sans-serif; }
.stage-copy > span { font-size: 12px; }
.stage-copy small { color: var(--muted); font-size: 10px; }
.is-completed .stage-copy small { color: var(--green); }
.stage-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-pager > span { font-size: 11px; color: var(--muted); text-align: center; }
.campaign-results { grid-column: 2; grid-row: 3; align-self: center; z-index: 1; }
.campaign-finished .toolkit { visibility: hidden; }
.art-reveal .picross-layout { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); transition: grid-template-columns .2s .2s, grid-template-rows .2s .2s; }
.art-reveal .column-clues, .art-reveal .row-clues { opacity: 0; visibility: hidden; padding: 0; transition: opacity .2s, visibility 0s .2s; }
.art-reveal .sudoku-board { border-color: transparent; background: #edf1f6; transition: border-color .2s, background-color .2s; }
.art-reveal .placement-cell { border-width: 0; background: transparent; box-shadow: none; transition: border-width .2s, background-color .2s, box-shadow .2s; }
.art-reveal .placement-cell::after, .art-reveal .placement-cell .icon { opacity: 0; transition: opacity .2s; }
.art-reveal .filled-square { width: 100%; height: 100%; border-radius: 0; background: var(--ink); transition: background-color .3s var(--pixel-delay), width .2s, height .2s, border-radius .2s; }
.art-colorized .filled-square { background: var(--pixel-color); }
@media (max-width: 760px) and (orientation: portrait) {
    .picross-options { grid-template-columns: 1fr; }
    .campaign-content { gap: 12px; }
    .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stage-card { min-height: 84px; padding: 10px; gap: 9px; }
    .stage-art, .stage-placeholder { width: 40px; height: 40px; }
    .stage-copy strong { font-size: 16px; }
    .stage-copy > span { font-size: 11px; }
    .stage-copy small { font-size: 9px; }
    .campaign-results { grid-column: 1; grid-row: 5; align-self: center; }
    .campaign-content h1 { font-size: 28px; }
}
@media (max-height: 700px) and (orientation: portrait) {
    .campaign-content { gap: 9px; }
    .campaign-content h1 { font-size: 25px; }
    .stage-card { min-height: 72px; padding: 8px; gap: 7px; }
    .stage-art, .stage-placeholder { width: 35px; height: 35px; }
    .stage-copy strong { font-size: 14px; }
    .stage-pager .button { min-height: 44px; padding: 8px 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .campaign-content { display: grid; grid-template-columns: minmax(0, 1fr) 180px; grid-template-rows: 42px auto 44px; gap: 8px 16px; }
    .campaign-content > .back-link { grid-column: 1; grid-row: 1; z-index: 1; justify-self: start; }
    .campaign-content > .setup-heading { grid-column: 1 / -1; grid-row: 1; padding: 0 85px; align-self: center; }
    .campaign-content h1 { font-size: 20px; }
    .campaign-content .setup-heading p { display: block; font-size: 9px; margin-top: 2px; }
    .campaign-content .stage-grid { grid-column: 1 / -1; grid-row: 2; gap: 7px; }
    .stage-card { min-height: 65px; padding: 7px; gap: 8px; }
    .stage-art, .stage-placeholder { width: 34px; height: 34px; }
    .stage-copy { gap: 2px; }
    .stage-copy strong { font-size: 14px; }
    .stage-copy > span { font-size: 10px; }
    .stage-copy small { font-size: 9px; }
    .stage-pager { grid-column: 1; grid-row: 3; }
    .stage-pager .button { min-height: 44px; padding: 8px 10px; }
    #campaign-continue { grid-column: 2; grid-row: 3; padding: 8px; font-size: 11px; }
    #campaign-status { grid-column: 1 / -1; }
    .campaign-results { grid-column: 2; grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) {
    .art-reveal * { transition-delay: 0s !important; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
