/* Fact or Fake: bold, high-contrast, built to read on a phone and on a stream.
   Radius rule: 14px for cards, buttons and panels; 999px for small chips and tags. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #141317;
  --ink-2: #1e1d23;
  --paper: #f4f3ee;
  --lime: #c5f23a;
  --lime-deep: #7ea316;
  --coral: #ff5c6c;
  --coral-deep: #b72f3e;

  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --fg: var(--paper);
  --muted: #b9b7ae;
  --line: #3b3a42;
  --surface: var(--paper);
  --on-surface: var(--ink);
  --surface-muted: #55535c;
  --card-shadow: #3b3a42;
  --focus: var(--lime);
  --dot: rgba(244, 243, 238, 0.07);

  --radius: 14px;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #e9e8e1;
    --bg-2: #dcdbd3;
    --fg: var(--ink);
    --muted: #4a4950;
    --line: #b9b7ae;
    --surface: #ffffff;
    --card-shadow: var(--ink);
    --focus: var(--ink);
    --dot: rgba(20, 19, 23, 0.08);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* Dot grid, fixed and non-interactive so it never repaints on scroll. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

main { flex: 1; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--lime); }
@media (prefers-color-scheme: light) { a:hover { text-decoration-color: var(--coral-deep); } }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--lime);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header { padding-block: 14px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.logo {
  display: inline-block;
  text-decoration: none;
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
  padding: 10px 14px 9px;
  border-radius: 10px;
  transform: rotate(-2deg);
  box-shadow: 4px 4px 0 var(--coral);
  white-space: nowrap;
}

.nav { display: flex; gap: clamp(10px, 2vw, 28px); }
.nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 2px;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--fg); text-decoration: underline; text-decoration-color: var(--lime); }

@media (max-width: 480px) {
  .nav a[href='/how-to-play'] { display: none; }
}

/* ---------- Game: shared ---------- */

.game { padding-block: 8px 48px; }

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--fg);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.counter { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.link-btn {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
  padding: 10px 0;
}

.pips {
  list-style: none;
  margin: 0 0 clamp(14px, 2vw, 24px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.pip { height: 10px; border-radius: 999px; border: 2px solid var(--line); }
.pip-now { border-color: var(--fg); background: var(--fg); }
.pip-right { border-color: var(--lime); background: var(--lime); }
.pip-wrong { border-color: var(--coral); background: var(--coral); }

/* ---------- Stage: fact card + side panel ---------- */

.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.4vw, 32px);
  align-items: stretch;
}

@media (min-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }
}

.card {
  position: relative;
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(22px, 3.4vw, 56px);
  box-shadow: 10px 10px 0 var(--card-shadow);
  min-height: clamp(240px, 38vh, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow 260ms var(--ease);
}
@media (min-width: 960px) { .card { min-height: clamp(380px, 56vh, 680px); } }
.card.is-right { box-shadow: 10px 10px 0 var(--lime-deep); }
.card.is-wrong { box-shadow: 10px 10px 0 var(--coral-deep); }

.topic {
  position: absolute;
  top: clamp(16px, 2vw, 26px);
  left: clamp(22px, 3.4vw, 56px);
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--surface-muted);
}

.fact {
  margin: 1.6rem 0 0;
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 24ch;
}

.stamp {
  position: absolute;
  right: clamp(14px, 2.4vw, 30px);
  bottom: clamp(14px, 2.4vw, 30px);
  font-weight: 800;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 10px 16px 8px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  transform: rotate(-7deg);
  opacity: 0;
}
.stamp:empty { display: none; }
.stamp-real { background: var(--lime); opacity: 1; }
.stamp-fake { background: var(--coral); opacity: 1; }

/* ---------- Buttons ---------- */

.btn {
  --btn-depth: 6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background-color 160ms;
}
.btn:active:not(:disabled) { transform: translateY(4px); }
.btn:disabled { cursor: default; }

