/* REAL OR FAKE: BTV HEADLINES — newspaper front page.
   Mobile-first; headline typography is the star. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #f5f1e6;
  --paper-dark: #ece6d4;
  --ink: #191713;
  --ink-soft: #4a463c;
  --rule: #191713;
  --red: #a8231c;
  --green: #1e5c31;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: #3a352b;
  color: var(--ink);
  font-family: var(--serif);
  -webkit-tap-highlight-color: transparent;
}

#paper {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  background:
    linear-gradient(rgba(25,23,19,0.035), rgba(25,23,19,0) 30%),
    var(--paper);
  box-shadow: 0 0 40px rgba(0,0,0,0.55);
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------ masthead */

#masthead { border-bottom: 4px double var(--rule); padding-bottom: 8px; }

.ears {
  display: flex; justify-content: space-between;
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}

#nameplate {
  text-align: center;
  font-size: clamp(44px, 13vw, 76px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  margin: 10px 0 2px;
  font-variant: small-caps;
}
#nameplate .or {
  font-style: italic; font-weight: 400; font-variant: normal;
  font-size: 0.45em; vertical-align: 12%;
}

#subplate {
  text-align: center;
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; color: var(--ink-soft);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 4px 0; margin-top: 6px;
}

#scorebar {
  display: flex; justify-content: space-around;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 2px; padding-top: 7px; color: var(--ink-soft);
}
#scorebar b { font-size: 15px; color: var(--ink); margin-left: 4px; }

/* ------------------------------------------------ screens */

.screen { flex: 1; display: flex; flex-direction: column; padding-top: 18px; }
.hidden { display: none !important; }

.deck {
  text-align: center; font-size: 19px; line-height: 1.45; font-style: italic;
  max-width: 46ch; margin: 0 auto 14px;
}
.deck.small { font-size: 14px; color: var(--ink-soft); }

.fineprint {
  text-align: center; font-family: var(--sans);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 18px;
}

button { font: inherit; color: inherit; cursor: pointer; }

.btn-lead {
  display: block; margin: 10px auto 0;
  background: var(--ink); color: var(--paper);
  border: none; padding: 14px 30px;
  font-family: var(--sans); font-size: 15px; font-weight: 800; letter-spacing: 2px;
  box-shadow: 4px 4px 0 rgba(25,23,19,0.25);
}
.btn-lead:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(25,23,19,0.25); }

.btn-second {
  display: block; margin: 12px auto 0;
  background: none; border: 2px solid var(--ink);
  padding: 10px 22px;
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 2px;
}

/* ------------------------------------------------ round */

#round-kicker {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 4px;
}
#round-task .fake-word { color: var(--red); font-size: 13px; }
#round-task .real-word { color: var(--green); font-size: 13px; }

#cards { display: flex; flex-direction: column; }

.card {
  text-align: left; background: none; border: none;
  border-bottom: 1px solid rgba(25,23,19,0.35);
  padding: 15px 6px 15px 2px;
  display: block; width: 100%;
}
.card:last-child { border-bottom: none; }

.card .hl {
  font-size: clamp(19px, 5.4vw, 24px);
  font-weight: 800; line-height: 1.22;
  letter-spacing: -0.2px;
}
.card .meta {
  margin-top: 7px; font-family: var(--sans); font-size: 12px;
  color: var(--ink-soft); display: none;
}
.card .meta a {
  color: var(--red); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid var(--red);
}

/* hover only where hover exists (don't sticky-highlight on touch) */
@media (hover: hover) {
  .card:not([disabled]):hover { background: var(--paper-dark); }
}
.card:not([disabled]):active { background: var(--paper-dark); }

/* reveal state */
.card.revealed { cursor: default; }
.card.revealed .meta { display: block; }
.card.is-fake .hl { color: rgba(25,23,19,0.45); text-decoration: line-through; text-decoration-thickness: 2px; }
.card.is-real-answer .hl { color: var(--green); }

