/* ═══════════════════════════════════════════════════════════
   ANODAILIES: the "Crimson Noir" theme. A detective's case file at night:
   near-black, bone-white paper, one deep crimson. Typewriter fonts, case-folder
   cards with red pins, stamps, and a flashlight that follows the cursor.
   (The accent variables are still called --cyan / --violet / --pink from the old
   theme; they now hold crimson, bone and light crimson.)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #09090b;
  --surface: rgba(22, 20, 23, 0.82);
  --solid: #121114;
  --surface-2: #1f1b1f;
  --line: #2e2528;
  --line-2: #523236;
  --text: #ece4dc;
  --text-2: #b6aba7;
  --text-3: #8c807d;

  --gold: #efe6dc;     /* "perfect" and first place: bone white (no yellow anywhere) */
  --warn: #ff9a4d;
  --cyan: #e0384d;     /* the main accent: crimson (the name is left over from the old theme) */
  --violet: #d8d0c8;   /* the second accent: bone */
  --pink: #ff6b7a;     /* a lighter crimson */
  --ok: #4ade9f;
  --bad: #ff7b6b;

  color-scheme: dark; /* dark scrollbars and no white flash while a page loads */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Courier Prime', 'Courier New', monospace;                 /* body text: typewriter */
  --font-display: 'Special Elite', 'Courier Prime', monospace;       /* titles and the wordmark */
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; /* dense screens (admin) */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* body stays transparent: the page colour is on html, so the background layers below can show */
body { position: relative; display: flex; flex-direction: column; font-family: var(--font); color: var(--text); min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; }

/* ── Background: Crimson Noir ───────────────────────────
   Faint paper grain, a dark crimson glow at the top and a vignette. A soft flashlight
   follows the cursor (common.js sets --mx / --my). All plain CSS, so it is painted on the
   very first frame of every page: no flash when moving between pages. */
html::before { /* glow, vignette and grain */
  content: ''; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(ellipse 85% 75% at 50% 35%, transparent 40%, rgba(0, 0, 0, 0.62) 100%),
    radial-gradient(ellipse 60% 26% at 50% 0%, rgba(224, 56, 77, 0.16), transparent 72%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px);
}
html::after { /* the flashlight */
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(circle 260px at var(--mx, 50%) var(--my, 14%), rgba(224, 56, 77, 0.11), transparent 70%);
}
body::before, body::after { content: none; }

/* Smooth cross-fade when moving between pages (Chrome/Edge; others just ignore it) */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 0.18s; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h1, h2, .brand, .card-title, .game-text b { font-family: var(--font-display); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(216, 208, 200, 0.45); }

.page { width: 100%; max-width: 680px; margin: 0 auto; padding: 20px 20px 56px; }
.muted { color: var(--text-3); }
.small { font-size: 0.88rem; }
.center { text-align: center; }

