/* ═══════════════════════════════════════════════════════════════════════════
   live.css — the Live Dashboard (/live/), 1:1 with the live page's structure
   and state machinery, dressed in the haven look.

   The SHAPES are the live page's (LIVE_SITE_SPEC §4.11; live_capture/pjs/
   live_live.css + live_spin.css + live_claim.css + live_growthstop.css +
   live_prizeview.css): the four scenes keyed off one attribute, the two
   banners keyed off the connection, the rewards row with its :has()-driven
   third column and container-query spin layout, the wheel, the seven-day
   track. Every COLOUR is a haven.css token. Paint tokens (--ember, --violet,
   --ember-deep …) are fills, borders and glows only; anything a reader reads
   is --t-* or the two ink accents --ember-core / --ember-ink / --violet-ink.

   ★ THE SCENE ATTRIBUTES ARE ON #live-root, NOT <body>. build.py owns <body>
     (data-deep); the page's own root carries data-scene and data-conn, and
     every rule below keys off it. Same machinery as the live site, one
     element down.
   ★ THE TOAST HAS ONE CLASS SCHEME: #toast.on + .ok / .err / .warn. The live
     spin.js and claim.js write `.show` / `.error`, which NONE of /live/'s six
     sheets defines (LIVE_SITE_SPEC §5.11 row 1 — every spin win, locked-wheel
     nudge and claim message is invisible on the real page). live.js routes
     all five modules through one toast() and this sheet styles exactly that.
   ★ `[hidden]` WINS. Several of these boxes are flex or grid by class, and a
     class display beats the UA's [hidden] rule — the live claim.css carries
     the same guard for the same reason.
   ═══════════════════════════════════════════════════════════════════════════ */

.live-root [hidden] { display: none !important; }
.live-root .page-head { margin-bottom: var(--s6); }

/* ── scene machinery ─────────────────────────────────────────────────────── */
.live-root .scene { display: none; }
.live-root[data-scene="loading"] #scene-loading,
.live-root[data-scene="noauth"] #scene-noauth,
.live-root[data-scene="nodino"] #scene-nodino,
.live-root[data-scene="live"] #scene-live { display: block; }

/* the connection pill shows only under the live scene, as on the real page */
.live-root .live-pill-row { display: none; margin: 18px 0 0; }
.live-root[data-scene="live"] .live-pill-row { display: block; }
.live-root .live-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px;
  border: 1px solid var(--line-up); border-radius: var(--r-pill);
  background: rgba(6,5,6,.6);
  font: 600 10px/1 var(--data); letter-spacing: .2em; text-transform: uppercase;
  color: var(--t-sec);
}
.live-root .live-pill .txt { color: var(--t-hi); }
.live-root .live-pill .dot.live { animation: gd-pulse 2.4s ease-in-out infinite; }
.live-root[data-conn="stale"] .live-pill .dot { background: var(--ember-core); box-shadow: 0 0 8px rgba(255,198,77,.6); animation: none; }
.live-root[data-conn="stale"] .live-pill .txt { color: var(--ember-core); }
.live-root[data-conn="offline"] .live-pill .dot { background: var(--t-off); background-image: var(--hatch); box-shadow: none; animation: none; }
.live-root[data-conn="offline"] .live-pill .txt { color: var(--t-sec); }

/* banners: hidden until the connection says otherwise */
.live-root .banner {
  display: none; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--r); border: 1px solid var(--line-up); background: rgba(6,5,6,.72);
  margin: 0 0 var(--s4); font-size: 13px; line-height: 1.45; color: var(--t-body);
}
.live-root .banner.warn { border-color: rgba(255,176,32,.45); }
.live-root .banner.err { border-color: var(--t-ter); border-style: dashed; }
.live-root[data-scene="live"][data-conn="stale"] #banner-stale,
.live-root[data-scene="live"][data-conn="offline"] #banner-offline { display: flex; }
.live-root[data-conn="stale"] .live-grid,
.live-root[data-conn="offline"] .live-grid { opacity: .64; filter: saturate(.7); }

