.theme-toggle{width:40px;height:40px;border-radius:12px;border:2px solid var(--line,#ddd);background:var(--card,#fff);color:var(--ink,#222);display:grid;place-items:center;cursor:pointer;padding:0;transition:transform .1s}
.theme-toggle:active{transform:scale(.92)}
.theme-toggle:focus-visible{outline:3px solid var(--accent,#333);outline-offset:2px}
.theme-toggle .i-moon{display:none}
[data-theme="dark"] .theme-toggle .i-sun{display:none}
[data-theme="dark"] .theme-toggle .i-moon{display:block}
.theme-toggle.floating{position:absolute;top:12px;right:16px;z-index:4}
body:has(.theme-toggle.floating){padding-top:44px}

[data-theme="dark"]{
  --bg:#141416;--card:#1f1f24;--ink:#f1efe9;--muted:#9c99a6;--line:#33333c;
  --shadow:0 6px 22px rgba(0,0,0,.45);
  color-scheme:dark;
}
[data-theme="dark"] .inp,
[data-theme="dark"] .btn.ghost,
[data-theme="dark"] .tbtn,
[data-theme="dark"] .sz,
[data-theme="dark"] .cell,
[data-theme="dark"] .opt,
[data-theme="dark"] .key,
[data-theme="dark"] .mode button,
[data-theme="dark"] .chips button,
[data-theme="dark"] .notes button,
[data-theme="dark"] .set select{background:#26262d;border-color:var(--line);color:var(--ink)}
[data-theme="dark"] .key.go{background:var(--accent);color:#fff}
[data-theme="dark"] .btn.alt{background:#f1efe9;color:#141416}
[data-theme="dark"] .tbtn.on,
[data-theme="dark"] .mode button.on,
[data-theme="dark"] .chips button.on{background:var(--ink);border-color:var(--ink);color:#141416}
[data-theme="dark"] .sw{border-color:var(--card)}
[data-theme="dark"] .sw.on{box-shadow:0 0 0 3px var(--ink)}
[data-theme="dark"] .toast{background:#f1efe9;color:#141416}
[data-theme="dark"] .overlay{background:rgba(20,20,22,.94)}
[data-theme="dark"] .modal{background:rgba(0,0,0,.6)}
[data-theme="dark"] .cell.empty{color:#4a4a55}
[data-theme="dark"] .cell.called,
[data-theme="dark"] .mini div.called{background:rgba(255,107,139,.18)}
[data-theme="dark"] .h{background:#26262d}
[data-theme="dark"] .h.win{background:rgba(34,181,115,.22)}
[data-theme="dark"] .notes button.no{background:#1a1a1f;color:#5b5b66;border-color:#1a1a1f}
[data-theme="dark"] .opt.mine{background:rgba(0,150,199,.22);border-color:var(--accent)}
[data-theme="dark"] .opt.right{background:rgba(34,181,115,.24);border-color:var(--good)}
[data-theme="dark"] .opt.wrong{background:rgba(239,71,111,.22);border-color:var(--bad)}
[data-theme="dark"] .opt .tags span{background:#f1efe9;color:#141416}
[data-theme="dark"] .letters b:not(.on){background:#33333c}
[data-theme="dark"] .board,
[data-theme="dark"] .pad{box-shadow:0 0 0 2px #33333c,var(--shadow)}
[data-theme="dark"] .sz i{background:var(--ink)}
[data-theme="dark"] .cell.called{color:var(--mark);border-color:var(--mark)}
[data-theme="dark"] .cell.line{background:var(--mark);border-color:var(--mark);color:#fff}
[data-theme="dark"] .notes button.yes{background:var(--good);border-color:var(--good);color:#fff}
[data-theme="dark"] .sz.on,[data-theme="dark"] .tbtn.on{border-color:var(--ink)}
[data-theme="dark"] .slot.cur{border-color:var(--accent)}
.gicon{display:block;width:72px;height:72px;margin:10px auto 6px;filter:drop-shadow(0 8px 14px rgba(0,0,0,.18))}

@keyframes dd-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes dd-pop{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.02)}100%{transform:scale(1)}}
@keyframes dd-toast{from{opacity:0;transform:translate(-50%,16px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes dd-bob{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-6px) rotate(3deg)}}
@keyframes dd-tick{0%,100%{transform:scale(1)}50%{transform:scale(1.12)}}
@keyframes dd-fade{from{opacity:0}to{opacity:1}}
.screen:not([hidden]){animation:dd-rise .35s ease both}
.screen:not([hidden]) .card{animation:dd-rise .45s ease backwards}
.screen:not([hidden]) .card:nth-of-type(2){animation-delay:.06s}
.screen:not([hidden]) .card:nth-of-type(3){animation-delay:.12s}
.gicon{animation:dd-bob 4s ease-in-out infinite}
.overlay:not([hidden]){animation:dd-fade .2s ease both}
.overlay:not([hidden])>*,.stage>*{animation:dd-rise .35s ease both}
.modal:not([hidden]){animation:dd-fade .2s ease both}
.modal:not([hidden]) .card{animation:dd-pop .38s cubic-bezier(.2,.9,.3,1.2) both}
.toast:not([hidden]){animation:dd-toast .25s ease both}
.timer.low span{animation:dd-tick 1s ease-in-out infinite}
.btn,.key,.opt,.cell,.tbtn,.chips button,.mode button{transition:transform .12s ease,background-color .2s ease,border-color .2s ease,box-shadow .2s ease}
@media (hover:hover){
  .btn:not(:disabled):hover{transform:translateY(-2px)}
  .opt:not(:disabled):hover,.key:not(:disabled):hover{transform:translateY(-2px)}
  .grid:not(.locked) .cell:hover{transform:translateY(-2px)}
}
.opt.right{animation:dd-pop .4s ease both}
.feed>div:last-child,.hist>.h:last-child,.calls .chip:last-child{animation:dd-rise .3s ease both}
.letters b.on{animation:dd-pop .4s ease both}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}

html[data-theme="light"]{--bg:#f8f4ec;--card:#fffdf8;--ink:#1c1a17;--muted:#6f685d;--line:#ece4d6;--shadow:0 10px 24px rgba(28,26,23,.10);--tile:#ddd5c7;--tilebg:rgba(255,255,255,.35)}
html[data-theme="dark"]{--tile:#2d2c31;--tilebg:rgba(255,255,255,.02)}
body{font-family:ui-sans-serif,-apple-system,"Segoe UI",system-ui,sans-serif;font-weight:500}
h1,h2,.code,.btn,.score b,.pl b,.big,.secret,.slot,.cell,.key,.timer,.wordbar,.blanks,.qcard,.letters b,.chip,.reveal b,.final .big b,.res b{font-family:"Geist",ui-sans-serif,-apple-system,"Segoe UI",system-ui,sans-serif}
h1{letter-spacing:-.04em}
.wrap{position:relative;z-index:1}
h1{font-weight:800;letter-spacing:-.035em;font-size:clamp(2.4rem,9vw,3.2rem);line-height:1}
.sub{font-weight:500}
.btn{font-weight:700;letter-spacing:-.01em;border-radius:12px}
.card{border-radius:16px;border:1px solid var(--line)}
.code{font-weight:800}
.score b,.pl b,.big,.secret,.slot,.cell,.key{font-weight:800}
.back{font-weight:600}
