/* ==========================================================================
   Guess the Uni — light theme matched to guesstheparty.co.uk
   ========================================================================== */

*, *::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 (mirrors UK/US/Gaff sites) ---------- */
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;
  flex-wrap: wrap;
}

.game-switcher {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  min-width: 0;
  flex-wrap: wrap;
}
.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);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.game-tab:hover { border-color: #c8c8d0; }
.game-tab.active { background: var(--ink); border-color: var(--ink); }
.game-tab-name {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.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 .short { display: none; }
.game-tab-sep { color: var(--line); font-size: 0.7rem; }
.game-tab.active .game-tab-sep { color: rgba(255,255,255,0.35); }
.game-tab-stats-link {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.game-tab-stats-link:hover { color: var(--ink); }
.game-tab.active .game-tab-stats-link { color: rgba(255,255,255,0.7); }
.game-tab.active .game-tab-stats-link:hover { color: #fff; }

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

.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; }

.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; }
}

/* ---------- main / card / review ---------- */
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;
}

.review-wrap {
  position: relative;
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stars {
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: var(--star);
  line-height: 1;
}

.review-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.review-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink);
  position: relative;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
}

/* Fixed height keeps the answer buttons in the same screen position
   on every round; clicking "Read more" expands and pushes them down. */
.review-text.collapsed {
  height: 12rem;
}

.review-text.collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--card) 90%);
  pointer-events: none;
}

.see-more {
  align-self: flex-start;
  background: transparent;
  border: none;
  padding: 0;
  margin: -0.25rem 0 0 1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}
.see-more[hidden] { display: none; }
.see-more:hover { color: var(--muted); }

.reveal {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.reveal.show { opacity: 1; transform: translateY(0); }
.actual { font-size: 0.9rem; color: var(--muted); }
.actual strong { color: var(--ink); font-weight: 700; }

/* ---------- answer buttons ---------- */
.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.uni-btn {
  position: relative;
  padding: 0.85rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: #f5f5f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform .08s, opacity .2s, filter .2s, background .2s, border-color .2s;
  text-align: center;
  line-height: 1.2;
}
.uni-btn:hover:not(:disabled) { background: #ececef; border-color: #c8c8d0; }
.uni-btn:active:not(:disabled) { transform: scale(0.97); }
.uni-btn:disabled { cursor: default; opacity: 0.5; }

.uni-btn.correct {
  opacity: 1;
  background: #dcfce7;
  border-color: var(--correct);
  color: #064e2a;
}
.uni-btn.wrong {
  opacity: 1;
  background: #fee2e2;
  border-color: var(--wrong);
  color: #7f1d1d;
}

.uni-btn.correct::after,
.uni-btn.wrong::after {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--card);
}
.uni-btn.correct::after { content: "✓"; background: var(--correct); }
.uni-btn.wrong::after   { content: "✕"; background: var(--wrong); }

/* ---------- countdown bar ---------- */
.countdown {
  height: 3px;
  background: var(--ink);
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  opacity: 0;
}
.countdown.run {
  opacity: 1;
  animation: countdown var(--ms, 2200ms) linear forwards;
}
@keyframes countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.status {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1.25rem 0 0;
  text-align: center;
}

/* ---------- history ---------- */
.history { margin-top: 2.5rem; }
.history h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding: 0 0.25rem;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--card);
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  animation: slideIn .25s ease;
}
.history-item.correct .history-mark { background: var(--correct); }
.history-item.wrong   .history-mark { background: var(--wrong); }
.history-item.correct .history-mark::before { content: "\2713"; }
.history-item.wrong   .history-mark::before { content: "\2715"; }
.history-stars {
  font-size: 0.85rem;
  color: var(--star);
  letter-spacing: 1px;
  flex-shrink: 0;
  width: 38px;
}
.history-body { flex: 1; min-width: 0; }
.history-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- site footer (consistent across all pages) ---------- */
.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); }
.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; }