/* ── shared bits ─────────────────────────────────────────────────────────── */
.live-root .panel-sub {
  margin-left: auto; flex: 0 1 auto; min-width: 0; text-align: right;
  font: 500 9.5px/1.3 var(--data); letter-spacing: .16em; text-transform: uppercase;
  color: var(--t-dim);
}
.live-root .spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line-up); border-top-color: var(--ember-core);
  animation: gd-live-spin .9s linear infinite;
}
@keyframes gd-live-spin { to { transform: rotate(360deg); } }

.live-root .scene-card {
  display: grid; place-items: center; gap: 18px; min-height: 320px;
  padding: 48px 24px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(21,15,16,.94), rgba(8,6,7,.97));
  box-shadow: var(--lit-edge), var(--crush);
}
.live-root .scene-card h2 { margin: 0; }
.live-root .scene-card p { margin: 0; max-width: 46ch; color: var(--t-sec); font-size: 14px; line-height: 1.55; }

/* a measured bar: the fill is a paint, never a word */
.live-root .bar { margin: 0; }
.live-root .fill { width: 0; background: linear-gradient(90deg, var(--ember-deep), var(--ember)); transition: width .3s ease; }
.live-root .stat .lab, .live-root .spin-stat .lab, .live-root .claim-stat .lab, .live-root .gs-stat .lab {
  display: block; font: 600 9px/1.2 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-dim);
}
.live-root .spin-stat .val, .live-root .claim-stat .val {
  display: block; margin-top: 7px; font-size: 22px; line-height: 1; font-weight: 500; color: var(--t-hi);
}

/* ── the rewards row: prize card · spin · claim ──────────────────────────
   The third column only exists when there is a third card: the prize card
   carries `hidden` whenever no skin is on the wheel. The cards are size
   containers too, because it is the COLUMN that is narrow, not the viewport.
   A row with nothing visible in it takes no space at all (signed out). */
.live-root .rewards-row { display: grid; grid-template-columns: 1fr; gap: var(--s4); margin-bottom: var(--s4); }
.live-root .rewards-row:not(:has(> .panel:not([hidden]))) { display: none; }
@media (min-width: 1180px) {
  .live-root .rewards-row { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch; }
}
@media (min-width: 1380px) {
  .live-root .rewards-row:has(.prizeview-panel:not([hidden])) {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.16fr) minmax(0, 1fr);
  }
}
@media (min-width: 1180px) and (max-width: 1379px) {
  .live-root .rewards-row:has(.prizeview-panel:not([hidden])) .prizeview-panel { grid-column: 1 / -1; }
  .live-root .rewards-row:has(.prizeview-panel:not([hidden])) .prizeview-body { flex-direction: row; align-items: flex-start; gap: 22px; }
  .live-root .rewards-row:has(.prizeview-panel:not([hidden])) .prizeview-stage { flex: 0 0 clamp(260px, 34%, 400px); }
}
.live-root .spin-panel, .live-root .claim-panel, .live-root .prizeview-panel { container-type: inline-size; }
/* the container queries that make the third card affordable sit AFTER the
   spin and claim sections below — see the note there on order and specificity */

/* ── prize view ──────────────────────────────────────────────────────────── */
.live-root .prizeview-panel { display: flex; flex-direction: column; }
.live-root .prizeview-body { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.live-root .prizeview-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 92% at 50% 8%, rgba(163,43,200,.18), transparent 62%),
    radial-gradient(90% 70% at 50% 100%, rgba(232,144,26,.14), transparent 70%),
    rgba(4,2,7,.6);
}
.live-root #prize-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.live-root .stage-spinner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,2,7,.45); }
.live-root .prize-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid var(--line-hot); background: rgba(4,2,7,.72);
  color: var(--t-hi); font: 400 22px/1 var(--display); cursor: pointer;
  opacity: 0; transition: opacity .18s ease, background .18s ease; z-index: 2;
}
.live-root .prize-nav.prev { left: 10px; }
.live-root .prize-nav.next { right: 10px; }
.live-root .prizeview-panel:hover .prize-nav,
.live-root .prizeview-panel:focus-within .prize-nav { opacity: 1; }
.live-root .prize-nav:hover { background: rgba(232,144,26,.28); }
.live-root .prize-nav:focus-visible { opacity: 1; }
@media (hover: none) { .live-root .prize-nav { opacity: 1; } }

