/* ============================================================
   24 WINS — black & F1-red theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@600;700;800&family=Chakra+Petch:wght@400;500;600&display=swap');

:root {
  --bg: #0b0b0d;
  --panel: #151518;
  --panel-2: #1b1b1f;
  --line: #2a2a30;
  --cream: #f4f4f4;
  --muted: #9a9aa2;
  --accent: #e10600;      /* F1 red */
  --accent-soft: rgba(225, 6, 0, .14);
  --gold: #d4af37;
  --purple: #b57bee;      /* fastest lap */
  --green: #4caf7d;
  --player: #e10600;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 34px, rgba(255,255,255,.012) 34px 68px);
  opacity: .5;
  pointer-events: none;
  z-index: -1;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 14px 80px; }

/* ---------- top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 13, .92);
  backdrop-filter: blur(6px);
}
.top-bar .brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.top-nav { display: flex; gap: 6px; }
.nav-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  height: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 500;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.nav-btn:hover { border-color: var(--accent); color: var(--cream); }
.nav-btn.active { border-color: var(--accent); color: var(--accent); }

.page-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 20px 0 10px;
}
.page-placeholder {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

/* ---------- privacy policy ---------- */
.policy-date { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.policy-content h2 {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 22px 0 8px;
  color: var(--cream);
}
.policy-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.masthead { text-align: center; padding: 4px 0 10px; }
.tagline { color: var(--muted); margin-top: 4px; font-size: 13px; }

.section-label {
  font-family: 'Saira Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 14px;
  color: var(--muted);
  margin: 26px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- difficulty screen ---------- */
#diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.diff-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: left;
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .2s, box-shadow .2s;
}
.diff-box:hover { border-color: var(--accent); }
.diff-box.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.diff-name {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.diff-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Extreme box pulsing red glow */
.extreme-box {
  border-color: var(--accent);
  animation: extremePulse 2.5s ease-in-out infinite;
}
@keyframes extremePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(225, 6, 0, .2); }
  50% { box-shadow: 0 0 22px rgba(225, 6, 0, .45), 0 0 0 1px rgba(225, 6, 0, .3) inset; }
}
.extreme-box .diff-name { color: var(--accent); }
.extreme-box.selected { animation: none; box-shadow: 0 0 0 1px var(--accent) inset; }

#custom-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.slider-group { margin-bottom: 14px; }
.slider-group:last-child { margin-bottom: 0; }
.slider-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.slider-label b { color: var(--cream); font-weight: 600; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--cream);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--cream);
  cursor: pointer;
}
/* ---------- dual range slider ---------- */
.dual-range {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}
.dual-range-track {
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}
.dual-range-fill {
  position: absolute;
  height: 5px;
  border-radius: 3px;
  background: var(--accent);
}
.dual-range input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px; width: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  pointer-events: auto;
  margin-top: -1px;
}
.dual-range input[type="range"]::-moz-range-thumb {
  height: 20px; width: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  pointer-events: auto;
}
.dual-range input[type="range"]::-webkit-slider-runnable-track {
  background: none;
  height: 18px;
}
.dual-range input[type="range"]::-moz-range-track { background: none; }

#year-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
#year-panel .slider-group { margin-bottom: 0; }

#btn-diff-start { width: 100%; }

/* ---------- blocked option ---------- */
.option.blocked {
  opacity: .45;
  cursor: not-allowed;
  border-color: var(--line);
}
.option.blocked:hover { border-color: var(--line); }
.opt-blocked {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- team overview bar ---------- */
.team-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.team-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.team-bar-ovr {
  background: var(--accent);
  color: #fff;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 18px;
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 40px;
  text-align: center;
}

/* ---------- garage ---------- */
#garage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot {
  position: relative;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  min-height: 88px;
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, transform .1s;
}
.slot:hover { border-color: var(--accent); }
.slot.locked { opacity: .55; pointer-events: none; }
.slot.filled { border-left-width: 4px; cursor: default; }
.slot.filled:hover { border-color: var(--line); border-left-color: inherit; }
.slot-cat {
  font-family: 'Saira Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  color: var(--muted);
}
.slot-name { font-weight: 600; font-size: 15px; }
.slot-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot-meta .yr { color: #fff; font-weight: 600; }
.slot-empty { color: var(--muted); font-size: 13px; margin-top: 8px; }
.rating {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent);
  color: #fff;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 14px;
}
.rating.big { font-size: 18px; padding: 2px 9px; }

