/* 123 Racing — tokens
   paper  #F3F5F2  page ground (cool, pale)
   ink    #16201C  text, outlines, tarmac
   green  #0E5A43  racing green: boards, links
   flag   #F4C21B  signal yellow: primary action, numbers on boards
   red    #C8341F  marker red: zero segments, hearts and diamonds
   Type: Adventor (wide geometric) for display, numbers and controls; Lora for reading.
   Layout concept: a starting grid. Games are lanes 1, 2, 3; boards are timing boards. */

@font-face {
  font-family: "Adventor";
  src: url("../fonts/adventor-bold-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F3F5F2;
  --white: #FFFFFF;
  --ink: #16201C;
  --ink-2: #44514C;
  --green: #0E5A43;
  --green-2: #0A4533;
  --flag: #F4C21B;
  --red: #C8341F;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 10px;
  --display: "Adventor", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --text: "Lora", Georgia, "Times New Roman", serif;
  --wrap: 72rem;
  --gut: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums lining-nums; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4em; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 40rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.on-green :focus-visible, .site-head :focus-visible { outline-color: var(--flag); }

.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--flag); color: var(--ink); border: var(--line); border-radius: var(--r);
  padding: .5rem .9rem; font-family: var(--display); text-decoration: none;
}
.skip:focus { top: .5rem; }
main:focus { outline: none; }

/* Header */
.site-head { background: var(--green); color: var(--white); border-bottom: var(--line); }
.head-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: .5rem 1rem; padding-top: .6rem; padding-bottom: .6rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: inherit; text-decoration: none;
}
.brand:hover { color: inherit; }
.brand-name { font-family: var(--display); font-size: 1.15rem; letter-spacing: -.01em; }
.main-nav { grid-column: 1 / -1; grid-row: 2; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; }
.main-nav a {
  display: inline-block; padding: .3rem 0; color: var(--white);
  font-family: var(--display); font-size: .95rem; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { border-bottom-color: rgba(255,255,255,.5); color: var(--white); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--flag); }
