:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #5b6673;
  --paper: #f7f4ec;
  --card: #ffffff;
  --rule: #e5dfd2;
  --runner-h: 96px;
  --runner-w: 66px;
  --lane-h: calc(var(--runner-h) + 58px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }

/* Header */
/* Read by screen readers but not shown. Used instead of aria-label on
   sections because Google Translate stops updating text inside them */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.n::after { content: attr(data-n); }
/* Margins instead of spaces, which Google Translate drops around them */
.gap { margin: 0 .3em; }
.card-total .num { margin-right: .3em; }
.hero { position: relative; padding-top: 34px; text-align: center; margin-bottom: 18px; }

/* EN/ES switch */
.lang-bar {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-note { font-size: 13px; font-weight: 600; color: var(--muted); }
.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.lang::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--ink);
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.lang[aria-checked="true"]::before { transform: translateX(100%); }
.lang span { position: relative; padding: 4px 10px; color: var(--muted); transition: color .25s; }
.lang[aria-checked="false"] span:first-child,
.lang[aria-checked="true"] span:last-child { color: #fff; }
.lang.busy::before { animation: lang-busy .9s ease-in-out infinite alternate; }
@keyframes lang-busy { to { opacity: .45; } }
.lang:hover { border-color: var(--ink); }
.lang:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }

/* Hide Google Translate's banner, tooltips, hover highlights and floating
   progress spinner. The spinner only has an obfuscated class that Google
   could rename */
iframe.skiptranslate, #goog-gt-tt, .goog-te-balloon-frame,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin: .2em 0 .15em;
  font-size: clamp(30px, 5.5vw, 50px);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.sub { margin: 0; color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); }

