/* ============================================================
   API-Sports Spring Cup — Main Stylesheet
   Formula1-inspired design with API-Sports brand colors
   Font: Lato (Google Fonts) | Icons: Font Awesome 5
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --gradient-primary: linear-gradient(45deg, #fe2983, #ff6f61 50%, #fc9e21 110%);
  --coral:    #ff6f61;
  --orange:   #fc9e21;
  --pink:     #fe2983;
  --blue:     #007cb7;
  --teal:     #17ecda;
  --body:     #27333e;
  --muted:    #b5b5b5;
  --bg:       #ffffff;
  --alt-bg:   #f3f4f6;
  --footer:   #000000;
  --border:   #edf4f8;
  --success:  #37bd74;
  --gold:     #f5c842;
  --silver:   #b0b8c1;
  --bronze:   #cd7f32;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,.14);
  --radius:   8px;
  --radius-sm: 4px;
  --font:     'Lato', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ── Navigation Bar ── */
.navbar {
  background: #000;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.navbar__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar__logo-mark svg { width: 22px; height: 22px; fill: #fff; }
.navbar__logo-text {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
}
.navbar__logo-text span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--coral);
  margin-top: 1px;
}
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar__nav a {
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
  text-decoration: none;
}
.navbar__nav a:hover,
.navbar__nav a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.navbar__nav a.active { border-bottom: 2px solid var(--coral); }

.navbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.season-selector {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: background .2s;
}
.season-selector option { background: #222; color: #fff; }
.season-selector:hover { background: rgba(255,255,255,.14); }

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.navbar__hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s;
}

