/* Pulse — base layout, header nav and footer copied from uni/style.css; Pulse-specific rules at the bottom. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f1f1f4;
  --card: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b73;
  --line: #e6e6ea;
  --correct: #16a34a;
  --wrong: #dc2626;
  --star: #f59e0b;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

html, body { margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 2px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}

.stat-value.bump { transform: scale(1.18); }

.reset-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.reset-btn:hover { color: var(--ink); border-color: #c8c8d0; }

@media (max-width: 480px) {
  .stats { gap: 0.85rem; }
  .reset-btn { display: none; }
}

/* Mobile: compact every vertical block so the answer buttons land
   above the fold on a typical phone (≈ 640–700 px usable viewport).
   Below 380 px the squeeze goes one notch tighter again. */
@media (max-width: 520px) {
  main { padding: 0.75rem 0.75rem 3rem; }
  .review-wrap { padding: 1rem 1rem 0.85rem; gap: 0.5rem; }
  .alumnus-photo { width: 104px; height: 130px; }
  .alumnus-caption { font-size: 0.72rem; }
  .review-text { font-size: 0.95rem; line-height: 1.45; }
  .review-text.collapsed { height: 5rem; }
  .review-meta { font-size: 0.85rem; }
  .stars { font-size: 1.1rem; }
  .review-author-photo { width: 20px; height: 20px; }
  .review-author { font-size: 0.78rem; }
  header { padding: 0.6rem 0.85rem; }
  .brand { font-size: 0.95rem; }
  .stat-value { font-size: 0.9rem; }
  .stat-label { font-size: 0.62rem; }
  .buttons { gap: 0.4rem; padding: 0.5rem; }
  .uni-btn { padding: 0.7rem 0.55rem; font-size: 0.85rem; }
}

@media (max-width: 380px) {
  .alumnus-photo { width: 92px; height: 116px; }
  .review-text.collapsed { height: 4.25rem; }
}

main {
  max-width: 580px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}