/* Year picker */
.matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.pick {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: var(--card);
}
.chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 44px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  cursor: pointer;
  transition: background .2s, color .2s;
  touch-action: manipulation;
}
.chip small { font-size: 10px; font-weight: 700; letter-spacing: .02em; opacity: .7; }
.chip:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.chip[aria-pressed="true"] { background: var(--c); color: #fff; cursor: default; }
.chip[aria-pressed="true"] small { opacity: .9; }
/* The other lane's year: picking it swaps lanes */
.chip.taken { color: var(--muted); }
.chip.taken::after { content: "⇄"; position: absolute; top: 1px; right: 7px; font-size: 11px; }
.chip:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.vs {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Scoreboard */
.board {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.card {
  padding: 10px 12px;
  border: 2px solid var(--rule);
  border-radius: 12px;
  transition: border-color .3s, box-shadow .3s;
}
.card.leading { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.card-name { font-weight: 800; }
.card-day {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.card-total {
  margin-top: 2px;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.card-unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.bar { height: 8px; margin-top: 6px; border-radius: 99px; background: #eee8dc; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); }
.lead {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}
.lead a { color: var(--ink); text-underline-offset: 3px; }

/* Two-option pill switches */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
}
.seg-btn {
  padding: .4em 1em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-btn:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.view-switch { display: flex; width: max-content; max-width: 100%; margin: 0 auto 12px; }
.view-switch .seg-btn { padding: .5em 1.25em; font-size: 16px; }

/* Data view */
.data {
  padding: 16px 18px 10px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(31, 41, 51, .1);
  animation: data-in .35s ease-out;
}
@keyframes data-in { from { opacity: 0; transform: translateY(8px); } }
.data-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.data-title { margin: 0; font-size: clamp(18px, 3vw, 22px); }
.data-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; font-size: 14px; font-weight: 800; }
.data-legend span::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c);
  vertical-align: -1px;
}
.days { margin: 0; padding: 0; list-style: none; }
.day {
  display: grid;
  grid-template-columns: 3.8em 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--rule);
}
.day-label { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.day-bars { display: grid; gap: 4px; }
.day-bar { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.day-fill {
  flex: none;
  width: calc((100% - 5em) * var(--p, 0));
  min-width: 3px;
  height: 13px;
  border-radius: 99px;
  background: var(--c);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.day-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-bar.empty .day-fill { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); width: 22px; }
.day-note { color: var(--muted); font-size: 13px; font-weight: 600; font-style: italic; white-space: nowrap; }
.day-val[data-n=""], .day-note:empty { display: none; }

/* Scene */
.scene {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #5fb35a;
  box-shadow: 0 10px 30px rgba(31, 41, 51, .18);
  user-select: none;
  -webkit-user-select: none;
  /* Fast taps when racing yourself shouldn't zoom the page */
  touch-action: manipulation;
}
.sky {
  position: relative;
  height: clamp(64px, 10vw, 100px);
  background: linear-gradient(#8fd3ff, #d9f1ff);
}
.sun {
  position: absolute;
  top: 12px;
  left: 4%;
  width: clamp(24px, 4vw, 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffd84d;
  box-shadow: 0 0 0 8px rgba(255, 216, 77, .25);
}
.cloud {
  position: absolute;
  height: 16px;
  border-radius: 20px;
  background: #fff;
  opacity: .9;
  animation: drift 40s ease-in-out infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.cloud::before { width: 24px; height: 24px; left: 10px; top: -11px; }
.cloud::after { width: 18px; height: 18px; left: 28px; top: -7px; }
.c1 { width: 60px; top: 28px; left: 18%; }
.c2 { width: 48px; top: 14px; left: 48%; opacity: .75; animation-duration: 55s; }
.c3 { width: 70px; top: 40px; left: 72%; animation-duration: 48s; }
@keyframes drift { 50% { transform: translateX(40px); } }

.sign {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  z-index: 1;
}
.sign::after { content: ""; width: 3px; height: clamp(14px, 3.5vw, 32px); background: #6b7280; }
.sign span {
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(10px, 1.6vw, 14px);
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.finish-sign span { background: #dc2626; color: #fff; }
.finish-sign.won span { animation: flash .45s ease-in-out 8 alternate; }
@keyframes flash { to { background: #facc15; color: var(--ink); transform: scale(1.18); } }

.grass {
  height: 14px;
  background: repeating-linear-gradient(90deg, #5fb35a 0 18px, #56a851 18px 36px);
}
.grass.bottom { height: 20px; }

.road {
  position: relative;
  padding: 2px 0;
  border-block: 4px solid #f3f4f6;
  background:
    radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.5px) 0 0 / 9px 9px,
    #4b5058;
}
.lane { position: relative; height: var(--lane-h); z-index: 2; }
.lane + .lane { border-top: 3px dashed rgba(255, 255, 255, .6); }
.line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  transform: translateX(-50%);
  z-index: 1;
}
.start-line { background: #fff; }
.finish-line {
  width: 14px;
  background: conic-gradient(#111 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0 / 7px 7px;
}

.runner {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: var(--runner-w);
  height: var(--runner-h);
  z-index: 2;
  will-change: transform;
}
.runner svg { display: block; width: 100%; height: 100%; overflow: visible; }

.bubble {
  --tip: 50%;
  position: absolute;
  top: 3px;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  white-space: nowrap;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(11px, 1.5vw, 14px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  will-change: transform;
}
.bubble b { color: var(--c); }
.bubble span { font-weight: 700; font-variant-numeric: tabular-nums; }
.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tip);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--c);
}
.bubble.won { background: var(--c); color: #fff; }
.bubble.won b { color: #fff; }
.bubble.won::before { content: "🏆"; }

/* Start overlay and countdown */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, .3);
}
.play-btn {
  padding: .5em 1.2em;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(15, 23, 42, .55);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.play-btn:hover { background: rgba(15, 23, 42, .8); transform: translateY(-2px); }
.play-btn:focus-visible, .pad-btn:focus-visible { outline: 3px solid #facc15; outline-offset: 3px; }

/* Positive voting actions the player leaves behind as they run */
.tap-msg {
  position: absolute;
  bottom: 12%;
  /* Under the runner so a message never hides them */
  z-index: 1;
  padding: 3px 9px;
  border: 2px solid #16a34a;
  border-radius: 12px;
  background: #fff;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  /* Long messages wrap rather than run off a narrow track */
  width: max-content;
  max-width: calc(100% - 24px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
  pointer-events: none;
  animation: tap-msg 1.8s ease-out forwards;
}
@keyframes tap-msg {
  0% { opacity: 0; transform: translate(14px, 10px) scale(.85); }
  12% { opacity: 1; transform: translate(0, 0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-12px, -96px); }
}
@keyframes tap-msg-fade { 12%, 70% { opacity: 1; } 0%, 100% { opacity: 0; } }
@media (max-width: 560px) { .tap-msg { font-size: 11px; } }

/* On-screen Run button for racing yourself, bottom-right for a thumb */
.pad {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
}
.pad-btn {
  height: 64px;
  padding: 0 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(22, 163, 74, .9);
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pad-btn:active { transform: scale(.92); background: #15803d; }
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .7em 1.5em;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #15803d);
  color: #fff;
  font: inherit;
  font-size: clamp(20px, 3.6vw, 30px);
  font-weight: 900;
  box-shadow: 0 7px 0 #14532d, 0 14px 30px rgba(0, 0, 0, .3);
  cursor: pointer;
  animation: pulse 1.6s ease-in-out infinite;
  touch-action: manipulation;
}
.start-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #14532d, 0 6px 14px rgba(0, 0, 0, .3); animation: none; }
.start-btn:focus-visible, .again-btn:focus-visible { outline: 4px solid #facc15; outline-offset: 4px; }
.go-icon { font-size: .8em; }
@keyframes pulse { 50% { transform: scale(1.05); } }

.countdown {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(56px, 12vw, 120px);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 30px rgba(0, 0, 0, .3);
  pointer-events: none;
  opacity: 0;
}
.countdown.pop { animation: pop .45s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.4); }
  20% { opacity: 1; transform: scale(1.1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* Result */
.result {
  margin-top: 14px;
  padding: 16px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  animation: rise .5s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.result-title { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 900; }
.result-sub { margin: 4px 0 14px; color: var(--muted); }
.result-you { margin: -6px 0 14px; font-weight: 800; color: #15803d; }
.again-btn {
  padding: .6em 1.3em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.again-btn:hover { background: var(--ink); color: #fff; }

.note { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* Encouragement modal */
.cheer {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.cheer[open] { animation: cheer-in .5s cubic-bezier(.2, 1.4, .4, 1); }
.cheer[open]::backdrop { background: rgba(15, 23, 42, .55); animation: fade-in .3s ease-out; }
.cheer.closing { animation: cheer-out .22s ease-in forwards; }
.cheer.closing::backdrop { animation: fade-out .22s ease-in forwards; }
@keyframes cheer-in { from { opacity: 0; transform: translateY(30px) scale(.85); } }
@keyframes cheer-out { to { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.cheer-card {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px 22px 20px;
  text-align: center;
  background: var(--card);
  border-radius: inherit;
  border-top: 6px solid #22c55e;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.cheer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: #f1ede4;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
/* Grows the tap target to cover the whole top-right corner */
.cheer-close::after { content: ""; position: absolute; inset: -10px; border-radius: 0 0 0 24px; }
.cheer-close:hover { background: #e5dfd2; transform: scale(1.08); }
.cheer-close:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.cheer-icon {
  font-size: 44px;
  line-height: 1;
  animation: cheer-wiggle 1.4s ease-in-out .4s infinite;
  transform-origin: 70% 70%;
}
@keyframes cheer-wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  15%, 45% { transform: rotate(-12deg) scale(1.08); }
  30% { transform: rotate(10deg) scale(1.08); }
}
.cheer-title { margin: 10px 0 2px; font-size: clamp(21px, 4.5vw, 26px); font-weight: 900; line-height: 1.2; }
.cheer-intro { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.cheer-msg {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 5px solid #22c55e;
  border-radius: 10px;
  background: #f1f8f1;
  font-size: 17px;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cheer-msg.swap { animation: msg-in .35s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateX(14px); } }
.cheer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cheer-actions button {
  padding: .6em 1.2em;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.cheer-next { border: 0; background: linear-gradient(180deg, #22c55e, #15803d); color: #fff; box-shadow: 0 4px 0 #14532d; }
.cheer-next:active { transform: translateY(3px); box-shadow: 0 1px 0 #14532d; }
.cheer-done { border: 2px solid var(--ink); background: #fff; color: var(--ink); }
.cheer-done:hover { background: var(--ink); color: #fff; }
.cheer-say { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.cheer-say summary {
  display: inline-block;
  padding: .35em .9em;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.cheer-say summary::-webkit-details-marker { display: none; }
.cheer-say summary:hover, .cheer-say[open] summary { background: #f1ede4; color: var(--ink); }
.cheer-say summary:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.cheer-say-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.cheer-say[open] .cheer-say-options { animation: say-pop .3s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes say-pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.cheer-say-options a {
  display: inline-block;
  padding: .45em 1em;
  border: 2px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.cheer-say-options a:hover { border-color: var(--ink); transform: translateY(-2px); }
.cheer-say-options a:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.cheer button:focus-visible { outline: 3px solid #facc15; outline-offset: 3px; }

@media (max-width: 560px) {
  .page { padding-top: 16px; }
  .board { padding: 12px; }
}

/* Bonus clip: a retro TV that has to be switched on */
.clip { margin-top: 22px; animation: tv-drop .7s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes tv-drop { from { opacity: 0; transform: translateY(-30px) rotate(-4deg) scale(.9); } }
.clip-title { margin: 0 0 58px; font-size: 18px; font-weight: 900; }
.tv {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  padding: 14px 14px 52px;
  border-radius: 22px;
  background: linear-gradient(160deg, #b45f2a, #7c3a14);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .12), 0 12px 24px rgba(0, 0, 0, .25);
}
/* Rabbit-ear antennas */
.tv::before, .tv::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 4px;
  height: 46px;
  border-radius: 4px;
  background: #4b5563;
  transform-origin: bottom center;
  animation: antenna 2.4s ease-in-out infinite;
}
.tv::before { --tilt: -32deg; transform: rotate(var(--tilt)); }
.tv::after { --tilt: 28deg; transform: rotate(var(--tilt)); animation-delay: -1.2s; }
@keyframes antenna { 50% { transform: rotate(calc(var(--tilt) * 1.25)); } }
.tv-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px / 18px;
  background: #111;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .9);
}
/* Static until the TV is turned on */
.clip:not(.on) .tv-screen::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    repeating-radial-gradient(circle at 17% 32%, #ddd 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 63% 71%, #888 0 1px, transparent 1px 4px),
    #222;
  opacity: .55;
  animation: static .25s steps(4) infinite;
}
@keyframes static {
  25% { transform: translate(-7%, 5%); }
  50% { transform: translate(6%, -4%); }
  75% { transform: translate(-3%, -8%); }
  100% { transform: translate(5%, 6%); }
}
.tv-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  animation: power-on .6s ease-out;
}
@keyframes power-on {
  0% { transform: scale(1, .01); filter: brightness(4); }
  45% { transform: scale(1, .02); filter: brightness(3); }
  100% { transform: none; filter: none; }
}
.tv-power {
  position: absolute;
  top: calc(14px + (100% - 66px) / 2);
  left: 50%;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .55em 1.1em;
  border: 0;
  border-radius: 999px;
  background: #facc15;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 5px 0 #a16207, 0 10px 20px rgba(0, 0, 0, .4);
  cursor: pointer;
  animation: pulse 1.6s ease-in-out infinite;
}
.tv-power:active { box-shadow: 0 2px 0 #a16207; translate: -50% calc(-50% + 3px); animation: none; }
.tv-power:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.clip.on .tv-power { display: none; }
.tv-knob {
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ink) 0 8%, transparent 8%);
}
.tv-panel {
  position: absolute;
  right: 22px;
  bottom: 12px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tv-panel i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e5e7eb, #6b7280);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.tv-panel b {
  flex: 1;
  height: 18px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 3px, transparent 3px 6px);
}
.clip-link { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* More about early voting */
.more {
  margin-top: 28px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  scroll-margin-top: 16px;
}
.more:target { animation: flash-ring 1.6s ease-out; }
@keyframes flash-ring { from { box-shadow: 0 0 0 6px #facc15; } }
.more h2 { margin: 0 0 12px; font-size: clamp(20px, 3.5vw, 26px); }
.more-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.more-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.more-links a::after { content: "↗"; margin-left: auto; align-self: flex-start; color: var(--muted); }
.link-icon { flex: none; font-size: 20px; }
.link-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.link-text small { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--muted); }
.more-links a:hover { border-color: var(--ink); transform: translateY(-2px); }
.more-links a:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 40px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.footer p { margin: 0; }
.footer a { color: var(--ink); font-weight: 600; }
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.source-link:hover { border-color: var(--ink); transform: translateY(-2px); }
.source-link:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .start-btn, .cloud, .cheer-icon, .cheer-msg.swap,
  .cheer[open], .cheer[open]::backdrop, .data, .lang::before, .lang.busy::before, .cheer-say[open] .cheer-say-options,
  .clip, .tv::before, .tv::after, .clip:not(.on) .tv-screen::before,
  .tv-screen iframe, .tv-power, .more:target { animation: none; }
  .day-fill { transition: none; }
  .tap-msg { animation-name: tap-msg-fade; }
}