.wallet-btn {
  justify-self: end;
  font: 700 .9rem/1 var(--display); color: var(--ink); background: var(--flag);
  border: var(--line); border-radius: 999px; padding: .55rem .9rem; cursor: pointer;
  max-width: 13rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wallet-btn:hover { background: #FFD43D; }
@media (min-width: 52rem) {
  .head-row { grid-template-columns: auto 1fr auto; }
  .main-nav { grid-column: 2; grid-row: 1; justify-self: center; }
  .wallet-btn { max-width: 18rem; }
}

/* Buttons and chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.9rem; padding: .6rem 1.15rem;
  font: 700 1rem/1.1 var(--display); color: var(--ink); text-decoration: none;
  background: var(--white); border: var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--ink); background: #EAF0EC; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--flag); }
.btn-primary:hover { background: #FFD43D; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow); }
.btn-sm { min-height: 2.3rem; padding: .35rem .8rem; font-size: .9rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-lg { min-height: 3.4rem; font-size: 1.15rem; padding: .7rem 1.6rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; border: 0; padding: 0; margin: 0; }
.chips legend { font-family: var(--display); font-size: .9rem; margin-right: .3rem; padding: 0; float: left; line-height: 2.5rem; }
.chip {
  min-width: 3.4rem; min-height: 2.5rem; padding: .3rem .8rem;
  font: 700 1rem/1 var(--display); color: var(--ink);
  background: var(--white); border: var(--line); border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--flag); }

/* Dialogs */
.dlg {
  width: min(28rem, calc(100vw - 2rem)); padding: 0;
  background: var(--paper); color: var(--ink);
  border: var(--line); border-radius: 14px; box-shadow: 6px 6px 0 var(--ink);
}
.dlg::backdrop { background: rgba(10, 20, 16, .72); }
.dlg-body { padding: 1.5rem; }
.dlg h2 { font-size: 1.5rem; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.badge-18 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--red); color: var(--white); border: 2px solid var(--ink);
  font: 700 .8rem/1 var(--display); vertical-align: middle;
}
.badge-lg { width: 3.4rem; height: 3.4rem; font-size: 1.1rem; margin: 0 0 1rem; }
.age-refusal { margin-top: 1rem; padding-top: 1rem; border-top: 2px dashed var(--ink-2); }
.field { display: block; font-family: var(--display); font-size: .95rem; margin: .8rem 0 .35rem; }
.input {
  width: 100%; min-height: 2.9rem; padding: .5rem .75rem;
  font: 400 1.05rem/1.2 var(--text); color: var(--ink);
  background: var(--white); border: var(--line); border-radius: var(--r);
}
.input[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: .9rem; color: var(--ink-2); margin: .4rem 0 0; }
.error { color: var(--red); font-size: .95rem; font-weight: 600; margin: .3rem 0 0; min-height: 1.2em; }
.profile-list { margin: 0 0 1rem; display: grid; gap: .4rem; }
.profile-list div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #D9DFDB; padding: .4rem 0; }
.profile-list dt { color: var(--ink-2); }
.profile-list dd { margin: 0; font-family: var(--display); overflow-wrap: anywhere; text-align: right; }

/* Storage notice and toast */
.store-note {
  position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 40;
  display: flex; gap: .8rem; align-items: center; justify-content: space-between;
  max-width: 34rem; margin: 0 auto; padding: .7rem .9rem;
  background: var(--white); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  font-size: .9rem; line-height: 1.45;
}
.store-note p { margin: 0; }
.store-note[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; top: 5.5rem; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 2rem); padding: .6rem 1rem;
  background: var(--ink); color: var(--white); border-radius: var(--r);
  font: 700 .95rem/1.3 var(--display); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

/* Hero (home) — the one loud place */
.hero { padding: 2.5rem 0 3rem; border-bottom: var(--line); background:
  linear-gradient(var(--paper), var(--paper)) padding-box; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-bottom: 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
@media (min-width: 56rem) {
  .hero { padding: 4rem 0; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; }
}

/* Timing board: the shared game surface */
.board {
  position: relative; background: var(--green); color: var(--white);
  border: var(--line); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink);
  padding: 1rem; overflow: hidden;
}
.board-top {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  font-family: var(--display); font-size: .95rem; margin-bottom: .8rem;
}
.chequer {
  height: 14px; margin: -1rem -1rem .9rem; border-bottom: var(--line);
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--white) 0 50%) 0 0 / 14px 14px;
}
.board .stat { display: flex; flex-direction: column; line-height: 1.15; }
.board .stat span { font-size: .8rem; color: #CFE3DA; font-family: var(--text); }
.board .stat strong { font-family: var(--display); font-size: 1.35rem; color: var(--flag); font-variant-numeric: tabular-nums; }
.board-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.result {
  min-height: 1.6em; margin: .9rem 0 0; font: 700 1.05rem/1.4 var(--display); color: var(--white);
}
.controls { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; margin-top: 1rem; }
.board .chip { border-color: var(--ink); }
.board .chips legend { color: var(--white); }

/* Reels */
.reels {
  --cell: clamp(4.4rem, 22vw, 6.5rem);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem;
  background: var(--ink); padding: .55rem; border-radius: 12px; position: relative;
}
.reel {
  height: calc(var(--cell) * 3); overflow: hidden; background: var(--white);
  border-radius: 8px; position: relative;
}
.reel::before, .reel::after {
  content: ""; position: absolute; left: 0; right: 0; height: var(--cell); z-index: 2; pointer-events: none;
  background: rgba(22, 32, 28, .38);
}
.reel::before { top: 0; }
.reel::after { bottom: 0; }
.strip { will-change: transform; }
.cell { height: var(--cell); display: grid; place-items: center; padding: .55rem; }
.cell svg { width: 100%; height: 100%; }
.payline {
  position: absolute; left: .2rem; right: .2rem; top: 50%; height: 0; z-index: 3;
  border-top: 3px dashed var(--flag); transform: translateY(-50%); pointer-events: none;
}
.reels.compact { --cell: clamp(4rem, 19vw, 5.6rem); }
.reels.hit .reel { box-shadow: inset 0 0 0 4px var(--flag); }

/* Lanes (game list) */
.section { padding: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.lanes { list-style: none; margin: 0; padding: 0; border-top: var(--line); }
.lane {
  display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: center;
  padding: 1.25rem 0; border-bottom: var(--line);
}
.lane-no {
  grid-row: span 2; width: 3.4rem; height: 3.4rem; display: grid; place-items: center;
  font: 700 1.8rem/1 var(--display); background: var(--flag); border: var(--line); border-radius: 10px;
}
.lane h3 { margin: 0; font-size: 1.3rem; }
.lane p { margin: 0; color: var(--ink-2); }
.lane-art { display: none; }
.lane .btn { grid-column: 2; justify-self: start; margin-top: .6rem; }
@media (min-width: 48rem) {
  .lane { grid-template-columns: auto 5.5rem 1fr auto; gap: .2rem 1.5rem; }
  .lane-no { grid-row: span 2; }
  .lane-art { display: block; grid-row: span 2; width: 5.5rem; height: 5.5rem; }
  .lane h3 { grid-column: 3; align-self: end; }
  .lane p { grid-column: 3; align-self: start; }
  .lane .btn { grid-column: 4; grid-row: 1 / span 2; margin: 0; align-self: center; }
}

.facts { display: grid; gap: 0; border: var(--line); border-radius: 14px; background: var(--white); overflow: hidden; }
.fact { padding: 1.2rem 1.25rem; border-top: var(--line); }
.fact:first-child { border-top: 0; }
.fact h3 { margin-bottom: .3rem; }
.fact p { margin: 0; color: var(--ink-2); }
@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .fact { border-top: 0; border-left: var(--line); }
  .fact:first-child { border-left: 0; }
}

/* Game pages */
.page-head { padding: 2.25rem 0 1.25rem; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: .4rem; }
.page-head .lead { margin: 0; }
.game-grid { display: grid; gap: 2rem; padding-bottom: 3rem; align-items: start; }
@media (min-width: 60rem) { .game-grid { grid-template-columns: 1.4fr 1fr; } }
.side h2 { font-size: 1.3rem; }
.paytable { width: 100%; border-collapse: collapse; background: var(--white); border: var(--line); }
.paytable th, .paytable td { padding: .5rem .7rem; text-align: left; border-bottom: 2px solid #D9DFDB; vertical-align: middle; }
.paytable th { font-family: var(--display); font-size: .9rem; background: #E4EBE7; }
.paytable td.pay { font-family: var(--display); text-align: right; white-space: nowrap; }
.pt-syms { display: flex; gap: .2rem; }
.pt-syms svg { width: 1.9rem; height: 1.9rem; }
.fine { font-size: .9rem; color: var(--ink-2); border-top: 2px solid #D9DFDB; padding-top: .8rem; margin-top: 1.2rem; }

/* Wheel */
.wheel-stage { position: relative; width: min(100%, 26rem); margin: 0 auto; aspect-ratio: 1; }
.wheel-svg { width: 100%; height: 100%; transform: rotate(0deg); transform-origin: 50% 50%; pointer-events: none; }
.wheel-svg.spinning { transition: transform 4s cubic-bezier(.12, .7, .14, 1); }
.wheel-pointer { position: absolute; left: 50%; top: -6px; width: 2.6rem; transform: translateX(-50%); z-index: 2; }
.wheel-hub {
  position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--ink); border: 4px solid var(--flag);
  display: grid; place-items: center; color: var(--flag); font: 700 clamp(.8rem, 3vw, 1.05rem)/1.1 var(--display); text-align: center;
}

/* Cards */
.table-cards { display: flex; justify-content: center; align-items: center; gap: clamp(.8rem, 4vw, 2rem); padding: .5rem 0; }
.card-slot { width: clamp(7rem, 30vw, 9.5rem); aspect-ratio: 5 / 7; perspective: 900px; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s ease; }
.card-slot.flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-face svg { width: 100%; height: 100%; }
.card-front { transform: rotateY(180deg); }
.card-slot.static .card-inner { transition: none; }
.vs { font: 700 1.1rem/1 var(--display); color: var(--flag); }
.streak { color: var(--flag); }

/* Generic content */
.plain-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain-list li { padding: .65rem 0; border-bottom: 2px solid #D9DFDB; }
.help-box { background: var(--white); border: var(--line); border-radius: 14px; padding: 1.25rem; margin: 1.5rem 0; }
.help-box h2 { margin-top: 0; }
.key-table { width: 100%; border-collapse: collapse; background: var(--white); border: var(--line); margin: 1rem 0; font-size: .95rem; }
.key-table th, .key-table td { padding: .55rem .7rem; border-bottom: 2px solid #D9DFDB; text-align: left; vertical-align: top; }
.key-table th { font-family: var(--display); background: #E4EBE7; }
.key-table code { font-size: .88rem; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.content { padding-bottom: 3rem; }
.notfound { padding: 3rem 0 4rem; }

/* Footer */
.site-foot { background: var(--ink); color: #E6ECE8; margin-top: 0; border-top: var(--line); font-size: .95rem; }
.site-foot a { color: var(--flag); }
.site-foot a:hover { color: var(--white); }
.site-foot :focus-visible { outline-color: var(--flag); }
.foot-grid { display: grid; gap: 1.75rem; padding-top: 2.5rem; padding-bottom: 1.5rem; }
.brand-foot { color: var(--white); margin-bottom: .75rem; }
.brand-foot:hover { color: var(--white); }
.foot-op { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot-nav a { font-family: var(--display); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-notice p { margin-bottom: .8rem; }
.age-line .badge-18 { margin-right: .4rem; }
.foot-base { border-top: 1px solid #3A4743; padding-top: 1rem; padding-bottom: 5.5rem; color: #B9C4BF; font-size: .88rem; }
@media (min-width: 52rem) {
  .foot-grid { grid-template-columns: 1fr .7fr 1.6fr; gap: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