.site-footer {
  margin-top: 3rem;
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer .by {
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Shared header nav + footer-row (restored to match Gaff/UK/US look)
   ========================================================================== */
.game-switcher {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  min-width: 0;
}

.game-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  line-height: 1.2;
  transition: border-color .15s ease, background .15s ease;
}

.game-tab:hover { border-color: #c8c8d0; }

.game-tab.active { background: var(--ink); border-color: var(--ink); }

.game-tab-name {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.005em;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}

.game-tab-name:hover { color: var(--ink); }

.game-tab.active .game-tab-name { color: #fff; cursor: default; }
.game-tab.active .game-tab-name:hover { color: #fff; }

.game-tab-name .full { display: inline; }
.game-tab-name .short { display: none; }

.game-tab-sep {
  color: #c8c8d0;
  font-size: 0.85rem;
  user-select: none;
}

.game-tab.active .game-tab-sep { color: rgba(255,255,255,.32); }

.game-tab-stats-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color .15s ease;
}

.game-tab-stats-link:hover { color: var(--ink); }

.game-tab.active .game-tab-stats-link { color: rgba(255,255,255,.7); }
.game-tab.active .game-tab-stats-link:hover { color: #fff; }

@media (max-width: 720px) {
  .game-tab { padding: 0.35rem 0.6rem; gap: 0.35rem; }
  .game-tab-name { font-size: 0.82rem; }
  .game-tab-stats-link { font-size: 0.68rem; }
}

@media (max-width: 520px) {
  .game-tab-name .full { display: none; }
  .game-tab-name .short { display: inline; }
}

.header-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.header-x:hover { transform: scale(1.08); background: #1f1f24; }
.header-x svg { width: 13px; height: 13px; fill: #fff; }

@media (max-width: 480px) {
  .stats { gap: 0.85rem; }
  .reset-btn { display: none; }
  .header-x { width: 28px; height: 28px; }
}

/* ---------- mobile header layout (unified across all four games) ----------
   Tabs on their own horizontally-scrollable row, stats on a second row,
   so the Score/Streak/Best block never overlaps the nav tabs. */
header { flex-wrap: wrap; }

@media (max-width: 720px) {
  .game-switcher {
    order: 1;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .game-switcher::-webkit-scrollbar { display: none; }
  .game-tab { flex: 0 0 auto; }
  .stats {
    order: 2;
    width: 100%;
    justify-content: flex-start;
  }
}

.site-footer .footer-row {
  margin: 1rem auto 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 4px 14px rgba(0,0,0,.04);
}
.site-footer .footer-row a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s ease;
}
.site-footer .footer-row a:hover { color: var(--muted); }
.site-footer .bmc { display: inline-flex; align-items: center; gap: 0.35rem; }
.site-footer .sep { color: var(--line); font-weight: 700; user-select: none; }

/* --- one-line header on desktop (nav scrolls, score stays right); compact stacked header on mobile so vote buttons sit above the fold --- */
header { flex-wrap: nowrap; }
.game-switcher { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.game-switcher::-webkit-scrollbar { display: none; }
.stats { flex: 0 0 auto; }
.game-tab { padding: 0.32rem 0.6rem; }
.game-tab-name { font-size: 0.9rem; }
@media (max-width: 720px) {
  header { flex-wrap: wrap; padding: 0.45rem 1rem; gap: 0.35rem; }
  .game-switcher { width: 100%; order: 1; }
  .stats { width: 100%; order: 2; gap: 0.7rem; }
  .stat { flex-direction: row; align-items: baseline; gap: 0.28rem; line-height: 1; }
  .stat-label { font-size: 0.62rem; }
  .stat-value { font-size: 0.9rem; margin-top: 0; }
  .reset-btn { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
  main { padding: 0.85rem 1rem 4rem; }
}
/* --- More games dropdown --------------------------------------------- */
.game-more { position: relative; flex: 0 0 auto; }
.game-more > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 0.3rem;
  padding: 0.4rem 0.75rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); line-height: 1.2;
  font-weight: 700; font-size: 0.9rem; color: var(--muted);
  white-space: nowrap; transition: border-color .15s ease, color .15s ease;
}
.game-more > summary::-webkit-details-marker { display: none; }
.game-more > summary:hover { border-color: #c8c8d0; color: var(--ink); }
.game-more[open] > summary { border-color: #c8c8d0; color: var(--ink); }
.game-more.active > summary { background: var(--ink); border-color: var(--ink); color: #fff; }
.game-more .more-caret { font-size: 0.7rem; transition: transform .15s ease; }
.game-more[open] .more-caret { transform: rotate(180deg); }
.game-more-panel {
  position: fixed;
  display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.5rem; box-shadow: 0 10px 28px rgba(0,0,0,.12);
  z-index: 60; min-width: 200px;
}
.game-more-panel .game-tab { display: flex; }
.game-more-panel .game-tab-name .full { display: inline; }
.game-more-panel .game-tab-name .short { display: none; }
/* --------------------------------------------------------------------- */

/* ==========================================================================
   Pulse
   ========================================================================== */
:root {
  --bullseye: #16a34a;
  --close:    #ca8a04;
  --ballpark: #ea580c;
  --wayoff:   #dc2626;
  --crowd:    #0087DC;
}

.pulse-card { padding: 1.5rem 1.4rem 1.6rem; }
.pulse-kicker {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
}
.pulse-kicker .day { color: var(--ink); }
.pulse-question {
  font-size: 1.45rem; line-height: 1.25; font-weight: 800; letter-spacing: -0.015em;
  margin: 0 0 1.25rem; text-wrap: balance;
}
.pulse-intro { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.25rem; }

.guess-form { display: flex; flex-direction: column; gap: 0.6rem; }
.guess-field {
  display: flex; align-items: center; gap: 0.4rem;
  border: 2px solid var(--line); border-radius: 12px; padding: 0.2rem 0.9rem;
  background: #fafafb; transition: border-color .15s ease;
}
.guess-field:focus-within { border-color: var(--ink); background: #fff; }
.guess-field .affix { font-weight: 700; color: var(--muted); font-size: 1.1rem; white-space: nowrap; }
.guess-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.6rem; font-weight: 800; padding: 0.55rem 0;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.guess-preview { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.guess-preview.err { color: var(--wrong); }
.btn-primary {
  appearance: none; border: 0; border-radius: 12px; background: var(--ink); color: #fff;
  font: inherit; font-weight: 800; font-size: 1.05rem; padding: 0.9rem 1rem; cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.guess-note { font-size: 0.78rem; color: var(--muted); text-align: center; margin: 0.2rem 0 0; }

/* reveal */
.truth { margin: 0.25rem 0 1.25rem; }
.truth-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.truth-value { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.truth-source { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }
.truth-source a { color: var(--ink); }

.scale { position: relative; height: 64px; margin: 1.6rem 0.4rem 1.1rem; }
.scale-line { position: absolute; left: 0; right: 0; top: 29px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--wayoff) 0%, var(--ballpark) 20%, var(--close) 38%, var(--bullseye) 50%, var(--close) 62%, var(--ballpark) 80%, var(--wayoff) 100%); opacity: .35; }
.scale-mark { position: absolute; top: 0; width: 0; height: 64px; }
.scale-mark .dot { position: absolute; top: 24px; left: -7px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); box-sizing: border-box; }
.scale-mark .lbl { position: absolute; top: 2px; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.scale-mark.below .lbl { top: 44px; }
.scale-mark.truth-mark .dot { background: var(--ink); }
.scale-mark.me .dot { background: #7c3aed; }
.scale-mark.me .lbl { color: #7c3aed; }
.scale-mark.crowd .dot { background: var(--crowd); }
.scale-mark.crowd .lbl { color: var(--crowd); }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--muted); margin: 0 0.2rem 1rem; }

.result-rows { display: grid; gap: 0.6rem; margin-bottom: 1.2rem; }
.result-row { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.8rem; align-items: baseline;
  border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.9rem; }
.result-row .who { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.result-row .num { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-row .band { grid-row: span 2; align-self: center; font-weight: 800; font-size: 0.9rem; padding: 0.35rem 0.6rem; border-radius: 8px; color: #fff; white-space: nowrap; }
.result-row .off { font-size: 0.8rem; color: var(--muted); }
.band.bullseye { background: var(--bullseye); }
.band.close    { background: var(--close); }
.band.ballpark { background: var(--ballpark); }
.band.wayoff   { background: var(--wayoff); }
.crowd-note { font-size: 0.85rem; color: var(--muted); margin: -0.4rem 0 1.2rem; }

.share-box { background: #f6f6f8; border: 1px dashed #c8c8d0; border-radius: 12px; padding: 0.9rem 1rem; margin-bottom: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; white-space: pre-line; line-height: 1.5; }
.share-actions { display: flex; gap: 0.5rem; }
.share-actions .btn-primary { flex: 1; }
.share-actions .btn-ghost { flex: 1; }
.btn-ghost { appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0.9rem 1rem;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.btn-ghost:hover { border-color: #c8c8d0; }

.next-up { text-align: center; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.next-up .cd { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.next-up .cd-label { font-size: 0.8rem; color: var(--muted); }
.next-up a { display: inline-block; margin-top: 0.6rem; font-size: 0.85rem; color: var(--ink); font-weight: 600; }

.pulse-how { margin: 1.5rem 0.2rem 0; font-size: 0.85rem; color: var(--muted); }
.pulse-how h2 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.5rem; }
.pulse-how ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.pulse-how .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.45rem; vertical-align: -1px; }

.pulse-empty { text-align: center; padding: 2.5rem 1.4rem; }
.pulse-empty h1 { font-size: 1.4rem; margin: 0 0 0.5rem; }
.pulse-empty p { color: var(--muted); margin: 0; }
[hidden] { display: none !important; }

/* virality pass */
.insight { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 0.35rem; text-wrap: balance; }
.beat { margin: -0.4rem 0 1.1rem; font-weight: 800; font-size: 1rem; color: #7c3aed; }
.guess-social { text-align: center; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin: 0.1rem 0 0; }
.share-actions { flex-wrap: wrap; }
.share-actions .btn-primary { flex: 1 1 100%; }
.btn-share { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0.8rem 0.6rem;
  font-weight: 800; font-size: 0.92rem; text-decoration: none; color: #fff; white-space: nowrap; }
.btn-share.wa { background: #25D366; }
.btn-share.x  { background: #0a0a0a; }
.share-actions .btn-ghost { flex: 1 1 0; padding: 0.8rem 0.6rem; }
.share-hint { font-size: 0.75rem; color: var(--muted); text-align: center; margin: 0.5rem 0 0; }

/* explainer */
.pulse-what { font-size: 0.9rem; color: var(--muted); line-height: 1.45; margin: -0.3rem 0 1rem; padding: 0.7rem 0.85rem; background: #f6f6f8; border-radius: 10px; }
.pulse-what a { color: var(--ink); font-weight: 600; }
.pulse-about { margin-top: 2rem; }
.pulse-about .about-lede { color: var(--ink); font-size: 0.95rem; line-height: 1.5; margin: 0 0 0.8rem; }
.pulse-about .about-why { gap: 0.45rem; margin-bottom: 0.8rem; }
.pulse-about .about-why li { line-height: 1.45; }
.pulse-about .about-why b { color: var(--ink); }
#about { scroll-margin-top: 90px; }