.live-root .prizeview-meta { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.live-root .prize-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.live-root #prize-name { margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: .03em; min-width: 0; overflow-wrap: anywhere; }
.live-root .prize-counter { flex: none; font: 600 9px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-dim); }
.live-root .prize-sub { margin: 0; color: var(--t-body); font-size: 13px; line-height: 1.5; }
.live-root .prize-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.live-root .prize-tag.won { color: var(--ember-core); border-color: rgba(255,198,77,.55); }
.live-root .prize-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.live-root .prize-swatches i {
  display: block; width: 20px; height: 20px; border-radius: 5px;
  border: 1px solid rgba(4,2,7,.55); box-shadow: inset 0 0 0 1px rgba(246,244,247,.08);
}
.live-root .prize-note { margin: 0; color: var(--t-sec); font-size: 12px; line-height: 1.5; }
.live-root .prize-price { margin: 0; color: var(--ember-core); font-size: 12px; letter-spacing: .04em; }
.live-root .prize-dots { display: flex; flex-wrap: wrap; gap: 4px; }
/* a 22px target around an 8px dot: the dot is the picture, the button is the control */
.live-root .prize-dot { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.live-root .prize-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-hot); transition: background .18s ease, transform .18s ease; }
.live-root .prize-dot:hover::before { background: rgba(246,244,247,.35); }
.live-root .prize-dot.on::before { background: var(--ember-core); border-color: var(--ember-core); transform: scale(1.15); }
.live-root .prize-shoplink { margin-top: auto; font-size: 13px; color: var(--ember-ink); display: inline-block; padding: 5px 0; align-self: flex-start; }

/* ── spin ────────────────────────────────────────────────────────────────── */
.live-root .spin-layout { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 26px 40px; align-items: center; }
@media (max-width: 820px) {
  .live-root .spin-layout { grid-template-columns: 1fr; justify-items: center; }
  .live-root .spin-side { width: 100%; max-width: 420px; }
}
.live-root .wheel-wrap { position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: 6px auto; }
.live-root .wheel-wrap.idle { cursor: pointer; }
.live-root .wheel-wrap.locked { cursor: not-allowed; }
.live-root #spin-wheel { width: 100%; height: 100%; display: block; overflow: visible;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); transition: filter .3s ease, transform .22s ease; }
.live-root #spin-wheel .wheel-rotor { transform-origin: 0 0; }
.live-root .wheel-wrap.idle #spin-wheel .wheel-rotor { animation: gd-wheel-idle 90s linear infinite; }
@keyframes gd-wheel-idle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.live-root .wheel-wrap.idle:hover #spin-wheel { filter: brightness(1.06) drop-shadow(0 18px 44px rgba(0,0,0,.5)); }
.live-root .wheel-wrap.idle:hover .wheel-hub { box-shadow: 0 0 30px rgba(232,144,26,.42), inset 0 0 14px rgba(0,0,0,.7); }
.live-root .wheel-wrap.winding #spin-wheel { transform: scale(.965); }
.live-root .wheel-wrap.win .wheel-hub span { display: inline-block; animation: gd-hub-pop .6s ease; }
@keyframes gd-hub-pop { 0% { transform: scale(1); } 34% { transform: scale(1.34); color: var(--ember-core); } 100% { transform: scale(1); } }
.live-root .spin-confetti, .live-root .claim-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; }

.live-root #spin-wheel path.seg { stroke: rgba(4,2,7,.85); stroke-width: 1.5; }
.live-root #spin-wheel text { font-family: var(--display); font-weight: 700; font-size: 15px; fill: var(--t-hi); letter-spacing: .04em; }
.live-root #spin-wheel text.jackpot-label { fill: #1d1405; font-size: 16px; }
.live-root #spin-wheel .seg-hit { opacity: 0; }
.live-root #spin-wheel .seg-hit.flash { opacity: 1; animation: gd-seg-flash 1.4s ease 3; }
@keyframes gd-seg-flash { 0%, 100% { opacity: 0; } 45% { opacity: .85; } }

