/* Hot or Not: News Edition */
:root {
  --bg: #0b0d13;
  --bg2: #12151f;
  --panel: #171b27;
  --panel2: #1e2333;
  --line: #2a3045;
  --ink: #eef1f8;
  --ink2: #a6afc4;
  --ink3: #6e7893;

  --hot: #22c98a;
  --hot-dim: #123a2c;
  --not: #f4436a;
  --not-dim: #3d1122;
  --warn: #f5a524;
  --satire: #b57bff;
  --accent: #ff5c39;

  --r: 18px;
  --shadow: 0 24px 60px -18px rgba(0,0,0,.8);
  --card-w: min(400px, calc(100vw - 32px));
  --card-h: min(560px, calc(100vh - 300px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  background:
    radial-gradient(1100px 600px at 12% -8%, #1d2440 0%, transparent 60%),
    radial-gradient(900px 520px at 92% 4%, #33161f 0%, transparent 62%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; }

kbd {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel2); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px;
  padding: 3px 5px; color: var(--ink2);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: rgba(11,13,19,.78);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 40;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; cursor: default; user-select: none; }
.flame { font-size: 20px; filter: drop-shadow(0 0 12px rgba(255,92,57,.6)); }
.brandtext { font-weight: 850; letter-spacing: -.5px; font-size: 19px; }
.slash { color: var(--accent); margin: 0 1px; }
.brandsub {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--ink3); font-weight: 700;
}

.scoreboard { display: flex; gap: 22px; margin-left: auto; }
.stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.statval { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.statlab { font-size: 9px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--ink3); font-weight: 700; }

.tabs { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 11px; border: 1px solid var(--line); }
.tab {
  background: none; border: 0; color: var(--ink2); font: 600 12.5px/1 inherit;
  padding: 8px 13px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--panel2); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }

/* ---------- views ---------- */
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; flex-direction: column; }
#view-deck.active { align-items: center; }

.panel {
  max-width: 820px; margin: 0 auto; padding: 28px 20px 80px;
  width: 100%; overflow-y: auto;
}
.panel h1 { font-size: 27px; letter-spacing: -.6px; margin: 0 0 6px; }
.muted { color: var(--ink2); font-size: 13.5px; }
.secttl {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink3); font-weight: 800; margin: 28px 0 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ttlnote { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink2); font-size: 11.5px; }

/* ---------- deck controls ---------- */
.controls { display: flex; gap: 8px; align-items: center; padding: 14px 16px 6px; flex-wrap: wrap; justify-content: center; }
.ctl {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink2);
  border-radius: 10px; padding: 7px 12px; font: 600 12.5px/1 inherit; cursor: pointer;
  transition: .15s;
}
.ctl:hover { border-color: #3a4260; color: var(--ink); }
.ctl > span:first-child { color: var(--ink3); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.ctl select {
  background: none; border: 0; color: var(--ink); font: 600 12.5px/1 inherit;
  cursor: pointer; outline: none; text-transform: capitalize;
}
.ctl select option { background: var(--panel2); }
.toggle .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink3);
  box-shadow: 0 0 0 3px transparent; transition: .18s;
}
.toggle.active { color: var(--ink); border-color: #4a3a6d; background: #1c1730; }
.toggle.active .dot { background: var(--satire); box-shadow: 0 0 10px var(--satire); }

/* ---------- card stage ---------- */
.stage {
  position: relative; flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 8px 0;
}
.cardstack { position: relative; width: var(--card-w); height: var(--card-h); }

.card {
  position: absolute; inset: 0;
  border-radius: var(--r); overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: flex-end;
  will-change: transform;
  transform-origin: 50% 120%;
  user-select: none;
}
.card.animate { transition: transform .42s cubic-bezier(.2,.7,.3,1), opacity .42s ease; }
.card.top { cursor: grab; }
.card.top.dragging { cursor: grabbing; transition: none; }
.card.gone { opacity: 0; pointer-events: none; }

.card-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.04);
}
.card-img.blur { filter: blur(2px) saturate(.75); }
.card-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(150deg, #232a44 0%, #2f1f38 55%, #3a2230 100%);
}
.card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,8,13,.97) 20%, rgba(6,8,13,.72) 48%, rgba(6,8,13,.18) 78%, rgba(6,8,13,.45) 100%);
}

