/* ============================================================
   Crypt EV — "The Vault"
   A graded-grail trading terminal: vault-ink + champagne gold,
   holographic foil for the magic moments. Fraunces + Spline Sans Mono.
   ============================================================ */

:root {
  /* vault ink (warm-cool dark, never flat black) */
  --bg-0: #070a09;
  --bg-1: #0c1110;
  --panel: #111817;
  --panel-2: #16201d;
  --line: #2a3531;
  --line-soft: #1b2522;

  /* parchment text — like an old grading ledger */
  --ink: #efe7d6;
  --ink-dim: #a6a89a;
  --ink-faint: #6c7269;

  /* champagne gold — the dominant accent */
  --gold: #e7c483;
  --gold-bright: #f7dca4;
  --gold-deep: #b58a3e;
  --gold-glow: rgba(231, 196, 131, 0.22);

  /* desaturated edge signals (kept quiet so gold leads) */
  --pos: #84d2a6;
  --neg: #e2897a;
  --warn: #e8be6b;
  --hot: #f0a55d;

  /* holographic foil */
  --holo: linear-gradient(110deg,
      #6fd8c6 0%, #9fe0a8 14%, #f3d99c 30%, #efb0a6 46%,
      #c8a8e8 62%, #7fc8e0 78%, #f3d99c 92%, #6fd8c6 100%);

  --serif: "Fraunces", "Hoefler Text", Georgia, serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 13px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(231, 196, 131, 0.18);
  background:
    radial-gradient(1100px 560px at 50% -8%, var(--gold-glow), transparent 60%),
    radial-gradient(820px 480px at 88% 2%, rgba(111, 216, 198, 0.05), transparent 55%),
    linear-gradient(178deg, #0d1311 0%, #0a0e0c 58%, #070908 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
}

/* atmosphere: film grain + vault vignette, behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04; mix-blend-mode: overlay;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 32%, transparent 52%, rgba(0, 0, 0, 0.55));
}
.topbar, main, footer, .caveat { position: relative; z-index: 1; }

h1, h2 { margin: 0; font-weight: 600; }
.muted { color: var(--ink-dim); font-weight: 400; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos-t { color: var(--pos); }
.neg-t { color: var(--neg); }
.dim-t { color: var(--ink-faint); }

/* keyframes ---------------------------------------------------------- */
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes holoShift { to { background-position: 220% center; } }
@keyframes dotPulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--pos); } 50% { opacity: 0.45; box-shadow: 0 0 0 4px transparent; } }
@keyframes brandSheen { 0% { background-position: -120% center; } 60%, 100% { background-position: 220% center; } }

/* booting: stagger the first paint only (removed by JS after ~1.8s) */
body.booting .card { opacity: 0; animation: reveal 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.booting .hit-card { opacity: 0; animation: reveal 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.booting .machine-grid .card:nth-child(1) { animation-delay: 0.04s; }
body.booting .machine-grid .card:nth-child(2) { animation-delay: 0.10s; }
body.booting .machine-grid .card:nth-child(3) { animation-delay: 0.16s; }
body.booting .machine-grid .card:nth-child(4) { animation-delay: 0.22s; }
body.booting .machine-grid .card:nth-child(5) { animation-delay: 0.28s; }
body.booting .machine-grid .card:nth-child(6) { animation-delay: 0.34s; }
body.booting .machine-grid .card:nth-child(7) { animation-delay: 0.40s; }
body.booting .machine-grid .card:nth-child(n+8) { animation-delay: 0.46s; }
body.booting .hit-card:nth-child(1) { animation-delay: 0.10s; }
body.booting .hit-card:nth-child(2) { animation-delay: 0.16s; }
body.booting .hit-card:nth-child(3) { animation-delay: 0.22s; }
body.booting .hit-card:nth-child(4) { animation-delay: 0.28s; }
body.booting .hit-card:nth-child(5) { animation-delay: 0.34s; }
body.booting .hit-card:nth-child(6) { animation-delay: 0.40s; }
body.booting .hit-card:nth-child(n+7) { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
  body.booting .card, body.booting .hit-card { animation: none; opacity: 1; }
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 17px 30px;
  background: linear-gradient(180deg, rgba(18, 24, 22, 0.92), rgba(10, 14, 12, 0.78));
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(231, 196, 131, 0.08), 0 14px 40px -28px rgba(0, 0, 0, 0.9);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 15px; }
.logo {
  font-size: 24px; line-height: 1; color: var(--bg-0);
  background: var(--gold); width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px var(--gold-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transform: rotate(-4deg);
}
.topbar h1 {
  font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 90;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold), var(--gold-bright));
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandSheen 6s ease-in-out infinite;
}
.topbar h1 .muted { -webkit-text-fill-color: var(--ink-dim); }
.tagline { margin: 2px 0 0; font-size: 11px; letter-spacing: 0.04em; color: var(--ink-faint); }

.topstats { display: flex; gap: 34px; flex: 1; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .v { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--gold); font-variation-settings: "opsz" 60; }
.stat .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-faint); margin-top: 1px; }

