/* art-ui-v2.css - UI migration phase 6 (see output/art-migration-status.md)
 *
 * Loaded AFTER the main <style> block in index.html and after art-tokens.css.
 * It moves the remaining off-token screens onto the ART-STYLE.md tokens
 * (one navy outline, navy-tinted shadows, lip + sink press, AA contrast).
 * Behaviour and markup are untouched; class names are unchanged.
 *
 * Legacy rules superseded here (kept in index.html so the diff stays small
 * and the ads-branch merge stays trivial; delete them when convenient):
 *   :root --th-pause*/--th-bar*, #game[data-theme="1"|"2"], .round-btn,
 *   .speed-btn, .board filter, .ant-box, .box-flight, .box-ghost, .mech-tag,
 *   .tunnel-cover, .booster-slot:disabled, .tut-skip, landscape .board-wrap,
 *   #home ellipse, .hm-mascot::before, .hm-play, .toast, .lvl-btn,
 *   .lv-h.on, .ps-bar i, .lg-tab, .lg-tier, .st-row/.tm-row/.rc-row states,
 *   .al-pack/.al-claim/.al-x/.al-new/.al-tag/.al-card, .tm-input,
 *   .mock-badge, .fail-streak/.lg-sim colours.
 */

:root {
  /* semantic tints for highlight / done / premium rows (all text on them >= 4.5:1) */
  --hl-bg: #fff3c4;      --hl-line: var(--gold-lo);   --hl-ring: rgba(240, 163, 15, .4);  --hl-ink: #7a4a00;
  --ok-bg: #e4f6d6;      --ok-line: #8fcf6c;          --ok-ink: var(--green-text);
  --prem-bg: #efe3ff;    --prem-line: var(--purple-hi);
  --danger-ink: var(--red-text);

  /* top bar + booster bar themes: 0 blue, 1 purple, 2 red, all from token ramps */
  --th-pause: var(--blue);        --th-pause-dark: var(--blue-lip);        --th-pause-lt: var(--blue-hi);
  --th-bar: var(--sky-500);       --th-bar2: var(--sky-600);
}
#game[data-theme="1"] { --th-pause: var(--purple); --th-pause-dark: var(--purple-lip); --th-pause-lt: var(--purple-hi); --th-bar: #8c5fe0; --th-bar2: var(--purple); }
#game[data-theme="2"] { --th-pause: var(--red);    --th-pause-dark: var(--red-lip);    --th-pause-lt: var(--red-hi);    --th-bar: #d9505a; --th-bar2: var(--red); }