/* Mobile nav */
.navbar__mobile-menu {
  display: none;
  background: #111;
  padding: 8px 20px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.navbar__mobile-menu a {
  display: block;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
}
.navbar__mobile-menu a:hover { color: #fff; }
.navbar__mobile-menu.open { display: block; }

/* ── Category Tabs (inside navbar, dark bg) ── */
.cat-tabs {
  background: #111;
  border-top: 1px solid rgba(255,255,255,.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs__inner {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.cat-tabs a {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  padding: 10px 20px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.cat-tabs a:hover {
  color: rgba(255,255,255,.85);
  text-decoration: none;
}
.cat-tabs a.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

/* ── Page Header / Hero ── */
.page-hero {
  background: var(--gradient-primary);
  padding: 64px 0 52px;
  color: #fff;
  text-align: center;
}
.page-hero__eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 12px;
}
.page-hero__title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.page-hero__subtitle {
  font-size: 16px;
  font-weight: 400;
  opacity: .9;
}

/* ── Homepage Hero ── */
.hero {
  background: var(--gradient-primary);
  padding: 80px 0 64px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 280px;
  height: 280px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.hero__eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 16px;
}
.hero__title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.05;
  margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.hero__subtitle {
  font-size: 18px;
  font-weight: 300;
  opacity: .9;
  margin-bottom: 36px;
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--pink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 32px;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.hero__cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); text-decoration: none; }

/* ── Section ── */
.section { padding: 64px 0; }
.section--alt { background: var(--alt-bg); }
.section__title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 8px;
}
.section__heading {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  color: var(--body);
  letter-spacing: -.01em;
  margin-bottom: 32px;
  line-height: 1.2;
}
.section__heading--white { color: #fff; }
.section__title--white { color: rgba(255,255,255,.7); }

/* ── Cards ── */
.card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card__body { padding: 24px; }
.card__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Next Race Card ── */
.next-race-card {
  background: var(--body);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.next-race-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
}
.next-race-card__label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 12px;
}
.next-race-card__round {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.next-race-card__name {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  line-height: 1.2;
}
.next-race-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.next-race-card__detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,.75);
}
.next-race-card__detail i { color: var(--coral); font-size: 13px; }

/* ── Round Cards (Schedule) ── */
.round-cards { display: flex; flex-direction: column; gap: 12px; }
.round-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  align-items: center;
  overflow: hidden;
  transition: box-shadow .25s, transform .2s;
  text-decoration: none;
  color: inherit;
}
.round-card:hover { box-shadow: var(--shadow-hover); transform: translateX(3px); text-decoration: none; color: inherit; }
.round-card--completed .round-card__num { background: var(--success); }
.round-card--cancelled .round-card__num { background: var(--muted); }
.round-card__num {
  background: var(--gradient-primary);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 90px;
  padding: 12px;
}
/* Track image thumbnail in round card (right-aligned) */
.round-card__track-img {
  width: 80px;
  height: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}
.round-card__track-img img {
  max-width: 64px;
  max-height: 60px;
  object-fit: contain;
  opacity: .7;
}
.round-card__info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.round-card__name {
  font-size: 16px;
  font-weight: 900;
  color: var(--body);
  letter-spacing: -.01em;
}
.round-card__track {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.round-card__winner {
  font-size: 12px;
  color: var(--success);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.round-card__right {
  padding: 16px 20px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.round-card__date {
  font-size: 13px;
  font-weight: 700;
  color: var(--body);
  white-space: nowrap;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}
.badge-upcoming  { background: rgba(0,124,183,.12); color: var(--blue); }
.badge-completed { background: rgba(55,189,116,.12); color: var(--success); }
.badge-cancelled { background: rgba(181,181,181,.2); color: var(--muted); }

/* ── Position Badges ── */
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  background: var(--alt-bg);
  color: var(--muted);
}
.pos-badge.pos-gold   { background: var(--gold);   color: #7a5c00; }
.pos-badge.pos-silver { background: var(--silver); color: #444; }
.pos-badge.pos-bronze { background: var(--bronze); color: #fff; }

/* ── Results Table ── */
.results-table-wrapper { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.results-table th {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  background: var(--alt-bg);
  white-space: nowrap;
}
.results-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--alt-bg); }
.results-table tr.row-gold td   { border-left: 3px solid var(--gold); }
.results-table tr.row-silver td { border-left: 3px solid var(--silver); }
.results-table tr.row-bronze td { border-left: 3px solid var(--bronze); }
.results-table tr.row-dnf td    { opacity: .6; }
.results-table .driver-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.results-table .flag {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.results-table .driver-name {
  font-weight: 700;
  color: var(--body);
}
.results-table .driver-name a { color: inherit; text-decoration: none; }
.results-table .driver-name a:hover { color: var(--blue); text-decoration: underline; }
.results-table .dnf-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #e53e3e;
  background: rgba(229,62,62,.1);
  padding: 2px 6px;
  border-radius: 3px;
}
.results-table .penalty {
  font-size: 11px;
  color: #e53e3e;
  font-weight: 700;
}
.results-table .pole-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-left: 6px;
  vertical-align: middle;
  title: 'Pole Position';
}
.results-table .lap-time { font-family: 'Courier New', monospace; font-size: 13px; }
.results-table .gap-time { font-family: 'Courier New', monospace; font-size: 13px; color: var(--coral); font-weight: 700; }

/* Car cell */
.car-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.car-thumb {
  width: 40px;
  height: 26px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--alt-bg);
}
.car-name {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Session Tabs ── */
.session-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
}
.session-tabs__tab {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 28px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.session-tabs__tab:hover { color: var(--body); }
.session-tabs__tab.active { color: var(--coral); border-bottom-color: var(--coral); }
.session-tabs__tab .count {
  background: var(--alt-bg);
  border-radius: 12px;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  color: var(--muted);
}
.session-panel { display: none; }
.session-panel.active { display: block; }

/* ── Standings Table ── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.standings-table th {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  background: var(--alt-bg);
  white-space: nowrap;
}
.standings-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:nth-child(even) td { background: rgba(0,0,0,.015); }
.standings-table tr:hover td { background: var(--alt-bg); }
.standings-table tr.standing-gold   td:first-child { border-left: 3px solid var(--gold); }
.standings-table tr.standing-silver td:first-child { border-left: 3px solid var(--silver); }
.standings-table tr.standing-bronze td:first-child { border-left: 3px solid var(--bronze); }
.standings-table .driver-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.standings-table .points-cell {
  font-size: 18px;
  font-weight: 900;
  color: var(--body);
  min-width: 60px;
}
.standings-table .pos-number {
  font-size: 16px;
  font-weight: 900;
  color: var(--body);
  min-width: 28px;
}
.standings-table .pos-number.pos-gold   { color: #c69500; }
.standings-table .pos-number.pos-silver { color: #7a8799; }
.standings-table .pos-number.pos-bronze { color: #9e5c1a; }
.stat-cell { text-align: center !important; font-weight: 700; color: var(--muted); }
.stat-cell.has-value { color: var(--body); }

/* Points Bar */
.points-bar-wrap { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.points-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.points-bar__fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width .6s ease;
}

/* ── Driver Cards ── */
.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.driver-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .25s, transform .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.driver-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); text-decoration: none; color: inherit; }
.driver-card__avatar-wrap {
  background: var(--alt-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  position: relative;
}
.driver-card__pos {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--body);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.driver-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.driver-card__flag { font-size: 20px; }
.driver-card__name {
  font-size: 15px;
  font-weight: 900;
  color: var(--body);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.driver-card__cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--coral);
  margin-top: 2px;
}
.driver-card__pts {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-top: auto;
  padding-top: 8px;
}
.driver-card__pts span {
  font-size: 18px;
  font-weight: 900;
  color: var(--body);
  margin-right: 3px;
}

/* ── Driver Avatar ── */
.driver-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.driver-avatar.avatar-lg {
  width: 100px;
  height: 100px;
}
.driver-avatar.avatar-sm {
  width: 36px;
  height: 36px;
}
.driver-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.01em;
}
.driver-avatar-placeholder.avatar-lg {
  width: 100px;
  height: 100px;
  font-size: 32px;
}
.driver-avatar-placeholder.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.driver-avatar-placeholder.avatar-xl {
  width: 120px;
  height: 120px;
  font-size: 40px;
}
.driver-avatar.avatar-xl {
  width: 120px;
  height: 120px;
}

/* ── Driver Profile ── */
.profile-header {
  background: var(--body);
  color: #fff;
  padding: 48px 0;
}
.profile-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.profile-header__info { flex: 1; }
.profile-header__flag { font-size: 28px; margin-bottom: 8px; }
.profile-header__name {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.profile-header__meta {
  font-size: 14px;
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-header__meta span { display: flex; align-items: center; gap: 6px; }
.profile-header__meta i { color: var(--coral); }
.profile-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.profile-stat {
  text-align: center;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 80px;
}
.profile-stat__value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.profile-stat__value.stat-pts { color: var(--orange); }
.profile-stat__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

/* ── F1 Podium (reusable: 2nd-left, 1st-center-tall, 3rd-right-short) ── */
.f1-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding: 0 8px;
}
.f1-podium__slot {
  flex: 1;
  max-width: 220px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
/* Order: P2 first in DOM, P1 second, P3 third */
.f1-podium__slot--p1 { order: 2; }
.f1-podium__slot--p2 { order: 1; }
.f1-podium__slot--p3 { order: 3; }
/* White content area (top): avatar + name + points */
.f1-podium__content {
  padding: 16px 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.f1-podium__avatar { margin: 0 auto; }
.f1-podium__name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--body);
}
.f1-podium__name a { color: inherit; text-decoration: none; }
.f1-podium__name a:hover { color: var(--blue); text-decoration: underline; }
.f1-podium__pts {
  font-size: 12px;
  color: var(--muted);
}
.f1-podium__pts-big {
  font-size: 22px;
  font-weight: 900;
}
.f1-podium__slot--p1 .f1-podium__pts-big { color: var(--gold); }
.f1-podium__slot--p2 .f1-podium__pts-big { color: var(--silver); }
.f1-podium__slot--p3 .f1-podium__pts-big { color: var(--bronze); }
.f1-podium__stats {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 12px;
}
/* Colored step at bottom: ONLY the P1/P2/P3 label */
.f1-podium__step {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.f1-podium__slot--p1 .f1-podium__step { height: 56px; background: var(--gold); }
.f1-podium__slot--p2 .f1-podium__step { height: 36px; background: var(--silver); }
.f1-podium__slot--p3 .f1-podium__step { height: 20px; background: var(--bronze); }
.f1-podium__pos {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.f1-podium__slot--p1 .f1-podium__pos { color: rgba(0,0,0,.5); }
.f1-podium__slot--p2 .f1-podium__pos { color: rgba(0,0,0,.4); }
.f1-podium__slot--p3 .f1-podium__pos { color: rgba(255,255,255,.85); font-size: 11px; }

/* Legacy podium-grid kept as alias for backward compat */
.podium-grid { display: none; }

/* ── Round Result Card (Results page) ── */
.result-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow .2s;
}
.result-card:hover { box-shadow: var(--shadow-hover); }
.result-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--alt-bg);
}
.result-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-card__round-num {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-card__name {
  font-size: 16px;
  font-weight: 900;
  color: var(--body);
  letter-spacing: -.01em;
}
.result-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.result-card__detail-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.result-card__detail-link:hover { text-decoration: underline; }
.result-card__body { padding: 20px 24px; }
.result-card__track-img {
  margin-left: auto;
  flex-shrink: 0;
}
.result-card__track-img img {
  max-height: 56px;
  max-width: 80px;
  object-fit: contain;
  opacity: .65;
}
/* 2-column results grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.results-grid .result-card { margin-bottom: 0; }
.result-card__podium { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.result-card__pos-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.result-card__pos-num {
  font-size: 20px;
  font-weight: 900;
  min-width: 28px;
}
.result-card__pos-num.g { color: var(--gold); }
.result-card__pos-num.s { color: var(--silver); }
.result-card__pos-num.b { color: var(--bronze); }
.result-card__driver-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--body);
}
.result-card__driver-flag { font-size: 16px; }

/* ── Rulebook ── */
.rulebook-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 0;
}
.rulebook-content h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--body);
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gradient-primary);
  border-image: var(--gradient-primary) 1;
}
.rulebook-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--body);
  margin: 20px 0 8px;
}
.rulebook-content p { margin-bottom: 12px; line-height: 1.7; color: var(--body); }
.rulebook-content ul, .rulebook-content ol {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}
.rulebook-content ul li, .rulebook-content ol li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.rulebook-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}
.rulebook-content table th {
  background: var(--alt-bg);
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.rulebook-content table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.rulebook-content table tr:nth-child(even) td { background: rgba(0,0,0,.02); }

/* TOC in rulebook */
.rulebook-toc {
  background: var(--alt-bg);
  border-left: 4px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin-bottom: 40px;
}
.rulebook-toc__title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 14px;
}
.rulebook-toc ol {
  list-style: decimal;
  padding-left: 20px;
  columns: 2;
  column-gap: 24px;
}
.rulebook-toc ol li { margin-bottom: 5px; font-size: 14px; }
.rulebook-toc ol li a { color: var(--blue); text-decoration: none; }
.rulebook-toc ol li a:hover { text-decoration: underline; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .3; }
.empty-state p { font-size: 15px; }
.empty-state strong { display: block; font-size: 20px; font-weight: 900; color: var(--body); margin-bottom: 8px; opacity: .5; }