.topmeta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); animation: dotPulse 2.4s infinite; }

.caveat {
  margin: 0; padding: 8px 30px; text-align: center; font-size: 12px; letter-spacing: 0.02em;
  color: var(--warn);
  background: repeating-linear-gradient(-45deg, rgba(232, 190, 107, 0.05) 0 12px, transparent 12px 24px);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- collector heartbeat ---------- */
.heartbeat { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; font-family: var(--mono); font-size: 11px; }
.hb-lead { text-transform: uppercase; letter-spacing: 0.14em; font-size: 9.5px; color: var(--ink-faint); }
.hb-item { display: inline-flex; align-items: center; gap: 6px; }
.hb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.hb-live { color: var(--ink-dim); }
.hb-live .hb-dot { background: var(--pos); box-shadow: 0 0 7px var(--pos); }
.hb-stale { color: var(--neg); font-weight: 500; }
.hb-stale .hb-dot { background: var(--neg); box-shadow: 0 0 8px var(--neg); animation: dotPulse 1.5s infinite; }

/* drift fallback hero (favor offline) */
.drift-hero { padding: 5px 0 2px; }
.heat-drift { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1; font-variation-settings: "opsz" 70; }
.drift-up .heat-drift { color: var(--pos); }
.drift-down .heat-drift { color: var(--neg); }
.drift-steady .heat-drift { color: var(--ink-dim); }
.drift-none .heat-drift { color: var(--ink-faint); }
.now-offline::before { background: var(--neg) !important; }

/* ---------- "right now" strip ---------- */
.now-strip { margin-bottom: 24px; }
.now-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 15px 20px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card-hi), var(--card));
  border: 1px solid var(--line-soft); position: relative; overflow: hidden;
}
.now-inner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.now-hot { border-color: rgba(255, 138, 91, 0.5); box-shadow: 0 0 38px -10px rgba(255, 138, 91, 0.4); }
.now-hot::before { background: var(--hot); box-shadow: 0 0 14px var(--hot); }
.now-warm { border-color: rgba(245, 196, 81, 0.4); }
.now-warm::before { background: var(--warn); }
.now-flat::before { background: var(--line); }
.now-lead { display: flex; align-items: baseline; gap: 14px; flex: 1; min-width: 280px; }
.now-eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); white-space: nowrap; padding-top: 2px; }
.now-verdict { font-family: var(--serif); font-size: 16px; line-height: 1.4; color: var(--ink); font-variation-settings: "opsz" 50; }
.now-verdict b { color: var(--gold); font-weight: 600; }
.now-flame { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--hot); }
.now-warm .now-flame { color: var(--warn); }
.now-caveat { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.now-noisy { font-family: var(--mono); font-size: 10.5px; color: var(--warn); border: 1px solid rgba(245, 196, 81, 0.3); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.now-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.now-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.now-chip { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 7px; background: var(--bg-soft); border: 1px solid var(--line-soft); color: var(--ink-dim); }
.now-chip b { color: var(--ink); }
.now-chip.chip-hot { border-color: rgba(255, 138, 91, 0.45); color: var(--hot); }
.now-chip.chip-hot b { color: var(--hot); }
.now-chip.chip-warm { border-color: rgba(245, 196, 81, 0.35); color: var(--warn); }
.now-chip.chip-warm b { color: var(--warn); }
.now-open { font-family: var(--mono); font-size: 11.5px; font-weight: 600; text-decoration: none; letter-spacing: 0.03em; text-transform: uppercase; color: var(--bg-0); background: var(--gold); padding: 7px 14px; border-radius: 8px; white-space: nowrap; transition: background 0.2s, box-shadow 0.2s; }
.now-open:hover { background: var(--gold-bright); box-shadow: 0 0 18px var(--gold-glow); }

/* ---------- layout ---------- */
main { padding: 28px 30px 8px; max-width: 1520px; margin: 0 auto; }
.block { margin-bottom: 34px; }
.block-head { display: flex; align-items: baseline; gap: 13px; margin-bottom: 15px; flex-wrap: wrap; padding-left: 2px; }
.block-head h2 {
  font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 80;
  position: relative; padding-bottom: 4px;
}
.block-head h2::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent); border-radius: 2px;
}
.block-head .muted { font-family: var(--mono); font-size: 12px; }
.hint { font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.01em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* ---------- machine board groups ---------- */
.machine-group { margin-bottom: 26px; }
.machine-group:last-child { margin-bottom: 0; }
.group-label {
  display: flex; align-items: baseline; gap: 11px; margin: 0 2px 13px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--gold);
}
.group-label::after {
  content: ""; flex: 1; height: 1px; align-self: center;
  background: linear-gradient(90deg, rgba(231, 196, 131, 0.28), transparent);
}
.group-sub { text-transform: none; letter-spacing: 0.02em; font-weight: 400; font-size: 11px; color: var(--ink-faint); }

