/* 24-0 — styles. Dark carbon, racing red, no official anything. */
:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --panel2: #1b1f26;
  --text: #f2f3f5;
  --dim: #9aa3ad;
  --red: #e10600;
  --gold: #ffd500;
  --green: #2bd96b;
  --line: #262b33;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    radial-gradient(1200px 600px at 50% -10%, #161a21 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

#app { width: 100%; max-width: 480px; padding: 18px 16px 28px; }

.screen { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- type & buttons ---------- */
h2 { font-size: 18px; letter-spacing: .12em; }

.btn {
  display: block; width: 100%;
  border: 0; border-radius: 12px;
  padding: 15px 18px;
  font-size: 15px; font-weight: 800; letter-spacing: .08em;
  cursor: pointer;
  font-family: inherit;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 24px rgba(225,6,0,.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn.big { font-size: 17px; padding: 18px; }

.link {
  background: none; border: 0; color: var(--dim);
  font: inherit; font-size: 13px; letter-spacing: .06em;
  cursor: pointer; text-decoration: none;
}
.link:hover { color: var(--text); }

/* ---------- home ---------- */
.home { text-align: center; padding-top: 7vh; }

.logo {
  font-size: 96px; font-weight: 900; font-style: italic;
  letter-spacing: -0.04em; line-height: 1;
  text-shadow: 0 10px 40px rgba(225,6,0,.25);
}
.logo-kicker {
  display: block; font-size: 17px; font-style: normal;
  letter-spacing: .46em; text-indent: .46em; font-weight: 800;
  color: var(--red); margin-bottom: 4px;
}
.logo-24 { color: var(--text); }

.logo::after {
  content: ""; display: block; height: 10px; margin: 18px auto 0; width: 180px;
  background: repeating-conic-gradient(#fff 0% 25%, #0b0d10 0% 50%) 0 0/10px 10px;
  border-radius: 2px; opacity: .9;
}

.tagline { color: var(--dim); font-size: 14.5px; line-height: 1.55; margin: 22px 6px 26px; }
.tagline b { color: var(--text); }

.home-btns { display: grid; gap: 10px; margin: 0 4px; }

.challenge-banner {
  background: rgba(225,6,0,.08); border: 1px solid rgba(225,6,0,.5); border-radius: 12px;
  padding: 14px; margin: 0 4px 14px; font-size: 13.5px; display: grid; gap: 10px;
  text-align: center;
}
.challenge-verdict {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px; font-size: 13.5px; letter-spacing: .05em; margin-bottom: 12px;
}

.stat-row { display: flex; justify-content: center; gap: 10px; margin: 22px 0 10px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; min-width: 86px;
}
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.support-row { margin-top: 16px; font-size: 12px; color: var(--dim); }
.support-row .link { font-size: 12px; }

.legal { color: #5c656f; font-size: 10.5px; line-height: 1.5; margin-top: 22px; }

/* ad container stays invisible until a network is wired in (see MONETIZATION.md) */
.ad-slot:empty { display: none; }
.ad-slot { margin-top: 18px; min-height: 50px; }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(5,6,8,.78);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  max-width: 420px; width: calc(100% - 36px); padding: 22px;
}
.modal h2 { margin-bottom: 14px; }
.modal ol { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; color: #cdd3da; }
.modal .fine { color: var(--dim); font-size: 12px; line-height: 1.5; margin: 14px 0 16px; }

/* ---------- draft ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mode-tag {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--gold);
  border: 1px solid rgba(255,213,0,.35); border-radius: 99px; padding: 4px 10px;
}

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.slot {
  background: var(--panel); border: 1px dashed var(--line); border-radius: 10px;
  padding: 8px 10px; min-height: 52px;
}
.slot.filled { border-style: solid; background: var(--panel2); }
.slot-label { display: block; font-size: 9.5px; letter-spacing: .12em; color: var(--dim); margin-bottom: 4px; }
.slot-val { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; border-left: 3px solid transparent; padding-left: 6px; }
.slot-val em { color: var(--dim); font-style: normal; font-size: 11px; }
.slot-val b { margin-left: auto; color: var(--gold); }
.slot-val.empty { color: #4a525c; border-left: none; }

.spin-area { min-height: 360px; }

.team-card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px 14px;
}
.tc-stripe { position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--tc, var(--red)); }
.team-card::after {
  content: ""; position: absolute; top: 0; right: 0; width: 90px; height: 90px;
  background: radial-gradient(circle at top right, var(--tc, var(--red)) 0%, transparent 70%);
  opacity: .18; pointer-events: none;
}
.tc-year { font-size: 13px; font-weight: 800; letter-spacing: .2em; color: var(--tc2, var(--gold)); }
.tc-name { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: -.01em; margin: 2px 0 4px; }
.tc-blurb { color: var(--dim); font-size: 12.5px; line-height: 1.45; margin-bottom: 14px; }

.team-card.shuffling .tc-name { color: var(--dim); animation: blurr .15s infinite; }
@keyframes blurr { 50% { opacity: .55; } }

.comps { display: grid; gap: 7px; }
.comp {
  display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; cursor: pointer; color: var(--text);
  font-family: inherit; text-align: left;
  transition: border-color .12s ease, transform .06s ease;
}
.comp:not(.locked):hover { border-color: var(--tc, var(--red)); }
.comp:not(.locked):active { transform: scale(.985); }
.comp.locked { opacity: .32; cursor: not-allowed; }
.comp-kind { font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--dim); }
.comp-name { font-size: 14px; font-weight: 700; }
.comp-rate { font-size: 16px; font-weight: 900; color: var(--gold); }

.spin-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.hint { color: var(--dim); font-size: 11px; letter-spacing: .04em; }

/* ---------- lights out ---------- */
.lights { padding-top: 4vh; }
.lights-title { text-align: center; font-style: italic; font-size: 22px; letter-spacing: .08em; margin-bottom: 18px; }
.garage { display: grid; gap: 8px; margin-bottom: 16px; }
.g-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px;
  padding: 11px 12px; font-size: 13.5px; font-weight: 600;
}
.g-row em { color: var(--dim); font-style: normal; font-size: 11.5px; margin-left: 6px; }
.g-row b { color: var(--gold); }
.score-line {
  text-align: center; color: var(--dim); letter-spacing: .14em; font-size: 12px; margin-bottom: 18px;
}
.score-line b { color: var(--text); font-size: 16px; }

/* ---------- season ticker ---------- */
.ticker { display: grid; gap: 6px; }
.race-row {
  display: grid; grid-template-columns: 22px 24px 1fr auto 24px; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px; font-size: 12.5px;
  transition: background .2s ease;
}
.race-row.pending { opacity: .35; }
.r-no { color: var(--dim); font-size: 10.5px; }
.r-venue { font-weight: 700; }
.r-note { color: var(--dim); font-size: 10.5px; text-align: right; }
.race-row.win { background: rgba(43,217,107,.10); border-color: rgba(43,217,107,.35); }
.race-row.podium { background: rgba(255,213,0,.07); border-color: rgba(255,213,0,.3); }
.race-row.dnf { background: rgba(225,6,0,.10); border-color: rgba(225,6,0,.4); }
.race-row.dnf .r-note { color: #ff8a86; font-weight: 700; }
.race-row.tense { animation: tense .8s ease; }
@keyframes tense { 0% { transform: scale(.97); box-shadow: 0 0 0 3px rgba(255,213,0,.35); } 100% { transform: none; } }

/* ---------- result ---------- */
.result { padding-top: 3vh; text-align: center; }
.tier { border-radius: 18px; padding: 26px 18px 22px; margin-bottom: 14px; border: 1px solid var(--line); }
.tier-record { font-size: 12px; letter-spacing: .18em; color: rgba(255,255,255,.8); margin-bottom: 8px; }
.tier-name { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: -.01em; line-height: 1.1; }
.tier-sub { font-size: 12.5px; margin-top: 9px; color: rgba(255,255,255,.75); line-height: 1.45; }

.t-immortal { background: linear-gradient(160deg, #4a3a00, #1c1709 60%); border-color: var(--gold); box-shadow: 0 0 50px rgba(255,213,0,.25); }
.t-immortal .tier-name { color: var(--gold); }
.t-dominance { background: linear-gradient(160deg, #3c1010, #170b0b 60%); border-color: var(--red); }
.t-dominance .tier-name { color: #ff5c57; }
.t-great { background: linear-gradient(160deg, #102c3c, #0b1217 60%); border-color: #47c7fc; }
.t-great .tier-name { color: #47c7fc; }
.t-champs { background: linear-gradient(160deg, #0f3422, #0b140f 60%); border-color: var(--green); }
.t-champs .tier-name { color: var(--green); }
.t-contender { background: var(--panel); }
.t-contender .tier-name { color: var(--text); }
.t-podium { background: var(--panel); }
.t-podium .tier-name { color: var(--gold); }
.t-midfield { background: var(--panel); }
.t-midfield .tier-name { color: var(--dim); }
.t-back { background: var(--panel); }
.t-back .tier-name { color: var(--dim); }
.t-lola { background: linear-gradient(160deg, #2b2b2b, #141414 60%); border-color: #555; }
.t-lola .tier-name { color: #bbb; }

.grid-emoji {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 17px; line-height: 1.5; letter-spacing: 1.5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; white-space: pre-wrap;
}
.garage-line { color: var(--dim); font-size: 12px; margin-bottom: 18px; }

.result-btns { display: grid; gap: 10px; }
.next-daily { color: var(--dim); font-size: 12px; letter-spacing: .08em; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .confetti { display: none; }
}

@media (min-width: 600px) {
  #app { padding-top: 34px; }
  .logo { font-size: 110px; }
}
