/* Gridiron Reels: a molded-plastic arcade football machine in daylight.
   Pylon orange body, referee-stripe trim, penalty-flag yellow for the one big action. */
:root {
  --pylon: oklch(0.72 0.17 50);
  --pylon-deep: oklch(0.62 0.17 44);
  --ink: oklch(0.21 0.03 265);
  --ink-soft: oklch(0.34 0.03 265);
  --cream: oklch(0.96 0.025 90);
  --cream-deep: oklch(0.89 0.035 88);
  --flag: oklch(0.89 0.17 98);
  --flag-deep: oklch(0.72 0.15 88);
  --turf: oklch(0.46 0.11 160);
  --miss: oklch(0.48 0.19 27);
  --display: "Bowlby One", Impact, "Arial Black", sans-serif;
  --text: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--pylon);
  color: var(--ink);
  font: 500 1rem/1.5 var(--text);
  font-variation-settings: "wdth" 100;
  min-height: 100vh;
}

.floor {
  display: grid;
  gap: 28px;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(10px, 3vw, 40px) clamp(10px, 3vw, 32px) 40px;
}
@media (min-width: 900px) {
  .floor { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); column-gap: 56px; align-items: start; }
  #ad-slot, footer { grid-column: 1 / -1; }
  #ad-slot { margin-top: 122px; } /* with the 28px row gap: 150px clear of the game */
  #how { margin-top: 72px; rotate: 1.2deg; }
}

/* ---------- the machine ---------- */
.cabinet {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.cabinet > section, .modes { padding-inline: clamp(12px, 4vw, 24px); }

.marquee {
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(12px, 4vw, 24px) 12px;
}
h1 {
  margin: 0;
  font: 400 clamp(1.7rem, 8.4vw, 2.9rem)/0.92 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
h1 span { display: block; color: var(--flag); }

.counters { display: flex; gap: 8px; margin: 0; }
.counters div { text-align: center; }
.counters dt { font-size: 0.8125rem; font-weight: 700; line-height: 1.3; }
.counters dd {
  margin: 0;
  min-width: 3.4rem;
  padding: 2px 8px;
  background: var(--cream);
  color: var(--ink);
  border-radius: 8px;
  font: 800 1.2rem/1.3 var(--text);
  font-variation-settings: "wdth" 80;
  font-variant-numeric: tabular-nums;
}

.stripes { height: 14px; background: repeating-linear-gradient(90deg, var(--ink) 0 14px, var(--cream) 14px 28px); border-bottom: 4px solid var(--ink); }

.modes { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 14px 12px; }
.rocker { display: flex; background: var(--ink); border-radius: 999px; padding: 4px; }
.rocker button {
  border: 0; border-radius: 999px; padding: 7px 14px; min-height: 44px; background: none; color: var(--cream);
  font: 700 0.95rem/1.2 var(--text); cursor: pointer;
}
.rocker button[aria-pressed="true"] { background: var(--flag); color: var(--ink); }
#mute {
  border: 0; background: none; color: var(--ink-soft); padding: 7px 4px; min-height: 44px;
  font: 600 0.9rem/1.2 var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.rocker button:focus-visible, .marquee :focus-visible { outline-color: var(--flag); }

/* ---------- reels ---------- */
#reels {
  list-style: none; margin: 0; padding: 10px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px;
  background: var(--ink); border-radius: 18px;
}

.reel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reel .label { color: var(--cream); font-size: 0.8125rem; font-weight: 700; font-variation-settings: "wdth" 85; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel .window {
  height: 68px; border-radius: 10px; overflow: hidden;
  background: var(--cream-deep);
  box-shadow: inset 0 5px 0 oklch(0.21 0.03 265 / 0.16);
  display: grid; place-items: center; padding: 4px;
  border: 0; width: 100%; font: inherit; /* a button: tapping a hidden reel calls the audible */
}
.reel.callable .window { cursor: pointer; box-shadow: inset 0 5px 0 oklch(0.21 0.03 265 / 0.16), 0 0 0 2px var(--flag); }
.reel.callable .window:hover { background: var(--cream); }
.reel .window:focus-visible { outline-color: var(--flag); }
.reel .value {
  font: 800 clamp(0.98rem, 4.4vw, 1.22rem)/1.02 var(--text);
  font-variation-settings: "wdth" 75;
  text-align: center; text-wrap: balance; overflow-wrap: anywhere;
  color: oklch(0.21 0.03 265 / 0.28);
}
.reel.revealed[data-clue="position"] .value, .reel.revealed[data-clue="jersey"] .value { font-size: 1.9rem; }
.reel.revealed .window { background: var(--cream); }
.reel.revealed .value { color: var(--ink); }
.reel.revealed[data-clue="team"] .value { color: var(--cream); }
.reel.spinning .value { color: var(--ink-soft); animation: roll 0.14s linear infinite; }
.reel.lock .value { animation: settle 0.5s var(--out); }
@keyframes roll { from { transform: translateY(-120%); } to { transform: translateY(120%); } }
@keyframes settle { from { transform: translateY(-90%); } to { transform: none; } }

/* ---------- the dispensed card: takes the reels' place when a round ends ---------- */
#card-wrap {
  display: grid; justify-items: center; padding: 12px 10px 2px; margin-bottom: 14px;
  background: var(--ink); border-radius: 18px; position: relative;
  --card-w: min(168px, 54%); /* sized so the longest result line still fits one phone screen */
}
/* a foil pull catches the light once: a band crossing the card, laid over the canvas */
#card-wrap.sweep::after {
  content: ""; position: absolute; top: 12px; left: 50%; translate: -50%; pointer-events: none;
  width: var(--card-w); aspect-ratio: 250 / 400; border-radius: 10px;
  background: linear-gradient(115deg, transparent 42%, oklch(1 0 0 / 0.5) 50%, transparent 58%) 100% 0 / 300% 100% no-repeat;
  animation: sweep 0.6s var(--out) forwards;
}
@keyframes sweep { to { background-position: 0 0; } }
#card {
  width: var(--card-w); aspect-ratio: 250 / 400; filter: drop-shadow(4px 4px 0 oklch(0 0 0 / 0.45));
  transition: transform 0.15s var(--out);
}
#card.turning { transform: rotateY(90deg); }
#flip {
  border: 0; background: none; color: var(--cream); padding: 0 12px; min-height: 44px;
  font: 700 0.9rem/1.2 var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