/* ---------- machine cards ---------- */
/* 5-up on desktop so the core price ladder sits on one row; degrades gracefully */
.machine-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) { .machine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 500px) { .machine-grid { grid-template-columns: 1fr; } }
.card {
  position: relative; background: var(--panel);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 17px 19px 15px; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card::before { /* top hairline catchlight */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 196, 131, 0.25), transparent);
}
.card:hover { border-color: var(--line); transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9); }
.card.fav { background: linear-gradient(178deg, var(--panel-2), var(--panel)); border-color: rgba(231, 196, 131, 0.18); }
.card.hot { border-color: rgba(240, 165, 93, 0.5); box-shadow: 0 0 34px -6px rgba(240, 165, 93, 0.22); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-name { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.2; display: flex; align-items: flex-start; gap: 7px; font-variation-settings: "opsz" 50; min-height: 2.4em; }
.card-name .star { color: var(--gold); font-size: 13px; }
.card-sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; letter-spacing: 0.02em; }
.card-price { color: var(--ink); font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.badges { display: flex; gap: 6px; flex-shrink: 0; }
.badge { font-size: 9.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--bg-1); color: var(--ink-dim); border: 1px solid var(--line-soft); }
.badge.heat-warm { background: rgba(232, 190, 107, 0.14); color: var(--warn); border-color: transparent; }
.badge.heat-hot {
  color: #1a1206; border: none; position: relative; overflow: hidden;
  background: var(--holo); background-size: 220% auto; animation: holoShift 3.2s linear infinite;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

/* heat meter — the card hero */
.heat-hero { margin: 14px 0 2px; }
.heat-top { display: flex; align-items: baseline; gap: 10px; }
.heat-pct {
  font-family: var(--serif); font-size: 33px; font-weight: 600; line-height: 0.9;
  font-variation-settings: "opsz" 120, "SOFT" 0; font-variant-numeric: tabular-nums lining-nums;
}
.heat-pct-sym { font-size: 17px; opacity: 0.75; }
.heat-label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.heat-bar { position: relative; height: 9px; border-radius: 5px; background: var(--line-soft); overflow: hidden; margin-top: 9px; }
.heat-bar > span { display: block; height: 100%; border-radius: 5px; transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.heat-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(239, 231, 214, 0.16); z-index: 1; }
.heat-sub { font-size: 10.5px; color: var(--ink-faint); margin-top: 7px; }
.heat-hot .heat-pct, .heat-hot .heat-label { color: var(--hot); }
.heat-hot .heat-bar > span { background: linear-gradient(90deg, var(--gold), var(--hot)); box-shadow: 0 0 14px -2px var(--hot); }
.heat-warm .heat-pct, .heat-warm .heat-label { color: var(--warn); }
.heat-warm .heat-bar > span { background: linear-gradient(90deg, var(--gold-deep), var(--warn)); }
.heat-cool .heat-pct { color: var(--ink); }
.heat-cool .heat-label { color: var(--ink-faint); }
.heat-cool .heat-bar > span { background: var(--ink-dim); }
.heat-noisy { font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--warn); border: 1px solid rgba(245, 196, 81, 0.32); border-radius: 5px; padding: 1px 5px; white-space: nowrap; align-self: center; }
.heat-unreliable .heat-bar > span { box-shadow: none !important; opacity: 0.7; }
.heat-unreliable .heat-pct, .heat-unreliable .heat-label { opacity: 0.8; }
.heat-none { opacity: 0.7; }
.heat-none .heat-pct { font-family: var(--mono); font-size: 22px; color: var(--ink-faint); }
.heat-none .heat-label { color: var(--ink-faint); }
.heat-none .heat-bar > span { background: var(--line); }