.btn-real { background: var(--lime); box-shadow: 0 var(--btn-depth) 0 var(--lime-deep); }
.btn-fake { background: var(--coral); box-shadow: 0 var(--btn-depth) 0 var(--coral-deep); }
.btn-real:active:not(:disabled) { box-shadow: 0 2px 0 var(--lime-deep); }
.btn-fake:active:not(:disabled) { box-shadow: 0 2px 0 var(--coral-deep); }
@media (hover: hover) {
  .btn-real:hover:not(:disabled) { background: #d4f86a; }
  .btn-fake:hover:not(:disabled) { background: #ff7a87; }
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
  box-shadow: 0 var(--btn-depth) 0 var(--line);
}
@media (hover: hover) { .btn-ghost:hover:not(:disabled) { background: var(--bg-2); } }
.btn-ghost:disabled { opacity: 0.55; }

.btn-next {
  width: 100%;
  min-height: 72px;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem);
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  box-shadow: 0 var(--btn-depth) 0 var(--line);
}
.btn-next:active { box-shadow: 0 2px 0 var(--line); }

.btn-md { min-height: 56px; padding: 0 24px; font-size: 1.15rem; }

kbd {
  display: none;
  font: inherit;
  font-size: 0.42em;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: 0.75;
}
@media (hover: hover) and (pointer: fine) { kbd { display: inline-block; } }

/* ---------- Choices and reveal ---------- */

.side { display: flex; flex-direction: column; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.choices .btn { min-height: 96px; font-size: clamp(1.8rem, 1.2rem + 2vw, 3.6rem); }

.prompt {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  display: none;
}

@media (min-width: 960px) {
  .choices { grid-template-columns: 1fr; gap: 22px; align-content: center; height: 100%; }
  .choices .btn { min-height: clamp(120px, 15vh, 190px); }
  .prompt { display: block; font-size: 1.25rem; }
}

.reveal, .endless-done {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  justify-content: center;
}

.verdict {
  align-self: flex-start;
  margin: 0;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  padding: 6px 14px 8px;
  border-radius: var(--radius);
  transform: rotate(-1.5deg);
}
.verdict-right { background: var(--lime); color: var(--ink); }
.verdict-wrong { background: var(--coral); color: var(--ink); }
.endless-done .verdict { background: var(--fg); color: var(--bg); }

.verdict-sub { margin: 0; font-size: clamp(1.2rem, 1rem + 0.8vw, 1.75rem); font-weight: 700; }

.pct { margin: 0; font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.35rem); color: var(--muted); min-height: 1.6em; }
.pct strong { color: var(--fg); font-size: 1.6em; font-weight: 800; margin-right: 4px; font-variant-numeric: tabular-nums; }
.pct.loading { animation: pulse 1.2s ease-in-out infinite; }

.source { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 1.1rem; font-weight: 600; }
.source a { font-weight: 800; font-size: 1.2rem; }
.source a::after { content: ' \2197'; }
.source-name { color: var(--muted); font-weight: 500; font-size: 0.95rem; }

/* ---------- Result ---------- */

.result-top {
  display: grid;
  gap: clamp(24px, 4vw, 64px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) { .result-top { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); } }

.result-score .chip { margin-bottom: 10px; }

.score {
  margin: 0;
  font-size: clamp(6rem, 4rem + 9vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.score span { color: var(--muted); font-size: 0.45em; letter-spacing: -0.02em; margin-left: 6px; }

.squares {
  list-style: none;
  padding: 0;
  margin: 22px 0 26px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 46px));
  gap: 6px;
}
.sq { aspect-ratio: 1; border-radius: 8px; border: 3px solid var(--ink); }
.sq-right { background: var(--lime); }
.sq-wrong { background: var(--coral); }
@media (prefers-color-scheme: dark) { .sq { border-color: var(--bg); } }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.share-status { min-height: 1.5em; margin: 14px 0 0; font-weight: 600; color: var(--muted); }

.result-side {
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 34px);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
  margin: 0 0 22px;
}
.stats dt { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.stats dd { margin: 0; font-size: clamp(2rem, 1.6rem + 1.4vw, 3rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }

.next-round { margin: 0; font-size: 1.15rem; font-weight: 600; padding-top: 18px; border-top: 2px solid var(--line); }
.next-round .mono { display: block; font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.next-round-note { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

/* Ad slot placeholder: empty until AdSense is approved and wired. */
.ad-slot { margin-block: 32px 0; }
.ad-slot:empty { display: none; }

.recap-wrap { margin-top: 40px; border-top: 2px solid var(--line); padding-top: 18px; }
.recap-wrap summary { cursor: pointer; font-weight: 800; font-size: 1.3rem; padding: 8px 0; }
.recap { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 960px) { .recap { grid-template-columns: 1fr 1fr; } }

.recap-item, .fact-row {
  border-left: 6px solid var(--line);
  padding: 4px 0 4px 16px;
}
.recap-item.is-right { border-left-color: var(--lime); }
.recap-item.is-wrong { border-left-color: var(--coral); }
.recap-text { margin: 0 0 6px; font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.recap-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 0.98rem; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.tag-real { background: var(--lime); }
.tag-fake { background: var(--coral); }

/* ---------- Loading / error ---------- */

.skel { background: var(--bg-2); border-radius: var(--radius); }
.skel-meta { height: 34px; width: 220px; margin-bottom: 18px; border-radius: 999px; }
.skel-card { height: clamp(240px, 38vh, 520px); }
.skel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.skel-btn { height: 96px; }
.loading-view .skel { animation: pulse 1.4s ease-in-out infinite; }

.error-view { padding-block: 48px; }
.error-view h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); line-height: 1.05; margin: 0 0 12px; }
.error-view .btn { min-height: 56px; padding: 0 24px; margin-top: 16px; }
.noscript { font-size: 1.2rem; }

@keyframes pulse { 50% { opacity: 0.5; } }

/* ---------- Motion (feedback and state change only) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .card.enter { animation: card-in 340ms var(--ease) both; }
  .stamp.pop { animation: stamp-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .reveal:not([hidden]) > * { animation: rise 280ms var(--ease) both; }
  .reveal:not([hidden]) > :nth-child(2) { animation-delay: 40ms; }
  .reveal:not([hidden]) > :nth-child(3) { animation-delay: 80ms; }
  .reveal:not([hidden]) > :nth-child(4) { animation-delay: 120ms; }
  .reveal:not([hidden]) > :nth-child(5) { animation-delay: 160ms; }
  .reveal:not([hidden]) > .verdict { animation: verdict-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
}

@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-18deg) scale(1.9); } to { opacity: 1; transform: rotate(-7deg) scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes verdict-in { from { opacity: 0; transform: translateY(10px) rotate(-6deg) scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Content pages ---------- */

.page { padding-block: clamp(20px, 4vw, 56px) 64px; }

.prose { max-width: 70ch; }
.prose h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
}
.prose h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--fg); max-width: 65ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose .lead { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem); font-weight: 600; line-height: 1.4; }
.prose .muted { color: var(--muted); }