.card .stamp-fake {
  display: inline-block; margin-top: 8px;
  font-family: var(--sans); font-weight: 900; font-size: 13px; letter-spacing: 2px;
  color: var(--red); border: 3px solid var(--red);
  padding: 3px 10px; transform: rotate(-4deg);
  text-transform: uppercase;
}
.card .stamp-real {
  display: inline-block; margin-top: 8px;
  font-family: var(--sans); font-weight: 900; font-size: 13px; letter-spacing: 2px;
  color: var(--green); border: 3px solid var(--green);
  padding: 3px 10px; transform: rotate(-4deg);
}
.card.picked-wrong { background: rgba(168, 35, 28, 0.08); }

#verdict { margin-top: 4px; text-align: center; }
#verdict-line {
  font-size: 17px; font-style: italic; padding: 8px 0 2px;
  border-top: 1px solid var(--rule);
}
#verdict-line b.good { color: var(--green); font-style: normal; }
#verdict-line b.bad { color: var(--red); font-style: normal; }

/* ------------------------------------------------ game over */

#gameover { align-items: center; text-align: center; }

#stamp {
  font-family: var(--sans); font-weight: 900;
  font-size: clamp(26px, 8vw, 40px); letter-spacing: 3px;
  color: var(--red); border: 5px solid var(--red);
  padding: 6px 18px; transform: rotate(-3deg);
  margin: 6px 0 14px;
}
#final-line { font-style: italic; font-size: 16px; max-width: 44ch; }

.go-score { margin: 14px 0 4px; }
#final-score { font-size: 64px; font-weight: 900; line-height: 1; }
.go-label {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; color: var(--ink-soft); margin-top: 2px;
}
#best-line { font-family: var(--sans); font-size: 13px; font-weight: 700; margin-top: 6px; }
#best-line.new-best { color: var(--green); }

.go-actions { margin: 8px 0 14px; }

/* ------------------------------------------------ leaderboard (newspaper box) */

.lb {
  width: min(400px, 100%);
  border: 2px solid var(--ink);
  padding: 10px 14px 12px;
  margin-top: 14px;
  background: var(--paper-dark);
}
.lb-head {
  font-family: var(--sans); font-size: 11px; font-weight: 900;
  letter-spacing: 3px; border-bottom: 2px solid var(--ink); padding-bottom: 5px;
}
.lb-tabs { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.lb-chip {
  background: none; border: 1px solid var(--ink);
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  padding: 5px 12px; letter-spacing: 0.5px;
}
.lb-chip.sel { background: var(--ink); color: var(--paper); }
.lb-status {
  font-family: var(--sans); font-size: 12px; font-style: italic;
  color: var(--ink-soft); margin: 8px 0 2px; min-height: 15px;
}
.lb ol { list-style: none; margin: 6px 0 2px; max-height: 32vh; overflow-y: auto; }
.lb li {
  display: flex; gap: 8px; align-items: baseline;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 3px 6px; text-align: left;
  border-bottom: 1px dotted rgba(25,23,19,0.3);
}
.lb li .rank { width: 24px; text-align: right; font-size: 12px; color: var(--ink-soft); }
.lb li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb li.me { background: var(--ink); color: var(--paper); }
.lb li.me .rank { color: var(--paper-dark); }
.lb-form { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.lb-form input {
  font: inherit; font-family: var(--sans); font-size: 14px; font-weight: 600;
  width: 170px; padding: 8px 12px;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  outline: none;
}
.lb-rename { margin-top: 8px; font-size: 11px; opacity: 0.85; }
.lb-form.hidden, .lb-rename.hidden { display: none; }

/* ------------------------------------------------ footer */

#colophon {
  border-top: 4px double var(--rule);
  margin-top: 22px; padding-top: 10px;
  text-align: center;
  font-family: var(--sans); font-size: 12px; color: var(--ink-soft);
}
#colophon a { color: var(--red); font-weight: 700; text-decoration: none; }

/* toast for clipboard-share feedback */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  padding: 10px 18px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  z-index: 20;
}
#toast.show { opacity: 1; }

@media (min-width: 480px) {
  #paper { padding: 20px 34px calc(26px + env(safe-area-inset-bottom)); }
}