.card-body { position: relative; padding: 20px; display: flex; flex-direction: column; gap: 11px; }
.card-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font: 700 9.5px/1 inherit; text-transform: uppercase; letter-spacing: 1.2px;
  padding: 5px 8px; border-radius: 6px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
  color: #dbe2f2; backdrop-filter: blur(6px);
}
.chip.mystery { background: rgba(181,123,255,.16); border-color: rgba(181,123,255,.4); color: #d9c2ff; }
.chip.known { background: rgba(255,255,255,.14); }

.card h2 {
  margin: 0; font-size: clamp(19px, 4.6vw, 24px); line-height: 1.24;
  letter-spacing: -.5px; font-weight: 750;
  text-shadow: 0 2px 22px rgba(0,0,0,.8);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.card p.dek {
  margin: 0; font-size: 13px; color: #b9c2d6; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* swipe stamps */
.stamp {
  position: absolute; top: 26px; padding: 8px 16px;
  font: 900 22px/1 inherit; letter-spacing: 2px; text-transform: uppercase;
  border: 4px solid currentColor; border-radius: 10px;
  opacity: 0; transform: rotate(-14deg) scale(.85); pointer-events: none;
  backdrop-filter: blur(2px);
}
.stamp-hot { left: 22px; color: var(--hot); background: rgba(34,201,138,.14); }
.stamp-not { right: 22px; color: var(--not); transform: rotate(14deg) scale(.85); background: rgba(244,67,106,.14); }

/* stacked cards behind */
.card[data-depth="1"] { transform: translateY(14px) scale(.955); filter: brightness(.72); }
.card[data-depth="2"] { transform: translateY(26px) scale(.912); filter: brightness(.5); }
.card[data-depth="3"] { transform: translateY(36px) scale(.875); filter: brightness(.34); opacity: .7; }

/* ---------- loading / empty ---------- */
.loading, .empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 20px; z-index: 5;
}
.loading[hidden], .empty[hidden] { display: none; }
.loading p { margin: 0; font-weight: 650; }
.loading small, .empty p { color: var(--ink3); font-size: 12.5px; max-width: 300px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty h2 { margin: 0; font-size: 22px; }

/* ---------- action buttons ---------- */
/* Sits above the card stack: the lower cards in the stack cast their shadow
   downward and would otherwise wash the buttons out. */
.actions {
  display: flex; gap: 18px; align-items: center; justify-content: center;
  padding: 6px 0 4px; position: relative; z-index: 10;
}
.act {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
}
.act svg { width: 25px; height: 25px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.act-not svg { stroke: var(--not); }
.act-hot svg { stroke: var(--hot); }
.act-undo { width: 46px; height: 46px; }
.act-undo svg { width: 18px; height: 18px; stroke: var(--ink3); }
.act:hover:not(:disabled) { transform: translateY(-2px) scale(1.05); }
.act-not:hover:not(:disabled) { border-color: var(--not); box-shadow: 0 0 24px -6px var(--not); background: var(--not-dim); }
.act-hot:hover:not(:disabled) { border-color: var(--hot); box-shadow: 0 0 24px -6px var(--hot); background: var(--hot-dim); }
.act-undo:hover:not(:disabled) { border-color: var(--ink3); }
.act:disabled { opacity: .35; cursor: default; }
.act:active:not(:disabled) { transform: scale(.93); }

.hint { text-align: center; color: var(--ink3); font-size: 11.5px; margin: 2px 0 14px; }
.hint kbd { margin: 0 1px; }

/* ---------- reveal sheet ---------- */
.sheet-scrim {
  position: fixed; inset: 0; background: rgba(4,6,11,.62);
  backdrop-filter: blur(3px); z-index: 60; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 61; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(560px, 100vw);
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 100%);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -30px 70px -20px rgba(0,0,0,.9);
  animation: slideup .3s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideup { from { transform: translate(-50%, 100%); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 12px; }

.verdictbar {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; border-radius: 11px; margin-bottom: 16px;
  font-weight: 750; font-size: 13.5px; border: 1px solid;
}
.verdictbar.match { background: var(--hot-dim); border-color: #1d6b4d; color: #7ef0c0; }
.verdictbar.miss  { background: var(--not-dim); border-color: #7d2440; color: #ff9ab1; }
.verdictbar.neutral { background: #241a3d; border-color: #4a3a6d; color: #d9c2ff; }
.vb-icon { font-size: 16px; }

.reveal-head { display: flex; gap: 18px; align-items: flex-start; }
.ring-wrap { position: relative; width: 108px; height: 108px; flex: none; }
.ring { width: 108px; height: 108px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring-bg { stroke: var(--panel2); }
.ring-fg { stroke: var(--hot); transition: stroke-dashoffset .7s cubic-bezier(.2,.8,.3,1), stroke .3s; }
.ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1;
}
.ring-score { font-size: 30px; font-weight: 850; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.ring-grade { font-size: 10.5px; font-weight: 800; letter-spacing: 1.6px; color: var(--ink3); margin-top: 4px; }

.src { flex: 1; min-width: 0; padding-top: 2px; }
.src h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.5px; line-height: 1.15; }
.srcmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.badge {
  font: 700 9.5px/1 inherit; text-transform: uppercase; letter-spacing: 1.1px;
  padding: 5px 8px; border-radius: 6px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--ink2);
}
.badge.lean { background: #1b2136; }
.badge.dim { color: var(--ink3); text-transform: none; letter-spacing: 0; font-weight: 600; }
.badge.warn { background: #3a2a12; border-color: #6b4a17; color: var(--warn); }
.srcblurb { margin: 0; font-size: 12.5px; color: var(--ink2); line-height: 1.45; }
.crowd { margin: 9px 0 0; font-size: 12px; color: var(--ink3); }
.crowd b { color: var(--ink2); }

.verdicttext {
  margin: 16px 0 0; font-size: 14.5px; font-weight: 650;
  line-height: 1.45; color: var(--ink);
  padding: 13px 15px; border-radius: 11px;
  background: var(--panel2); border-left: 3px solid var(--accent);
}

/* dimension bars */
.dims { display: flex; flex-direction: column; gap: 9px; }
.dim {
  display: grid; grid-template-columns: 92px 1fr 30px; gap: 10px; align-items: center;
  font-size: 12px;
}
.dim-name { color: var(--ink2); font-weight: 650; }
.dim-track { height: 7px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.2,.8,.3,1); }
.dim-val { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink2); }
.dim-weight { font-size: 9.5px; color: var(--ink3); font-weight: 600; }

/* headline signals */
.signals { display: flex; flex-direction: column; gap: 7px; }
.sig {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
}
.sig-delta {
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 4px 6px; border-radius: 5px; flex: none; min-width: 32px; text-align: center;
}
.sig-delta.up { background: var(--hot-dim); color: var(--hot); }
.sig-delta.down { background: var(--not-dim); color: var(--not); }
.sig-delta.flat { background: #262b3d; color: var(--ink3); }
.sig-body { min-width: 0; }
.sig-label { font-weight: 700; font-size: 12.5px; }
.sig-note { font-size: 11.5px; color: var(--ink3); line-height: 1.4; }
.sig.none { justify-content: center; color: var(--ink3); font-size: 12.5px; }

.readlink {
  display: block; text-align: center; margin: 18px 0 0;
  color: var(--ink2); font-size: 13px; font-weight: 650; text-decoration: none;
  padding: 12px; border: 1px dashed var(--line); border-radius: 11px;
}
.readlink:hover { color: var(--ink); border-color: #3a4260; background: var(--panel2); }

.bigbtn {
  display: block; width: 100%; margin-top: 12px;
  background: var(--accent); border: 0; color: #fff;
  font: 750 14.5px/1 inherit; padding: 15px; border-radius: 12px; cursor: pointer;
  transition: .15s;
}
.bigbtn:hover { filter: brightness(1.1); }
.bigbtn:active { transform: scale(.99); }
.bigbtn kbd { background: rgba(0,0,0,.24); border-color: rgba(255,255,255,.18); color: #fff; margin-left: 6px; }
.bigbtn.ghost { background: none; border: 1px solid var(--line); color: var(--ink2); margin-top: 32px; }
.bigbtn.ghost:hover { border-color: var(--not); color: var(--not); }

/* ---------- stats ---------- */
.bigstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.bigstat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.bigstat .v { font-size: 30px; font-weight: 850; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.bigstat .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink3); font-weight: 700; margin-top: 3px; }
.bigstat .s { font-size: 11.5px; color: var(--ink3); margin-top: 7px; line-height: 1.4; }

.disagree { display: flex; flex-direction: column; gap: 7px; }
.dis-row {
  display: grid; grid-template-columns: 1fr 130px 62px; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px;
}
.dis-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dis-bar { height: 6px; background: var(--panel2); border-radius: 3px; position: relative; }
.dis-bar i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.dis-bar .mid { position: absolute; left: 50%; top: -3px; width: 1px; height: 12px; background: var(--line); }
.dis-val { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }

.gradebars { display: flex; flex-direction: column; gap: 8px; }
.gb-row { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; font-size: 12px; }
.gb-grade { font-weight: 800; color: var(--ink2); }
.gb-track { height: 22px; border-radius: 6px; background: var(--panel); overflow: hidden; display: flex; border: 1px solid var(--line); }
.gb-seg { height: 100%; display: grid; place-items: center; font: 700 10px/1 inherit; color: #04120c; transition: width .5s; }
.gb-seg.hot { background: var(--hot); }
.gb-seg.not { background: var(--not); color: #2b0510; }

/* ---------- sources ---------- */
.search {
  width: 100%; margin: 16px 0 14px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  color: var(--ink); font: 14px inherit; outline: none;
}
.search:focus { border-color: #3a4260; }
.srclist { display: flex; flex-direction: column; gap: 6px; }
.srow {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 13px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 14px;
}
.srow-score {
  font-weight: 850; font-size: 17px; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.srow-name { font-weight: 650; font-size: 13.5px; }
.srow-sub { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.srow-bar { width: 86px; height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.srow-bar i { display: block; height: 100%; border-radius: 3px; }

/* ---------- method ---------- */
.callout {
  background: #241a10; border: 1px solid #5c3f14; border-left: 3px solid var(--warn);
  border-radius: 11px; padding: 14px 16px; margin: 18px 0 6px;
  font-size: 13.5px; line-height: 1.55; color: #f0dcc0;
}
#view-method p { font-size: 13.5px; line-height: 1.6; color: var(--ink2); }
#view-method strong { color: var(--ink); }
.formula { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.frow {
  display: grid; grid-template-columns: 108px 54px 1fr; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 13px;
  font-size: 12.5px;
}
.frow b { font-variant-numeric: tabular-nums; color: var(--accent); }
.frow span:last-child { color: var(--ink3); font-size: 11.5px; }
.donot { color: var(--ink2); font-size: 13.5px; line-height: 1.7; padding-left: 20px; }
.donot li { margin-bottom: 4px; }

.feedhealth { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.fh {
  font: 600 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink3);
}
.fh.ok { color: var(--hot); border-color: #1d6b4d; }
.fh.bad { color: var(--not); border-color: #7d2440; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  /* Budget: topbar 100 + controls 46 + actions 72 + hint 18 + padding.
     dvh keeps the deck whole when mobile browser chrome slides away. */
  :root { --card-h: min(520px, calc(100dvh - 268px)); }
  .topbar { gap: 10px; padding: 8px 12px; }
  .brandsub { display: none; }
  .brandtext { font-size: 17px; }
  .scoreboard { gap: 15px; }
  .statval { font-size: 15px; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tab { flex: 1; text-align: center; padding: 7px 4px; }

  /* Keep the controls on one row so they do not eat the deck's height. */
  .controls { padding: 10px 12px 4px; gap: 6px; flex-wrap: nowrap; }
  .ctl { padding: 7px 10px; font-size: 12px; }
  .ctl > span:first-child { display: none; }   /* the "Beat" label */
  .stage { padding: 4px 0; }
  .act { width: 58px; height: 58px; }
  .act-undo { width: 44px; height: 44px; }
  .card { box-shadow: 0 16px 40px -20px rgba(0,0,0,.8); }
  .sheet { border-radius: 18px 18px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
  .reveal-head { gap: 13px; }
  .ring-wrap, .ring { width: 92px; height: 92px; }
  .ring-score { font-size: 26px; }
  .dim { grid-template-columns: 78px 1fr 28px; }
  .dis-row { grid-template-columns: 1fr 80px 52px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
