:root {
  --yellow: #FFEE39;
  --cream: #FFFDEA;
  --cream-2: #F4F2D9;
  --black: #0A0A0A;
  --ink: #111;
  --muted: #66645a;
  --line: #9B9A92;
  --line-2: #d8d6c5;
  --olive: #A2A191;
  --bone: #EDEECD;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input { font-family: inherit; }
a { cursor: pointer; }

/* ===========================================================
   HOME
   =========================================================== */
.home {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  color: white;
  overflow: hidden;
}
.home__bg {
  position: absolute; inset: 0;
  background: url("assets/track-hero.jpg") center / cover no-repeat;
  z-index: 0;
}
.home__overlay { display: none; }
.home__header, .home__content, .home > .footer { position: relative; z-index: 2; }
.home__header {
  padding: 56px 64px 0;
  text-align: center;
}
.home__logo {
  font-family: "Monoton", cursive;
  font-size: 44px;
  color: var(--yellow);
  letter-spacing: 0.02em;
  line-height: 1;
}
.home__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 32px 40px;
  gap: 16px;
}
.home__eyebrow {
  font-family: "Figtree";
  font-size: 28px;
  line-height: 1.2;
  color: var(--bone);
  font-style: italic;
  font-weight: 500;
}
.home__title {
  font-family: "Figtree";
  font-weight: 900;
  font-style: italic;
  font-size: clamp(56px, 9vw, 116px);
  letter-spacing: -0.01em;
  line-height: 0.92;
  margin: 8px 0 4px;
  color: white;
  text-shadow: 0 6px 32px rgba(0,0,0,0.4);
}
.home__sub {
  max-width: 780px;
  font-size: 22px;
  line-height: 1.45;
  color: var(--bone);
  margin: 4px 0 28px;
  text-wrap: pretty;
}
.home__sub .hi { color: var(--yellow); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 70px;
  padding: 0 36px;
  border-radius: 0;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn--yellow { background: var(--yellow); color: var(--black); box-shadow: 0 0 0 0 var(--yellow); }
.btn--yellow:hover:not([disabled]) { background: #FFFFFF; }
.btn--dark { background: var(--black); color: white; }
.btn--dark:hover:not([disabled]) { background: var(--black); color: var(--yellow); }
.btn--outline { background: transparent; color: var(--black); box-shadow: inset 0 0 0 3px var(--black); }
.btn--outline:hover:not([disabled]) { background: var(--black); color: white; }
.btn--lg { height: 80px; font-size: 28px; padding: 0 48px; }
.link-btn {
  font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
  text-decoration: underline; text-underline-offset: 4px;
  color: var(--muted);
}
.link-btn:hover { color: var(--black); }

/* ===========================================================
   PAGE SHELL (drivers / names / results / share)
   =========================================================== */
.page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.header {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 50px 22px;
  background: var(--cream);
  z-index: 50;
  border-bottom: 1px solid var(--line-2);
}
.header--dark { background: var(--black); color: white; border-color: transparent; }
.logo {
  font-family: "Monoton", cursive;
  font-size: 36px;
  letter-spacing: 0.01em;
  color: var(--black);
  line-height: 1;
  cursor: pointer;
}
.nav { display: flex; align-items: center; gap: 24px; }
.nav-link {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--black);
  position: relative;
  padding-bottom: 2px;
}
.nav-link:hover { color: var(--muted); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; background: var(--black);
}
.nav-divider {
  width: 1px; height: 16px; background: var(--olive);
}
.hamburger { display: none; flex-direction: column; gap: 4px; padding: 8px 0; }
.hamburger span {
  display: block; width: 28px; height: 3px; background: var(--black); border-radius: 1px;
}

.page__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  padding: 28px 50px 60px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.page__image {
  position: sticky;
  top: 110px;
  align-self: start;
  height: 650px;
  overflow: hidden;
  background: #ddd;
}
.page__image-inner {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
}
.names-img { background-image: url("assets/cars-grid.jpg"); }
.drivers-img { background-image: url("assets/cars-grid.jpg"); }
.results-img { background-image: url("assets/checkered-finish.jpg"); }

.page__image-cap {
  position: absolute; left: 20px; bottom: 20px;
  background: var(--yellow);
  color: var(--black);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.page__image-cap.dark { background: var(--black); color: var(--yellow); }
.page__image-cap .num {
  font-family: "Figtree"; font-weight: 900; font-style: italic;
  font-size: 56px; line-height: 0.9;
}
.page__image-cap .lbl {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; line-height: 1.15;
}

.page__panel { padding-top: 0; }
.eyebrow {
  font-weight: 600; font-size: 18px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--black);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 18px;
  background:
    repeating-conic-gradient(var(--black) 0% 25%, white 0% 50%) 0 0/8px 8px;
  border: 1.5px solid var(--black);
}
.eyebrow--green::before {
  background: #1a9b3e;
  border-color: var(--black);
}
.page__title {
  font-family: "Figtree";
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
.page__lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 540px;
  text-wrap: pretty;
}

/* ============ rows / inputs ============ */
.names__list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 6px;
}
.row__num {
  font-weight: 500; font-size: 28px; color: var(--black);
}
.row__input {
  height: 64px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  background: white;
  font-size: 20px;
  color: var(--black);
  outline: none;
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.row__input:focus { border-color: var(--black); box-shadow: inset 0 0 0 1.5px var(--black); }
.row__input::placeholder { color: #888; }
.row__x {
  width: 36px; height: 36px;
  font-size: 22px; line-height: 1;
  color: var(--muted);
  border-radius: 0;
  margin-left: 8px;
}
.row__x:hover { color: var(--black); background: var(--bone); }

.names__actions {
  display: flex; flex-wrap: nowrap; gap: 14px; align-items: center;
  margin-top: 8px;
  padding-left: 50px;
}
.names__actions .btn { flex: 1 1 0; min-width: 0; padding: 0 18px; }
.names__hint { margin-top: 16px; font-size: 14px; color: var(--muted); padding-left: 50px; }

.backlink {
  display: inline-flex; align-items: center;
  font-weight: 500; font-size: 16px; letter-spacing: 0.04em;
  color: var(--black); margin-bottom: 12px;
}
.backlink:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ============ Results player cards ============ */
.results__list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.player {
  border: 1.5px solid var(--black);
  background: white;
}
.player__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--black);
  color: white;
}
.player__tag {
  background: var(--yellow);
  color: var(--black);
  font-weight: 900; font-size: 16px; letter-spacing: 0.04em;
  padding: 6px 10px;
}
.player__name {
  font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.player__count {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--yellow);
}
.player__drivers { list-style: none; padding: 0; margin: 0; }
.player__drivers li {
  display: grid;
  grid-template-columns: 40px 50px 1fr auto 40px;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 16px;
  border-top: 1px solid var(--line-2);
}
.player__drivers li:first-child { border-top: none; }
.d__pos { font-weight: 800; font-size: 13px; color: var(--muted); }
.d__num { font-family: "Figtree"; font-weight: 900; font-style: italic; font-size: 20px; color: var(--black); }
.d__name { font-weight: 700; }
.d__team { color: var(--muted); font-size: 14px; text-align: right; }
.d__flag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  background: var(--bone); padding: 3px 6px;
  text-align: center; color: var(--black);
}