/* Gentle entrance */
.rise { animation: rise 0.5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ── Top bar ─────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 14px; padding: 4px 0 22px; }
.back-link + .brand { margin: 0 auto; }   /* game pages: back link left, brand in the middle, account right */
/* the group at the top right: account · language · speaker */
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-right .account { order: 1; }
.lang-toggle { order: 2; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.lang-toggle button { padding: 5px 10px; border: 0; border-radius: 999px; background: none; color: var(--text-3); font: inherit; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; cursor: pointer; transition: background 0.2s, color 0.2s; }
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.is-on { background: var(--violet); color: #14102a; }
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.back-link { color: var(--text-2); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── Shared parts ────────────────────────────────────── */
.card + .card { margin-top: 14px; }
.gs-input .guess-form { margin-top: 0; }
.card { backdrop-filter: blur(4px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.75); }
.q-card { border-top: 3px solid var(--cyan); }
.q-card--violet { border-top-color: var(--violet); }
.q-card--pink { border-top-color: var(--pink); }
.q-card--cyan { border-top-color: var(--cyan); }
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: var(--cyan); background: rgba(224, 56, 77, 0.1); }
.tag--violet { color: var(--violet); background: rgba(216, 208, 200, 0.14); }
.tag--pink { color: var(--pink); background: rgba(255, 107, 122, 0.14); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.dots i.is-on { background: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font-weight: 700; font-size: 0.96rem; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { background: var(--cyan); border-color: var(--cyan); color: #fff; box-shadow: 0 0 22px -6px rgba(224, 56, 77, 0.75); }
.btn--primary:hover:not(:disabled) { background: #f0566a; border-color: #f0566a; }
.btn--danger { color: var(--bad); border-color: rgba(255, 123, 107, 0.5); }
.btn--danger:hover:not(:disabled) { background: rgba(255, 123, 107, 0.1); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 0.86rem; border-radius: 10px; }

.input, .field-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; font: inherit; color: var(--text);
  background: #06050b; border: 2px solid var(--line-2); transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder, .field-input::placeholder { color: var(--text-3); }
.input:focus, .field-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(224, 56, 77, 0.16); }
.gs-input .input { border-color: rgba(216, 208, 200, 0.55); }
.gs-input .input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(216, 208, 200, 0.2); }
.input--big { height: 56px; font-size: 1.2rem; font-weight: 700; }

/* ── Hub ─────────────────────────────────────────────── */
.hero { padding: 4px 0 34px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 15px 6px 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pink); background: rgba(255, 107, 122, 0.12); border: 1px solid rgba(255, 107, 122, 0.35); }
.eyebrow svg { width: 14px; height: 14px; fill: currentColor; }
/* the wordmark is a two-tone neon sign: cyan glow on "Ano", violet + pink glow on "Dailies" */
.wordmark { margin: 20px 0 12px; font-family: var(--font-display); font-size: clamp(3.3rem, 15vw, 5.8rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-shadow: 0 0 26px rgba(224, 56, 77, 0.42); }
.wordmark span { font-style: italic; color: #c4b5fd; text-shadow: 0 0 6px #d8d0c8, 0 0 24px rgba(216, 208, 200, 0.6), 0 0 52px rgba(255, 107, 122, 0.38); animation: neon-flicker 7s ease-in-out infinite; }
@keyframes neon-flicker { 0%, 44%, 52%, 100% { opacity: 1; } 46% { opacity: 0.8; } 48% { opacity: 1; } 50% { opacity: 0.88; } }
.tagline { max-width: 32ch; margin: 0 auto; color: var(--text-2); font-size: clamp(1rem, 2.8vw, 1.2rem); font-weight: 500; }
.hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 0.88rem; font-weight: 700; }
.pill svg { width: 16px; height: 16px; color: var(--cyan); flex: none; }
.pill b { color: var(--text); font-variant-numeric: tabular-nums; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 14px; }
.section-head h2 { font-size: 1.3rem; }
.progress-pips { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 0.86rem; font-weight: 700; }
.pips { display: inline-flex; gap: 5px; }
.pip { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); transition: background 0.4s; }
.pip.is-done { background: var(--ok); }

.done-banner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; margin-bottom: 14px; padding: 22px; border-radius: 20px; border: 1px solid rgba(74, 222, 159, 0.38); background: linear-gradient(135deg, rgba(74, 222, 159, 0.12), rgba(224, 56, 77, 0.05)); }
.done-icon { flex: none; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: var(--ok); background: rgba(74, 222, 159, 0.14); animation: float 3.2s ease-in-out infinite; }
.done-icon svg { width: 30px; height: 30px; }
@keyframes float { 50% { transform: translateY(-4px) rotate(-4deg); } }
.done-text { min-width: 0; }
.done-banner .btn { grid-column: 1 / -1; }
.done-text h3 { font-size: 1.3rem; }
.done-text p { margin-top: 2px; color: var(--text-2); }
.done-results { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(5, 4, 10, 0.4); border: 1px solid var(--line-2); font-size: 0.86rem; color: var(--text-2); font-weight: 700; }
.chip b { color: var(--text); font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip small { color: var(--text-3); font-weight: 700; }
.done-banner .btn { gap: 10px; }
.done-banner .btn svg, .game-status svg { width: 18px; height: 18px; flex: none; }

.game-list { display: grid; grid-template-columns: 1fr; gap: 12px; } /* one button per row */
.game-card { position: relative; display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 26px 18px 16px; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  backdrop-filter: blur(4px); box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.75); transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s; }
/* marquee light bulbs along the top edge: two rows that blink in turn */
.game-card::before, .game-card::after { content: ''; position: absolute; top: 7px; height: 7px; pointer-events: none; animation: bulbs 1.4s steps(1) infinite; }
.game-card::before { left: 14px; right: 14px; background: radial-gradient(circle, var(--bulb-a) 2px, transparent 2.7px) 0 0 / 14px 7px; }
.game-card::after { left: 21px; right: 7px; background: radial-gradient(circle, var(--bulb-b) 2px, transparent 2.7px) 0 0 / 14px 7px; animation-direction: reverse; }
@keyframes bulbs { 50% { opacity: 0.15; } }
.game-card--cyan { --accent: var(--cyan); --accent-soft: rgba(224, 56, 77, 0.12); --bulb-a: #e0384d; --bulb-b: #d8d0c8; }
.game-card--violet { --accent: var(--violet); --accent-soft: rgba(216, 208, 200, 0.14); --bulb-a: #ff6b7a; --bulb-b: #d8d0c8; }
.game-card--fuchsia { --accent: var(--pink); --accent-soft: rgba(255, 107, 122, 0.14); --bulb-a: #ff6b7a; --bulb-b: #e0384d; }
a.game-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 20px 40px -22px var(--accent); text-decoration: none; }
.game-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); transition: transform 0.3s var(--ease); }
.game-icon svg { width: 22px; height: 22px; }
a.game-card:hover .game-icon { transform: rotate(-7deg) scale(1.08); }
.game-text { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
.game-text b { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.015em; }
.game-status { display: inline-flex; align-items: center; gap: 7px; align-self: center; margin-left: auto; padding: 8px 16px; border-radius: 999px; font-size: 0.84rem; font-weight: 800; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.game-status.play { background: var(--accent); color: #fff; transition: gap 0.2s; }
a.game-card:hover .game-status.play { gap: 10px; }
.game-status.done { color: var(--ok); background: rgba(74, 222, 159, 0.1); }
.game-card.is-idle { opacity: 0.55; border-style: dashed; }
.reset-line, .next-line { margin-top: 28px; text-align: center; font-size: 0.92rem; }
.reset-line b, .next-line b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Footer (public/js/common.js adds it to every page) ── */
.site-footer { margin-top: auto; padding: 0 20px 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 680px; margin: 0 auto; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.84rem; font-weight: 600; }
.coffee-row { display: flex; justify-content: center; margin-bottom: 16px; }
.coffee-btn { display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 800; color: #1c1405; background: linear-gradient(135deg, #efe6dc, #ffb347); box-shadow: 0 6px 22px rgba(255, 190, 80, 0.25); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.coffee-btn svg { width: 18px; height: 18px; }
.coffee-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 190, 80, 0.38); text-decoration: none; }
.footer-copy { justify-self: start; }
.footer-made { justify-self: end; }
.footer-made b { color: var(--text-2); font-weight: 800; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.footer-social a:hover { color: var(--text); border-color: var(--violet); transform: translateY(-2px); text-decoration: none; }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Speaker button (shown only when sounds are set in public/js/sounds.js) ── */
.sound-btn { order: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s; }
.sound-btn:hover { color: var(--text); border-color: var(--violet); }
.sound-btn.is-muted { color: var(--text-3); }
.sound-btn svg { width: 18px; height: 18px; }

/* ── Question card (both games) ──────────────────────── */
.q-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.q-title { font-size: clamp(1.3rem, 4vw, 1.65rem); line-height: 1.35; margin-bottom: 14px; }
.q-media { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
/* A picture, shown whole in a neon frame. --w is its size as a share of the card (set per puzzle in the admin). */
.pic { width: var(--w, 100%); max-width: 100%; margin: 4px auto 16px; padding: 5px; border-radius: 18px; background: linear-gradient(135deg, var(--cyan), var(--violet), var(--pink)); box-shadow: 0 16px 40px -18px rgba(216, 208, 200, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04); }
.pic img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; border-radius: 13px; background: var(--bg); }
.guess-form { display: flex; gap: 10px; margin-top: 18px; }
.guess-field { position: relative; flex: 1; }
.guess-field .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 700; pointer-events: none; }
.guess-field:has(.unit) .input { padding-right: 90px; }
.guess-form .btn { height: 56px; padding: 0 26px; }
.preview { margin-top: 10px; min-height: 22px; font-variant-numeric: tabular-nums; }
.preview.is-bad { color: var(--bad); }
.status-line { display: flex; justify-content: space-between; margin: 16px 4px 12px; color: var(--text-3); font-size: 0.88rem; font-weight: 700; }

/* ── Estimation rows ─────────────────────────────────── */
.history { display: flex; flex-direction: column; gap: 10px; }
.g-row {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  opacity: 0; transform: translateY(-8px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.g-row.is-in { opacity: 1; transform: none; }
.g-row.is-full { border-color: var(--ok); }
.g-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: var(--text-2); background: var(--surface-2); }
.g-val { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; word-break: break-all; }
.g-val small { font-size: 0.82rem; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.g-note { font-size: 0.86rem; color: var(--text-2); margin-top: 1px; }
.g-row.is-full .g-note { color: var(--ok); }
.meter { height: 5px; margin-top: 9px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--cyan); transition: width 0.9s var(--ease) 0.15s; }
.is-in .meter i, .sum-row .meter i { width: var(--w); }
.g-row.is-full .meter i { background: var(--ok); }
.g-pts { text-align: right; line-height: 1.1; }
.g-pts b { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.g-pts span { font-size: 0.75rem; color: var(--text-3); font-weight: 700; }

.hints { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; align-items: flex-start; }
.hint { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 11px 14px; border-radius: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); font-size: 0.94rem; }
.hint span { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; background: var(--violet); color: #14102a; }
.hint.is-new { animation: rise 0.4s var(--ease); }

/* ── Game Show: ranked list ──────────────────────────── */
.gs-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.gs-count { color: var(--text-2); font-weight: 600; }
.gs-count b { color: var(--text); font-size: 1.5rem; font-weight: 800; margin-right: 2px; }
.strikes { display: flex; gap: 8px; }
.strike { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: transparent; border: 1.5px solid var(--line-2); transition: background 0.25s, border-color 0.25s, color 0.25s; }
.strike.is-hit { color: #fff; background: var(--bad); border-color: var(--bad); animation: pop 0.4s var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }
.progress { height: 5px; margin-top: 14px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--w); background: var(--violet); border-radius: inherit; transition: width 0.6s var(--ease); }

.board { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.slot { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px; border-radius: 14px; background: var(--solid); border: 2px solid var(--line-2); transition: background 0.5s var(--ease), border-color 0.5s var(--ease); }
.slot-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.82rem; font-weight: 800; color: var(--text-2); background: var(--line); transition: background 0.4s, color 0.4s; }
.slot-blank { flex: 1; height: 0; border-top: 2px dashed rgba(160, 155, 189, 0.4); transition: opacity 0.3s; }
.slot-text { position: absolute; left: 60px; right: 16px; display: flex; flex-direction: column; line-height: 1.25; opacity: 0; transform: translateY(8px); transition: opacity 0.45s var(--ease) 0.1s, transform 0.45s var(--ease) 0.1s; pointer-events: none; }
.slot-text b { font-size: 1.02rem; font-weight: 800; }
.slot-text small { margin-top: 2px; font-size: 0.8rem; color: var(--text-2); }
.slot.is-open { background: rgba(216, 208, 200, 0.16); border-color: var(--violet); }
.slot.is-open .slot-n { background: var(--violet); color: #14102a; }
.slot.is-open .slot-blank { opacity: 0; }
.slot.is-open .slot-text { opacity: 1; transform: none; }
.slot.is-missed { background: rgba(255, 123, 107, 0.1); border-color: rgba(255, 123, 107, 0.65); }
.slot.is-missed .slot-n { background: var(--bad); color: #fff; }
.slot.is-pulse { animation: pulse 0.5s var(--ease); }
@keyframes pulse { 40% { transform: scale(1.015); border-color: var(--text); } }

.feedback { min-height: 28px; margin-top: 12px; font-weight: 600; color: var(--text-2); }
.feedback .fb { display: inline-block; animation: rise 0.35s var(--ease); }
.feedback.is-ok { color: var(--ok); }
.feedback.is-bad { color: var(--bad); }
.feedback.is-suggest { color: var(--cyan); }
.suggest { margin-left: 8px; padding: 3px 11px; border-radius: 8px; border: 0; font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; color: #fff; background: var(--cyan); }
.wrong-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wrong-chip { padding: 4px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 700; text-decoration: line-through; color: var(--bad); background: rgba(255, 123, 107, 0.1); animation: rise 0.35s var(--ease); }

/* ── Results, stats, summary ─────────────────────────── */
#after { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.result { text-align: center; padding: 30px 24px; }
.score { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.score span { font-size: clamp(3.4rem, 14vw, 5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.score small { color: var(--text-3); font-weight: 700; font-size: 1rem; }
.result-sub { color: var(--text-2); font-weight: 600; }
.answer-box { display: inline-flex; flex-direction: column; gap: 2px; margin-top: 20px; padding: 12px 22px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.answer-box span { font-size: 0.78rem; color: var(--text-3); font-weight: 700; }
.answer-box b { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.answer-box small { font-size: 0.85rem; color: var(--text-3); font-weight: 600; }
.note { max-width: 50ch; margin: 18px auto 0; color: var(--text-2); }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stats b, .you b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stats span, .you span { font-size: 0.8rem; color: var(--text-3); font-weight: 700; }
.dist-title { margin: 22px 0 10px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0; color: var(--text-3); }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 44px 1fr 28px; gap: 10px; align-items: center; font-size: 0.82rem; font-weight: 700; color: var(--text-3); }
.dist-track { height: 18px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.dist-track i { display: block; height: 100%; width: 0; min-width: 3px; border-radius: 6px; background: var(--line-2); transition: width 0.8s var(--ease) 0.2s; }
.is-in .dist-track i { width: var(--w); }
.dist-row.is-mine { color: var(--text); }
.dist-row.is-mine .dist-track i { background: var(--cyan); }
.dist-count { text-align: right; }

.summary { text-align: center; padding: 30px 24px; }
.summary h1 { font-size: 1.7rem; margin: 4px 0 14px; }
.total { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-variant-numeric: tabular-nums; }
.total b { font-size: clamp(3.6rem, 15vw, 5.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.total span { color: var(--text-3); font-weight: 700; font-size: 1.1rem; }
.total-sub { color: var(--text-2); font-weight: 600; margin-top: 4px; }
.sum-list { list-style: none; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.sum-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.sum-row.is-todo { border-style: dashed; }
.sum-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: var(--text-2); background: var(--surface-2); }
.sum-main b { display: block; font-weight: 800; }
.sum-main small { color: var(--text-3); font-weight: 600; font-size: 0.84rem; }
.sum-score { text-align: right; }
.sum-score b { font-size: 1.5rem; font-weight: 800; }
.sum-score small { color: var(--text-3); font-weight: 700; font-size: 0.8rem; margin-left: 2px; }
.you { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: center; }
.next-line { text-align: center; margin-top: 18px; font-weight: 600; }

.empty { text-align: center; padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 1.35rem; }
.empty p { color: var(--text-2); max-width: 40ch; }
.empty .btn { margin-top: 8px; }

/* ── Streak chip (top-left of every page) ─────────────────── */
.streak-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px; background: rgba(255, 154, 77, 0.1); border: 1px solid rgba(255, 154, 77, 0.4); color: var(--warn); font-weight: 800; font-size: 0.92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.streak-chip.is-zero { background: var(--surface); border-color: var(--line-2); color: var(--text-3); }

/* ── Account: top-bar button, login and profile pages ────── */
.account { display: flex; align-items: center; gap: 12px; }
.account-link { font-size: 0.85rem; font-weight: 800; color: var(--violet); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; max-width: 190px; padding: 0 14px 0 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-weight: 700; font-size: 0.88rem; white-space: nowrap; transition: border-color 0.2s; }
.account-chip:hover { border-color: var(--violet); text-decoration: none; }
.account-chip i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.75rem; font-weight: 800; background: var(--violet); color: #14102a; }

.auth-card { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8vh; padding: 38px 24px; text-align: center; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card p { color: var(--text-2); max-width: 36ch; }
.google-btn { display: flex; justify-content: center; min-height: 44px; margin-top: 6px; }
.auth-card .skip { margin-top: 6px; font-size: 0.9rem; font-weight: 600; color: var(--text-3); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; background: var(--violet); color: #14102a; }
.profile-head h1 { font-size: 1.45rem; }
.profile-head p { color: var(--text-3); font-size: 0.88rem; word-break: break-all; }
.profile-head .btn { margin-left: auto; }
.card-title { font-size: 1.1rem; margin-bottom: 4px; }
.nick-form { display: flex; gap: 10px; margin-top: 14px; }
.nick-form .input { flex: 1; }
.nick-form .btn { height: 48px; }
.nick-warning { margin-top: 8px; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; color: var(--warn); background: rgba(255, 154, 77, 0.08); border: 1px solid rgba(255, 154, 77, 0.3); }
.nick-warning b { font-weight: 800; }
.nick-locked { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.nick-locked b { font-size: 1.3rem; font-weight: 800; }
.nick-locked span { color: var(--text-3); font-size: 0.86rem; }
.nick-form .input[readonly] { border-color: var(--warn); }
.nick-msg { margin-top: 10px; min-height: 22px; font-size: 0.86rem; color: var(--text-3); }
.nick-msg.is-bad { color: var(--bad); }
.nick-msg.is-ok { color: var(--ok); }
.profile-stats + .dist-title { margin-top: 24px; }
.sum-row--hist { grid-template-columns: 76px 1fr auto; }
.hist-date { font-size: 0.82rem; font-weight: 800; color: var(--text-2); }
.more-btn { margin: 14px auto 0; display: flex; }

/* ── Estimation result: colour = how close you were ───────── */
.result .verdict { display: inline-block; margin-bottom: 4px; padding: 4px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; }
.tier-red { border-top: 3px solid var(--bad); }
.tier-red .verdict { color: var(--bad); background: rgba(255, 123, 107, 0.12); }
.tier-red .score span, .tier-red .result-sub b { color: var(--bad); }
.tier-yellow { border-top: 3px solid var(--warn); }
.tier-yellow .verdict { color: var(--warn); background: rgba(255, 154, 77, 0.12); }
.tier-yellow .score span, .tier-yellow .result-sub b { color: var(--warn); }
.tier-green { border-top: 3px solid var(--ok); }
.tier-green .verdict { color: var(--ok); background: rgba(74, 222, 159, 0.12); }
.tier-green .score span, .tier-green .result-sub b { color: var(--ok); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; text-align: left; }
.compare-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.compare-box span { font-size: 0.78rem; color: var(--text-3); font-weight: 700; }
.compare-box b { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-all; }
.compare-box small { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.compare-box--answer { border-color: var(--line-2); }
.tier-red .compare-box:first-child { border-color: rgba(255, 123, 107, 0.55); }
.tier-yellow .compare-box:first-child { border-color: rgba(255, 154, 77, 0.55); }
.tier-green .compare-box:first-child { border-color: rgba(74, 222, 159, 0.55); }

/* the guess rows */
.g-row.tier-red .meter i { background: var(--bad); }
.g-row.tier-yellow .meter i { background: var(--warn); }
.g-row.tier-green .meter i, .g-row.tier-gold .meter i { background: var(--ok); }
.g-row.tier-red .g-pts b { color: var(--bad); }
.g-row.tier-yellow .g-pts b { color: var(--warn); }
.g-row.tier-green .g-pts b { color: var(--ok); }
.g-row.tier-gold { border-color: var(--gold); }
.g-row.tier-gold .g-pts b { color: var(--gold); }

/* PERFECT: gold, sparkles, a little celebration */
.result.tier-gold { position: relative; overflow: hidden; border: 1px solid rgba(239, 230, 220, 0.65); border-top: 3px solid var(--gold); background: rgba(239, 230, 220, 0.05);
  box-shadow: 0 0 0 1px rgba(239, 230, 220, 0.2), 0 0 44px -10px rgba(239, 230, 220, 0.5);
  animation: gold-pop 0.9s var(--ease) backwards, gold-glow 2.6s ease-in-out 0.9s infinite; }
.tier-gold .verdict { color: #1b1514; background: var(--gold); }
.tier-gold .score span { background: linear-gradient(100deg, #fffaf3 20%, #efe6dc 42%, #fffaf3 50%, #efe6dc 58%, #efe6dc 80%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2.4s linear infinite; }
.tier-gold .result-sub { color: var(--gold); }
.tier-gold .compare-box:first-child { border-color: rgba(239, 230, 220, 0.6); }
.tier-gold > *:not(.sparkles) { position: relative; z-index: 1; }
.sparkles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sparkle { position: absolute; width: var(--s); height: var(--s); background: var(--gold); opacity: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle var(--d) ease-in-out var(--delay) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); } 50% { opacity: 0.95; transform: scale(1) rotate(45deg); } }
@keyframes shimmer { to { background-position: -250% 0; } }
@keyframes gold-pop { 0% { transform: scale(0.93); opacity: 0; } 55% { transform: scale(1.025); opacity: 1; } 100% { transform: none; } }
@keyframes gold-glow { 50% { box-shadow: 0 0 0 1px rgba(239, 230, 220, 0.4), 0 0 62px -4px rgba(239, 230, 220, 0.65); } }
@media (prefers-reduced-motion: reduce) { .sparkle { opacity: 0.8; } }

/* ── Scoreboard ──────────────────────────────────────────── */
.leaderboard { --lb-row-h: 46px; --lb-head-h: 26px; --lb-gap: 4px; margin-top: 26px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 700; font-size: 0.86rem; padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg--small { margin-top: 12px; }
.lb-table { display: flex; flex-direction: column; gap: var(--lb-gap); margin-top: 14px; }
/* ten rows visible, the rest (up to 100) scrolls */
.lb-scroll { display: flex; flex-direction: column; gap: var(--lb-gap); max-height: calc(var(--lb-head-h) + 10 * (var(--lb-row-h) + var(--lb-gap))); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.lb-scroll > * { flex: none; }
.lb-scroll::-webkit-scrollbar { width: 6px; }
.lb-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.lb-scroll::-webkit-scrollbar-track { background: transparent; }
.lb-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) repeat(var(--n, 3), 60px); gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.lb-row:not(.lb-head) { min-height: var(--lb-row-h); background: var(--bg); border: 1px solid var(--line); }
.lb-row.is-me { border-color: var(--cyan); background: rgba(224, 56, 77, 0.06); }
.lb-head { position: sticky; top: 0; z-index: 2; height: var(--lb-head-h); padding-top: 2px; padding-bottom: 4px; background: var(--solid); color: var(--text-3); font-size: 0.74rem; font-weight: 800; }
.lb-rank { text-align: center; font-weight: 800; color: var(--text-2); }
.lb-rank.r1 { color: var(--gold); } .lb-rank.r2 { color: #c9cfe4; } .lb-rank.r3 { color: #d9955a; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb-name em { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 0.7rem; font-weight: 800; color: var(--cyan); background: rgba(224, 56, 77, 0.12); }
.lb-num { text-align: right; color: var(--text-2); }
.lb-num.main { color: var(--text); font-weight: 800; }
.lb-row.top-1, .lb-row.top-2, .lb-row.top-3 { position: relative; overflow: hidden; }
/* #1: gold. A soft glow that breathes and a light sheen that sweeps across. */
.lb-row.top-1 { border-color: rgba(239, 230, 220, 0.55); background: rgba(239, 230, 220, 0.06); animation: lb-glow 2.8s ease-in-out infinite; }
/* #2: silver. Only a fainter, slower sheen. */
.lb-row.top-2 { border-color: rgba(201, 207, 228, 0.4); }
/* #3: bronze. Barely there: the border slowly breathes. */
.lb-row.top-3 { border-color: rgba(217, 149, 90, 0.3); animation: lb-breathe 5s ease-in-out infinite; }
.lb-row.top-1::after, .lb-row.top-2::after { content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(100deg, transparent 38%, var(--sheen) 50%, transparent 62%); animation: lb-sheen var(--sheen-time) ease-in-out infinite; }
.lb-row.top-1 { --sheen: rgba(239, 230, 220, 0.2); --sheen-time: 3.4s; }
.lb-row.top-2 { --sheen: rgba(220, 226, 245, 0.1); --sheen-time: 6s; }
@keyframes lb-sheen { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes lb-glow { 50% { box-shadow: 0 0 18px -4px rgba(239, 230, 220, 0.45); border-color: rgba(239, 230, 220, 0.85); } }
@keyframes lb-breathe { 50% { border-color: rgba(217, 149, 90, 0.6); } }
.lb-gap { text-align: center; color: var(--text-3); line-height: 0.8; }
.lb-empty { padding: 24px 8px; text-align: center; color: var(--text-3); }
.lb-foot { margin-top: 14px; text-align: center; }

/* ── Estimation: the hint note in the result ──────────────── */
.hint-note { margin-top: 8px; padding: 6px 14px; display: inline-block; border-radius: 999px; font-size: 0.86rem; font-weight: 700; color: var(--warn); background: rgba(255, 154, 77, 0.1); border: 1px solid rgba(255, 154, 77, 0.3); }

/* ── GraphGeek ─────────────────────────────────────────────── */
.gg-card { overflow: hidden; }
.gg-legend { display: flex; flex-wrap: wrap; gap: 16px; min-height: 0; margin-bottom: 4px; font-size: 0.82rem; font-weight: 700; color: var(--text-2); }
.gg-legend:empty { display: none; }
.gg-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.gg-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.gg-key.is-guess { background: var(--pink); } .gg-key.is-real { background: var(--gold); }
.gg-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.gg-svg.is-interactive { cursor: crosshair; }
.gg-grid { stroke: var(--line); stroke-width: 1; }
.gg-ylabel, .gg-xlabel { fill: var(--text-3); font-size: 11.5px; font-weight: 700; }
.gg-xlabel.is-hidden-label { fill: var(--pink); }
.gg-unit, .gg-xtitle { fill: var(--text-3); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }
.gg-line { fill: none; stroke: var(--cyan); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gg-line.is-guess { stroke: var(--pink); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0.85; }
.gg-line.is-real { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 3 5; opacity: 0.8; }
.gg-dot { fill: var(--bg); stroke: var(--cyan); stroke-width: 2.4; }
.gg-bar { fill: rgba(224, 56, 77, 0.55); }
.gg-bar.is-guess { fill: rgba(255, 107, 122, 0.75); stroke: var(--pink); stroke-width: 1.5; }
.gg-bar.is-real { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 4 3; }
.gg-column { fill: rgba(255, 107, 122, 0.05); stroke: rgba(255, 107, 122, 0.3); stroke-width: 1; stroke-dasharray: 4 4; }
.gg-column.is-active { fill: rgba(255, 107, 122, 0.12); stroke: var(--pink); }
.gg-question { fill: var(--pink); font-size: 34px; font-weight: 800; font-family: var(--font-display); opacity: 0.55; pointer-events: none; }
.gg-stem { stroke: var(--pink); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.7; pointer-events: none; }
.gg-handle { fill: var(--pink); stroke: #fff; stroke-width: 2.5; cursor: grab; touch-action: none; filter: drop-shadow(0 0 7px rgba(255, 107, 122, 0.8)); }
.gg-handle.is-active { r: 11; }
.gg-vlabel { fill: var(--text); font-size: 12.5px; font-weight: 800; pointer-events: none; }
.gg-vlabel.is-real { fill: var(--gold); }
.gg-hit { fill: transparent; }
.gg-real { fill: var(--gold); stroke: #fffaf3; stroke-width: 2; filter: drop-shadow(0 0 6px rgba(239, 230, 220, 0.8)); }
.gg-guess { fill: var(--pink); stroke: #fff; stroke-width: 2; }
.gg-miss { stroke: var(--text-3); stroke-width: 2.5; stroke-linecap: round; }
.gg-miss.tone-red, .gg-guess.tone-red, .gg-vlabel.tone-red { stroke: var(--bad); } .gg-guess.tone-red { fill: var(--bad); } .gg-vlabel.tone-red { fill: var(--bad); stroke: none; }
.gg-miss.tone-yellow, .gg-guess.tone-yellow { stroke: var(--warn); } .gg-guess.tone-yellow { fill: var(--warn); } .gg-vlabel.tone-yellow { fill: var(--warn); }
.gg-miss.tone-green, .gg-guess.tone-green { stroke: var(--ok); } .gg-guess.tone-green { fill: var(--ok); } .gg-vlabel.tone-green { fill: var(--ok); }
.gg-miss.tone-gold, .gg-guess.tone-gold { stroke: var(--gold); } .gg-guess.tone-gold { fill: var(--gold); } .gg-vlabel.tone-gold { fill: var(--gold); }
.gg-bar.is-guess.tone-red { fill: rgba(255, 123, 107, 0.7); stroke: var(--bad); } .gg-bar.is-guess.tone-yellow { fill: rgba(255, 154, 77, 0.7); stroke: var(--warn); }
.gg-bar.is-guess.tone-green { fill: rgba(74, 222, 159, 0.7); stroke: var(--ok); } .gg-bar.is-guess.tone-gold { fill: rgba(239, 230, 220, 0.75); stroke: var(--gold); }

.gg-tabs { margin: 12px 0 4px; flex-wrap: wrap; }
.gg-slider-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 0.86rem; font-weight: 700; color: var(--text-2); }
.gg-slider-value { font-size: 1.25rem; font-weight: 800; color: var(--pink); font-variant-numeric: tabular-nums; }
.gg-slider-value.is-empty { font-size: 0.9rem; color: var(--text-3); font-weight: 700; }
.gg-slider { width: 100%; height: 40px; margin: 6px 0 2px; accent-color: var(--pink); cursor: pointer; }
.gg-lock { width: 100%; margin-top: 10px; }

.gg-result-rows { display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.gg-result-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 0.88rem; }
.gg-result-row b { font-weight: 800; }
.gg-result-row span { color: var(--text-2); }
.gg-result-row span b { color: var(--text); }
.gg-result-row em { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-style: normal; font-size: 1.15rem; font-weight: 800; }
.gg-result-row.tone-red em { color: var(--bad); } .gg-result-row.tone-yellow em { color: var(--warn); } .gg-result-row.tone-green em, .gg-result-row.tone-gold em { color: var(--ok); }

/* ── Impostor ───────────────────────────────────────────────── */
.imp-rounds { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; font-size: 0.86rem; font-weight: 800; color: var(--text-2); }
.imp-rounds .pip.is-now { background: var(--cyan); }
.imp-prompt { margin: 4px 0 12px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: var(--text); }
.imp-question-image { margin-top: 0; }
.imp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.imp-option { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 84px; padding: 14px; overflow: hidden; text-align: left; font: inherit; font-weight: 800; font-size: 1.02rem; color: var(--text);
  border-radius: 16px; border: 2px solid var(--line-2); background: var(--solid); cursor: pointer; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, opacity 0.3s; }
.imp-option:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 14px 30px -18px var(--cyan); }
.imp-option:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.imp-key { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 0.74rem; font-weight: 800; color: var(--text-2); background: rgba(6, 5, 15, 0.7); }
.imp-picture { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; background: linear-gradient(135deg, var(--cyan), var(--violet), var(--pink)); }
.imp-picture img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; border-radius: 8px; background: var(--bg); }
.imp-text { display: block; line-height: 1.3; }
.imp-option:has(.imp-picture) .imp-text { font-size: 0.95rem; }
.imp-option.is-wrong { border-color: var(--bad); background: rgba(255, 123, 107, 0.1); opacity: 0.6; }
.imp-option.is-wrong .imp-text, .imp-option.is-wrong .imp-picture { text-decoration: line-through; }
.imp-option.is-impostor { border-color: var(--gold); background: rgba(239, 230, 220, 0.1); box-shadow: 0 0 26px -8px rgba(239, 230, 220, 0.7); animation: gold-pop 0.7s var(--ease); }
.imp-option.is-dim { opacity: 0.4; }
.imp-option:disabled { cursor: default; }
.imp-feedback { margin-top: 12px; font-weight: 700; }
.imp-feedback.is-good { color: var(--ok); } .imp-feedback.is-bad { color: var(--bad); }
.imp-points { margin-left: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.84rem; background: rgba(74, 222, 159, 0.14); }
.imp-explanation { margin-top: 12px; max-width: none; text-align: left; }
.imp-card .actions { justify-content: flex-end; }
.imp-result-rows { display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.imp-result-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.imp-result-answer { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 700; }
.imp-result-answer img { width: 44px; height: 34px; object-fit: cover; border-radius: 6px; }
.imp-result-answer small { display: block; font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.imp-result-row em { font-style: normal; font-weight: 800; }
.imp-result-row.tone-green em { color: var(--ok); } .imp-result-row.tone-yellow em { color: var(--warn); } .imp-result-row.tone-red em { color: var(--bad); }

/* ── "How everyone guessed" graph ─────────────────────────── */
.spread-card { margin-top: 14px; }
.spread-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.spread { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.sp-axis { stroke: var(--line-2); stroke-width: 1.5; }
.sp-bar { fill: rgba(216, 208, 200, 0.5); transform-box: fill-box; transform-origin: 50% 100%; animation: sp-grow 0.7s var(--ease) var(--d, 0ms) backwards; }
.sp-bar.is-you { fill: var(--cyan); }
.sp-bar.is-you.tone-red { fill: var(--bad); } .sp-bar.is-you.tone-yellow { fill: var(--warn); } .sp-bar.is-you.tone-green { fill: var(--ok); } .sp-bar.is-you.tone-gold { fill: var(--gold); }
.sp-answer { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 5 4; }
.sp-answer-label { fill: var(--gold); font-size: 13px; font-weight: 800; }
.sp-tick { stroke: var(--line-2); }
.sp-tick-label { fill: var(--text-3); font-size: 11px; font-weight: 700; }
.sp-side { fill: var(--text-3); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }
.sp-pin { animation: sp-drop 0.6s var(--ease) 0.9s backwards; }
.sp-pin path { fill: var(--cyan); }
.sp-pin line { stroke: var(--cyan); stroke-width: 1.5; stroke-dasharray: 3 3; }
.sp-pin text { fill: var(--text); font-size: 13px; font-weight: 800; }
.sp-pin.tone-red path { fill: var(--bad); } .sp-pin.tone-red line { stroke: var(--bad); }
.sp-pin.tone-yellow path { fill: var(--warn); } .sp-pin.tone-yellow line { stroke: var(--warn); }
.sp-pin.tone-green path { fill: var(--ok); } .sp-pin.tone-green line { stroke: var(--ok); }
.sp-pin.tone-gold path { fill: var(--gold); } .sp-pin.tone-gold line { stroke: var(--gold); }
@keyframes sp-grow { from { transform: scaleY(0); } }
@keyframes sp-drop { from { transform: translateY(-14px); opacity: 0; } }
.spread-caption { margin-top: 6px; color: var(--text-2); font-weight: 600; }
.tone-text.tone-red { color: var(--bad); } .tone-text.tone-yellow { color: var(--warn); } .tone-text.tone-green { color: var(--ok); } .tone-text.tone-gold { color: var(--gold); }

/* ── Motion helpers ──────────────────────────────────── */
.is-shake { animation: shake 0.4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.toast-stack { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; background: var(--surface-2); border: 1px solid var(--line-2); animation: toast-in 0.35s var(--ease); }
.toast.is-out { animation: toast-out 0.3s var(--ease) forwards; }
.toast--success { color: var(--ok); }
.toast--error { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ═══════════════════════════ ADMIN ═══════════════════════════ */
.login { width: 100%; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; padding: 30px; }
.login-card { text-align: center; align-items: center; }
.login-card h1 { font-size: 1.5rem; }
.google-btn { display: flex; justify-content: center; min-height: 44px; margin-top: 6px; }
.login-card p { color: var(--text-2); }
.form-error { min-height: 20px; color: var(--bad); font-size: 0.88rem; font-weight: 600; }

.admin { width: 100%; max-width: 980px; margin: 0 auto; padding: 20px 20px 90px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; }
.admin-top .brand span { color: var(--text-3); font-weight: 500; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat-card b { display: block; font-size: 1.6rem; font-weight: 800; }
.stat-card span { font-size: 0.8rem; color: var(--text-3); font-weight: 700; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 12px 18px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--text-2); font-weight: 800; font-size: 1rem; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); border-bottom-color: var(--cyan); }
.tab[data-game='gameshow'].is-on { border-bottom-color: var(--violet); }
.tab .count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.76rem; background: var(--surface-2); color: var(--text-2); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 220px; height: 42px; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.warn { margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; font-weight: 600; color: #ff9a4d; background: rgba(255, 154, 77, 0.08); border: 1px solid rgba(255, 154, 77, 0.3); }

.group { margin-bottom: 22px; }
.group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-3); cursor: default; }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: '+'; margin-left: auto; font-size: 1.1rem; }
details.group[open] > summary::after { content: '–'; }
.group-title span { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 0.74rem; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.p-row { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.2s; animation: rise 0.35s var(--ease) backwards; }
.p-row:hover { border-color: var(--line-2); }
.p-row.is-today { border-color: var(--cyan); }
.p-row.is-off { opacity: 0.5; }
.p-date { font-weight: 800; font-size: 0.9rem; line-height: 1.25; }
.p-date.is-none { color: var(--text-3); font-weight: 600; }
.p-title { font-weight: 700; font-size: 0.95rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-sub { margin-top: 2px; font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.is-live { background: rgba(74, 222, 159, 0.12); color: var(--ok); }
.badge.is-upcoming { background: rgba(224, 56, 77, 0.1); color: var(--cyan); }
.badge.is-bank { background: rgba(255, 154, 77, 0.1); color: #ff9a4d; }
.p-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.is-danger:hover { border-color: var(--bad); color: var(--bad); }
.none-found { padding: 34px; text-align: center; color: var(--text-3); }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch i { pointer-events: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line-2); position: relative; transition: background 0.25s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--ease); }
.switch input:checked + i { background: var(--cyan); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }

.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 12, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); overflow-y: auto; scroll-padding-bottom: 120px; padding: 26px; background: var(--solid); border-left: 1px solid var(--line-2); transform: translateX(104%); transition: transform 0.45s var(--ease); }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer-head h2 { font-size: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f--full { grid-column: 1 / -1; }
.f label, .f .lbl { font-size: 0.82rem; font-weight: 800; color: var(--text-2); }
.f .help { font-size: 0.78rem; color: var(--text-3); }
.f textarea, .f select { height: auto; padding: 12px 14px; resize: vertical; min-height: 48px; }
.f select { height: 48px; padding: 0 12px; }
.f select option { background: var(--solid); }
.mode-block { display: contents; }
.lang-tabs { display: grid; gap: 8px; margin-bottom: 16px; }
.lang-tabs .seg { justify-self: start; }
.pl-flag { margin-left: 4px; font-size: 0.74rem; font-weight: 800; color: var(--warn); }
.pl-flag.is-ok { color: var(--ok); }
.pl-state { font-weight: 800; }
.pl-state.is-ok { color: var(--ok); }
.pl-state.is-missing { color: var(--warn); }
.ans-list { display: flex; flex-direction: column; gap: 8px; }
.ans-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 32px; gap: 8px; align-items: center; animation: rise 0.3s var(--ease); }
.ans-fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.ans-row .field-input { height: 42px; font-size: 0.86rem; padding: 0 11px; border-radius: 10px; }
.ans-row .n { text-align: center; color: var(--text-3); font-weight: 800; font-size: 0.78rem; }
.ans-row .x { height: 32px; width: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); cursor: pointer; }
.ans-row .x:hover { color: var(--bad); border-color: var(--bad); }
.switch-row { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); }
.switch-row b { display: block; font-size: 0.92rem; }
.switch-row span { font-size: 0.8rem; color: var(--text-3); }
.drawer-foot { position: sticky; bottom: -26px; margin: 24px -26px -26px; padding: 16px 26px; display: flex; gap: 10px; align-items: center; background: var(--solid); border-top: 1px solid var(--line); }
.drawer-foot .form-error { flex: 1; }

dialog.dlg { margin: auto; width: min(560px, 94vw); padding: 26px; color: var(--text); border-radius: 18px; border: 1px solid var(--line-2); background: var(--solid); }
dialog.dlg::backdrop { background: rgba(5, 4, 12, 0.65); }
dialog.dlg[open] { animation: rise 0.35s var(--ease); }
dialog.dlg h2 { font-size: 1.25rem; margin-bottom: 10px; }
dialog.dlg p { color: var(--text-2); }
dialog.dlg textarea { width: 100%; min-height: 220px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; font: 0.82rem/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); resize: vertical; }
dialog.dlg textarea:focus { outline: none; border-color: var(--cyan); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.dlg-result { margin-bottom: 6px; font-size: 0.88rem; color: var(--text-2); max-height: 120px; overflow: auto; }
.conflict-box { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); font-weight: 700; }

/* ── Admin: GraphGeek table, Impostor rounds, picture fields ── */
.gg-rows { display: grid; gap: 8px; }
.gg-row { display: grid; grid-template-columns: 22px 1.2fr 1fr auto 32px; gap: 8px; align-items: center; animation: rise 0.3s var(--ease); }
.gg-row .n { text-align: center; color: var(--text-3); font-weight: 800; font-size: 0.78rem; }
.gg-row .field-input { height: 42px; font-size: 0.88rem; padding: 0 11px; border-radius: 10px; }
.gg-hide { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 800; color: var(--pink); cursor: pointer; white-space: nowrap; }
.gg-hide input { accent-color: var(--pink); width: 16px; height: 16px; }
.gg-row .x { height: 32px; width: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); cursor: pointer; }
.gg-row .x:hover, .imp-admin-head .x:hover { color: var(--bad); border-color: var(--bad); }
.gg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gg-paste { display: grid; gap: 8px; margin-top: 10px; }
.gg-paste textarea { min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; }
.imp-admin-rounds { display: grid; gap: 14px; }
.imp-admin-round { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line-2); animation: rise 0.3s var(--ease); }
.imp-admin-head { display: flex; align-items: center; justify-content: space-between; }
.imp-admin-head .x { height: 30px; width: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); cursor: pointer; }
.imp-admin-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.imp-admin-option { display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--solid); }
.imp-admin-option:has(.o-impostor:checked) { border-color: var(--gold); background: rgba(239, 230, 220, 0.06); }
.imp-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 800; color: var(--gold); cursor: pointer; }
.imp-radio input { accent-color: #efe6dc; }
.imp-admin-round .field-input, .imp-admin-option .field-input { height: 40px; font-size: 0.86rem; padding: 0 11px; border-radius: 10px; }
.img-field { display: grid; gap: 10px; }
.upload-btn { position: relative; cursor: pointer; height: 38px; }
.upload-btn.is-busy { opacity: 0.55; pointer-events: none; }
.img-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.img-row .field-input { flex: 1 1 160px; min-width: 0; }
.pic-test { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--bg); }
.pic-test[hidden] { display: none; }
.size-ctl { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; font-weight: 800; color: var(--text-2); }
.size-ctl input { flex: 1; accent-color: var(--cyan); }
.size-ctl output { min-width: 3.2em; text-align: right; color: var(--cyan); }
.pic--option { --w: 100% !important; width: 160px; aspect-ratio: 4 / 3; margin: 0; }
.pic--option img { height: 100%; }
.pl-note-hidden { display: none; }

/* ── Archive (hub) and the banner on archive game pages ── */
.archive { margin-top: 18px; display: grid; gap: 14px; }
.archive-toggle { width: 100%; justify-content: center; font-weight: 800; letter-spacing: 0.02em; }
.archive-panel { display: grid; gap: 12px; }
.archive-panel[hidden] { display: none; }
.arch-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.arch-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); font-size: 0.86rem; font-weight: 700; color: var(--text); text-decoration: none; }
.arch-chip b { display: inline-flex; align-items: center; gap: 5px; }
.arch-chip svg { width: 16px; height: 16px; }
.arch-chip.is-play { border-color: var(--cyan); }
.arch-chip.is-play b { color: var(--cyan); }
.arch-chip.is-play:hover { background: rgba(224, 56, 77, 0.08); }
.arch-chip.is-done b { color: var(--good, #4ade80); }
.arch-chip.is-idle { opacity: 0.5; }
.arch-chip small { color: var(--text-3); }
.archive-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--gold, #efe6dc); color: var(--gold, #efe6dc); background: rgba(239, 230, 220, 0.06); font-size: 0.88rem; font-weight: 700; text-align: center; }

/* ═══ Crimson Noir: shapes, type, case folders, stamps, the detective badge ═══ */
body { font-size: 0.94rem; }
h1, h2, h3 { font-weight: 400; letter-spacing: 0.01em; }
b, strong { font-weight: 700; }
.card { border-radius: 6px; border: 1px dashed var(--line-2); backdrop-filter: none; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.85); }
.q-card { border-top: 3px solid var(--cyan); }
.card-title { font-weight: 400; }
.btn { border-radius: 4px; letter-spacing: 0.04em; }
.btn--primary { box-shadow: none; }
.btn--primary:hover:not(:disabled) { background: #f0566a; border-color: #f0566a; }
.input, .field-input { border-radius: 4px; }
.pill, .chip, .lang-toggle, .lang-toggle button, .streak-chip, .eyebrow, .tag { border-radius: 3px; }
.tag { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 700; }
.pill, .eyebrow { font-weight: 700; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; border-style: dashed; }
.brand { font-weight: 400; letter-spacing: 0.02em; }

/* the wordmark: a typewritten title, "Dailies" in crimson */
.wordmark { font-weight: 400; letter-spacing: 0.01em; font-size: clamp(2.9rem, 13vw, 5rem); line-height: 1; text-shadow: none; }
.wordmark span { font-style: normal; color: var(--cyan); text-shadow: 0 0 34px rgba(224, 56, 77, 0.4); animation: none; }
.tagline { font-style: italic; }

/* games as case folders: a case tab on top and a red pin */
.game-card { overflow: visible; border-radius: 4px; border: 1px dashed var(--line-2); padding: 24px 18px 16px; backdrop-filter: none; --accent: var(--cyan); --accent-soft: rgba(224, 56, 77, 0.14); }
.game-card--cyan, .game-card--violet, .game-card--fuchsia { --accent: var(--cyan); --accent-soft: rgba(224, 56, 77, 0.14); }
.game-card::before { content: attr(data-case); top: -10px; left: 14px; right: auto; height: auto; padding: 2px 11px 3px; background: var(--cyan); color: #fff; font: 700 0.62rem/1.4 var(--font); letter-spacing: 0.14em; border-radius: 3px 3px 0 0; animation: none; }
.game-card::after { content: ''; top: -5px; right: 16px; left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); animation: none; }
.game-icon { border-radius: 3px; }
.game-text b { font-weight: 400; font-size: 1.25rem; }
.game-status { border-radius: 3px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.game-status.play { color: #fff; }
.game-status.done { color: var(--cyan); background: transparent; border: 2px solid var(--cyan); transform: rotate(-4deg); }
.game-status.done svg { display: none; }

/* verdicts are stamps */
.result .verdict { border-radius: 4px; background: transparent !important; border: 2px solid currentColor; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; transform: rotate(-3deg); }
.tier-gold .verdict { color: var(--gold) !important; }
.score span { font-family: var(--font-display); font-weight: 400; }

/* ── The detective badge (the centrepiece of the hub; Dailies.badgeHTML in common.js): a landscape ID card ── */
.badge-slot { margin: 6px 0 0; }
.id-badge { position: relative; width: 100%; max-width: 520px; margin: 20px auto 0; text-align: left; border-radius: 12px; background: #e9e1d8; color: #1e1416; box-shadow: 0 22px 44px -18px #000, 0 0 0 1px rgba(255, 255, 255, 0.05); overflow: hidden; transform: rotate(-0.5deg); }
.id-badge::before { content: ''; position: absolute; left: 50%; top: 7px; width: 48px; height: 9px; margin-left: -24px; border-radius: 6px; background: #fbf6ef; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45); z-index: 1; }
.b-band { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 20px 18px 7px; background: #1e1416; color: #e9e1d8; font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; }
.b-band b { color: #ff8a98; }
.b-main { position: relative; display: grid; grid-template-columns: 128px 1fr; gap: 18px; padding: 14px 18px 10px; align-items: stretch; }
.b-photo { width: 128px; height: 158px; background: #251a1c; border: 4px solid #fbf6ef; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.55); overflow: hidden; }
.b-photo svg, .b-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.b-info { display: grid; align-content: space-between; gap: 8px; min-width: 0; }
.b-info small { display: block; font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; font-weight: 700; }
.b-name { display: block; max-width: 72%; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.05; overflow-wrap: anywhere; }
.b-pair { display: grid; grid-template-columns: auto 1fr; gap: 22px; }
.b-num { font-family: var(--font-display); font-size: 1.15rem; color: #c42a3d; letter-spacing: 0.08em; }
.b-disp { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; color: #c42a3d; }
/* the stamp: big, rough and tilted, like TOP SECRET on a file; it lies across the top right, over the name */
.b-stamp { position: absolute; top: 14px; right: 14px; padding: 5px 16px 7px; border: 4px solid #b3202f; outline: 2px solid #b3202f; outline-offset: 3px; border-radius: 6px; color: #b3202f; background: transparent; font: 400 2.1rem/1 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; transform: rotate(-11deg); transform-origin: 80% 40%; opacity: 0.88; mix-blend-mode: multiply; filter: url(#rough-ink); pointer-events: none; animation: stamp-in 0.6s var(--ease) 0.3s backwards; }
@keyframes stamp-in { from { transform: rotate(-11deg) scale(2.2); opacity: 0; } }
.b-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid #1e1416; }
.b-stats div { padding: 7px 4px 2px; text-align: center; } .b-stats div + div { border-left: 1px dashed rgba(30, 20, 22, 0.35); }
.b-stats b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.b-stats small { margin-top: 3px; font-size: 0.52rem !important; letter-spacing: 0.1em !important; }
.b-code { height: 14px; margin: 4px 18px 12px; background: repeating-linear-gradient(90deg, #1e1416 0 2px, transparent 2px 4px, #1e1416 4px 5px, transparent 5px 8px, #1e1416 8px 11px, transparent 11px 12px, #1e1416 12px 13px, transparent 13px 16px); opacity: 0.8; }
.badge-hint { margin-top: 12px; text-align: center; font-size: 0.82rem; color: var(--text-3); }
.cat-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: cat-blink 7s infinite; }
@keyframes cat-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@media (max-width: 480px) {
  .b-main { grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 14px 8px; } .b-photo { width: 96px; height: 120px; }
  .b-name { font-size: 1.25rem; max-width: 100%; margin-top: 18px; } .b-pair { gap: 12px; } .b-stamp { font-size: 1.45rem; top: 2px; right: 0; border-width: 3px; }
  .b-band { font-size: 0.55rem; letter-spacing: 0.14em; } .b-stats b { font-size: 1.15rem; }
}

/* other stamps get the same rough ink; the verdict stamp keeps a clear gap from the score below it */
.result .verdict { margin-top: 6px; margin-bottom: 26px; padding: 6px 16px; filter: url(#rough-ink-soft); }
.game-status.done { filter: url(#rough-ink-soft); }

/* ── Scoreboard: centred, every row and control the same width ── */
.leaderboard .lb-top { flex-direction: column; align-items: stretch; justify-content: center; gap: 12px; text-align: center; }
.leaderboard .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.leaderboard .seg button { padding: 8px 6px; text-align: center; white-space: nowrap; }
.leaderboard .seg--small { margin-top: 10px; }
.lb-scroll { padding: 0 4px; }                 /* the same gap on both sides, with or without the scrollbar */
.lb-table > .lb-gap, .lb-table > .lb-row { margin: 0 4px; }
.lb-head .lb-num, .lb-head span:first-child { text-align: center; }
.lb-row .lb-num { text-align: center; }
.lb-row .lb-name { text-align: left; }
.lb-foot, .lb-empty { text-align: center; }
@media (max-width: 640px) { .leaderboard .lb-top .seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .leaderboard .seg button { white-space: normal; } }

/* ── Responsive & motion ─────────────────────────────── */
@media (max-width: 640px) {
  body::before, body::after { opacity: 0.72; } /* softer spotlights behind the text on a phone */
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .guess-form, .nick-form { flex-direction: column; }
  .leaderboard { --lb-row-h: 42px; --lb-head-h: 24px; }
  .lb-row { grid-template-columns: 24px minmax(0, 1fr) repeat(var(--n, 3), 56px); gap: 4px; padding: 8px 6px; font-size: 0.82rem; }
  .lb-head { font-size: 0.6rem; letter-spacing: 0; }
  .compare { grid-template-columns: 1fr; }
  .streak-chip { padding: 0 10px 0 8px; }
  .profile-head { flex-wrap: wrap; }
  .profile-head .btn { margin-left: 0; }
  .guess-form .btn { height: 52px; }
  .lb-top .seg { flex-wrap: wrap; }
  .imp-grid { gap: 10px; }
  .gg-slider { height: 48px; }
  .gg-result-row { grid-template-columns: 1fr; } .gg-result-row em { grid-column: 1; grid-row: auto; }
  .footer-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-copy, .footer-made { justify-self: center; }
  .footer-social { order: -1; }
  .g-row { grid-template-columns: 28px 1fr auto; gap: 10px; padding: 12px 14px; }
  .p-row { grid-template-columns: 1fr auto; }
  .p-row > .p-main { grid-column: 1 / -1; order: 3; }
  .form-grid { grid-template-columns: 1fr; }
  .ans-row { grid-template-columns: 1fr 32px; }
  .ans-row .n { display: none; }
  .ans-fields { grid-template-columns: 1fr; }
  .gg-row { grid-template-columns: 1fr auto 32px; } .gg-row .n { display: none; } .gg-row .g-value { grid-column: 1; }
  .imp-admin-options { grid-template-columns: 1fr; }
  .toolbar-actions { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