.cta-row { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row .btn { min-height: 60px; padding: 0 28px; font-size: 1.25rem; text-decoration: none; }

.how-steps {
  list-style: none;
  padding: 0;
  margin: 28px 0;
  display: grid;
  gap: 14px;
}
@media (min-width: 760px) { .how-steps { grid-template-columns: 1.2fr 1fr 1fr; } }
.how-steps li {
  margin: 0;
  border-radius: var(--radius);
  padding: 22px;
  border: 3px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
  max-width: none;
}
.how-steps li strong { display: block; font-size: 1.6rem; line-height: 1.1; margin-bottom: 8px; font-weight: 800; }
.how-steps li:nth-child(1) { background: var(--surface); }
.how-steps li:nth-child(2) { background: var(--lime); }
.how-steps li:nth-child(3) { background: var(--coral); }

/* ---------- Archive ---------- */

.archive-grid {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.archive-grid a {
  display: block;
  text-decoration: none;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  transition: border-color 160ms, transform 160ms var(--ease);
}
.archive-grid a:hover { border-color: var(--fg); transform: translateY(-2px); }
.archive-grid .num { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.archive-grid .date { display: block; margin-top: 6px; color: var(--muted); font-weight: 600; font-size: 0.95rem; }

.day-facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 22px; max-width: 900px; }
.fact-row.real { border-left-color: var(--lime); }
.fact-row.fake { border-left-color: var(--coral); }
.fact-row h2 { margin: 0 0 8px; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.25; letter-spacing: -0.015em; }
.fact-row p { margin: 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.fact-row a { color: var(--fg); font-weight: 700; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 40px; max-width: 900px; font-weight: 700; }
.pager a { padding: 10px 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 2px solid var(--line); margin-top: 24px; }
.foot { padding-block: 28px 36px; display: grid; gap: 14px; }
.credit { margin: 0; max-width: 75ch; color: var(--muted); font-size: 0.98rem; }
.credit a { color: var(--fg); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { font-weight: 600; text-decoration: none; padding: 6px 0; }
.foot-links a:hover { text-decoration: underline; }
.fine { margin: 0; color: var(--muted); font-size: 0.9rem; }
.btn.keep-case { text-transform: none; }