#card-wrap :focus-visible { outline-color: var(--flag); }

/* ---------- payout ladder ---------- */
.ladder { display: flex; align-items: center; gap: 8px; margin: 12px 0 14px; font-size: 0.85rem; font-weight: 700; }
#ladder-label { white-space: nowrap; }
#ladder { list-style: none; display: flex; flex: 1; gap: 4px; margin: 0; padding: 0; }
#ladder li {
  flex: 1; text-align: center; padding: 3px 0; border-radius: 6px;
  background: var(--cream-deep); font-variant-numeric: tabular-nums;
  font-variation-settings: "wdth" 78; transition: transform 0.2s var(--out), background-color 0.2s;
}
#ladder li.now { background: var(--ink); color: var(--flag); transform: scale(1.12); }
#ladder li.gone { color: oklch(0.21 0.03 265 / 0.7); text-decoration: line-through; }

/* ---------- controls ---------- */
#lever {
  display: block; width: 100%; padding: 12px;
  font: 400 2.1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink); background: var(--flag);
  border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: 0 8px 0 var(--ink); margin-bottom: 24px; cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
#lever:hover:not(:disabled) { background: oklch(0.92 0.17 98); }
#lever:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
#lever:disabled { background: var(--cream-deep); color: var(--ink-soft); cursor: not-allowed; }

#guess-form label { display: block; font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.guess-row { display: flex; gap: 8px; }
#guess {
  flex: 1; min-width: 0; padding: 11px 14px;
  font: 600 1.05rem/1.2 var(--text); color: var(--ink);
  background: oklch(0.99 0.012 90); border: 3px solid var(--ink); border-radius: 14px;
}
#guess::placeholder { color: var(--ink-soft); opacity: 1; }
#guess:disabled { background: var(--cream-deep); }
#guess-btn, #share, #copy, #next, #ad-continue, #retry {
  font: 800 1.05rem/1.2 var(--text); padding: 11px 18px; border-radius: 14px;
  border: 3px solid var(--ink); background: var(--ink); color: var(--cream);
  cursor: pointer; text-decoration: none; display: inline-block;
}
#guess-btn:disabled { background: var(--cream-deep); color: var(--ink-soft); cursor: not-allowed; }
#guess-btn:not(:disabled):hover, #share:hover { background: var(--ink-soft); }

#status { min-height: 1.5em; margin: 12px 0 18px; font-weight: 700; }
#status.miss { color: var(--miss); }
#retry { margin-bottom: 18px; }