/* ---------- inline flag images ---------- */
.flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}

/* ---------- team chips ---------- */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 17px;
  padding: 0 4px;
  border-radius: 4px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5px;
  color: #101013;
  vertical-align: middle;
  margin-right: 6px;
}


/* ---------- draft panel ---------- */
#draft-panel {
  margin-top: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-cat {
  font-family: 'Saira Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 14px;
  color: var(--muted);
}
.year-roll {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--muted);
  min-width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.year-roll.landed { color: #fff; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  position: relative;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 60px 12px 14px;
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  animation: rise .3s ease both;
  transition: border-color .15s;
}
.option:hover { border-color: var(--accent); }
.opt-name { font-weight: 600; font-size: 16px; }
.opt-detail { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.opt-yr { color: #fff; font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.reroll-note { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.reroll-row { display: flex; gap: 8px; margin-top: 8px; }
.reroll-row .reroll { flex: 1; border-style: dashed; color: var(--cream); font-size: 13px; }
.reroll-row .reroll:disabled { color: var(--muted); border-color: var(--line); cursor: default; }

/* ---------- launch ---------- */
#launch {
  margin-top: 20px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
}
.team-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.sum-item {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.sum-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.sum-val {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
}
.name-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#team-name {
  min-width: 0;
  width: 140px;
  flex: 0 1 160px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  padding: 10px 10px;
  font-family: inherit;
  font-size: 14px;
}
#team-name:focus { outline: none; border-color: var(--accent); }
#team-color {
  width: 38px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.name-row .btn { flex: 1; white-space: nowrap; }


.btn {
  font-family: 'Saira Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  font-size: 15px;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--cream); }

/* ---------- season ---------- */
#season-team {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
#season-team .chip { height: 22px; min-width: 36px; font-size: 13px; }

#ticker {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px;
  background: rgba(11, 11, 13, .92);
  backdrop-filter: blur(6px);
  padding: 10px 0 6px;
}
.tick {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  text-align: center;
}
.tick span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.tick b { font-family: 'Saira Condensed', sans-serif; font-size: 19px; font-weight: 800; }

#trophies {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 10px;
}
.trophy .tr { width: 15px; height: 15px; fill: #35353c; }
.trophy.gold .tr { fill: var(--gold); }

#races { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.race {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  animation: rise .35s ease both;
}
.race.team-win { border-color: var(--accent); }
.race.slam { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.race-flag {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  height: auto;
  opacity: .12;
  pointer-events: none;
  filter: saturate(1.3);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1), transparent 25%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1), transparent 25%);
}
.race-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 8px;
  position: relative;
  flex-wrap: wrap;
}
.race-round {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  color: var(--accent);
  font-size: 17px;
}
.race-gp { font-weight: 600; font-size: 15px; }
.race-gp em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 7px; }
.badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.flag-badge {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 12px;
  border-radius: 5px;
  padding: 3px 8px;
  display: inline-flex; align-items: center; gap: 5px;
}
.flag-badge.win { background: var(--accent); color: #fff; }
.flag-badge.win .tr { width: 12px; height: 12px; fill: #fff; }
.flag-badge.gs { background: var(--gold); color: #17101f; }

.race-lines {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 8px;
  position: relative;
}
.race-lines b { color: var(--cream); font-weight: 600; }
.race-lines b.fl { color: var(--purple); }
.race-lines b.mine-text { color: var(--player); }

.race-block { margin-top: 8px; position: relative; }
.block-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.trow {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13.5px;
}
.trow.out { opacity: .55; }
.trow.player-dnf {
  opacity: 1;
  border: 1px solid var(--accent);
  border-radius: 6px;
  animation: dnfPulse 1.8s ease-in-out infinite;
}
@keyframes dnfPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(225, 6, 0, .25); }
  50% { box-shadow: 0 0 14px rgba(225, 6, 0, .5), inset 0 0 8px rgba(225, 6, 0, .12); }
}
.pos {
  min-width: 26px;
  text-align: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  color: var(--muted);
  font-size: 14px;
}
.pos.p1 { color: var(--accent); }
.pos.dnf { font-size: 10.5px; letter-spacing: 1px; }
.tname { flex: 1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tname em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.gridpos { font-size: 11px; color: var(--muted); }
.pts { min-width: 34px; text-align: right; color: var(--green); font-weight: 600; }
.pts.zero { color: transparent; }

/* ---------- finale ---------- */
#final { margin-top: 22px; }
.banner {
  text-align: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 14px;
  margin-bottom: 14px;
}
.banner.win { border-color: var(--accent); }
.banner.gold { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.banner-big {
  display: block;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 42px;
  letter-spacing: 3px;
  line-height: 1.05;
}
.banner.win .banner-big { color: var(--accent); }
.banner.gold .banner-big { color: var(--gold); }
.banner-sub { color: var(--muted); font-size: 13.5px; }

.diff-line {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.stile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 6px;
  text-align: center;
}
.stile b { display: block; font-family: 'Saira Condensed', sans-serif; font-size: 22px; font-weight: 800; }
.stile span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

.tbl-title {
  font-family: 'Saira Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 16px;
  margin: 20px 0 8px;
}
.table { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.thead {
  display: flex; gap: 9px;
  padding: 8px 12px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.thead span:nth-child(2) { flex: 1; }
.pos-h { min-width: 26px; }
.num-h { min-width: 40px; text-align: right; }
.table .trow { border-radius: 0; padding: 7px 12px; }
.table .trow + .trow { border-top: 1px solid var(--line); }
.table .trow:first-of-type .pos { color: var(--accent); }
.num { min-width: 40px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.num.strong { color: var(--cream); font-weight: 600; }

/* Player rows in final tables */
#final .trow.mine {
  border-left: 3px solid var(--player);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--player) 18%, transparent),
              0 0 10px color-mix(in srgb, var(--player) 10%, transparent);
  position: relative;
}

#btn-again { width: 100%; margin-top: 20px; margin-bottom: 6px; }
#btn-resim { width: 100%; margin-bottom: 20px; }

/* ---------- picks recap ---------- */
.picks-table .pos.pick-cat {
  min-width: auto;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.picks-table .trow { border-left: 3px solid var(--line); }
.ovr-row {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 6px;
}
.ovr-row .lb-pick-cat,
.ovr-row .pick-cat { color: var(--cream); font-weight: 700; }

/* ---------- info / content sections ---------- */
.info-sections {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.info-block { margin-bottom: 26px; }
.info-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream);
  margin-bottom: 10px;
}
.info-block p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.smallprint {
  margin-top: 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.hidden { display: none !important; }

/* ---------- auth form ---------- */
.auth-form {
  margin-top: 16px;
  max-width: 360px;
}
.auth-input {
  display: block;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 8px;
}
.auth-input:focus { outline: none; border-color: var(--accent); }
.auth-btns { display: flex; gap: 8px; }
.auth-btns .btn { flex: 1; }
.auth-msg {
  min-height: 20px;
  font-size: 13px;
  margin-top: 8px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- google sign-in ---------- */
.google-btn {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: box-shadow .15s;
}
.google-btn:hover { box-shadow: 0 2px 12px rgba(255,255,255,.15); filter: none; }

/* ---------- profile page ---------- */
.profile-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.profile-avatar-wrap { width: 48px; height: 48px; flex-shrink: 0; }
.profile-avatar-svg { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); }
.profile-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: cover;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.profile-header-btns { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- achievement button ---------- */
.ach-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 5px 14px 5px 6px;
  color: var(--gold);
  text-decoration: none;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: box-shadow .2s;
  box-shadow: 0 0 6px rgba(212, 175, 55, .15);
}
.ach-btn:hover {
  box-shadow: 0 0 14px rgba(212, 175, 55, .35);
  filter: none;
}
.ach-ring { flex-shrink: 0; }

/* ---------- settings ---------- */
.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.setting-row { margin-bottom: 14px; }
.setting-row:last-child { margin-bottom: 0; }
.setting-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.setting-input-row { display: flex; gap: 8px; }
.setting-input-row .auth-input { flex: 1; margin-bottom: 0; }

.flag-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.flag-opt {
  width: 36px; height: 28px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-size: 18px;
  transition: border-color .15s;
}
.flag-opt:hover { border-color: var(--accent); }
.flag-opt.selected { border-color: var(--gold); box-shadow: 0 0 6px rgba(212,175,55,.3); }
.flag-opt img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }

/* ---------- best teams ---------- */
.best-tabs { margin-bottom: 10px; }
.best-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.best-card.champion { border-left: 3px solid var(--accent); }
.best-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.best-team {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
}
.best-result { font-size: 13px; color: var(--cream); }
.best-picks { border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- achievements page ---------- */
.ach-subtitle { margin-bottom: 14px; }
.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ach-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  transition: border-color .3s, box-shadow .3s;
}
.ach-card.locked {
  opacity: .5;
}
.ach-card.unlocked {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, .2), inset 0 0 6px rgba(212, 175, 55, .06);
}
.ach-card-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border-radius: 8px;
}
.ach-card-icon svg { fill: var(--line); }
.ach-card.unlocked .ach-card-icon { background: rgba(212, 175, 55, .12); }
.ach-card.unlocked .ach-card-icon svg { fill: var(--gold); }
.ach-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ach-card-name {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.ach-card.unlocked .ach-card-name { color: var(--gold); }
.ach-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.ach-card-date {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.ach-card.unlocked .ach-card-date { color: var(--cream); }

@media (max-width: 460px) {
  .ach-grid { grid-template-columns: 1fr; }
}

/* ---------- season history ---------- */
.history-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 6px;
}
.hist-entry { margin-bottom: 6px; }
.hist-entry .history-row { margin-bottom: 0; }
.hist-clickable { transition: background .15s; }
.hist-clickable:hover { background: var(--panel-2); }
.hist-entry .lb-picks { border-radius: 0 0 9px 9px; }
.history-row.champion { border-left: 3px solid var(--accent); }
.history-row.perfect { border-left: 3px solid var(--gold); }
.hist-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hist-team {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.hist-result { font-size: 13px; color: var(--cream); }
.hist-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- leaderboard tabs ---------- */
.lb-tabs {
  display: flex; gap: 6px;
  margin-bottom: 10px;
}
.lb-tab {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 0;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lb-tab:hover { border-color: var(--accent); color: var(--cream); }
.lb-tab.active { border-color: var(--accent); color: var(--accent); }
.lb-badge { font-size: 12px; }
.perfect-row { border-left: 2px solid var(--gold); }

.lb-sort-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.lb-sort-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.lb-sort {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lb-sort:hover { border-color: var(--accent); color: var(--cream); }
.lb-sort.active { border-color: var(--accent); color: var(--accent); }

/* ---------- leaderboard expandable picks ---------- */
.lb-entry { border-bottom: 1px solid var(--line); }
.lb-entry:last-child { border-bottom: none; }
.lb-row { transition: background .15s; }
.lb-row:hover { background: var(--panel-2) !important; }
.lb-picks {
  background: var(--panel-2);
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}
.lb-picks:not(.hidden) {
  padding: 10px 12px;
  max-height: 400px;
}
.lb-pick {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.lb-pick em { color: var(--muted); font-style: normal; font-size: 11px; margin-left: 4px; }
.lb-pick-cat {
  min-width: 70px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.lb-pick-rtg {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
}

/* ---------- database page ---------- */
.db-subtitle { margin-bottom: 14px; }
.db-tabs { flex-wrap: wrap; }
.db-tabs .lb-tab { flex: 0 1 auto; padding: 8px 12px; font-size: 13px; }
.db-year-filter {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.db-count {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.db-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
}
.db-rank {
  min-width: 26px;
  text-align: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  color: var(--muted);
  font-size: 14px;
}
.db-row:first-child .db-rank { color: var(--accent); }
.db-name { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.db-team { font-size: 12px; display: flex; align-items: center; gap: 3px; }
.db-years { font-size: 11px; color: var(--muted); min-width: 65px; text-align: right; }
.db-row .rating { position: static; font-size: 13px; }

@media (max-width: 460px) {
  .db-tabs .lb-tab { font-size: 11px; padding: 7px 8px; }
  .db-team span { display: none; }
  .db-years { display: none; }
  .top-nav { gap: 4px; }
  .nav-btn { padding: 5px 8px; font-size: 11px; gap: 3px; }
  .nav-btn svg { width: 14px; height: 14px; }
}

/* ---------- trophy cabinet ---------- */
.trophy-cabinet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.cab-cell {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 70px;
  justify-content: center;
  transition: border-color .3s, box-shadow .3s;
}
.cab-bg-flag {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .08;
  pointer-events: none;
}
.cab-cell.won .cab-bg-flag { opacity: .35; }
.cab-cell.won {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, .3), inset 0 0 8px rgba(212, 175, 55, .12);
}
.cab-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 1;
}
.cab-top svg { fill: var(--line); width: 14px; height: 14px; flex-shrink: 0; }
.cab-cell.won .cab-top svg { fill: var(--gold); }
.cab-name {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .3px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.cab-cell.won .cab-name { color: var(--gold); }
.cab-count {
  position: relative;
  z-index: 1;
  font-size: 10px;
  color: var(--muted);
}
.cab-cell.won .cab-count { color: var(--cream); }

@media (max-width: 460px) {
  .trophy-cabinet { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- toast notifications ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 25, 12, .92);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 0 18px rgba(212, 175, 55, .25);
  backdrop-filter: blur(8px);
  animation: toastIn .35s ease, toastOut .4s ease 4.6s forwards;
  max-width: 340px;
}
.toast-icon svg { fill: var(--gold); flex-shrink: 0; }
.toast-body { display: flex; flex-direction: column; gap: 1px; }
.toast-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gold);
}
.toast-sub { font-size: 13px; color: var(--cream); }
.toast-close {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
  padding: 0 0 0 8px;
  line-height: 1;
  opacity: .6;
  transition: opacity .15s;
}
.toast-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 460px) {
  .toast { right: 12px; left: 12px; max-width: none; bottom: 12px; }
}

/* ---------- restart slot ---------- */
.restart-slot {
  border-style: dashed;
  border-left-width: 1px;
  opacity: .7;
  transition: opacity .15s;
}
.restart-slot:hover { opacity: 1; border-color: var(--accent); }
.restart-slot .slot-cat { color: var(--accent); }

/* ---------- confirm modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px 18px;
  max-width: 340px;
  text-align: center;
}
.modal p { margin-bottom: 18px; font-size: 15px; line-height: 1.5; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- confetti ---------- */
.confetti-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 200;
}

@media (max-width: 460px) {
  .brand { font-size: 42px; }
  #garage { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .option, .race { animation: none; }
}