/* ── Grid Helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Footer ── */
.footer {
  background: var(--footer);
  color: rgba(255,255,255,.6);
  padding: 48px 0 28px;
  margin-top: 80px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer__brand { }
.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 6px;
}
.footer__logo-text {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}
.footer__logo-text span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--coral);
}
.footer__desc { font-size: 13px; line-height: 1.7; max-width: 260px; }
.footer__col-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-bottom: 16px;
}
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links a {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .2s;
}
.footer__links a:hover { color: #fff; text-decoration: none; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer__copy { font-size: 12px; }
.footer__pplx a {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .2s;
}
.footer__pplx a:hover { color: rgba(255,255,255,.7); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }
.text-muted { color: var(--muted); }
.text-coral { color: var(--coral); }
.text-success { color: var(--success); }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--coral); }
.breadcrumb i { font-size: 8px; }

/* ── Round Detail Header ── */
.round-detail-header {
  background: var(--body);
  color: #fff;
  padding: 40px 0;
}
.round-detail-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.round-detail-header__sub {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 8px;
}
.round-detail-header__name {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  line-height: 1.15;
}
.round-detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: rgba(255,255,255,.7);
}
.round-detail-header__meta span { display: flex; align-items: center; gap: 7px; }
.round-detail-header__meta i { color: var(--coral); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .f1-podium { gap: 8px; }
  .f1-podium__slot { max-width: none; }
  .result-card__podium { grid-template-columns: 1fr; gap: 4px; }
  .results-grid { grid-template-columns: 1fr; }
  .profile-header__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
  .navbar__nav { display: none; }
  .navbar__hamburger { display: flex; }
  .navbar__right .season-selector { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .round-card { grid-template-columns: 56px 1fr; }
  .round-card__right { display: none; }
  .round-card__track-img { display: none; }
  .drivers-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
  .profile-stats { gap: 12px; }
  .profile-stat { padding: 10px 14px; min-width: 64px; }
  .section { padding: 40px 0; }
  .hero { padding: 52px 0 44px; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .standings-table, .results-table { font-size: 13px; }
  .standings-table th, .results-table th { padding: 8px 10px; }
  .standings-table td, .results-table td { padding: 10px 10px; }
}