/* ---------- payout tray ---------- */
#result { background: var(--ink); color: var(--cream); padding-block: 18px 22px; animation: pay 0.45s var(--out); }
@keyframes pay { from { transform: translateY(100%); } } /* the tray slides out of the machine */
#result.won { background: var(--turf); }
#result-title { margin: 0; font: 400 clamp(2rem, 9vw, 2.8rem)/1 var(--display); text-transform: uppercase; }
#result.won #result-title { color: var(--flag); }
#result-title:focus { outline: none; }
#result-answer { margin: 8px 0 0; font-size: 1.5rem; font-weight: 800; line-height: 1.15; font-variation-settings: "wdth" 85; }
#result-coins { margin: 4px 0 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#result-payout { color: var(--flag); font-weight: 800; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#share-status { margin: 10px 0 0; font-weight: 700; }
#share-status:empty { margin: 0; } /* stays rendered while empty so screen readers announce what lands in it */
#result :focus-visible, #ad-break :focus-visible { outline-color: var(--flag); }
/* yellow marks the main action: the next spin, or the share on a Daily result */
#next, #ad-continue, #result.daily #share { background: var(--flag); color: var(--ink); border-color: var(--ink); }
#share, #copy, #result.daily #next { border-color: var(--cream); }
#copy, #result.daily #next { background: none; color: var(--cream); }
#result.daily #share:hover { background: oklch(0.92 0.17 98); }

#ad-break { background: var(--ink); color: var(--cream); padding-block: 18px 22px; }
.ad-note { margin: 0 0 12px; font-weight: 700; }

/* ---------- instruction decal, ad, footer ---------- */
#how { background: var(--cream); border: 4px solid var(--ink); border-radius: 20px; padding: 18px 22px 20px; }
#how h2 { margin: 0 0 10px; font: 400 1.6rem/1 var(--display); text-transform: uppercase; }
#how ol { margin: 0 0 12px; padding-left: 1.3em; }
#how li { margin-bottom: 6px; }
#how li::marker { font-weight: 800; }
#how p { margin: 0 0 10px; max-width: 62ch; }
#how p:last-child { margin-bottom: 0; }
#odds { margin: 0 0 12px; }
#odds summary { font-weight: 800; cursor: pointer; padding: 6px 0; }
#odds table { border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; }
#odds th, #odds td { padding: 3px 14px 3px 0; text-align: left; }
#odds thead th { font-weight: 800; border-bottom: 2px solid var(--ink); }

.ad {
  min-height: 100px; display: grid; place-items: center; text-align: center; padding: 12px;
  border: 3px dashed var(--ink); border-radius: 16px; font-weight: 700;
}
#ad-break .ad { border-color: var(--cream); margin-bottom: 14px; }

footer { font-size: 0.9rem; font-weight: 600; }
footer p { margin: 0; }
#tip { display: inline-block; margin-bottom: 8px; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
footer p a { color: var(--ink); font-weight: 800; }

/* ---------- jackpot: a flurry of penalty flags ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -24px; width: 14px; height: 18px; border-radius: 3px; animation: fall 1.7s cubic-bezier(0.3, 0, 0.8, 0.6) forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(600deg); } }

@media (prefers-reduced-motion: reduce) {
  .reel.spinning .value, .reel.lock .value, #result { animation: none; }
  #lever, #ladder li, #card { transition: none; }
}

/* ---------- plain reading pages (privacy) ---------- */
.sheet { max-width: 760px; margin: 0 auto; padding: clamp(14px, 3vw, 40px) clamp(10px, 3vw, 32px) 48px; }
.sheet .home { display: inline-block; margin-bottom: 14px; color: var(--ink); text-decoration: none; font: 400 1.25rem/1.1 var(--display); text-transform: uppercase; }
.sheet article { background: var(--cream); border: 4px solid var(--ink); border-radius: 20px; padding: clamp(18px, 5vw, 40px); }
.sheet h1 { font-size: clamp(2.2rem, 10vw, 3.4rem); margin-bottom: 6px; }
.sheet h2 { font: 800 1.3rem/1.2 var(--text); margin: 30px 0 6px; }
.sheet p, .sheet li { max-width: 65ch; }
.sheet p { margin: 0 0 10px; }
.sheet ul { margin: 0 0 10px; padding-left: 1.2em; }
.sheet li { margin-bottom: 4px; }
.sheet a:not(.home) { color: var(--ink); font-weight: 700; }
.sheet .updated { color: var(--ink-soft); font-weight: 600; margin-bottom: 18px; }
