/* Responsive theme shop and character themes. */
.theme-shop-host{min-width:0;flex-shrink:0}
.theme-shop-open{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:#fffcff;color:var(--ink);text-decoration:none;font-size:13px;font-weight:700;white-space:nowrap}
.theme-shop-open:hover{background:#f2e9ff}
.theme-dialog{width:min(94vw,760px);max-height:88dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;padding:24px;background:#fffaff;color:var(--ink);box-shadow:0 18px 60px #24123d44}
.theme-dialog::backdrop{background:#26193899}
.theme-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.theme-dialog-head .eyebrow{margin:0 0 4px;font-size:10px}
.theme-dialog h2{font-size:26px;line-height:1.3}
.theme-close{width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:#f5edff;color:var(--ink);font-size:24px}
.theme-wallet-status{padding:10px 13px;border-radius:10px;background:#f1e9fc;font-weight:700;font-size:14px}
.daily-quest{display:flex;align-items:center;gap:12px;padding:14px;margin:14px 0 16px;border:1px solid #d9c6ee;border-radius:14px;background:linear-gradient(110deg,#faf6ff,#f1e8fb)}
.quest-icon{font-size:26px}.daily-quest strong{font-size:14px}.daily-quest p{font-size:12px;line-height:1.6;color:var(--muted)}.quest-reward{margin-left:auto;padding:6px 9px;border-radius:20px;background:#fff;color:#61369b;font-weight:800;font-size:13px;white-space:nowrap}
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.theme-card{display:grid;grid-template-columns:92px minmax(0,1fr);align-items:center;gap:12px;min-width:0;padding:12px;border:1px solid var(--line);border-radius:15px;background:#fff;box-shadow:0 3px 12px #36204d0a}
.theme-art{height:96px;width:92px;display:grid;place-items:center;overflow:hidden;border-radius:12px;background:color-mix(in srgb,var(--theme-accent) 12%,white)}
.theme-art img{width:90%;height:90%;object-fit:contain;animation:theme-float 3.8s ease-in-out infinite;filter:drop-shadow(0 5px 4px #36204d1a)}
.theme-art span{font-size:36px;color:var(--theme-accent);animation:theme-float 3.8s ease-in-out infinite}
.theme-detail{min-width:0}.theme-detail h3{font-size:14px;line-height:1.4;overflow-wrap:anywhere}.theme-detail p{min-height:36px;font-size:11px;line-height:1.5;color:var(--muted);margin-top:3px}.theme-price{display:block;margin:3px 0 7px;font-size:11px;color:var(--theme-accent);font-weight:800}
.theme-action{width:100%;min-height:42px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--theme-accent) 38%,white);border-radius:9px;background:color-mix(in srgb,var(--theme-accent) 10%,white);color:var(--ink);font-size:12px;font-weight:750;line-height:1.3}
.theme-action:disabled{opacity:.55;cursor:default}
.theme-footnote{margin:14px 0 0}.theme-hero-mascot{position:absolute;z-index:2;width:clamp(48px,15vw,74px);height:clamp(48px,15vw,74px);object-fit:contain;left:0;top:26px;filter:drop-shadow(0 5px 5px #36204d28);animation:theme-float 3.8s ease-in-out infinite;pointer-events:none}.theme-hero-mascot[hidden]{display:none!important}
@keyframes theme-float{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-7px) rotate(3deg)}}
@media(max-width:680px){
  .site-header{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;grid-template-areas:"brand brand sounds sounds" "theme history account account";align-items:center;column-gap:8px;row-gap:8px;padding:16px 18px}
  .site-header>.wordmark{grid-area:brand;min-width:0}.site-header>.sound-controls{grid-area:sounds;justify-self:end}.site-header>.theme-shop-host{grid-area:theme}.site-header>#historyNav{grid-area:history;justify-self:center;white-space:nowrap}.site-header>div:last-of-type{grid-area:account;justify-self:end}
  .site-header .text-button{font-size:12px;padding:7px 5px;white-space:nowrap}.theme-shop-open{min-height:42px;padding:7px 10px;font-size:12px}
  .theme-dialog{width:min(96vw,520px);max-height:90dvh;padding:17px}.theme-grid{grid-template-columns:1fr;gap:9px}.theme-card{grid-template-columns:78px minmax(0,1fr);gap:10px;padding:9px}.theme-art{width:78px;height:80px}.theme-detail p{min-height:0}.theme-hero-mascot{left:2px;top:32px}
}
@media(max-width:360px){.site-header{padding:14px 14px;column-gap:6px}.wordmark{font-size:15px}.sound-toggle{width:36px;padding:4px;font-size:14px}.sound-toggle span{display:none}.theme-shop-open{padding:6px 8px;font-size:11px}.site-header .text-button{font-size:11px}}

/* ==== Theme palettes ====================================================
   Classic purple is the default look defined in app.css. Each collectible theme
   sets one family of colour tokens; every control below reads those tokens, so a
   theme never mixes in colours from another family. Text/background pairs are
   chosen to keep at least 4.5:1 contrast. */
:root{--wheel-colors:#d9c4f4,#f0d4f2,#cbb1ec,#e4d3f8,#d4c0ef,#eadff7}
/* SpongeBob blue */
:root[data-theme="spongebob"]{
  --wheel-colors:#9ce1f6,#57bee5,#bceef7,#77cfe8,#a7daf1,#4faed4;
  --hero-1:#9ce1f6;--hero-2:#bceef7;--hero-3:#77cfe8;--hero-4:#a7daf1;
  --paper:#eaf8fd;--ink:#173e52;--muted:#4a7280;--line:#c1e6f2;--white:#f8fdff;--green:#e6f7fa;
  --theme-control:#2287b7;--theme-control-ink:#145c7a;--theme-control-soft:#e0f4fa;--theme-deep:#134b63;
  --theme-button-a:#145c7a;--theme-button-b:#1f7da9;
  --theme-wash:#edf9fd;--theme-track:#cae6f2;--theme-soft-hover:#c5e5f1;
  --theme-edge:#b4d6e7;--theme-edge-strong:#7fb9d5;--theme-edge-soft:#baddec;--theme-ring:#abd1e4;
  --theme-shadow:#145c7a24;--theme-shadow-soft:#145c7a0f;--theme-shadow-strong:#134b6347;
  --brand:var(--theme-control);--orange:var(--theme-control-ink)
}
/* soft New Year red */
:root[data-theme="new-year"]{
  --wheel-colors:#f0d7be,#b75a65,#ead6b6,#a74452,#f5e6cd,#ab6068;
  --hero-1:#f0d7be;--hero-2:#e6b3b6;--hero-3:#f5e6cd;--hero-4:#dea0a5;
  --paper:#fbf3ee;--ink:#51353b;--muted:#7b6466;--line:#ead5d1;--white:#fffaf4;--green:#f5ebe2;
  --theme-control:#aa4855;--theme-control-ink:#7b303b;--theme-control-soft:#f8e9e6;--theme-deep:#612a34;
  --theme-button-a:#7b303b;--theme-button-b:#aa4855;
  --theme-wash:#fcf5f1;--theme-track:#eed8d6;--theme-soft-hover:#edd2d2;
  --theme-edge:#e2c1c5;--theme-edge-strong:#ce959c;--theme-edge-soft:#e8cac9;--theme-ring:#dfb9be;
  --theme-shadow:#7b303b24;--theme-shadow-soft:#7b303b0f;--theme-shadow-strong:#612a3447;
  --brand:var(--theme-control);--orange:var(--theme-control-ink)
}
/* Hangyodon teal */
:root[data-theme="hangyodon"]{
  --wheel-colors:#bcebe7,#68c5c4,#d1f1ec,#70c1c6,#a8e0dd,#79c5d0;
  --hero-1:#bcebe7;--hero-2:#8fd6d5;--hero-3:#d1f1ec;--hero-4:#a8e0dd;
  --paper:#eaf7f8;--ink:#224c56;--muted:#507279;--line:#cce7e8;--white:#f7ffff;--green:#e5f5f4;
  --theme-control:#4caeb3;--theme-control-ink:#286f76;--theme-control-soft:#e2f5f3;--theme-deep:#225960;
  --theme-button-a:#286f76;--theme-button-b:#317f86;
  --theme-wash:#edf8f9;--theme-track:#d1ebed;--theme-soft-hover:#cdebea;
  --theme-edge:#c2e3e5;--theme-edge-strong:#97d0d3;--theme-edge-soft:#c4e5e7;--theme-ring:#bbe0e2;
  --theme-shadow:#286f7624;--theme-shadow-soft:#286f760f;--theme-shadow-strong:#22596047;
  --brand:var(--theme-control);--orange:var(--theme-control-ink)
}
/* Cinnamoroll cream and sky */
:root[data-theme="cinnamoroll"]{
  --wheel-colors:#efe7d8,#cbdff2,#f3eee4,#d9e7f5,#e6ddcd,#c5d9e9;
  --hero-1:#efe7d8;--hero-2:#cbdff2;--hero-3:#f3eee4;--hero-4:#d9e7f5;
  --paper:#f7f3ea;--ink:#4c4b48;--muted:#706c66;--line:#e4ddcf;--white:#fffdf8;--green:#f3eee4;
  --theme-control:#96adc0;--theme-control-ink:#54697d;--theme-control-soft:#edf2f5;--theme-deep:#445566;
  --theme-button-a:#54697d;--theme-button-b:#62778b;
  --theme-wash:#f8f5ed;--theme-track:#e7e8e3;--theme-soft-hover:#e1e8ee;
  --theme-edge:#dbe3ea;--theme-edge-strong:#c2cfda;--theme-edge-soft:#e0e2e0;--theme-ring:#d7e0e7;
  --theme-shadow:#54697d24;--theme-shadow-soft:#54697d0f;--theme-shadow-strong:#44556647;
  --brand:var(--theme-control);--orange:var(--theme-control-ink)
}
/* grey starlight */
:root[data-theme="starlight"]{
  --wheel-colors:#d5d9e1,#9da6b4,#eceef2,#b1bac8,#c8ccd5,#6d7788;
  --hero-1:#d5d9e1;--hero-2:#b1bac8;--hero-3:#eceef2;--hero-4:#c8ccd5;
  --paper:#f0f1f5;--ink:#353c49;--muted:#626b7a;--line:#d9dce3;--white:#fafbfe;--green:#eceef2;
  --theme-control:#778295;--theme-control-ink:#505b6d;--theme-control-soft:#eceef2;--theme-deep:#414a5a;
  --theme-button-a:#505b6d;--theme-button-b:#6a7588;
  --theme-wash:#f2f3f7;--theme-track:#dddfe6;--theme-soft-hover:#dcdfe5;
  --theme-edge:#d1d4db;--theme-edge-strong:#b0b6c2;--theme-edge-soft:#d3d6de;--theme-ring:#cbd0d7;
  --theme-shadow:#505b6d24;--theme-shadow-soft:#505b6d0f;--theme-shadow-strong:#414a5a47;
  --brand:var(--theme-control);--orange:var(--theme-control-ink)
}

/* Page chrome */
:root[data-theme]:not([data-theme="classic"]) body{background:linear-gradient(165deg,var(--theme-wash),var(--paper) 75%,var(--theme-control-soft))}
:root[data-theme]:not([data-theme="classic"]) .site-header{background:var(--theme-wash);border-bottom-color:var(--line)}
:root[data-theme]:not([data-theme="classic"]) .wordmark-sub{color:var(--muted)}
:root[data-theme]:not([data-theme="classic"]) .brand-mark{background:linear-gradient(145deg,var(--theme-button-b),var(--theme-button-a));box-shadow:0 3px 10px var(--theme-shadow)}
:root[data-theme]:not([data-theme="classic"]) :focus-visible,:root[data-theme]:not([data-theme="classic"]) .segmented input:focus-visible+span,:root[data-theme]:not([data-theme="classic"]) .chips input:focus-visible+span{outline-color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .site-footer{border-color:var(--line);background:linear-gradient(180deg,var(--theme-wash),var(--theme-control-soft))}
:root[data-theme]:not([data-theme="classic"]) .site-footer a{color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .toast{background:var(--ink);color:var(--white)}

/* Home */
:root[data-theme]:not([data-theme="classic"]) .eyebrow,:root[data-theme]:not([data-theme="classic"]) .orange{color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .status-dot{background:var(--theme-control)}
:root[data-theme]:not([data-theme="classic"]) .hero-disc{background:conic-gradient(from -5deg,var(--hero-1) 0 90deg,var(--hero-2) 90deg 180deg,var(--hero-3) 180deg 270deg,var(--hero-4) 270deg 360deg);border-color:var(--white);box-shadow:0 0 0 1px var(--theme-edge),9px 11px 0 var(--theme-edge-soft)}
:root[data-theme]:not([data-theme="classic"]) .hero-center{color:var(--theme-control-ink);box-shadow:0 2px 12px var(--theme-shadow)}
:root[data-theme]:not([data-theme="classic"]) .hero-pointer,:root[data-theme]:not([data-theme="classic"]) .wheel-pointer{background:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .theme-hero-mascot{filter:drop-shadow(0 5px 5px var(--theme-shadow))}
:root[data-theme]:not([data-theme="classic"]) .home-notes span:before{color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .howto{border-color:var(--line)}
:root[data-theme]:not([data-theme="classic"]) .howto-number{color:var(--theme-control-ink);border-color:var(--theme-edge-strong);background:var(--white)}

/* Buttons: white label on the dark end of the family, dark label on its tints */
:root[data-theme]:not([data-theme="classic"]) .button.primary{background:linear-gradient(115deg,var(--theme-button-a),var(--theme-button-b));color:#fff;box-shadow:0 3px 0 var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .button.primary:hover{background:linear-gradient(115deg,var(--theme-deep),var(--theme-button-a))}
:root[data-theme]:not([data-theme="classic"]) .button.primary:active{box-shadow:0 1px 0 var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .button.secondary{background:var(--theme-control-soft);border:1px solid var(--theme-edge);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .button.secondary:hover{background:var(--theme-soft-hover)}
:root[data-theme]:not([data-theme="classic"]) .button.outline{background:var(--white);border-color:var(--theme-edge-strong);color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .button.outline:hover{background:var(--theme-control-soft)}
:root[data-theme]:not([data-theme="classic"]) .sound-toggle{border-color:var(--theme-edge);background:var(--white);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) .sound-toggle[aria-pressed=true]{background:var(--theme-edge);border-color:var(--theme-control-ink);color:var(--theme-deep);font-weight:700}
:root[data-theme]:not([data-theme="classic"]) .theme-shop-open{background:var(--white);border-color:var(--theme-edge);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) .theme-shop-open:hover{background:var(--theme-control-soft)}
:root[data-theme]:not([data-theme="classic"]) .restore{border-color:var(--theme-edge);background:var(--white);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) .restore:hover{background:var(--theme-control-soft)}

/* Search form */
:root[data-theme]:not([data-theme="classic"]) .segmented{background:var(--theme-track)}
:root[data-theme]:not([data-theme="classic"]) .segmented input:checked+span{background:var(--white);color:var(--theme-control-ink);box-shadow:0 2px 8px var(--theme-shadow)}
:root[data-theme]:not([data-theme="classic"]) .location-panel{background:var(--white);border-color:var(--line);box-shadow:0 5px 18px var(--theme-shadow-soft)}
:root[data-theme]:not([data-theme="classic"]) input[type=text],:root[data-theme]:not([data-theme="classic"]) input[type=url],:root[data-theme]:not([data-theme="classic"]) input[type=password],:root[data-theme]:not([data-theme="classic"]) select{border-color:var(--theme-edge);background:var(--white);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) input[type=text]:focus,:root[data-theme]:not([data-theme="classic"]) input[type=url]:focus,:root[data-theme]:not([data-theme="classic"]) input[type=password]:focus,:root[data-theme]:not([data-theme="classic"]) select:focus{outline:3px solid var(--theme-ring);outline-offset:1px;border-color:var(--theme-control)}
:root[data-theme]:not([data-theme="classic"]) .chips span{border-color:var(--theme-edge);background:var(--white);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) .chips input:checked+span{border-color:var(--theme-control-ink);background:var(--theme-control-soft);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .notice{background:var(--theme-control-soft);border-left-color:var(--theme-control)}
:root[data-theme]:not([data-theme="classic"]) .notice p{color:var(--muted)}
:root[data-theme]:not([data-theme="classic"]) .empty-state{border-color:var(--theme-edge-strong);background:var(--theme-wash)}

/* Loading, candidates, wheel, result, history */
:root[data-theme]:not([data-theme="classic"]) .loader{border-color:var(--theme-track);border-top-color:var(--theme-control)}
:root[data-theme]:not([data-theme="classic"]) #candidateCount{background:var(--theme-control-soft);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .list-heading{border-color:var(--line)}
:root[data-theme]:not([data-theme="classic"]) .shop-row,:root[data-theme]:not([data-theme="classic"]) .area-button{background:var(--white);border-color:var(--line);box-shadow:0 2px 10px var(--theme-shadow-soft)}
:root[data-theme]:not([data-theme="classic"]) .shop-row a:hover{color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .row-arrow,:root[data-theme]:not([data-theme="classic"]) .wheel-hub,:root[data-theme]:not([data-theme="classic"]) .card-link{color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .wheel-wrap canvas{border-color:var(--white);box-shadow:0 0 0 1px var(--theme-edge),0 8px 0 var(--theme-edge-soft)}
:root[data-theme]:not([data-theme="classic"]) .wheel-hub{border-color:var(--theme-edge);background:var(--white)}
:root[data-theme]:not([data-theme="classic"]) .result-card{border-color:var(--line);background:var(--white);box-shadow:0 8px 24px var(--theme-shadow)}
:root[data-theme]:not([data-theme="classic"]) .card-link{border-color:var(--line)}
:root[data-theme]:not([data-theme="classic"]) .budget-known,:root[data-theme]:not([data-theme="classic"]) .result-budget{color:var(--theme-control-ink)!important}
:root[data-theme]:not([data-theme="classic"]) .budget-unknown{color:var(--muted)!important}

/* Member and theme-shop dialogs */
:root[data-theme]:not([data-theme="classic"]) .account-dialog,:root[data-theme]:not([data-theme="classic"]) .theme-dialog{background:var(--white);border-color:var(--line);box-shadow:0 18px 60px var(--theme-shadow-strong)}
:root[data-theme]:not([data-theme="classic"]) .account-dialog input{border-color:var(--theme-edge);background:var(--white);color:var(--ink)}
:root[data-theme]:not([data-theme="classic"]) .account-tabs button,:root[data-theme]:not([data-theme="classic"]) .account-close,:root[data-theme]:not([data-theme="classic"]) .theme-close{background:var(--theme-control-soft);border-color:var(--theme-edge);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .account-tabs button:hover,:root[data-theme]:not([data-theme="classic"]) .account-close:hover,:root[data-theme]:not([data-theme="classic"]) .theme-close:hover{background:var(--theme-soft-hover)}
:root[data-theme]:not([data-theme="classic"]) .account-dialog pre{background:var(--theme-control-soft)}
:root[data-theme]:not([data-theme="classic"]) .theme-wallet-status{background:var(--theme-control-soft);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .daily-quest{border-color:var(--theme-edge);background:linear-gradient(110deg,var(--white),var(--theme-control-soft))}
:root[data-theme]:not([data-theme="classic"]) .quest-reward{background:var(--white);color:var(--theme-control-ink)}
:root[data-theme]:not([data-theme="classic"]) .theme-card{background:var(--white);border-color:var(--line);box-shadow:0 3px 12px var(--theme-shadow-soft)}
:root[data-theme]:not([data-theme="classic"]) .theme-action{background:var(--theme-control-soft);border-color:var(--theme-edge-strong);color:var(--theme-deep)}
:root[data-theme]:not([data-theme="classic"]) .theme-action:hover:not(:disabled){background:var(--theme-soft-hover)}
/* ::backdrop cannot read custom properties on older iOS, so each theme states its colour. */
:root[data-theme="spongebob"] dialog::backdrop{background:#0e263399}
:root[data-theme="new-year"] dialog::backdrop{background:#32212599}
:root[data-theme="hangyodon"] dialog::backdrop{background:#152f3599}
:root[data-theme="cinnamoroll"] dialog::backdrop{background:#2f2e2d99}
:root[data-theme="starlight"] dialog::backdrop{background:#21252d99}

/* Shop cards: the thumbnail keeps each theme's own colour as a preview; price and button follow the page. */
.theme-price{color:var(--orange)}
.theme-action{border-color:#cdb5e8;background:#f3eafd;color:#4f2d78}
.theme-action:hover:not(:disabled){background:#e9dcf8}
.theme-art{isolation:isolate;background-color:color-mix(in srgb,var(--theme-accent) 12%,white)}
.theme-art img{display:block;background:transparent;mix-blend-mode:normal}
.theme-art-fallback{display:grid;place-items:center;width:100%;height:100%;font-size:42px;line-height:1;animation:theme-float 3.8s ease-in-out infinite}
.theme-art:has(.theme-art-fallback){background:radial-gradient(circle at 50% 42%,white 0 30%,color-mix(in srgb,var(--theme-accent) 17%,white) 31% 100%)}
.hero-wheel.theme-active>.mascot{opacity:0;visibility:hidden}
/* Classic purple leftovers that were not purple. */
.segmented input:focus-visible+span,.chips input:focus-visible+span{outline-color:#7644b8}
@media(prefers-reduced-motion:reduce){.theme-art img,.theme-art span,.theme-art-fallback,.theme-hero-mascot{animation:none}}
