:root {
  --bg: #0b0b0c;
  --panel: #161618;
  --panel-2: #1f1f22;
  --text: #f2f2f4;
  --muted: #9a9aa2;
  --accent: #4cc38a;
  --wrong: #e5534b;
  --radius: 16px;
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

body {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 16px) 16px max(env(safe-area-inset-bottom), 16px);
}

header { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.hud { display: flex; align-items: center; gap: 10px; }
.stat { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.icon-btn {
  border: none; background: var(--panel); color: var(--text);
  width: 38px; height: 38px; border-radius: 11px; font-size: 17px; cursor: pointer;
}
.icon-btn:active { background: var(--panel-2); }

.config-pill {
  margin: 14px 0 4px; width: 100%; padding: 11px 14px; border: 1px solid #26262a;
  border-radius: 12px; background: var(--panel); color: var(--muted);
  font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.config-pill:active { background: var(--panel-2); }
.config-pill .edit { color: var(--accent); font-size: 13px; }

main { flex: 1; display: flex; flex-direction: column; gap: 18px; justify-content: flex-start; padding-top: 8px; }

/* ---- player ---- */
.player { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; }
.player-row { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px; }
.play {
  width: 68px; height: 68px; flex: none; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 30% 30%, #2a2a2e, #141416);
  box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  color: var(--accent); display: grid; place-items: center; transition: transform .1s;
}
.play:active { transform: scale(.95); }
.play-icon { font-size: 27px; margin-left: 3px; }
.play.playing .play-icon { font-size: 0; margin-left: 0; }
.play.playing .play-icon::before { content: "❚❚"; font-size: 17px; color: var(--text); }
.replay {
  width: 52px; height: 52px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1px solid #2a2a2e; background: var(--panel); color: var(--text); font-size: 23px;
}
.replay:active { background: var(--panel-2); }

.scrubber { flex: 1; min-width: 0; }
#seek {
  width: 100%; -webkit-appearance: none; appearance: none; height: 6px;
  border-radius: 4px; background: #2a2a2e; cursor: pointer; outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
#seek::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--accent);
}
.times { display: flex; justify-content: space-between; color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 4px; }

.clip-meta { color: var(--muted); font-size: 13px; min-height: 16px; }
/* Compact action bar above the choices: also-calling badge on the left, verdict
   + Next to its right — everything you look at and click stays together. Reserves
   height so the choices don't jump when the verdict appears. Matches the player
   row's width so the badge lands under the play button. */
.actionbar {
  width: 100%; max-width: 440px; margin: 0 auto; min-height: 42px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
/* Non-clickable info badge (count + names), shown only when the clip has
   background birds. Subtle on purpose — glance at it, or ignore it. */
.also-now { min-width: 0; }
.also-now .pill {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  background: rgba(110,168,254,.10); border: 1px solid rgba(110,168,254,.28);
  border-radius: 10px; padding: 6px 11px; font-size: 13px; color: var(--muted);
  line-height: 1.35;
}
.also-now .cnt { flex: none; font-weight: 700; font-size: 13px; color: #6ea8fe; }
.also-now .lbl {
  color: #6ea8fe; text-transform: uppercase; font-size: 10px; letter-spacing: .07em;
  font-weight: 700; flex: none;
}
.also-now .names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- choices ---- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choices.fade { opacity: 0; }
.choices { transition: opacity .18s; }
.choice {
  padding: 16px 12px; border-radius: var(--radius); border: 1px solid #2a2a2e;
  background: var(--panel); color: var(--text); font-size: 16px; font-weight: 500;
  cursor: pointer; min-height: 64px; transition: background .15s, border-color .15s;
}
.choice:active { background: var(--panel-2); }
.choice.correct { background: rgba(76,195,138,.18); border-color: var(--accent); color: #cdebd9; }
.choice.wrong { background: rgba(229,83,75,.16); border-color: var(--wrong); color: #f3c9c6; }
.choice:disabled { cursor: default; }

/* ---- reveal ---- */
.reveal { text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.reveal.hidden, .hidden { display: none; }
/* Verdict + Next as a row inside the action bar, right of the also-calling badge
   — one compact "look here, then click here" cluster. */
.reveal-action { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; }
.reveal-action.hidden { display: none; }   /* beat .reveal-action display:flex */
.reveal-action .verdict { margin-bottom: 0; }
.reveal-action .next { margin-top: 0; padding: 9px 20px; font-size: 15px; }
.verdict {
  align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: 4px;
}
.verdict.right { color: #cdebd9; background: rgba(76,195,138,.18); }
.verdict.miss { color: #f3c9c6; background: rgba(229,83,75,.16); }
.answer { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.sci { color: var(--muted); font-style: italic; font-size: 14px; }

.answer-photo { margin: 10px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.answer-photo.hidden { display: none; }
.answer-photo img {
  max-width: 280px; max-height: 240px; width: auto; height: auto;
  border-radius: 14px; background: var(--panel); box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.answer-photo figcaption { color: #6b6b73; font-size: 10.5px; max-width: 280px; line-height: 1.3; }

.meta-cards { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 380px; margin: 12px 0 4px; }
.meta-card.hidden { display: none; }  /* beat .meta-card display:flex */
.meta-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  background: var(--panel); border: 1px solid #232327; border-radius: 12px; padding: 10px 13px;
  border-left-width: 3px;
}
.meta-card.also { border-left-color: #6ea8fe; }     /* blue — who else is here */
.meta-card.diverge { border-left-color: var(--accent); } /* green — phylogeny */
.meta-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.meta-val { font-size: 14.5px; color: var(--text); line-height: 1.35; }
.meta-card.diverge .meta-val { color: #bfe6d2; }

.attr { color: #6b6b73; font-size: 11.5px; text-decoration: none; max-width: 90%;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #1d1d20; }
.attr:hover { color: var(--text); text-decoration: underline; }
.next {
  margin-top: 14px; padding: 14px 30px; border: none; border-radius: 14px;
  background: var(--accent); color: #06281a; font-size: 16px; font-weight: 650; cursor: pointer;
}
.next:active { filter: brightness(.95); }

footer { margin-top: 18px; display: flex; justify-content: space-between; color: #5d5d65; font-size: 11px; }

/* ---- settings sheet ---- */
.sheet.hidden, .backdrop.hidden, .field.hidden { display: none; }  /* beat display:flex */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9; }
.sheet {
  position: fixed; left: 50%; top: 0; transform: translateX(-50%);
  width: 100%; max-width: 560px; background: #141416; z-index: 10;
  border-radius: 0 0 20px 20px; padding: max(env(safe-area-inset-top), 18px) 18px 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 16px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.done { border: none; background: none; color: var(--accent); font-size: 16px; font-weight: 650; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { color: var(--muted); font-size: 13px; }
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 10px; border: none; border-radius: 11px; background: var(--panel);
  color: var(--muted); font-size: 15px; font-weight: 550; cursor: pointer;
}
.seg-btn.active { background: var(--panel-2); color: var(--text); }
#season, #top {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid #2a2a2e;
  background: var(--panel); color: var(--text); font-size: 15px; -webkit-appearance: none; appearance: none;
}
.hint { margin: 0; color: #6b6b73; font-size: 12px; }