.card-odds { font-size: 11px; color: var(--ink-dim); margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft); letter-spacing: 0.01em; }

.realized-row { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; padding-top: 13px; border-top: 1px solid var(--line-soft); font-size: 10.5px; }
.realized-row .lbl { text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.verdict { font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 5px; letter-spacing: 0.05em; }
.verdict.neg { background: rgba(226, 137, 122, 0.15); color: var(--neg); }
.verdict.pos { background: rgba(132, 210, 166, 0.15); color: var(--pos); }
.verdict.unc { background: rgba(232, 190, 107, 0.13); color: var(--warn); }
.realized-val { margin-left: auto; font-weight: 600; font-size: 13px; }
.realized-ci { font-size: 10px; color: var(--ink-faint); text-align: right; }

.spark { margin: 11px 0 4px; }
.spark-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); margin-bottom: 4px; }

.tiers { margin-top: 13px; display: grid; gap: 5px; }
.tier-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 9px; font-size: 10.5px; }
.tier-row .tname { color: var(--ink-dim); letter-spacing: 0.02em; }
.tier-bar { height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.tier-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.tier-row .tval { color: var(--ink-faint); }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.open-link {
  font-size: 11px; font-weight: 600; text-decoration: none; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold); padding: 6px 13px; border: 1px solid rgba(231, 196, 131, 0.32); border-radius: 8px;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.open-link:hover { background: var(--gold); color: var(--bg-0); box-shadow: 0 0 20px var(--gold-glow); }
.card-age { font-size: 10px; color: var(--ink-faint); }

/* ---------- biggest hits controls ---------- */
.hits-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.hits-machines, .hits-sort { display: flex; gap: 7px; flex-wrap: wrap; }
.hits-sort { padding-left: 10px; border-left: 1px solid var(--line-soft); }
.hits-chip { font-family: var(--mono); font-size: 11px; padding: 5px 11px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-soft); color: var(--ink-dim); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.hits-chip:hover { border-color: var(--line); color: var(--ink); }
.hits-chip.on { background: var(--gold); color: var(--bg-0); border-color: var(--gold); font-weight: 600; }

/* ---------- biggest hits showcase ---------- */
.hits-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.hit-card {
  position: relative; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 13px; overflow: hidden; transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.hit-card:hover { border-color: rgba(231, 196, 131, 0.5); transform: translateY(-4px); box-shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.95); }
.hit-img { position: relative; aspect-ratio: 3 / 4.1; background: #0a0d0c; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hit-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.hit-card:hover .hit-img img { transform: scale(1.06); }
.hit-img::after { /* holographic foil sweep on hover (tilt a holo card) */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: var(--holo); background-size: 220% auto; mix-blend-mode: color-dodge;
  transition: opacity 0.4s; animation: holoShift 3.5s linear infinite;
}
.hit-card:hover .hit-img::after { opacity: 0.34; }
.hit-card:first-child .hit-img::after { opacity: 0.16; } /* the top grail always glints */
.hit-noimg { font-size: 30px; color: var(--line); }
.hit-mult {
  position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; color: #14100a;
  padding: 2px 8px; border-radius: 6px; background: var(--gold); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.hit-meta { padding: 10px 12px 12px; }
.hit-name { font-family: var(--serif); font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variation-settings: "opsz" 40; }
.hit-sub { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; font-size: 11px; }
.hit-val { font-weight: 600; color: var(--gold); }

.feed-thumb { width: 23px; height: 31px; object-fit: cover; border-radius: 3px; flex-shrink: 0; background: #0a0d0c; border: 1px solid var(--line-soft); }
.feed-thumb-x { width: 23px; flex-shrink: 0; }

/* ---------- best time to open (hour chart) ---------- */
.time-selector { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.time-chip { font-family: var(--mono); font-size: 11px; padding: 5px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-soft); color: var(--ink-dim); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.time-chip:hover { border-color: var(--line); color: var(--ink); }
.time-chip.on { background: var(--gold); color: var(--bg-0); border-color: var(--gold); font-weight: 600; }
.time-chart { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 18px 12px; }
.tbars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 132px; }
.tbars::before { content: ""; position: absolute; left: 0; right: 0; bottom: var(--avg); border-top: 1px dashed rgba(231, 196, 131, 0.4); z-index: 2; }
.tcol { flex: 1; display: flex; align-items: flex-end; height: 100%; border-radius: 4px; }
.col-now { background: linear-gradient(180deg, rgba(255, 138, 91, 0.1), transparent); }
.tbar { width: 100%; height: 100%; display: flex; align-items: flex-end; }
.tbar > i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--ink-dim); transition: height 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tbar.warm > i { background: linear-gradient(180deg, var(--hot), var(--gold-deep)); }
.tbar.thin > i { opacity: 0.38; }
.tbar.now > i { box-shadow: 0 0 12px -1px var(--gold-glow); outline: 1px solid rgba(255, 138, 91, 0.4); }
.tlbls { display: flex; gap: 4px; margin-top: 7px; }
.tlbl { flex: 1; text-align: center; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }
.time-cap { font-size: 10.5px; color: var(--ink-faint); margin-top: 11px; line-height: 1.5; }

/* ---------- signals band ---------- */
.signals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
/* minmax(0,1fr) not plain 1fr: lets the single column shrink below the widest
   panel's content (the restock table) instead of flooring at it → no overflow */
@media (max-width: 900px) { .signals-grid { grid-template-columns: minmax(0, 1fr); } }
.sig-wide { grid-column: 1 / -1; }
.sig-head {
  display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px;
  font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 70;
}
.sig-sub { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.01em; color: var(--ink-faint); }

/* ---------- panels (tables / feeds) ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 6px 4px; min-height: 80px;
  /* tables can be wider than the panel on narrow screens — scroll, don't clip
     (was overflow:hidden, which silently cut off the right-hand columns on phones) */
  overflow-x: auto; overflow-y: hidden;
}
table { width: 100%; border-collapse: collapse; }
th { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 500; text-align: right; padding: 9px 13px; }
th:first-child, td:first-child { text-align: left; }
td { font-size: 12px; padding: 8px 13px; text-align: right; border-top: 1px solid var(--line-soft); }
tr:first-child td { border-top: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(231, 196, 131, 0.04); }
.state-pill { font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 5px; letter-spacing: 0.05em; }
.state-IDLE { background: var(--bg-1); color: var(--ink-faint); }
.state-BELOW { background: rgba(226, 137, 122, 0.16); color: var(--neg); }
.state-ABOVE { background: rgba(132, 210, 166, 0.16); color: var(--pos); }

/* live activity flows into two columns so the rows don't sprawl */
.feed { columns: 2; column-gap: 30px; padding: 6px 14px; }
.feed-row { display: flex; align-items: center; gap: 11px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--line-soft); break-inside: avoid; }
.feed-row:last-child { border-bottom: none; }
@media (max-width: 720px) { .feed { columns: 1; } }

/* restock detector: table beside its fresh-grails feed, no dead width */
.restock-split { display: grid; grid-template-columns: 1.45fr 1fr; gap: 4px 26px; align-items: start; }
@media (max-width: 920px) { .restock-split { grid-template-columns: minmax(0, 1fr); } }
.restock-aside { border-left: 1px solid var(--line-soft); padding-left: 4px; align-self: stretch; }
@media (max-width: 920px) { .restock-aside { border-left: none; border-top: 1px solid var(--line-soft); padding-left: 0; margin-top: 6px; } }
.aside-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); padding: 10px 14px 6px; font-weight: 600; }
.restock-aside .feed-row { padding: 6px 14px; }
/* ratio emphasis: meaningful ratios pop, noisy ones recede */
td.restock-sig { font-weight: 600; }
td.restock-thin { color: var(--ink-faint); opacity: 0.8; font-style: italic; }
.restock-note { font-size: 10px; color: var(--ink-faint); padding: 9px 13px 5px; line-height: 1.5; letter-spacing: 0.01em; }
.restock-note .pos-t, .restock-note .neg-t { font-weight: 600; }
.restock-note .restock-thin { font-style: normal; opacity: 1; }
.feed-row.big { background: linear-gradient(90deg, rgba(240, 165, 93, 0.07), transparent); }
.feed-time { color: var(--ink-faint); font-size: 10px; width: 42px; flex-shrink: 0; }
.feed-code { color: var(--ink-dim); width: 112px; flex-shrink: 0; }
.feed-tier { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-val { margin-left: auto; }
.feed-mult { font-weight: 600; width: 52px; text-align: right; }

.alert-row { display: flex; align-items: center; gap: 11px; padding: 8px 15px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.alert-row:last-child { border-bottom: none; }
.alert-sig { font-size: 13px; width: 22px; flex-shrink: 0; text-align: center; }
.alert-code { color: var(--ink); width: 122px; }
.alert-detail { color: var(--ink-dim); }
.alert-time { margin-left: auto; color: var(--ink-faint); font-size: 10px; }

.fresh-grails { display: flex; flex-direction: column; }

.pending { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; padding: 22px; color: var(--ink-dim); }
.pending .tag { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--warn); padding: 3px 9px; border-radius: 6px; background: rgba(232, 190, 107, 0.1); }
.pending p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.6; }
.pending code { font-family: var(--mono); color: var(--gold); background: var(--bg-1); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

footer { padding: 18px 30px 34px; text-align: center; font-size: 10.5px; color: var(--ink-faint); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- phone layout (≤560px) ----------
   The board is designed desktop-first; this block tunes it down for phones:
   reclaim side padding, reflow the header, turn the wide data tables into one
   stacked card per machine (zero horizontal scrolling), and enlarge tap targets. */
@media (max-width: 560px) {
  .caveat { padding: 8px 15px; }
  main { padding: 18px 13px 8px; }
  footer { padding: 16px 13px 30px; }
  .block { margin-bottom: 26px; }
  /* fixed backgrounds jank on mobile scroll — let it ride with the page */
  body { background-attachment: scroll; }

  /* header wraps: brand + status share the top row, the 4 stats get their own */
  .topbar { padding: 12px 15px; gap: 11px 16px; flex-wrap: wrap; }
  .topstats { order: 3; flex-basis: 100%; gap: 16px 22px; justify-content: flex-start; }
  .stat { text-align: left; }

  /* don't let the "right now" lead force horizontal overflow on small phones */
  .now-inner { padding: 14px 15px; }
  .now-lead { min-width: 0; }
  .now-caveat, .now-noisy { white-space: normal; }  /* were nowrap → clipped on phones */

  /* a tall sticky header wastes precious vertical space on a phone — let it scroll away
     (freshness is still shown by the heartbeat strip + footer) */
  .topbar { position: static; }

  /* biggest hits: always two per row, even on narrow phones */
  .hits-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* hour chart: tighter gaps so 24 bars have room */
  .time-chart { padding: 14px 12px 10px; }
  .tbars, .tlbls { gap: 2px; }

  /* fatter tap targets for chips & links */
  .hits-chip, .time-chip { padding: 8px 13px; }
  .now-open, .open-link { padding: 9px 16px; }

  /* ---- responsive tables → one card per machine, no sideways scrolling ---- */
  .panel table, .panel tbody, .panel tr, .panel td { display: block; width: auto; }
  .panel thead { display: none; }
  .panel tr {
    border: 1px solid var(--line-soft); border-radius: 11px;
    margin: 9px 8px; background: var(--bg-1); overflow: hidden;
  }
  .panel td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 13px; text-align: right; font-size: 12.5px;
    border-top: none; border-bottom: 1px solid var(--line-soft);
  }
  .panel tr td:last-child { border-bottom: none; }
  .panel td::before {
    content: attr(data-label); flex-shrink: 0; text-align: left;
    color: var(--ink-faint); font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em;
  }
  .restock-note { padding: 10px 10px 4px; }
}

/* ============================================================
   Site toggle (Collector Crypt ⇄ Tilt Rips) + Tilt Rips view
   ============================================================ */
[hidden] { display: none !important; }

.site-toggle {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  padding: 10px 16px; position: relative; z-index: 1;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(18, 24, 22, 0.55), transparent);
}
.site-btn {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink-dim); background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 9px; padding: 7px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.site-btn:hover { color: var(--ink); border-color: var(--line); }
.site-btn.is-on { color: var(--bg-0); background: var(--gold); border-color: var(--gold); }
.site-tag {
  font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; background: rgba(240, 165, 93, 0.2); color: var(--hot);
}
.site-btn.is-on .site-tag { background: rgba(0, 0, 0, 0.18); color: #5a3c12; }

/* Tilt Rips "early data" banner + caveat tint */
.early-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px; padding: 12px 16px; border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.5; color: var(--warn);
  background: repeating-linear-gradient(-45deg, rgba(232, 190, 107, 0.06) 0 14px, transparent 14px 28px);
  border: 1px solid rgba(232, 190, 107, 0.32);
}
.early-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--bg-0);
  background: var(--warn); padding: 3px 9px; border-radius: 6px; flex-shrink: 0;
}
.caveat-early { color: var(--warn); }