.live-root .wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); transform-origin: 50% 0;
  width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid var(--ember-core); filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); z-index: 4;
}
.live-root .wheel-pointer.flick { animation: gd-pointer-flick .13s ease; }
@keyframes gd-pointer-flick { 0% { transform: translateX(-50%) rotate(0); } 42% { transform: translateX(-50%) rotate(11deg); } 100% { transform: translateX(-50%) rotate(0); } }

.live-root .wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 21%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 30%, #2a1a10, #050408 78%);
  border: 2px solid var(--line-hot);
  box-shadow: 0 0 24px rgba(232,144,26,.25), inset 0 0 14px rgba(0,0,0,.7); z-index: 3;
}
.live-root .wheel-hub span { font: 700 24px/1 var(--display); color: var(--ember-core); letter-spacing: .08em; }

/* locked: the wheel desaturates and the padlock breathes */
.live-root .wheel-wrap.locked #spin-wheel { filter: saturate(.28) brightness(.62) drop-shadow(0 18px 40px rgba(0,0,0,.45)); transition: filter .8s ease; }
.live-root .wheel-lock {
  position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4,2,7,.42) 30%, rgba(4,2,7,.72) 72%, transparent 74%);
}
.live-root .padlock { width: 64px; height: 64px; color: var(--t-hi); transform-origin: 50% 60%; animation: gd-padlock-breathe 2.6s ease infinite; }
.live-root .padlock-body { fill: currentColor; }
.live-root .padlock-key { fill: var(--void); }
@keyframes gd-padlock-breathe { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.05); opacity: 1; } }
.live-root .padlock-shackle { transform-origin: 20px 28px; transition: transform .5s ease; }
.live-root .wheel-lock.deny .padlock { animation: gd-padlock-deny .4s ease-in-out 2; }
@keyframes gd-padlock-deny { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-5px) rotate(-3deg); } 75% { transform: translateX(5px) rotate(3deg); } }
.live-root .wheel-lock.opening .padlock-shackle { transform: rotate(-38deg); }
.live-root .wheel-lock.opening { animation: gd-lock-fade .7s ease forwards; }
@keyframes gd-lock-fade { to { opacity: 0; } }
.live-root .lock-count { font-size: 30px; line-height: 1; font-weight: 500; color: var(--t-hi); letter-spacing: .06em; }
.live-root .lock-label { font: 600 9px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--t-sec); }

/* the win burst */
.live-root .wheel-burst { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 2px; pointer-events: none; }
.live-root .wheel-burst b { font-size: 56px; line-height: 1; color: var(--ember-core); text-shadow: 0 0 34px rgba(232,144,26,.65); animation: gd-burst-pop 2.6s ease forwards; }
.live-root .wheel-burst span { font: 600 11px/1 var(--data); letter-spacing: .22em; text-transform: uppercase; color: var(--t-body); animation: gd-burst-pop 2.6s ease forwards; }
@keyframes gd-burst-pop { 0% { opacity: 0; transform: scale(.4); } 12% { opacity: 1; transform: scale(1.08); } 22% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(1) translateY(-14px); } }