/* ── Top bar: pause + speed, chunky raised controls ─────────── */
.round-btn {
  background: linear-gradient(180deg, var(--th-pause-lt) 0%, var(--th-pause) 55%, var(--th-pause-dark) 100%);
  border-color: var(--outline);
  box-shadow: 0 .5cqw 0 var(--th-pause-dark), 0 .9cqw .8cqw var(--drop), inset 0 .45cqw 0 var(--rim);
}
.round-btn i { background: #fff; box-shadow: 0 .4cqw 0 var(--shade); }
.speed-btn {
  background: linear-gradient(180deg, var(--sky-600) 0%, var(--sky-700) 55%, var(--sky-800) 100%);
  border-color: var(--outline);
  box-shadow: 0 .5cqw 0 var(--sky-900), 0 .9cqw .8cqw var(--drop), inset 0 .45cqw 0 var(--rim);
  font-family: var(--font-display); font-weight: 400;
  text-shadow: 0 .35cqw 0 var(--outline), .3cqw 0 0 var(--outline), -.3cqw 0 0 var(--outline);
}
.speed-btn svg { fill: #fff; stroke: var(--outline); }
.speed-btn.on {
  background: var(--g-gold); color: var(--gold-ink);
  box-shadow: 0 .5cqw 0 var(--gold-lip), 0 .9cqw .8cqw var(--drop), inset 0 .45cqw 0 var(--rim-strong);
  text-shadow: 0 .3cqw 0 var(--rim);
}
.speed-btn.on svg { fill: var(--gold-ink); stroke: var(--gold-ink); }
.round-btn:active, .speed-btn:active { transform: translateY(.5cqw); box-shadow: 0 0 0 var(--th-pause-dark), 0 .2cqw .3cqw var(--drop), inset 0 .45cqw 0 var(--rim); }
.speed-btn:active { box-shadow: 0 0 0 var(--sky-900), 0 .2cqw .3cqw var(--drop), inset 0 .45cqw 0 var(--rim); }
.speed-btn.on:active { box-shadow: 0 0 0 var(--gold-lip), 0 .2cqw .3cqw var(--drop), inset 0 .45cqw 0 var(--rim-strong); }

/* ── Play field: navy-tinted shadows instead of brown ───────── */
.board { filter: drop-shadow(0 .45cqw 0 rgba(11, 42, 86, .25)) drop-shadow(0 .9cqw .6cqw var(--drop-soft)); }
.ant-box { box-shadow: inset 0 .5cqw .3cqw rgba(255, 255, 255, .3), 0 .5cqw .6cqw var(--drop-soft); }
.box-flight { box-shadow: inset 0 calc(var(--u) * .6) 0 rgba(255, 255, 255, .35), 0 calc(var(--u) * 1.4) calc(var(--u) * 1.6) var(--drop); }
.box-ghost { background: rgba(11, 42, 86, .22); }
.mech-tag { background: rgba(255, 255, 255, .88); border: .3cqw solid var(--surface-line); color: var(--ink); }
.tunnel-cover { background: var(--sky-800); border: .4cqw solid var(--sky-500); color: #fff; }
.booster-slot:disabled:not(.ready) {
  background: radial-gradient(circle at 50% 30%, var(--grey-hi), var(--grey-lo));
  box-shadow: 0 .7cqw 0 var(--grey-lip), 0 1.2cqw 1cqw var(--drop);
}
.tut-skip { box-shadow: 0 .5cqw 0 var(--surface-line), 0 1cqw 1cqw var(--drop-soft); }
.tut-skip:active { translate: 0 .5cqw; box-shadow: 0 0 0 var(--surface-line); }
.toast { background: rgba(11, 29, 58, .94); border: .3cqw solid var(--sky-700); box-shadow: 0 .6cqw 0 rgba(7, 24, 54, .5); color: #fff; }
.toast small { color: var(--gold); }


/* ── Home: play button + island ─────────────────────────────── */
#home { background:
  radial-gradient(ellipse 120% 40% at 50% 62%, var(--sky-50) 0 60%, transparent 61%),
  linear-gradient(#5fb8f2 0, #9ad8fb 45%, #c9ecff 62%, #8fcf78 62.2%, #6fb85a 100%); }
.hm-mascot::before { background: var(--sky-200); box-shadow: inset 0 calc(var(--hu) * -1) 0 var(--sky-300), 0 calc(var(--hu) * 1) calc(var(--hu) * 2) var(--drop); }
.hm-play {
  background: var(--g-primary); border-color: var(--outline); color: #fff;
  box-shadow: 0 calc(var(--hu) * 1.2) 0 var(--green-lip), 0 calc(var(--hu) * 2) calc(var(--hu) * 2) var(--drop), inset 0 calc(var(--hu) * .6) 0 var(--rim);
  text-shadow: 0 calc(var(--hu) * .6) 0 var(--green-lip), calc(var(--hu) * .45) 0 0 var(--green-lip), calc(var(--hu) * -.45) 0 0 var(--green-lip);
}
.hm-play:active { box-shadow: 0 0 0 var(--green-lip), 0 calc(var(--hu) * .4) calc(var(--hu) * 1) var(--drop), inset 0 calc(var(--hu) * .6) 0 var(--rim); }

/* ── Level select + hearts ─────────────────────────────────── */
.lvl-btn { box-shadow: 0 3px 0 var(--surface-line); border: 0; color: var(--ink); font-family: var(--font-display); font-weight: 400; }
.lvl-btn.current { background: var(--g-secondary); box-shadow: 0 3px 0 var(--blue-lip); }
.lvl-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #0000; }
.lv-h.on svg { fill: var(--red-hi); stroke: var(--red-lip); }
.fail-streak, .lg-sim, .al-tag { color: var(--danger-ink); }

/* ── Pass / league / team / race / cards / streak ──────────── */
.ps-bar { border-color: var(--sky-700); }
.ps-bar i { background: var(--g-bar-fill); }
.lg-tab { box-shadow: 0 3px 0 var(--surface-line); }
.lg-tab[aria-selected="true"] { background: var(--g-secondary); border-color: var(--outline); box-shadow: 0 3px 0 var(--blue-lip); color: #fff; }
.lg-tab:active { transform: translateY(3px); box-shadow: 0 0 0 #0000; }
.lg-tier { background: var(--grey-ink); color: #fff; }
.lg-tier[data-tier="emerald"] { background: var(--green); }
.lg-tier[data-tier="diamond"] { background: var(--blue); }

.st-row.got, .tm-row.got, .al-set.done { background: var(--ok-bg); border-color: var(--ok-line); }
.st-row.got em { color: var(--ok-ink); }
.st-row.ready, .st-row.next, .tm-row.me, .tm-row.ready, .rc-row.me, .rc-prize, .al-reveal, .dy.today, .ps-c.can { background: var(--hl-bg); border-color: var(--hl-line); }
.st-row.ready em { color: var(--hl-ink); }
.st-row.next { box-shadow: 0 0 0 calc(var(--u) * .6) var(--hl-ring); }
.lb-row.you { background: var(--hl-bg); box-shadow: 0 0 0 calc(var(--u) * .6) var(--hl-line); }
.dy.today, .ps-c.can { box-shadow: 0 0 0 calc(var(--u) * .6) var(--hl-ring); }
.ps-c.prem.can { background: var(--hl-bg); border-color: var(--hl-line); }
.ps-c.prem { background: var(--prem-bg); border-color: var(--prem-line); }
.dy i, .al-ok { color: var(--ok-ink); }
.dy-inf { color: var(--red-text); }
.shop-h em { color: var(--red-text); }
.tm-input { color: var(--ink); }

.al-card { border-color: var(--surface-line); }
.al-pack { border-color: var(--outline); text-shadow: 0 1px 0 rgba(11, 29, 58, .5); }
.al-pack.brown  { background: var(--orange); }
.al-pack.green  { background: var(--green); }
.al-pack.blue   { background: var(--blue); }
.al-pack.purple { background: var(--purple); }
.al-pack.red    { background: var(--red); }
.al-x, .al-new { background: var(--red); }
.al-x { background: var(--blue); }
.al-claim { background: var(--g-primary); border-color: var(--outline); box-shadow: 0 3px 0 var(--green-lip); text-shadow: 0 1px 0 var(--green-lip); }
.al-claim:active { transform: translateY(3px); box-shadow: 0 0 0 #0000; }

/* ── Mock purchase overlay ─────────────────────────────────── */
.mock-badge { background: var(--red); color: #fff; }

/* ── Motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .round-btn, .speed-btn, .lvl-btn, .lg-tab, .al-claim, .hm-play, .tut-skip { transition: none !important; }
}

/* ══ Phase 7: UI-expert top 5 (warm playfield, bright CTAs, game screen, Home, dialogs) ══ */

/* 1. WARM TONES: playfield and Home island are warm peach / sand, sky blue stays on UI chrome */
:root {
  --warm-a: #fbd5a0; --warm-b: #fde0b8; --warm-frame: #f7e4c0; --warm-frame-lip: #d9b98a;
  --sand: #f3dcae; --sand-lip: #d9b98a;
}
body { background-color: var(--warm-a); background-image: repeating-conic-gradient(from 45deg, var(--warm-a) 0% 25%, var(--warm-b) 0% 50%); }
.board-wrap { background: #fffaf0; border-color: var(--warm-frame); box-shadow: 0 .8cqw 0 var(--warm-frame-lip), 0 1.6cqw 1.2cqw rgba(110, 70, 20, .28), inset 0 .5cqw .8cqw rgba(110, 70, 20, .16); }
#home { background:
  radial-gradient(ellipse 120% 40% at 50% 62%, var(--sand) 0 60%, transparent 61%),
  radial-gradient(ellipse 120% 40% at 50% 63.4%, var(--sand-lip) 0 60%, transparent 61%),
  linear-gradient(#5fb8f2 0, #9ad8fb 45%, #c9ecff 62%, #8fcf78 62.2%, #6fb85a 100%); }
.hm-mascot::before { background: var(--sand); box-shadow: inset 0 calc(var(--hu) * -1.2) 0 var(--sand-lip), 0 calc(var(--hu) * 1) calc(var(--hu) * 2) rgba(110, 70, 20, .3); }

/* 2. BRIGHT PRIMARY BUTTONS: bright faces, contrast comes from a dark green text stroke, not a dark face */
:root { --g-primary: linear-gradient(180deg, #7ce24f 0%, #4cc43a 48%, #2f9e2a 100%); --prim-ink: #1d5e14; }
.ui-btn--primary, .hm-play, .shop-buy:not(:disabled):not(.short), .al-claim {
  color: #fff; -webkit-text-stroke: 3px var(--prim-ink); paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--prim-ink);
}
.hm-play { -webkit-text-stroke-width: 4px; text-shadow: 0 calc(var(--hu) * .6) 0 var(--prim-ink); }
.shop-buy:not(:disabled):not(.short) { -webkit-text-stroke-width: 2.5px; }
.hm-play, .al-claim { background: var(--g-primary); }

/* 3. GAME SCREEN (portrait; landscape keeps its own layout) */
  #btn-level { left: 52%; transform: translateX(-50%); width: 24cqw; font-size: 5.4cqw; }
  .coin-chip { left: 11.5cqw; gap: 2px; padding-right: 3px; }
  .coin-chip .ui-chip__val { min-width: 0; padding: 0 2px; font-size: 15px; }
  .tut-text { top: 131cqw !important; transform: translateY(-100%); }
  .toast { top: 14cqw; }
  .bottom-bar { height: 16cqw; }
  .booster-slot { top: 197cqw; }

.hm-bang { background: #c21f2b; color: #fff; text-shadow: none; }
.slot { background: #fff; box-shadow: inset 0 .7cqw .9cqw rgba(11, 42, 86, .16), inset 0 0 0 .3cqw rgba(11, 42, 86, .06), 0 .4cqw 0 #fff, 0 .8cqw .6cqw rgba(110, 70, 20, .2); }
.slot.filled { box-shadow: inset 0 .5cqw 0 #ffffff59, 0 .9cqw .8cqw rgba(11, 42, 86, .3); }
.ant-box.rest:not(.hidden-box) { color: #fff; filter: saturate(.7) brightness(.95); }
@media (max-width: 600px) and (orientation: portrait) {
  /* full-bleed on phones whose aspect is slightly wider than the 1:2.27 stage: no light strips at the edges */
  #game { overflow: visible; clip-path: inset(0 calc((var(--stage-w) - 100vw) / 2)); }
  .bottom-bar { left: calc((var(--stage-w) - 100vw) / 2); right: calc((var(--stage-w) - 100vw) / 2); border-left: 0; border-right: 0; border-radius: 0; }
  #home { --hu: 1vw; }
}

/* 4. HOME */
#hm-noads { --ac-bg: var(--g-danger);  --ac-lip: var(--red-lip);    --ac-ink: #fff; }
#hm-pass  { --ac-bg: var(--g-premium); --ac-lip: var(--purple-lip); --ac-ink: #fff; }
#hm-streak{ --ac-bg: var(--g-orange);  --ac-lip: var(--orange-lip); --ac-ink: #fff; }
#hm-race  { --ac-bg: linear-gradient(180deg, #5fd36a 0%, #2fa845 55%, #1f8a35 100%); --ac-lip: var(--green-lip); --ac-ink: #fff; }
#hm-daily { --ac-bg: var(--g-gold);    --ac-lip: var(--gold-lip);   --ac-ink: var(--gold-ink); }
.hm-side { background: var(--ac-bg, var(--sky-600)); color: var(--ac-ink, #fff); border-color: var(--outline); box-shadow: inset 0 calc(var(--hu) * .5) 0 var(--rim), 0 calc(var(--hu) * .7) 0 var(--ac-lip, var(--sky-800)), 0 calc(var(--hu) * 1.2) calc(var(--hu) * 1.2) var(--drop-soft); min-height: max(44px, calc(var(--hu) * 12)); padding: calc(var(--hu) * .5) calc(var(--hu) * 1); line-height: 1.05; }
.hm-side:active { transform: translateY(calc(var(--hu) * .6)); box-shadow: inset 0 calc(var(--hu) * .5) 0 var(--rim), 0 0 0 var(--ac-lip, var(--sky-800)); }
.hm-side-ic { font-size: calc(var(--hu) * 6.4); line-height: 1; filter: drop-shadow(0 calc(var(--hu) * .3) 0 rgba(11, 29, 58, .45)); }
.hm-side b { font-size: calc(var(--hu) * 2.9); } .hm-side small { font-size: calc(var(--hu) * 2.5); }
.hm-side:not(#hm-daily) b, .hm-side:not(#hm-daily) small { text-shadow: 0 1px 0 rgba(11, 29, 58, .6); }
.hm-right { gap: calc(var(--hu) * 2.2); }
.hm-mid { align-items: start; }
.hm-mascot { align-self: start; margin-top: calc(var(--hu) * 10); height: 62%; }
.hm-left { margin-top: calc(var(--hu) * 4); }
.hm-badge b { background: rgba(11, 29, 58, .78); color: #fff; padding: calc(var(--hu) * .3) calc(var(--hu) * 1.6); border-radius: 999px; text-shadow: none; }
.hm-tabs { margin-left: calc(var(--hu) * -3); margin-right: calc(var(--hu) * -3); padding-left: 0; padding-right: 0; }
.hm-tab { min-width: 0; padding: 0; white-space: nowrap; }

/* 5. DIALOGS */
:root { --lock-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1.5A1.5 1.5 0 0 1 20 11.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 20.5v-9A1.5 1.5 0 0 1 5.5 10zm2.5 0h5V7a2.5 2.5 0 0 0-5 0z'/%3E%3C/svg%3E"); }
.shop-buy:disabled:not(.short) {
  min-height: 32px; min-width: 0; padding: 0 10px 0 8px; border-radius: 999px; box-shadow: none; background: var(--surface-3); color: var(--ink);
  font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-small); text-shadow: none; -webkit-text-stroke: 0; gap: 4px;
}
.shop-buy:disabled:not(.short)::before { content: ''; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--lock-ic) center/contain no-repeat; mask: var(--lock-ic) center/contain no-repeat; }
.shop-pack em { display: none; }
.shop-sim { display: inline-block; margin: 0 0 calc(var(--u) * 2) calc(var(--u) * 2); padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-size: var(--fs-micro); font-weight: 600; vertical-align: middle; }
.shop-dlg .dlg-title { left: calc(var(--u) * -2.5); right: calc(var(--u) * -2.5); padding: 0 calc(var(--tap) + 8px); text-align: center; }
#shop-overlay, #board-overlay, #pass-overlay, #team-overlay, #race-overlay, #streak-overlay { padding-top: 64px; }
.shop-scroll, .lg-dlg .lb-list, .rc-scroll, .tm-body, .ps-list, .st-list {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  padding-bottom: 26px;
}
#pass-claimall:disabled { display: none; }
.dy:nth-child(4) { grid-column: 2 / span 2; } .dy:nth-child(5) { grid-column: 4 / span 2; }
.dy.today { border-color: var(--gold-lo); border-width: calc(var(--u) * .9); background: var(--hl-bg); }

/* ===== Phase 8: PNG icon art (output/icons/*.png, 192 px stickers) =====
   Sprite symbols in index.html and ICON/LOCK_SVG/msIcon in ui.js now point at the PNGs; this block sizes and states them. */
.ic-img, .hm-ms-img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.ic-img.ic-tag { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -.3em; }
.ant-icon { white-space: nowrap; }
.hm-bd-ic .hm-ms-img, .hm-bd-ic .ic-img { width: 100%; height: 100%; }
.hm-badge .hm-bd-ic .hm-ms-img, .hm-badge .hm-bd-ic .ic-img { width: 72%; height: 72%; }
.hm-badge .hm-bd-ic { background: #6d7886; filter: grayscale(1) brightness(.92); opacity: .95; }
/* coin everywhere (.coin-ic is a CSS disc) */
.coin-ic { background: url("icons/coin.png") center / contain no-repeat; border: 0; box-shadow: none; border-radius: 0; }
/* green plus chips */
.hm-plus { font-size: 0; color: transparent; background: url("icons/plus.png") center / contain no-repeat; border: 0; box-shadow: none; }
.ui-chip > .ui-chip__plus::before { content: ""; font-size: 0; background: url("icons/plus.png") center / contain no-repeat; box-shadow: none; }
.ui-chip > .ui-chip__plus:active::before { box-shadow: none; }
/* gear (circle kept behind) */
.hm-gear { background: url("icons/gear.png") center / 68% no-repeat, var(--sky-600); }
.hm-gear svg { display: none; }
/* heart */
.hm-heart svg { display: none; }
.hm-heart::before { content: ""; flex: none; width: calc(var(--hu) * 6); height: calc(var(--hu) * 6); background: url("icons/heart.png") center / contain no-repeat; }
/* pause (the PNG is the whole round button) */
.round-btn { background: url("icons/pause.png") center / contain no-repeat !important; border: 0 !important; box-shadow: none !important; }
.round-btn i { display: none; }
/* speed arrows */
.speed-btn svg { display: none; }
.speed-btn::before { content: ""; flex: none; width: 1.4em; height: 1.4em; background: url("icons/speed.png") center / contain no-repeat; }
/* dialog close (the PNG is the whole red button) */
.dlg-x { font-size: 0; color: transparent; background: url("icons/close.png") center / contain no-repeat; border: 0; box-shadow: none; }
.dlg-x:active { transform: translateY(2px); }
/* locked shop rows: grey the icon instead of new art */
.shop-row:has(.shop-buy:disabled:not(.short)) .shop-ic { filter: grayscale(.85) brightness(.95); }
/* nav and side-card sprites are richer than the old line icons: a touch larger */
.hm-tab .hm-svg { width: 1.3em; height: 1.3em; }
@media (prefers-reduced-motion: no-preference) { .ic-img { transition: filter .15s; } }