.results__actions {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}

.sent__list {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0 28px;
}
.sent__chip {
  background: var(--bone);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--black);
  border-left: 4px solid var(--black);
}

/* ============ Drivers list ============ */
.grid-list { list-style: none; padding: 0; margin: 0 0 28px; }
.grid-list__row {
  display: grid;
  grid-template-columns: 40px 50px 1fr auto 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--line-2);
  font-size: 16px;
}
.grid-list__row:first-child { border-top: 1.5px solid var(--black); }
.grid-list__row:last-child { border-bottom: 1.5px solid var(--black); }
.gl__pos { font-weight: 800; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.gl__num { font-family: "Figtree"; font-weight: 900; font-style: italic; font-size: 22px; }
.gl__name { font-weight: 700; }
.gl__team { color: var(--muted); font-size: 14px; text-align: right; }
.gl__flag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  background: var(--bone); padding: 3px 6px;
  text-align: center;
}

/* ============ Footer ============ */
.footer {
  display: flex; justify-content: space-between;
  padding: 24px 50px;
  font-size: 18px;
  color: var(--black);
  border-top: 1px solid var(--line-2);
}
.footer--light { color: white; border-top: none; }
.footer__link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer__link:hover { color: var(--yellow); }
.footer--light .footer__link:hover { color: var(--yellow); }

/* ===========================================================
   DRAW animation
   =========================================================== */
.draw {
  position: fixed; inset: 0;
  background: var(--black);
  color: white;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 100;
  overflow: hidden;
}
.draw__strip {
  position: absolute; left: 0; right: 0;
  height: 32px;
  display: flex;
  top: 0;
}
.draw__strip--bot { top: auto; bottom: 0; }
.draw__check {
  flex: 1;
  background:
    repeating-conic-gradient(white 0% 25%, var(--black) 0% 50%) 0 0/16px 16px;
}
.draw__check.is-alt {
  background:
    repeating-conic-gradient(var(--black) 0% 25%, white 0% 50%) 0 0/16px 16px;
}