.live-root .spin-side { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.live-root .spin-copy, .live-root .claim-copy { margin: 0; color: var(--t-body); font-size: 14px; line-height: 1.55; }
.live-root .spin-copy b, .live-root .claim-copy b { color: var(--ember-core); }
/* inline links get a real target: a bare 14px inline anchor is ~21px tall,
   under the 22px floor the rendered-proof gates refuse */
.live-root .spin-copy a, .live-root .inventory-pointer-copy a {
  color: var(--ember-ink); text-decoration: underline; text-underline-offset: 3px;
  display: inline-block; padding: 2px 0;
}
.live-root .spin-stats, .live-root .claim-stats { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 10px; width: 100%; }
.live-root .spin-stat, .live-root .claim-stat, .live-root .gs-stat, .live-root .stat, .live-root .condition, .live-root .prime-splits article {
  padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(6,5,6,.5);
}
@media (max-width: 460px) { .live-root .spin-stats, .live-root .claim-stats { grid-template-columns: 1fr 1fr; } }
.live-root .spin-button { align-self: stretch; min-height: 48px; white-space: normal; text-align: center; line-height: 1.3; }
.live-root .spin-button:not([disabled]) { animation: gd-spin-btn-glow 2.4s ease infinite; }
@keyframes gd-spin-btn-glow { 0%, 100% { box-shadow: 0 0 14px rgba(232,144,26,.16); } 50% { box-shadow: 0 0 30px rgba(232,144,26,.38); } }
.live-root .spin-cooldown-note { font: 600 10px/1.5 var(--data); letter-spacing: .1em; text-transform: uppercase; color: var(--t-dim); }
.live-root .spin-shop-link { font-size: 13px; color: var(--ember-ink); display: inline-block; padding: 5px 0; }

/* ── claim ───────────────────────────────────────────────────────────────── */
.live-root .claim-panel { position: relative; overflow: hidden; }
.live-root .claim-panel.ready { border-color: rgba(255,198,77,.45); }
.live-root .claim-layout { display: flex; flex-direction: column; gap: 16px; }
.live-root .claim-track { position: relative; padding: 10px 2px 2px; }
.live-root .claim-rail { position: absolute; left: 4%; right: 4%; top: 50%; height: 3px; border-radius: 2px; background: var(--panel-hi); overflow: hidden; }
.live-root .claim-rail i { display: block; height: 100%; width: 0; border-radius: 2px; background: linear-gradient(90deg, rgba(232,144,26,.5), var(--ember-core)); transition: width .7s ease; }
.live-root .claim-days { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.live-root .claim-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 74px; padding: 10px 4px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(6,5,6,.6);
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.live-root .cd-day { font: 700 9px/1 var(--data); text-transform: uppercase; letter-spacing: .1em; color: var(--t-dim); }
.live-root .cd-points { font: 700 18px/1 var(--display); color: var(--t-body); font-variant-numeric: tabular-nums; }
.live-root .cd-check { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; color: var(--ember-core); opacity: 0; transform: scale(.4); transition: opacity .25s ease, transform .25s ease; }
.live-root .claim-day.claimed { border-color: rgba(255,198,77,.45); background: rgba(232,144,26,.10); }
.live-root .claim-day.claimed .cd-points { color: var(--ember-core); }
.live-root .claim-day.claimed .cd-check { opacity: 1; transform: scale(1); }
.live-root .claim-day.locked { opacity: .62; }
.live-root .claim-day.next { border-color: var(--ember); background: rgba(232,144,26,.08); cursor: pointer; transform: translateY(-2px); }
.live-root .claim-day.next .cd-day { color: var(--ember-core); }
.live-root .claim-day.next .cd-points { color: var(--t-hi); }
.live-root .claim-day.next:hover { background: rgba(232,144,26,.16); }
.live-root .cd-ring { position: absolute; inset: -1px; border-radius: var(--r); border: 1px solid var(--ember); animation: gd-cd-ring 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes gd-cd-ring { 0%, 100% { opacity: .9; transform: scale(1); } 50% { opacity: .15; transform: scale(1.045); } }
/* day 7, the weekly claim, carries the violet family: the second light, not a second ink */
.live-root .claim-day.weekly { border-color: rgba(194,75,224,.45); background: rgba(163,43,200,.08); }
.live-root .claim-day.weekly .cd-day, .live-root .claim-day.weekly .cd-points { color: var(--violet-ink); }
.live-root .claim-day.weekly.next { border-color: var(--violet-ink); background: rgba(163,43,200,.16); }
.live-root .claim-day.weekly.next .cd-ring { border-color: var(--violet-ink); }
.live-root .claim-day.weekly.claimed { border-color: var(--violet-ink); background: rgba(163,43,200,.18); }
.live-root .claim-day.weekly.claimed .cd-check { color: var(--violet-core); }
.live-root .claim-day.just-claimed { animation: gd-cd-pop .55s ease; }
@keyframes gd-cd-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.live-root .claim-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.live-root .claim-button { min-height: 42px; white-space: normal; text-align: center; line-height: 1.3; padding-top: 8px; padding-bottom: 8px; }
.live-root .claim-panel.ready .claim-button { animation: gd-claim-breathe 2.6s ease-in-out infinite; }
@keyframes gd-claim-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,144,26,.28); } 50% { box-shadow: 0 0 0 7px rgba(232,144,26,0); } }
.live-root .claim-countdown { font: 600 11px/1 var(--data); letter-spacing: .1em; text-transform: uppercase; color: var(--t-sec); }
.live-root .claim-countdown b { color: var(--t-hi); }
.live-root .claim-reset-note { padding: 10px 14px; border-radius: var(--r); border: 1px dashed var(--t-ter); color: var(--t-body); font-size: 12px; line-height: 1.45; }
@media (max-width: 640px) {
  .live-root .claim-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .live-root .claim-rail { display: none; }
}

