/*
 * mnemocracy.com. The app's "Archive" look (src/constants/theme.ts): ivory
 * paper, ink-navy type and buttons, and brass kept for two things only, the
 * jackpot (the prize) and "today". The kind colours for years. Every text
 * pair meets WCAG AA 4.5:1 in both themes (ratios in the comments).
 * System fonts only, no animation.
 */

:root {
  --text: #15213b; /* 14.21 on --bg, 15.73 on --card, 13.12 on --band */
  --text-2: #4d586b; /* 6.38 on --bg, 7.06 on --card, 5.67+ on --selected, 5.89 on --band */
  --bg: #f6f1e7;
  --card: #fffdf7;
  --selected: #eee8da;
  --border: #ddd3c0;
  /* Buttons, links, focus rings: ink navy with ivory labels (15.73). */
  --accent: #15213b;
  --accent-text: #fffdf7;
  --danger: #a3263a;
  --year: #2a5d96; /* the Events colour: 6.65 on --card, 5.55 on --band */
  /* The prize and "today": one brass, as text (5.07 on --bg, 5.61 on --card, 4.68 on --band). */
  --gold: #85600e;
  /* Brass as a graphic, never text: the shelf mark's volume, the rollover ladder, the
     "when" rule (3:1 needed: 3.78 on --bg, 4.18 on --card, 3.49 on --band). */
  --brass: #9c7424;
  --band: #efe8da;
  --glow: rgb(217 181 99 / 16%);
  --shadow: 0 1px 2px rgb(21 33 59 / 6%), 0 8px 24px rgb(21 33 59 / 7%);
  /* The jackpot board: an ink-navy plate (on it: text 14.21, text-2 7.49, gold 9.03, line 4.60). */
  --board-bg: #15213b;
  --board-border: #15213b;
  --board-text: #f6f1e7;
  --board-text-2: #b7b1a3;
  --board-gold: #e4be66;
  /* The board's own button is light on the plate: ivory with an ink label (14.21). */
  --board-accent: #f6f1e7;
  --board-accent-text: #15213b;
  --board-line: #7e8aa2;
  --serif: ui-serif, Charter, Georgia, Cambria, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f2ede1; /* 15.63 on --bg, 13.92 on --card, 14.88 on --band */
    --text-2: #b7b1a3; /* 8.55 on --bg, 7.61 on --card, 6.61 on --selected */
    --bg: #0d1524;
    --card: #152036;
    --selected: #1f2b44;
    --border: #2c3a55;
    /* Light on dark: ivory buttons with ink labels (15.63), so brass stays the prize's and today's. */
    --accent: #f2ede1;
    --accent-text: #0d1524;
    --danger: #f4899a;
    --year: #86b0ee; /* 7.32 on --card */
    --gold: #e4be66; /* 10.31 on --bg, 9.18 on --card, 9.81 on --band */
    --brass: #d9b563; /* 9.34 on --bg */
    --band: #111a2c;
    --glow: rgb(217 181 99 / 8%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    /* A lighter plate with a brass rim, so it stands off the dark page
       (on it: text 13.67, text-2 7.20, gold 8.69, line 4.43). */
    --board-bg: #172441;
    --board-border: #d9b563;
  }
}

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

/* `hidden` wins over any display set below. */
[hidden] {
  display: none !important;
}

/* The last tournament, and after the series (main.js sets the class on <main>). */
main.final .hide-final,
main.ended .hide-ended {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--sans);
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Read by screen readers, not shown (#game-status). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.top {
  border-bottom: 1px solid var(--border);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

/* The lockup in live text: the shelf mark's four volumes (site/mark.svg, the brass one is
   "today") and the name stand on one shelf, the rule under them both. */
.brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 2px;
  border-bottom: 2px solid currentColor;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.brand-mark {
  flex: none;
  width: 38px;
  height: 34px;
  fill: currentColor;
}

.brand-mark .today {
  fill: var(--brass);
}

/* The full title: the name, and "On This Day in History" under it. */
.brand-text {
  display: flex;
  flex-direction: column;
  padding-bottom: 3px;
  line-height: 1.1;
}

.brand-tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.top nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top nav a:not(.button) {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.95rem;
}

.top nav a:not(.button):hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .top nav a:not(.button) {
    display: none;
  }
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  /* Short labels stay on one line; a long one wraps rather than pushing the page sideways. */
  white-space: normal;
  cursor: pointer;
}