.draw__count, .draw__spin {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
}
.draw__count-label {
  font-family: "Monoton", cursive;
  font-size: 28px;
  color: var(--yellow);
  letter-spacing: 0.04em;
}
.draw__count-num {
  font-family: "Figtree";
  font-weight: 900; font-style: italic;
  font-size: 240px;
  line-height: 1;
  color: white;
  animation: pop 0.7s ease;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.draw__reel {
  display: flex; flex-direction: column; gap: 4px;
  width: min(640px, 90vw);
  height: 320px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
}
.draw__reel-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  font-size: 18px;
  animation: slideIn 0.12s ease;
}
.draw__reel-row.is-top {
  background: var(--yellow);
  color: var(--black);
}
.draw__reel-num {
  font-family: "Figtree"; font-weight: 900; font-style: italic; font-size: 24px;
}
.draw__reel-name { font-weight: 700; }
.draw__reel-team { font-size: 14px; opacity: 0.7; }
@keyframes slideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.draw__bar {
  width: min(640px, 90vw); height: 6px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.draw__bar-fill {
  height: 100%; background: var(--yellow);
  transition: width 0.09s linear;
}

/* ===========================================================
   MOBILE MENU
   =========================================================== */
.mmenu {
  position: fixed; inset: 0;
  background: var(--cream);
  z-index: 200;
  display: flex; flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.mmenu.is-open { transform: translateY(0); }
.mmenu__top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 23px 20px;
}
.mmenu__logo {
  font-family: "Monoton", cursive;
  font-size: 22px;
}
.mmenu__close {
  width: 40px; height: 40px;
  position: relative;
  background: var(--black);
}
.mmenu__close span {
  position: absolute; left: 8px; top: 19px; width: 24px; height: 2px;
  background: white; border-radius: 1px;
}
.mmenu__close span:first-child { transform: rotate(45deg); }
.mmenu__close span:last-child { transform: rotate(-45deg); }
.mmenu__nav {
  background: var(--black);
  color: white;
  padding: 36px 20px;
  display: flex; flex-direction: column; gap: 22px;
}
.mmenu__nav a {
  font-weight: 500; font-size: 22px; letter-spacing: 0.02em;
  text-align: center;
  padding: 6px 0;
}
.mmenu__nav a:hover { color: var(--yellow); }
.mmenu__image {
  flex: 1;
  margin: 20px;
  background: url("assets/names-side.jpg") center / cover no-repeat;
  min-height: 160px;
}
.mmenu__footer {
  text-align: center; padding: 24px;
  font-size: 16px;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .home__header { padding: 32px 20px 0; }
  .home__logo { font-size: 26px; }
  .home__content { padding: 20px 24px 32px; }
  .home__eyebrow { font-size: 20px; }
  .home__title { font-size: clamp(48px, 12vw, 84px); }
  .home__sub { font-size: 17px; margin-bottom: 18px; }
  .btn--lg { height: 64px; font-size: 22px; padding: 0 28px; width: 100%; max-width: 360px; }

  .header { padding: 20px; }
  .logo { font-size: 22px; }
  .nav { display: none; }
  .hamburger { display: flex; }

  .page__body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px 20px 40px;
  }
  .page__image { position: relative; top: 0; height: 220px; }
  .page__image-cap .num { font-size: 38px; }
  .page__image-cap { padding: 10px 12px; }

  .page__title { font-size: 36px; }
  .page__lede { font-size: 16px; margin-bottom: 22px; }

  .row { grid-template-columns: 32px 1fr auto; }
  .row__num { font-size: 22px; }
  .row__input { height: 56px; font-size: 17px; padding: 0 14px; }
  .btn { height: 60px; font-size: 17px; padding: 0 24px; }
  .names__actions { flex-direction: column; align-items: stretch; padding-left: 0; }
  .names__hint { padding-left: 0; }
  .results__actions { flex-direction: column; align-items: stretch; }

  .player__head { grid-template-columns: auto 1fr; gap: 10px; padding: 14px; }
  .player__name { font-size: 17px; }
  .player__count { grid-column: 1 / -1; font-size: 11px; }
  .player__drivers li {
    grid-template-columns: 36px 44px 1fr 36px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .d__team { display: none; }

  .grid-list__row {
    grid-template-columns: 36px 44px 1fr 36px;
    font-size: 14px;
  }
  .gl__team { display: none; }

  .footer { padding: 20px; font-size: 14px; flex-direction: column; gap: 4px; align-items: center; }

  .draw__count-num { font-size: 140px; }
  .draw__count-label { font-size: 18px; }
  .draw__reel { height: 260px; }
  .draw__reel-row { font-size: 14px; padding: 10px 14px; grid-template-columns: 60px 1fr auto; }
  .draw__reel-num { font-size: 18px; }
  .draw__reel-team { font-size: 11px; }
}