/* ── narrow reward cards: the container queries ──────────────────────────
   ★ AFTER the spin and claim rules, at THEIR specificity. Two things the
     first two cuts of this block got wrong, each with a passing build and a
     1440 frame that kept a 110px column of one-word lines: a single-class
     rule inside @container loses to the two-class base rules whatever the
     breakpoint says, and a rule of EQUAL specificity loses when it comes
     EARLIER in the sheet. The live sheets get the order for free because
     claim.css (which carries these queries) loads after spin.css.
   ★ 640, not the live sheet's 520: this shell is 1560px wide where the live
     page is 1240, so in the three-column row the spin card measures ~537px —
     just over 520. Measured off the 1440 frame, not judged from it. */
@container (max-width: 640px) {
  .live-root .spin-layout { grid-template-columns: 1fr; justify-items: center; }
  .live-root .spin-side { width: 100%; max-width: 420px; align-items: stretch; }
  .live-root .wheel-wrap { width: min(100%, 320px); }
}
@container (max-width: 330px) {
  .live-root .spin-stats, .live-root .claim-stats { grid-template-columns: 1fr 1fr; }
}

/* ── the live grid: eight panels ─────────────────────────────────────────── */
.live-root .live-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
/* every panel of the grid is named, so the page's DOM contract (§4.11) has a
   styled hook per panel even where the haven .panel frame already carries it */
.live-root .preview-panel, .live-root .vitals-panel, .live-root .diet-panel,
.live-root .growthstop-panel, .live-root .deaddrop-panel { min-width: 0; }
.live-root .inventory-pointer-panel { min-width: 0; }
.live-root .teleport-block { padding: 2px 0 0; }
.live-root .prime-panel, .live-root .vault-panel, .live-root .teleport-panel { grid-column: 1 / -1; }
@media (max-width: 940px) {
  .live-root .live-grid { grid-template-columns: 1fr; }
  .live-root .prime-panel, .live-root .vault-panel, .live-root .teleport-panel { grid-column: auto; }
}

/* ① specimen */
.live-root .preview-frame {
  position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3;
  background: radial-gradient(ellipse at 50% 20%, rgba(232,144,26,.10), transparent 70%), rgba(4,2,7,.6);
}
.live-root .preview-frame canvas { display: block; width: 100%; height: 100%; }
.live-root .preview-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  font: 600 11px/1.4 var(--data); letter-spacing: .1em; text-transform: uppercase; color: var(--t-sec);
}
.live-root .fallback-card {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
}
.live-root .fallback-card.on { display: flex; }
.live-root .fallback-card .fname { font-size: clamp(18px, 2vw, 24px); line-height: 1.1; letter-spacing: .04em; overflow-wrap: anywhere; }
.live-root .fallback-card p { margin: 0; color: var(--t-sec); font-size: 12px; line-height: 1.5; max-width: 36ch; }

/* ② vitals */
.live-root .summary-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.live-root .summary-row .name { font-size: clamp(20px, 2vw, 26px); line-height: 1; letter-spacing: .04em; }
.live-root .summary-row .stage { font: 600 10px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--t-sec); }
.live-root .tag.prime, .live-root .tag.prime-badge { color: var(--ember-core); border-color: rgba(255,198,77,.55); }
.live-root .tag.elder { color: var(--violet-ink); border-color: var(--violet-ink); }
.live-root .vitals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.live-root .stat { padding: 12px 13px; }
.live-root .stat .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.live-root .stat .val { font-size: 13px; font-weight: 500; color: var(--t-hi); }
.live-root .stat .bar { margin-top: 10px; }
.live-root .stat .src { margin-top: 8px; display: none; font: 600 8.5px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-dim); }
.live-root .stat.pending .val { color: var(--t-dim); }
.live-root .stat.pending .src { display: block; }

