html[data-pw-theme="contrast"]{--paper:#ffffff;--surface:#ffffff;--ink:#111111;--muted:#333333;--line:#555555;--green:#111111;--lime:#ededed;--light:#f2f2f2;--mint:#ededed;--accent:#111111;--on-accent:#ffffff;--preview-word:#ffffff;--preview-number:#ededed;--preview-drop:#ffffff;--preview-other:#ededed;--focus:#111111}
html[data-pw-theme="light"]{--paper:#f4f8f5;--surface:#ffffff;--ink:#183b2b;--muted:#50675b;--line:#cbdacf;--green:#176044;--lime:#d9f1a3;--light:#e8f5ed;--mint:#d9f1a3;--accent:#176044;--on-accent:#ffffff;--preview-word:#cceccb;--preview-number:#cceaf1;--preview-drop:#ffe4ba;--preview-other:#e2dcf6;--focus:#a64415}
html[data-pw-theme="bright"]{--paper:#fff2c6;--surface:#ffffff;--ink:#213c36;--muted:#52635d;--line:#d7bd67;--green:#176044;--lime:#ddf66b;--light:#e4f4ce;--mint:#ddf66b;--accent:#176044;--on-accent:#ffffff;--preview-word:#c6ed76;--preview-number:#8bdbe4;--preview-drop:#ffc36d;--preview-other:#f7ad9c;--focus:#a53e13}
html[data-pw-theme="dark"]{color-scheme:dark;--paper:#101c17;--surface:#1c3027;--ink:#edf6ee;--muted:#b2c5b8;--line:#4b6456;--green:#94dfaf;--lime:#344d24;--light:#283f32;--mint:#344d24;--accent:#94dfaf;--on-accent:#11271a;--preview-word:#2a4935;--preview-number:#24444b;--preview-drop:#50402a;--preview-other:#403348;--focus:#ffd16b}
html[data-pw-theme="playful"]{--paper:#fff1df;--surface:#fffdf9;--ink:#39274c;--muted:#6b5676;--line:#dcbadd;--green:#623c83;--lime:#f6db85;--light:#efe2fa;--mint:#f6db85;--accent:#623c83;--on-accent:#ffffff;--preview-word:#f7c96e;--preview-number:#9bdcdb;--preview-drop:#fab4bf;--preview-other:#cbb4f0;--focus:#a63e16}
html[data-pw-theme]:not([data-pw-theme="calm"]) body{background:var(--paper);color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.board-card,.clues-card,.puzzle-settings,.about-content,dialog,.pw-menu nav){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.new-button,.primary,.check-answer,.progress-card,.cell.selected,.drop-game .cell.selected,.memory-tile:not(.revealed),.checkpoint.visited,.next-letter strong){background:var(--green);color:var(--on-accent)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.new-button,.primary):hover{filter:brightness(.92)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.progress-caption,.count>span,.progress-card .small-label,.found-list p){color:var(--on-accent)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.cell:not(.selected):not(.found),.drop-board,.path-board,.path-clue,.selection-bar,.entry,.hint-card,.active-clue-banner,.hunt-banner,.size-badge,.size-pill,.clue-row.active,.clue-row:hover,.clue-match,.object.selected,.piece.selected){background:var(--light);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.cell.found,.path-victory,.fit-victory,.order-victory){background:var(--lime);color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(dialog p,dialog li,.hint-card p,.size-badge,.size-pill,.clue-row.solved .clue-copy){color:var(--muted)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(select,input,.hint-button,.outline,.options-button,.rotate-button){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(button,a,summary,select,input):focus-visible{outline-color:var(--focus)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .game-preview{background:var(--preview-other)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .word-card .game-preview{background:var(--preview-word)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.number-card,.path-card) .game-preview{background:var(--preview-number)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.drop-card,.order-card) .game-preview{background:var(--preview-drop)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.word-demo span:nth-child(-n+4),.number-demo span:nth-child(2),.number-demo span:nth-child(3),.drop-demo .letter,.drop-demo .falling,.memory-demo span){color:var(--on-accent)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.pw-version,.pw-full-badge,.pw-full-badge:hover){background:var(--light);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .pw-full-check{background:var(--green);color:var(--on-accent)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.unlock-page,body:has(#purchase-code)){background:var(--paper);color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.unlock-page main,body:has(#purchase-code) main,.pw-access-panel){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.unlock-back,.unlock-intro,.unlock-help,.unlock-seller,.unlock-buy-note){color:var(--muted)}
/* Keep fixed puzzle-symbol colours legible; these colours carry game meaning. */
html[data-pw-theme="dark"] :is(.secret span,.guess-slot,#palette button,.object,.order-drag){background:#fffef9;color:#263e34}
html[data-pw-theme="dark"] :is(.deduction,.clue-miss,.nudged){color:#263e34}
html[data-pw-theme="dark"] :is(.code-demo,.fit-demo,.order-demo){background:#fffef9;border-radius:8px;padding:5px}
html[data-pw-theme="playful"] .game-card{border-width:2px;box-shadow:0 4px 0 #623c8315}
.pw-theme-open{font:600 12px/1.4 system-ui,sans-serif;font-family:inherit;background:var(--surface,#fffef9);color:var(--ink,#263e34);border:1px solid var(--line,#dedfd4);border-radius:9px;padding:10px 12px;min-height:44px;cursor:pointer;margin-left:8px}
.pw-theme-dialog{font:16px/1.5 'DM Sans',system-ui,sans-serif;width:calc(100% - 32px);max-width:580px;max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line,#dedfd4);border-radius:20px;padding:24px;background:var(--surface,#fffef9);color:var(--ink,#263e34)}.pw-theme-dialog::backdrop{background:#10231b99}.pw-theme-dialog h2{font:700 25px/1.2 Manrope,system-ui,sans-serif;margin:4px 32px 10px 0}.pw-theme-dialog p{font-size:14px;line-height:1.5;color:var(--muted,#50675b)}.pw-theme-close{position:absolute;right:14px;top:10px;background:none;border:0;color:inherit;font:24px system-ui;min-width:44px;min-height:44px;cursor:pointer}.pw-theme-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pw-theme-choice{display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:12px;gap:6px;background:var(--surface,#fffef9);color:var(--ink,#263e34);border:2px solid var(--line,#dedfd4);border-radius:12px;font:inherit;cursor:pointer}.pw-theme-choice[aria-pressed="true"]{border-color:var(--green,#365944);box-shadow:0 0 0 1px var(--green,#365944)}.pw-theme-choice>span:last-child{font-size:12px;line-height:1.4}.pw-theme-choice:hover{outline:1px solid var(--green,#365944)}.pw-theme-choice:active{transform:translateY(1px)}.pw-theme-swatch{display:flex;gap:5px;padding:12px;border-radius:7px;background:var(--swatch-paper)}.pw-theme-swatch i{display:block;width:24px;height:24px;border-radius:6px;background:var(--swatch-accent)}.pw-theme-swatch i:nth-child(2){background:var(--swatch-second)}.pw-theme-swatch i:nth-child(3){background:var(--swatch-third)}.pw-swatch-calm{--swatch-paper:#f5f3eb;--swatch-accent:#365944;--swatch-second:#dceba5;--swatch-third:#efe6d6}.pw-swatch-light{--swatch-paper:#f4f8f5;--swatch-accent:#176044;--swatch-second:#cceaf1;--swatch-third:#ffffff}.pw-swatch-bright{--swatch-paper:#fff2c6;--swatch-accent:#176044;--swatch-second:#8bdbe4;--swatch-third:#ffc36d}.pw-swatch-dark{--swatch-paper:#101c17;--swatch-accent:#94dfaf;--swatch-second:#24444b;--swatch-third:#403348}.pw-swatch-playful{--swatch-paper:#fff1df;--swatch-accent:#623c83;--swatch-second:#fab4bf;--swatch-third:#9bdcdb}.pw-theme-done{width:100%;min-height:44px;font:600 15px system-ui;background:var(--green,#365944);color:var(--on-accent,#fff);border:0;border-radius:9px;padding:12px;cursor:pointer}.pw-theme-dialog :is(button):focus-visible{outline:3px solid var(--focus,#c58844);outline-offset:3px}.pw-theme-dialog .pw-theme-storage{font-size:12px}@media(max-width:480px){.pw-theme-dialog{padding:20px}.pw-theme-open{font-size:11px;padding:8px}.site-header:has(.pw-theme-open){gap:8px;flex-wrap:wrap}}@media(prefers-reduced-motion:reduce){.pw-theme-choice:active{transform:none}}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.word-demo span,.number-demo span){background:var(--surface);color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.word-demo span:nth-child(-n+4),.number-demo span:nth-child(2),.number-demo span:nth-child(3)){background:var(--green);color:var(--on-accent)}
:root[data-pw-theme="dark"] :is(.object.selected,.object.drop-target){background:#fffef9;color:#263e34}
html[data-pw-theme]:not([data-pw-theme="calm"]) .site-header:has(.pw-menu){background:var(--paper)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .pw-menu nav :is(a,button){color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .pw-menu nav :is(a,button):hover{background:var(--light)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .pw-version .pw-access-status{color:var(--muted)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.memory-demo span:first-child,.memory-demo span:last-child){background:var(--surface);color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(a:not(.pw-access-unlock),.pw-help #pw-close){color:var(--ink)}
html[data-pw-theme]:not([data-pw-theme="calm"]) :is(.company-details,.pw-tools,.pw-help p){color:var(--muted)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .pw-tools button{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-pw-theme]:not([data-pw-theme="calm"]) .clue-item:hover{background:var(--light)}
html[data-pw-theme="dark"] .guess-slot[style*="inherit"]{color:#263e34!important}

.pw-swatch-contrast{--swatch-paper:#ffffff;--swatch-accent:#111111;--swatch-second:#777777;--swatch-third:#ffffff;border:1px solid #111}.pw-swatch-contrast i:last-child{border:1px solid #111}
/* State cues apply in every scene: colour is an extra cue, not the only one. */
.cell{position:relative}.cell.found{outline:1px dashed currentColor;outline-offset:-3px}.cell.found::after{content:'✓';position:absolute;right:2px;top:0;font:700 9px/1.2 system-ui;pointer-events:none}.cell.found.bonus::after{content:'✧'}
:is(.cell.selected,.piece.selected,.object.selected,.object.drop-target){outline:3px double currentColor;outline-offset:-4px}
.cell.claimed::after{content:'✓';position:absolute;right:2px;top:0;font:700 11px/1.2 system-ui;pointer-events:none}
:is(.cell.incorrect,.cell.invalid)::after{content:'×';position:absolute;right:2px;top:0;font:800 12px/1.2 system-ui;pointer-events:none}
:is(.cell.nudge,.path-cell.nudged){outline:2px dashed currentColor;outline-offset:-4px}
.fit-cell.ghost::after,.fit-cell.blocked::after{position:absolute;inset:0;display:grid;place-items:center;font:800 24px system-ui;background:#ffffffd9;color:#111;pointer-events:none}.fit-cell.ghost::after{content:'✓'}.fit-cell.blocked::after{content:'×'}
.fit-anchor-id{display:none}
:root[data-pw-theme="contrast"] :is(.game-card,.board-card,dialog,.pw-menu nav,.about-content,.pw-full-badge){border:2px solid #111}
:root[data-pw-theme="contrast"] :is(.cell:not(.selected),.path-cell,.memory-tile.revealed,.object,.piece,.guess-slot,.secret span,#palette button){border:1px solid #111}
:root[data-pw-theme="contrast"] :is(.cell.selected,.memory-tile:not(.revealed),.checkpoint.visited){background:#111;color:#fff}
:root[data-pw-theme="contrast"] :is(.cell.found,.cell.correct,.cell.claimed){background:#ededed;color:#111}
:root[data-pw-theme="contrast"] .cell.selected{background:#111;color:#fff}
:root[data-pw-theme="contrast"] :is(.cell.incorrect,.cell.invalid){background:#fff;color:#111;border:2px dashed #111}
:root[data-pw-theme="contrast"] :is(.clue-miss,.deduction,.nudged){background:#fff;color:#111;border:2px dashed #111}
:root[data-pw-theme="contrast"] :is(.clue-match,.checkpoint.visited){outline:3px double #111;outline-offset:2px}
:root[data-pw-theme="contrast"] .fit-cell.occupied{background:#111;color:#fff;border:1px solid #fff}
:root[data-pw-theme="contrast"] .fit-game #grid{background:#fff;border:2px solid #111}
:root[data-pw-theme="contrast"] .fit-cell{border:1px solid #555}
:root[data-pw-theme="contrast"] :is(.secret span,.guess-slot,#palette button,.object,.order-drag){background:#fff;color:#111}
:root[data-pw-theme="contrast"] :is(.secret span,.guess-slot,#palette button,.object-symbol){color:#111!important}
:root[data-pw-theme="contrast"] :is(.piece svg,.fit-drag-ghost svg,#selected-shape svg) rect{fill:#111}
:root[data-pw-theme="contrast"] :is(.fit-turn-preview i,.board-rotate){background:#111;color:#fff}
:root[data-pw-theme="contrast"] .fit-anchor-id{display:inline;font-size:10px;margin-right:2px}
:root[data-pw-theme="contrast"] .fit-cell.moving-piece{outline:3px double #fff;outline-offset:-5px}
:root[data-pw-theme="contrast"] .pw-theme-choice[aria-pressed="true"]{outline:3px double #111;outline-offset:-5px}
:root[data-pw-theme="contrast"] :is(.word-chip,.found-list span,.progress-card .word-chip){background:#fff;color:#111;border:1px solid #111}

.cell.correct::before{content:'✓';position:absolute;right:2px;top:0;font:700 11px/1.2 system-ui;pointer-events:none}
:root[data-pw-theme="contrast"] .cell.correct::after{display:none}