/* Navy lifts, ivory whitens; the labels keep AA (hovered: 14.01 light, 17.19 dark). */
.button:hover {
  filter: brightness(1.3);
}

.button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.95rem;
}

.button.quiet {
  min-height: 44px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.button.quiet:hover {
  filter: none;
  border-color: var(--text-2);
}

/* The narrowest phones (320 px): the name and "Open the app" fit side by side. */
.top nav,
.top .button.small {
  min-width: 0;
}

@media (max-width: 359px) {
  .brand {
    gap: 8px;
    padding: 0;
    font-size: 1.1rem;
  }

  .brand-mark {
    width: 30px;
    height: 27px;
  }

  .brand-tag {
    font-size: 0.62rem;
  }

  .top .button.small {
    padding: 0 12px;
    font-size: 0.9rem;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- Shared text ---------- */

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 34em;
}

/* p.small: .button.small (the header's "Open the app") is a size, not this. */
.note,
p.small {
  color: var(--text-2);
  font-size: 0.9rem;
}

.note {
  margin-top: 14px;
}

/* A translation of the rules not yet reviewed: for information, the English is accepted. */
.note.draft {
  color: var(--text);
  font-weight: 600;
}

.fine {
  color: var(--text-2);
  font-size: 0.85rem;
  margin: 16px 0 0;
}

/* ---------- Sections ---------- */

.section {
  padding: 56px 0;
}

@media (min-width: 720px) {
  .section {
    padding: 72px 0;
  }
}

.section > .wrap > p {
  max-width: 40em;
}

.band {
  background: var(--band);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Links on the band: ink, underlined. */
.band a:not(.button) {
  color: var(--text);
}

/* ---------- The jackpot (#tournament) ---------- */

.jackpot-hero {
  padding: 20px 0 40px;
}

.jackpot-hero .eyebrow {
  margin-bottom: 8px;
}

.jackpot-hero h1 {
  font-size: clamp(2.1rem, 8.5vw, 3.6rem);
  margin-bottom: 16px;
}

.jackpot-hero .lede {
  margin: 24px 0 0;
}

.series-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  max-width: 44em;
}

/* Phones: as little as possible above the board, so the jackpot and the button to play show at once. */
@media (max-width: 399px) {
  .jackpot-hero {
    padding-top: 14px;
  }

  .jackpot-hero .eyebrow {
    margin-bottom: 4px;
    letter-spacing: 0.04em;
  }

  .jackpot-hero h1 {
    font-size: 1.85rem;
    margin-bottom: 12px;
  }

  .series-notice {
    margin-bottom: 12px;
    padding: 8px 12px;
    font-size: 0.95rem;
  }
}

/* The narrowest phones: the eyebrow's time is on the board too. */
@media (max-width: 359px) {
  .jackpot-hero .eyebrow {
    display: none;
  }
}

.facts {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.facts li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 600px) {
  .jackpot-hero {
    padding: 32px 0 56px;
  }

  .jackpot-hero h1 {
    max-width: 14em;
  }

  .board {
    max-width: 560px;
  }

  .facts {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (min-width: 880px) {
  .jackpot-hero {
    display: grid;
    min-height: min(calc(100vh - 65px), 760px);
    min-height: min(calc(100svh - 65px), 760px);
    padding: 48px 0;
    background: radial-gradient(60% 55% at 75% 50%, var(--glow), transparent 70%), var(--bg);
  }

  .jackpot-hero .wrap {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    grid-template-rows: auto 1fr auto auto auto auto auto 1fr;
    grid-template-areas:
      'notice notice'
      '. board'
      'eyebrow board'
      'h1 board'
      'sub board'
      'facts board'
      'results board'
      '. board';
    column-gap: 56px;
  }

  .series-notice {
    grid-area: notice;
    margin-bottom: 32px;
  }

  #hero-eyebrow {
    grid-area: eyebrow;
  }

  .jackpot-hero h1 {
    grid-area: h1;
  }

  .jackpot-hero .board {
    grid-area: board;
    align-self: center;
    max-width: none;
  }

  #hero-sub {
    grid-area: sub;
  }

  .facts {
    grid-area: facts;
  }

  .results-link {
    grid-area: results;
  }
}

/* Under the facts, and still there after the series: the results page. */
.results-link {
  margin: 16px 0 0;
  font-weight: 600;
}

/* The board: the almanac's plate for the jackpot. */
.board {
  container-type: inline-size;
  padding: 16px 16px 20px;
  border: 1px solid var(--board-border);
  border-radius: 20px;
  background: var(--board-bg);
  color: var(--board-text);
  box-shadow: var(--shadow);
}

@media (min-width: 400px) {
  .board {
    padding: 20px;
  }
}

@media (min-width: 720px) {
  .board {
    padding: 28px;
  }
}

.board p {
  margin: 0;
}

.board a:not(.button) {
  color: var(--board-text);
  text-decoration: underline;
}

.board a:focus-visible,
.board button:focus-visible {
  outline-color: var(--board-accent);
}

.board-label {
  color: var(--board-text-2);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.board .board-amount {
  margin: 4px 0 10px;
  color: var(--board-gold);
  font-family: var(--serif);
  font-size: clamp(2.6rem, 11vw, 5.5rem);
  font-size: clamp(2.6rem, 15cqi, 5.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.board .board-amount.long {
  font-size: clamp(2.1rem, 9vw, 4.5rem);
  font-size: clamp(2.1rem, 12cqi, 4.5rem);
}

/* Beside the headline on wide screens: larger than it. */
@media (min-width: 880px) {
  .board .board-amount {
    font-size: clamp(3.5rem, 20cqi, 6rem);
  }

  .board .board-amount.long {
    font-size: clamp(2.4rem, 13cqi, 5rem);
  }
}

.board-amount .cur {
  margin-right: 0.06em;
  font-size: 0.45em;
  vertical-align: 0.9em;
}

.board .chip {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 12px;
  border: 1px solid var(--board-gold);
  border-radius: 999px;
  color: var(--board-gold);
  font-size: 0.85rem;
  font-weight: 650;
}

.board .chip.last {
  border-color: var(--board-line);
  color: var(--board-text);
}

.board-when {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

@media (min-width: 400px) {
  .board-when {
    font-size: 1.35rem;
  }
}

/* Under the button: what the amount includes, when it's fixed, and the rollover (or, the last time, that it isn't paid). */
.board .board-detail {
  margin-top: 14px;
  color: var(--board-text-2);
  font-size: 0.97rem;
}

.board .board-detail.strong {
  color: var(--board-text);
  font-size: 1rem;
  font-weight: 600;
}

/* The jackpot's conditions, next to every jackpot figure: small, like the notes under the button. */
.board .board-terms {
  margin-top: 6px;
  color: var(--board-text-2);
  font-size: 0.85rem;
}

.board .board-now {
  margin-top: 8px;
  font-weight: 650;
  line-height: 1.4;
}

/* The dot only while the lobby is open or the game on (main.js sets .dot); no animation.
   Brass: the game is today's. */
.board-now.dot::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--board-gold);
  vertical-align: 0.12em;
}

.board .board-play {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 8px 20px;
  background: var(--board-accent);
  color: var(--board-accent-text);
  font-size: 1.05rem;
  white-space: normal;
}

.board .board-note,
.board .board-days {
  margin-top: 8px;
  color: var(--board-text-2);
  font-size: 0.9rem;
}

.board .board-days {
  margin-top: 4px;
}

.board-more {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 400px) {
  .board-more {
    grid-template-columns: 1fr 1fr;
  }

  main.final .board-more {
    grid-template-columns: 1fr;
  }
}

.board .button.quiet {
  width: 100%;
  min-height: 44px;
  padding: 6px 16px;
  border: 1.5px solid var(--board-line);
  color: var(--board-text);
  white-space: normal;
}

.board .button.quiet:hover {
  border-color: var(--board-text-2);
}

.board .fine {
  margin-top: 16px;
  color: var(--board-text-2);
  font-size: 0.85rem;
}

/* ---------- The rollover (#rollover) ---------- */

.rollover .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.rollover-text p {
  margin: 0;
}

.rollover-text p + p {
  margin-top: 12px;
}

.ladder {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 14px;
  font-weight: 600;
}

.ladder li {
  --share: 20%;
  --rise: 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ladder li:nth-child(2) {
  --share: 40%;
  --rise: 70px;
}

.ladder li:nth-child(3) {
  --share: 60%;
  --rise: 100px;
}

.ladder li:nth-child(4) {
  --share: 80%;
  --rise: 130px;
}

.ladder li:nth-child(5) {
  --share: 100%;
  --rise: 160px;
}

/* Under each label on phones; above it (a column) from 720 px. */
.ladder li::before {
  content: '';
  order: 2;
  width: var(--share);
  height: 12px;
  border-radius: 6px;
  background: var(--brass);
}

/* The last one fades out: there is no upper limit. */
.ladder li:last-child::before {
  background: linear-gradient(to right, var(--brass) 55%, transparent);
}

.capstone {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
}

.caption {
  color: var(--text-2);
  font-size: 0.9rem;
  margin: 0;
}

@media (min-width: 720px) {
  .rollover .wrap {
    grid-template-columns: 2fr 3fr;
    align-items: center;
    column-gap: 48px;
  }

  .ladder {
    display: flex;
    align-items: stretch;
    gap: 12px;
    font-size: 0.9rem;
  }

  /* A row as tall as the tallest bar, then the label: the bars stand on one line, the labels hang from it. */
  .ladder li {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    grid-template-rows: 160px auto;
    align-content: start;
    gap: 10px;
    text-align: center;
  }

  .ladder li::before {
    order: 0;
    align-self: end;
    width: 100%;
    height: var(--rise);
    border-radius: 6px 6px 0 0;
  }

  .ladder li:last-child::before {
    background: linear-gradient(to top, var(--brass) 55%, transparent);
  }
}

/* ---------- How Sunday works (#how) ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

@media (min-width: 880px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--serif);
  font-weight: 700;
}

.steps strong {
  display: block;
}

.steps span {
  color: var(--text-2);
}

/* ---------- Start preparing today (#prepare) ---------- */

.prepare .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 880px) {
  .prepare .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 56px;
  }
}

.prepare-when {
  padding-left: 12px;
  border-left: 3px solid var(--brass);
  color: var(--text);
  font-weight: 600;
}

/* Today's highlights, from Wikipedia */
.today {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 22px 16px;
}

.today-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.today-head h3 {
  font-size: 1.35rem;
  margin: 0;
}

/* Today's date, in the brass kept for "today". */
.today-head span {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 650;
}

.today ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.today li {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.today li:first-child {
  border-top: 0;
}

.year {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--year);
  font-variant-numeric: tabular-nums;
}

.today .fact {
  font-size: 0.97rem;
}

/* One message across the card, not in the year column. */
.today .status {
  display: block;
  color: var(--text-2);
  padding: 12px 0;
}

.credit {
  color: var(--text-2);
  font-size: 0.78rem;
  margin: 10px 0 0;
}

.band .credit a,
.credit a {
  color: inherit;
}

/* ---------- Is there a catch? (#faq) ---------- */

.faq-list {
  max-width: 760px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 12px 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: '+';
  content: '+' / '';
  flex: none;
  width: 1em;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.faq-list details[open] > summary::after {
  content: '−';
  content: '−' / '';
}

.faq-list details p {
  margin: 0 0 18px;
  max-width: 40em;
}

.faq-more {
  margin-top: 24px;
}

/* Which eligible countries take entries now (main.js, from the games server). */
.faq-list details p.faq-open {
  margin-top: -8px;
  color: var(--text-2);
}

/* ---------- The app (#app) and features ---------- */

.features {
  display: grid;
  gap: 28px;
  margin-top: 40px;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.features h3 {
  margin-bottom: 6px;
}

.features p {
  color: var(--text-2);
  margin: 0;
}

/* ---------- Install (#get) ---------- */

.cards {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

@media (min-width: 780px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.card ol {
  margin: 0;
  padding-left: 1.2em;
}

.card li {
  margin: 6px 0;
}

.card.yours {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card .yours-tag {
  display: none;
  position: absolute;
  top: -12px;
  left: 18px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.card.yours .yours-tag {
  display: block;
}

@media (max-width: 779px) {
  .card.yours {
    order: -1;
  }
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.store {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 12px 18px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  color: var(--text-2);
}

.store strong {
  color: var(--text);
}

/* ---------- See you Sunday (#sunday) ---------- */

.sunday .wrap {
  max-width: 672px;
  text-align: center;
}

.sunday .wrap > p {
  margin-left: auto;
  margin-right: auto;
}

.sunday .actions {
  justify-content: center;
}

.sunday .button {
  white-space: normal;
}

.sunday-block {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.sunday-block p.small {
  margin: 12px 0 0;
}

.sunday .label {
  margin: 20px 0 6px;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clipping {
  margin: 0;
  padding: 14px 16px;
  border: 1.5px dashed var(--text-2);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.share-buttons .button {
  min-height: 48px;
  padding: 6px 10px;
  font-size: 0.95rem;
}

@media (min-width: 560px) {
  .share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .share-buttons .button {
    padding: 6px 20px;
  }
}

.sunday .status-line {
  color: var(--text);
  font-weight: 600;
}

.sunday .status-line:empty {
  margin: 0;
}

.sunday .fine {
  margin-top: 32px;
}

/* ---------- Results (/results; results.js builds the tournaments) ---------- */

.results-status {
  margin-top: 28px;
  color: var(--text-2);
}

.result {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.page .result h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
}

.result-tags {
  margin: 0 0 12px;
}

.result-tag {
  display: inline-block;
  margin: 0 8px 6px 0;
  padding: 2px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 650;
}

.result-outcome {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.4;
}

.result-numbers {
  margin-bottom: 6px;
  font-weight: 650;
}

.page .result-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}

.page .result-facts li {
  margin: 0;
}

.result-part h3 {
  margin: 28px 0 12px;
}

.q-cards {
  display: grid;
  gap: 14px;
}

.q-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.q-card.try {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.q-card p {
  margin: 0 0 8px;
}

.q-card > :last-child {
  margin-bottom: 0;
}

.q-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.q-subject {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.q-prompt,
.q-meta,
.q-source {
  color: var(--text-2);
}

.q-meta,
.q-source {
  font-size: 0.92rem;
}

.q-result {
  font-weight: 700;
}

.q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.q-option {
  min-height: 48px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: 650 1.05rem/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.q-option:hover {
  border-color: var(--accent);
}

.q-option[aria-disabled='true'] {
  cursor: default;
}

.q-option[aria-disabled='true']:hover {
  border-color: var(--border);
}

/* After a tap: the right answer ticked (in the Events blue), a wrong choice crossed (in red). */
.q-option.right,
.q-option.right:hover {
  border-color: var(--year);
  border-width: 3px;
}

.q-option.right::after {
  content: ' ✓';
  content: ' ✓' / '';
  color: var(--year);
}

.q-option.wrong,
.q-option.wrong:hover {
  border-color: var(--danger);
  border-style: dashed;
}

.q-option.wrong::after {
  content: ' ✗';
  content: ' ✗' / '';
  color: var(--danger);
}

.q-reveal {
  font-weight: 700;
}

.q-card .q-reveal:empty {
  margin: 0;
}

.q-answer summary,
.result-all > summary {
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

.q-answer p {
  margin: 8px 0 0;
}

.result-all {
  margin-top: 24px;
}

.q-list {
  margin: 12px 0 0;
  padding-left: 1.6em;
}

.page .q-list li {
  margin: 0 0 14px;
}

.q-list p {
  margin: 0;
}

.q-list .q-subject {
  font-size: 1rem;
}

.q-list .q-source {
  font-size: 0.9rem;
}

.q-list .removed .q-line {
  color: var(--danger);
}

.page .result-countries {
  max-width: 360px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page .result-countries li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.result-countries .n {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.result-share {
  margin-top: 24px;
}

/* Older tournaments: folded under their heading. */
.result.older > details > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  list-style: none;
  cursor: pointer;
}

.result.older > details > summary::-webkit-details-marker {
  display: none;
}

.result.older > details > summary::after {
  content: '+';
  content: '+' / '';
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}

.result.older > details[open] > summary::after {
  content: '−';
  content: '−' / '';
}

.page .result.older h2 {
  font-size: 1.3rem;
}

.result.older .result-head {
  flex: 1;
}

.results-about {
  margin-top: 32px;
}

.results-about + .results-about {
  margin-top: 0;
}

.results-share {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.page .results-share h2 {
  margin-top: 0;
}

.results-share .label {
  margin: 12px 0 6px;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.results-share p.small {
  margin: 12px 0 0;
}

.results-share .status-line {
  color: var(--text);
  font-weight: 600;
}

.results-share .status-line:empty {
  margin: 0;
}

@media (min-width: 560px) {
  .results-share .share-buttons {
    justify-content: flex-start;
  }
}

.results-next {
  margin-top: 40px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--band);
}

.results-next p {
  margin: 0 0 8px;
}

.results-next .fine {
  margin-top: 16px;
}

/* ---------- Text pages (rules, privacy, Plus, terms, refunds, legal notice) ---------- */

.page {
  padding: 48px 0 64px;
}

.page .wrap {
  max-width: 760px;
}

.page h2 {
  font-size: 1.45rem;
  margin-top: 1.8em;
}

.page .meta {
  color: var(--text-2);
}

/* The rules in the other languages, under the version line. */
.page .langs {
  color: var(--text-2);
  font-size: 0.95rem;
}

.page ul {
  padding-left: 1.2em;
}

.page li {
  margin: 6px 0;
}

/* ---------- Mnemocracy Plus (/plus, /terms) ---------- */

.plus-features {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  display: grid;
  gap: 14px;
}

.page .plus-features li {
  margin: 0;
  color: var(--text-2);
}

.plus-features strong {
  display: block;
  color: var(--text);
}

.plans {
  display: grid;
  gap: 16px;
  margin: 8px 0 28px;
}

@media (min-width: 720px) {
  .plans {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
}

.plan h3 {
  margin-bottom: 4px;
}

.plan .plan-price {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.plan p:not(.plan-price) {
  color: var(--text-2);
  font-size: 0.95rem;
}

/* The buttons line up at the bottom of the cards. */
.plan .button {
  margin-top: auto;
}

/* ---------- Cancel and withdraw (/cancel, /withdraw) ---------- */

/* "Cancel contracts here" in German and French, under the heading. */
.contract p[lang] {
  margin: 0 0 4px;
  color: var(--text-2);
}

.contract-form {
  margin-top: 28px;
}

.contract-form fieldset {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.contract-form legend,
.field > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.contract-form legend {
  padding: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  cursor: pointer;
}

.radio input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.radio .hint {
  display: block;
}

.field {
  margin: 0 0 24px;
}

/* A choice's own fields, under it. */
.field.sub {
  margin: 4px 0 16px 30px;
}

/* Phones: the whole width, so the key's example fits. */
@media (max-width: 479px) {
  .field.sub {
    margin-left: 0;
  }
}

.field > label:not(:first-child) {
  margin-top: 14px;
}

.contract-form #key::placeholder {
  font-size: 0.8em;
}

.contract-form input[type='text'],
.contract-form input[type='email'],
.contract-form input[type='date'],
.contract-form textarea {
  display: block;
  width: 100%;
  max-width: 32em;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.contract-form input[type='date'] {
  width: auto;
}

.contract-form textarea {
  resize: vertical;
}

.contract-form input:focus-visible,
.contract-form textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.contract-form [aria-invalid='true'] {
  border-color: var(--danger);
}

.hint {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.form-error {
  padding: 12px 16px;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  background: var(--card);
  font-weight: 600;
}

.contract-step {
  margin-top: 28px;
}

.contract-step h2 {
  margin-top: 0;
}

.contract-step h2:focus {
  outline: none;
}

.page .lines {
  margin: 0 0 20px;
  padding: 16px 20px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.page .lines li {
  margin: 4px 0;
}

.contract .button:disabled {
  cursor: progress;
  opacity: 0.7;
}

/* Printing the confirmation: only the confirmation. */
@media print {
  .top,
  .foot,
  .skip,
  .contract .actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page {
    padding: 0;
  }

  .page .lines {
    border-color: #999;
  }
}

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

.foot {
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  color: var(--text-2);
  font-size: 0.9rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 18px;
}

.foot nav a {
  color: var(--text);
  font-weight: 600;
}

.foot p {
  max-width: 60em;
  margin: 0 0 8px;
}

.foot a {
  color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