/* ③ diet */
.live-root .diet-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 10px; margin: 0 0 10px; }
.live-root .diet-row .dl { font: 600 10px/1.2 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-sec); }
.live-root .diet-row .db { height: 8px; }
.live-root .diet-row.carb .fill { background: var(--ember); }
.live-root .diet-row.prot .fill { background: var(--violet); }
.live-root .diet-row.lip .fill { background: var(--t-sec); background-image: var(--hatch); }
.live-root .diet-row .dv { text-align: right; color: var(--t-hi); font-size: 12px; }
.live-root #diet-note { margin-top: 6px; font: 600 9px/1.4 var(--data); letter-spacing: .08em; text-transform: uppercase; color: var(--t-dim); }

/* ④ prime */
.live-root .prime-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
.live-root .prime-score { display: flex; align-items: baseline; gap: 8px; font-size: 44px; line-height: 1; color: var(--t-hi); }
.live-root .prime-score em { font-style: normal; font-size: 20px; color: var(--t-dim); }
.live-root .prime-score b:last-child { font-size: 24px; color: var(--t-sec); }
.live-root .prime-badge { display: none; }
.live-root .prime-badge.on { display: inline-flex; }
.live-root .prime-meter { margin: 16px 0 4px; }
.live-root .prime-splits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.live-root .prime-splits span { display: block; font: 600 9px/1.2 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-dim); }
.live-root .prime-splits strong { display: block; margin-top: 8px; font-size: 15px; color: var(--t-hi); }
.live-root .curated-title, .live-root .checklist-title { margin: 22px 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ember-ink); }
.live-root .condition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.live-root .condition { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 11px 13px; }
.live-root .condition span { font: 500 12px/1.3 var(--ui); color: var(--t-body); }
.live-root .condition .st { font: 600 9px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--t-dim); white-space: nowrap; }
.live-root .condition.met { border-color: rgba(255,198,77,.5); background: rgba(232,144,26,.08); }
.live-root .condition.met .st { color: var(--ember-core); }
.live-root .condition.na { opacity: .6; }
.live-root .prime-message { margin-top: 14px; font-size: 10px; font-weight: 600; line-height: 1.5; color: var(--t-sec); }

/* ⑤ the inventory pointer */
.live-root .inventory-pointer-body { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; justify-content: space-between; }
.live-root .inventory-pointer-copy { margin: 0; max-width: 640px; color: var(--t-body); font-size: 14px; line-height: 1.6; }