/* Tilt Rips odds buckets (value ranges are wider than CC's tier grid) */
.tr-bucket {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; color: var(--ink-dim); padding: 4px 0;
  border-top: 1px solid var(--line-soft);
}
.tr-bucket:first-child { border-top: none; }
.tr-bucket .num { color: var(--ink); font-variant-numeric: tabular-nums; }

/* referral clicks panel */
.ref-panel { padding: 2px 0; }
.ref-row {
  display: grid;
  grid-template-columns: 1fr 52px 52px 62px;
  align-items: center; gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-family: var(--mono);
}
.ref-row:last-child { border-bottom: 0; }
.ref-hd { color: var(--ink-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.ref-foot { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.ref-pack { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-n { text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ref-tot { color: var(--gold-bright); font-weight: 600; }

/* glossed terms — dotted underline signals "hover for a plain-English definition" */
.gloss { border-bottom: 1px dotted var(--ink-faint); cursor: help; text-decoration: none; }
.gloss:hover { border-bottom-color: var(--gold); color: var(--gold-bright); }

/* inline monochrome icons (replace emoji-as-UI) */
.ic { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; }
.logo svg { width: 20px; height: 20px; fill: var(--bg-0); display: block; }
.theme-toggle .ic { width: 15px; height: 15px; vertical-align: middle; }

/* ============================================================
   ACTIVE THEME — "Refined" (adopted 2026-06-30)
   De-glowed, flat, solid panels, single confident gold accent.
   Neutralises the glowy/animated base above. (Future cleanup: fold upward.)
   ============================================================ */
body { background: #0a0f0e; }
body::before, body::after { background: none !important; }          /* drop the radial glow soup + vignette */
*, body.booting .card, body.booting .hit-card { animation: none !important; }  /* no sheen / reveal motion */
body.booting .card, body.booting .hit-card { opacity: 1 !important; }
.card, .panel, .sig-panel, .now-strip, .heat-hero, .hit-card {
  background: #111817; background-image: none !important;
  box-shadow: none !important; border-radius: 10px;
}
.topbar { background: rgba(13, 18, 17, 0.97); backdrop-filter: none; box-shadow: none; border-bottom: 1px solid var(--line-soft); }
.logo { box-shadow: none; }
.topbar h1, .topbar h1 .muted { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ink); }
.topbar h1 .muted { color: var(--gold) !important; }
.card:hover { transform: translateY(-1px); box-shadow: none !important; border-color: var(--line); }
.now-open:hover, .now-hot, .now-hot::before, .hb-dot { box-shadow: none !important; }
.block { margin-bottom: 28px; }

/* ============================================================
   LIGHT THEME — "Daylight" (default; toggle to dark = "night mode")
   Applied via <html data-theme="light">. Dark stays the base :root above.
   ============================================================ */
[data-theme="light"] {
  --bg-0: #f1eee5; --bg-1: #f6f4ee; --panel: #ffffff; --panel-2: #faf8f2;
  --line: #e2dccd; --line-soft: #ece7da;
  --ink: #1b201d; --ink-dim: #586056; --ink-faint: #6f746a;
  --gold: #117a52; --gold-bright: #0f8a5b; --gold-deep: #0c6342;   /* deep-green accent */
  --gold-glow: rgba(17, 122, 82, 0.12);
  --pos: #1a8a5a; --neg: #c2533a; --hot: #d9822b; --warn: #b88a1e;
}
/* surfaces — override the dark ACTIVE-THEME block's hardcoded hex (higher specificity) */
[data-theme="light"] body { background: #f6f4ee; }
[data-theme="light"] .card, [data-theme="light"] .panel, [data-theme="light"] .sig-panel,
[data-theme="light"] .now-strip, [data-theme="light"] .heat-hero, [data-theme="light"] .hit-card {
  background: #ffffff; border-color: #e6e0d2;
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.96); border-bottom-color: #e2dccd; }
[data-theme="light"] .logo { background: var(--gold); color: #fff; }
[data-theme="light"] .topbar h1, [data-theme="light"] .card-name, [data-theme="light"] .block-head h2 { color: var(--ink); }
[data-theme="light"] .topbar h1 .muted { color: var(--gold); -webkit-text-fill-color: var(--gold); }
[data-theme="light"] .now-open { background: var(--gold); color: #fff; }
[data-theme="light"] .site-btn.is-on { background: var(--gold); color: #fff; border-color: var(--gold); }
[data-theme="light"] .caveat, [data-theme="light"] .hint, [data-theme="light"] .card-sub, [data-theme="light"] .sig-sub { color: var(--ink-dim); }
/* green-ify the dark theme's gold-tint decoratives so light mode stays on-palette */
[data-theme="light"] .caveat { background: repeating-linear-gradient(-45deg, rgba(17,122,82,0.05) 0 12px, transparent 12px 24px); }
[data-theme="light"] .group-label::after { background: linear-gradient(90deg, rgba(17,122,82,0.28), transparent); }
[data-theme="light"] .card::before { background: linear-gradient(90deg, transparent, rgba(17,122,82,0.18), transparent); }
[data-theme="light"] .card.fav { border-color: rgba(17,122,82,0.22); }

/* theme toggle button (sun / moon) */
.theme-toggle {
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0; transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold-bright); }
[data-theme="light"] .theme-toggle { border-radius: 8px; }