/* ⑥ growth stop */
.live-root .gs-copy { margin: 0 0 14px; color: var(--t-body); font-size: 14px; line-height: 1.55; }
.live-root .gs-status {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; min-height: 2.4rem;
  border-radius: var(--r); border: 1px solid var(--line); background: rgba(6,5,6,.5);
  color: var(--t-body); font-size: 14px; line-height: 1.45;
}
.live-root .gs-status .spinner { display: none; width: 18px; height: 18px; border-width: 2px; flex: none; }
.live-root .gs-status.busy .spinner { display: inline-block; }
.live-root .gs-status.ok { border-color: rgba(255,198,77,.5); color: var(--t-hi); }
.live-root .gs-status.ready { color: var(--t-hi); }
.live-root .gs-status.warn { border-color: var(--t-ter); border-style: dashed; }
.live-root .gs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.live-root .gs-stat { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.live-root .gs-stat .val { font-weight: 600; color: var(--t-hi); }
.live-root .gs-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.live-root .gs-actions .btn { min-width: 11rem; white-space: normal; text-align: center; line-height: 1.3; }
.live-root .gs-note { margin-top: 12px; padding: 9px 12px; border-radius: var(--r); border: 1px dashed var(--t-ter); color: var(--t-body); font-size: 13px; line-height: 1.45; }

/* ⑦ dead drops */
.live-root .deaddrop-copy { margin: 0 0 10px; color: var(--t-body); font-size: 13px; line-height: 1.55; }
.live-root .deaddrop-gates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.live-root .dd-gate { white-space: normal; }
.live-root .dd-gate.ok { color: var(--ember-core); border-color: rgba(255,198,77,.5); }
.live-root .dd-gate.no { color: var(--t-sec); border-style: dashed; border-color: var(--t-ter); }
.live-root .deaddrop-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.live-root .btn.dd-offer { flex-direction: column; gap: 5px; padding: 10px 8px; min-height: 56px; white-space: normal; line-height: 1.2; }
.live-root .dd-name { font: 600 11px/1.2 var(--data); letter-spacing: .1em; }
.live-root .dd-price { font: 500 10px/1 var(--data); letter-spacing: .08em; color: var(--t-sec); }
.live-root .btn.dd-offer[disabled] .dd-price { color: var(--t-off); }
.live-root .deaddrop-cooldown, .live-root .deaddrop-disabled-note {
  margin-top: 10px; padding: 7px 10px; border: 1px dashed var(--line-up); border-radius: var(--r);
  font-size: 12px; color: var(--t-sec);
}
.live-root .deaddrop-cooldown b { color: var(--t-hi); }

/* ⑧ teleport */
.live-root .teleport-block-title { margin: 0 0 8px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--t-hi); }
.live-root .teleport-explain { margin: 0 0 14px; color: var(--t-body); font-size: 13px; line-height: 1.5; }
.live-root .teleport-code-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.live-root .teleport-code-active {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 14px;
  border-radius: var(--r); border: 1px solid var(--line); background: rgba(6,5,6,.5);
}
.live-root .teleport-code-value { font-size: 20px; font-weight: 700; letter-spacing: .18em; color: var(--ember-core); }
.live-root .teleport-code-expiry { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--t-sec); }
.live-root .teleport-redeem-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.live-root .teleport-redeem-row .input { flex: 1 1 220px; min-width: 180px; width: auto; text-transform: uppercase; letter-spacing: .1em; }
.live-root .teleport-hint { margin: 10px 0 0; font-size: 9px; font-weight: 600; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; color: var(--t-dim); }

/* ── the one toast, the one modal ────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--livebar-h, 34px) + 18px);
  transform: translateX(-50%) translateY(20px); z-index: 160;
  max-width: min(460px, calc(100% - 32px)); padding: 12px 18px;
  border-radius: var(--r); border: 1px solid var(--line-up); background: rgba(8,6,7,.97);
  color: var(--t-hi); font-size: 13px; line-height: 1.45;
  opacity: 0; pointer-events: none; box-shadow: var(--crush);
  transition: opacity .2s ease, transform .2s ease;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { border-color: rgba(255,198,77,.55); }
#toast.err { border-color: var(--t-ter); border-style: dashed; }
#toast.warn { border-color: var(--violet-ink); }

.modal-backdrop { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(4,2,7,.78); }
.modal-card {
  width: min(440px, 100%); padding: 26px; border: 1px solid var(--line-up); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(21,15,16,.98), rgba(8,6,7,.99)); box-shadow: var(--crush), var(--lit-edge);
}
.modal-card h3 { margin: 0 0 10px; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--t-hi); }
.modal-card p { margin: 0 0 20px; color: var(--t-body); font-size: 14px; line-height: 1.55; }
.modal-input { margin: -6px 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .live-root .vitals, .live-root .condition-grid, .live-root .prime-splits { grid-template-columns: 1fr; }
  .live-root .gs-stats { grid-template-columns: 1fr 1fr; }
  .live-root .diet-row { grid-template-columns: 90px 1fr 46px; }
}

/* ── reduced motion: nothing arrives late, nothing spins ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  .live-root .spinner, .live-root .live-pill .dot.live,
  .live-root .wheel-wrap.idle #spin-wheel .wheel-rotor, .live-root .padlock,
  .live-root .spin-button:not([disabled]), .live-root .wheel-wrap.win .wheel-hub span,
  .live-root .wheel-pointer.flick, .live-root .cd-ring, .live-root .claim-panel.ready .claim-button,
  .live-root .claim-day.just-claimed { animation: none; }
  .live-root #spin-wheel, .live-root #spin-wheel .wheel-rotor { transition: none !important; }
  .live-root .claim-rail i, .live-root .fill { transition: none; }
}
