/* ==========================================================
   Cores padrão do site. As cores da equipe são configuradas na área do
   administrador e chegam por /tema.css, que redefine estas variáveis:
   carbono (fundo) · dourado (cor principal) · vermelho (destaque)
   prata (texto) · roxo (ProAm) · azul (Academy)
   ========================================================== */
:root {
  --carbon-950: #07080a;
  --carbon-900: #0c0d10;
  --carbon-850: #111317;
  --carbon-800: #16181d;
  --carbon-700: #1e2127;
  --carbon-600: #2a2e36;
  --line: #262a31;

  --gold-300: #ecca84;
  --gold-400: #dcae58;
  --gold-500: #c8943c;
  --gold-600: #9c6f27;

  --red-400: #f0474d;
  --red-500: #e1262d;
  --red-600: #b81c22;

  --silver-50: #f6f7f8;
  --silver-200: #d9dce1;
  --silver-400: #a3a8b1;
  --silver-500: #80858f;

  --academy-400: #4a9bf0;
  --academy-500: #2f80d8;
  --proam-400: #b384ee;
  --proam-500: #9b5de5;
  --on-proam: #ffffff;

  --on-gold: #07080a;
  --on-academy: #ffffff;

  --up: #3fcf7a;
  --down: #f0474d;

  --text: var(--silver-50);
  --text-muted: var(--silver-400);
  --surface: var(--carbon-850);
  --surface-2: var(--carbon-800);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px -20px rgb(0 0 0 / 0.8);
  --font-display: 'Rajdhani', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar-h: 68px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* o atributo hidden sempre vence (ex.: botões com display: flex) */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  background: var(--carbon-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-400); text-decoration: none; }
a:hover { color: var(--gold-300); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); text-transform: uppercase; }
h3 { font-size: 1.3rem; }
code { background: var(--carbon-700); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.accent-red { color: var(--red-500); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.overline {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-400);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--carbon-900) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--carbon-600); }
.brand__name { display: grid; grid-template-columns: auto auto; line-height: 1; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.04em; }
.brand__name b { font-weight: 700; }
.brand__name em { font-style: normal; font-weight: 700; color: var(--red-500); }
.brand__name small { grid-column: 1 / -1; font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; }

.nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--silver-200);
}
.nav__links a:hover { color: var(--gold-300); background: var(--carbon-800); }
.nav__links a[aria-current='page'] { color: var(--gold-300); background: var(--carbon-800); }
.nav__account { border: 1px solid var(--line); }
.nav__account.is-logged { border-color: color-mix(in srgb, var(--gold-500) 60%, var(--line)); color: var(--gold-300) !important; }
.nav__toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav__toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; background: var(--silver-200); margin: 4px 0; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }

.live {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--carbon-850);
  font-size: 0.8rem; color: var(--silver-200); white-space: nowrap;
}
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--silver-500); }
.live[data-state='live'] .live__dot { background: var(--up); box-shadow: 0 0 0 0 rgb(63 207 122 / 0.6); animation: pulse 2s infinite; }
.live[data-state='updating'] .live__dot { background: var(--academy-400); }
.live[data-state='error'] .live__dot { background: var(--red-500); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(63 207 122 / 0); } 100% { box-shadow: 0 0 0 0 rgb(63 207 122 / 0); } }

/* ---------- Buttons / controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--on-gold); }
.btn--gold:hover { color: var(--on-gold); background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); }
.btn--ghost { border-color: var(--carbon-600); color: var(--silver-200); background: transparent; }
.btn--ghost:hover { border-color: var(--gold-500); color: var(--gold-300); }
.btn--block { display: flex; width: 100%; margin-top: 16px; }
.btn--sm { padding: 8px 16px; font-size: 0.95rem; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--carbon-950); border: 1px solid var(--line); }
.seg__btn {
  border: 0; background: transparent; cursor: pointer; padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.92rem;
  color: var(--silver-400);
}
.seg__btn:hover { color: var(--silver-50); }
.seg__btn.is-active { background: var(--gold-500); color: var(--on-gold); }
.seg__btn[data-squad='academy'].is-active { background: var(--academy-500); color: var(--on-academy); }
.seg__btn[data-squad='proam'].is-active { background: var(--proam-500); color: var(--on-proam); }

.search input {
  width: 200px; padding: 8px 16px 8px 36px; border-radius: 999px; border: 1px solid var(--line); font: inherit; font-size: 0.88rem;
  color: var(--silver-50);
  background: var(--carbon-950) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23c8943c' stroke-width='1.8'/%3E%3Cpath d='M9.4 9.4 13 13' stroke='%23c8943c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 14px center;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--gold-500); }

.select select {
  appearance: none; cursor: pointer;
  background: var(--carbon-950) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c8943c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: 999px; color: var(--silver-200);
  padding: 8px 38px 8px 16px; font: inherit; font-size: 0.88rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(40px, 7vw, 88px) 0 40px;
  background:
    radial-gradient(900px 500px at 85% 20%, color-mix(in srgb, var(--gold-500) 14%, transparent), transparent 60%),
    radial-gradient(700px 400px at 5% 90%, color-mix(in srgb, var(--red-500) 8%, transparent), transparent 60%),
    linear-gradient(180deg, var(--carbon-950), var(--carbon-900));
  border-bottom: 1px solid var(--line);
}
.hero__stripes {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
  background:
    linear-gradient(118deg, transparent 0 58%, color-mix(in srgb, var(--gold-500) 55%, transparent) 58% 58.6%, transparent 58.6% 61%, color-mix(in srgb, var(--gold-500) 25%, transparent) 61% 61.3%, transparent 61.3%),
    linear-gradient(118deg, transparent 0 8%, color-mix(in srgb, var(--red-500) 35%, transparent) 8% 8.25%, transparent 8.25%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero__title { font-size: clamp(4rem, 12vw, 8.5rem); line-height: 0.85; letter-spacing: 0.01em; display: flex; flex-wrap: wrap; }
.hero__sub {
  margin: 8px 0 0; font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem); letter-spacing: 0.55em; color: var(--silver-200);
}
.hero__tagline { color: var(--text-muted); max-width: 42ch; margin: 18px 0 28px; font-size: 1.05rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.panel {
  position: relative; align-self: stretch;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--carbon-800) 92%, transparent), color-mix(in srgb, var(--carbon-900) 92%, transparent));
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.04);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
}
.panel::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); background: linear-gradient(180deg, var(--gold-500), var(--red-500)); }
.panel__title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--gold-400); }
.panel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.panel__item {
  display: grid; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--carbon-900); border: 1px solid var(--line); color: var(--text);
}
a.panel__item, button.panel__item { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
a.panel__item:hover, button.panel__item:hover { border-color: var(--gold-600); color: var(--text); transform: translateX(2px); }
.panel__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }
.panel__value { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.panel__detail { font-size: 0.82rem; color: var(--silver-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel__item--next { border-color: color-mix(in srgb, var(--gold-500) 55%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold-500) 14%, var(--carbon-900)), var(--carbon-900)); }
.panel__item--next .panel__label { color: var(--gold-400); }

.stats {
  position: relative; margin: clamp(32px, 5vw, 56px) 0 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: color-mix(in srgb, var(--carbon-850) 92%, transparent); padding: 18px 20px; }
.stat dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.stat dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat:nth-child(1) dd { color: var(--gold-400); }


/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--carbon-950); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section__head h2::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 10px; background: linear-gradient(90deg, var(--gold-500), var(--red-500)); transform: skewX(-20deg); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Driver cards ---------- */
.drivers { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.skeleton { height: 250px; border-radius: var(--radius); background: linear-gradient(100deg, var(--carbon-850) 30%, var(--carbon-800) 50%, var(--carbon-850) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

.driver {
  --accent: var(--gold-500);
  position: relative; overflow: hidden; cursor: pointer; text-align: left; width: 100%;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 16px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--carbon-800), var(--carbon-850) 55%);
  border: 1px solid var(--line);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.driver::before {
  content: ''; position: absolute; top: 0; right: -30px; width: 120px; height: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 0 25%, transparent 60%); mask-image: linear-gradient(180deg, #000 0 25%, transparent 60%);
  background: linear-gradient(118deg, transparent 0 40%, var(--accent) 40% 44%, transparent 44% 52%, color-mix(in srgb, var(--accent) 40%, transparent) 52% 54%, transparent 54%);
  opacity: 0.55; pointer-events: none;
}
.driver:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); }
.driver--academy { --accent: var(--academy-500); }
.driver--proam { --accent: var(--proam-500); }
.driver.is-new { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--gold-400), 0 0 30px color-mix(in srgb, var(--gold-400) 40%, transparent); } 100% { box-shadow: none; } }

.driver__head { display: flex; align-items: center; gap: 12px; position: relative; }
/* foto do piloto (ou as iniciais, sem foto) */
.avatar {
  flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; overflow: hidden;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em;
  background: var(--carbon-950); color: var(--silver-200); border: 2px solid var(--accent, var(--gold-500));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.7rem; }
.avatar--sm { width: 30px; height: 30px; font-size: 0.8rem; border-width: 1.5px; }
.driver__name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.1; }
.driver__role { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 60%, white); }

.driver__rating { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; position: relative; margin-top: -10px; }
.irating__label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; white-space: nowrap; position: relative; }
.irating__value { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.delta { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.spark { width: 110px; height: 40px; flex: none; }

.lic {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums;
  padding: 2px 8px 2px 2px; border-radius: 6px; background: var(--carbon-950); border: 1px solid var(--line);
}
.lic__cls { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-size: 0.75rem; color: #fff; background: var(--lic, #555); }
.lic[data-dark-text] .lic__cls { color: #111; }

.driver__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--text-muted); }
.driver__foot strong { color: var(--silver-50); }
.driver__last { display: flex; align-items: center; gap: 8px; min-width: 0; }
.driver__last > span { display: grid; min-width: 0; line-height: 1.25; text-align: right; }
.driver__last strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver__last small { font-size: 0.75rem; }
.pos { flex: none; display: inline-grid; place-items: center; min-width: 30px; padding: 1px 6px; border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; background: var(--carbon-700); color: var(--silver-50); }
.pos--1 { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--on-gold); }
.pos--2 { background: linear-gradient(135deg, #eef0f3, #a9aeb7); color: var(--carbon-950); }
.pos--3 { background: linear-gradient(135deg, #d99a66, #8f5a31); color: #fff; }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-muted); border: 1px dashed var(--carbon-600); border-radius: var(--radius); }
.warn { color: var(--red-400); font-size: 0.78rem; }

/* ---------- Results table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--carbon-850); }
.results { width: 100%; border-collapse: collapse; min-width: 760px; }
.results th, .results td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.results th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 600; background: var(--carbon-800); position: sticky; top: 0; }
.results th.num, .results td.num { text-align: right; }
.results tbody tr:last-child td { border-bottom: 0; }
.results tbody tr:hover { background: var(--carbon-800); }
.results tbody tr.is-new { animation: rowflash 3s ease-out; }
@keyframes rowflash { 0% { background: color-mix(in srgb, var(--gold-500) 25%, transparent); } 100% { background: transparent; } }
.results .who { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.results .who button { all: unset; cursor: pointer; }
.results .who button:hover { color: var(--gold-300); }
.results .who button:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.results .series { font-weight: 500; }
.results .track { font-size: 0.8rem; color: var(--text-muted); }
.results .when { white-space: nowrap; color: var(--text-muted); font-size: 0.85rem; }
.squad-dot { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--gold-500); flex: none; }
.squad-dot--academy { background: var(--academy-500); }
.squad-dot--proam { background: var(--proam-500); }

/* ---------- Championships ---------- */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.champ { border-radius: var(--radius); border: 1px solid var(--line); background: var(--carbon-850); overflow: hidden; display: flex; flex-direction: column; }
.champ__head { padding: 18px 20px; background: linear-gradient(118deg, var(--carbon-800) 0 70%, color-mix(in srgb, var(--gold-500) 18%, transparent) 70% 71%, var(--carbon-800) 71%); border-bottom: 1px solid var(--line); }
.champ__head h3 { font-size: 1.45rem; }
.champ__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 0.82rem; color: var(--text-muted); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: rgb(63 207 122 / 0.14); color: var(--up); }
.chip--open { background: color-mix(in srgb, var(--academy-500) 18%, transparent); color: var(--academy-400); }
.chip--done { background: var(--carbon-700); color: var(--silver-400); }
.champ__next { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.champ__next b { font-family: var(--font-display); font-size: 1.1rem; color: var(--gold-400); }
.standings { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.standings td, .standings th { padding: 8px 20px; border-bottom: 1px solid var(--line); }
.standings th { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; text-align: left; font-weight: 600; }
.standings tr:last-child td { border-bottom: 0; }
.standings tr.is-team td { background: linear-gradient(90deg, color-mix(in srgb, var(--gold-500) 16%, transparent), transparent 70%); font-weight: 600; }
.standings tr.is-team td:first-child { box-shadow: inset 3px 0 0 var(--gold-500); }
.champ__note { padding: 16px 20px; color: var(--text-muted); font-size: 0.85rem; }
.champ__next--stage { display: grid; gap: 10px; }
.sessions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sessions li { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--carbon-900); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.sessions b { font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--silver-50); font-variant-numeric: tabular-nums; }
.sessions li:last-child { box-shadow: inset 0 2px 0 var(--gold-500); }
.sessions li:last-child b { color: var(--gold-300); }
.champ__team { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.champ__avatars { display: flex; }
.champ__avatars > span + span { margin-left: -6px; }
.champ__avatars .avatar { box-shadow: 0 0 0 2px var(--carbon-850); }
.champ__more { margin: auto 20px 18px; align-self: flex-start; }
.champ > * + .champ__more { margin-top: 16px; }
/* tabela de pilotos da competição: os da equipe em destaque, com a foto e a cor da categoria (Pro, ProAm ou Academy) */
.entries { min-width: 560px; }
.entries tr.is-team { --team: var(--gold-500); }
.entries tr.is-team.is-academy { --team: var(--academy-500); }
.entries tr.is-team.is-proam { --team: var(--proam-500); }
.entries tr.is-team td { background: color-mix(in srgb, var(--team) 16%, var(--carbon-850)); font-weight: 600; }
.entries tr.is-team td:first-child { box-shadow: inset 4px 0 0 var(--team); }
.entries tr.is-team .avatar { --accent: var(--team); }
.entries .who button { font-weight: 700; }
.stages { min-width: 620px; }
.stages tr.is-past td { color: var(--silver-500); }
.accent-text { color: var(--gold-400); }

/* ---------- Modal ---------- */
.modal {
  width: min(920px, 100% - 24px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--carbon-850); color: var(--text); box-shadow: 0 40px 80px -20px rgb(0 0 0 / 0.9);
}
.modal::backdrop { background: color-mix(in srgb, var(--carbon-950) 75%, transparent); backdrop-filter: blur(4px); }
.modal[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }
.modal__head {
  --accent: var(--gold-500);
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; background: linear-gradient(118deg, var(--carbon-800) 0 72%, color-mix(in srgb, var(--accent) 35%, transparent) 72% 73.5%, var(--carbon-800) 73.5%);
  border-bottom: 1px solid var(--line);
}
.modal__head.is-academy { --accent: var(--academy-500); }
.modal__head.is-proam { --accent: var(--proam-500); }
.modal__head h3 { font-size: 1.7rem; }
.modal__close { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--carbon-600); background: var(--carbon-900); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.modal__close:hover { border-color: var(--gold-500); color: var(--gold-300); }
.modal__content { padding: 20px; display: grid; gap: 24px; }
.modal h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-400); margin-bottom: 10px; }
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lic-card { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--carbon-900); border: 1px solid var(--line); border-top: 3px solid var(--lic, var(--carbon-600)); }
.lic-card__cat { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.lic-card__ir { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.lic-card__sr { font-size: 0.82rem; color: var(--silver-200); }
.career { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.career div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--carbon-900); border: 1px solid var(--line); }
.career dt { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.career dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.career__rank { margin: 0 0 10px; color: var(--silver-200); }
.career__rank strong { color: var(--gold-400); }
.career__title { margin-top: 14px; }
.career__champs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.career__champs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--carbon-900); border: 1px solid var(--line); }
.career__champs b { font-family: var(--font-display); font-size: 1.15rem; color: var(--gold-400); }
.chart { width: 100%; height: auto; display: block; background: var(--carbon-900); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.chart text { fill: var(--silver-500); font-size: 11px; font-family: var(--font-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart__tip { fill: var(--silver-50); font-weight: 600; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast {
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--carbon-800); border: 1px solid var(--line);
  border-left: 4px solid var(--gold-500); box-shadow: var(--shadow); font-size: 0.88rem; animation: slidein 0.25s ease-out;
}
.toast b { color: var(--gold-300); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: 0.3s; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Footer ---------- */
.footer { padding: 32px 0; border-top: 1px solid var(--line); background: var(--carbon-950); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1440px) {
  .topbar__inner { gap: 14px; }
  .nav__links a { padding: 8px 10px; font-size: 0.95rem; letter-spacing: 0.04em; }
  .live__time { display: none; }
}
@media (max-width: 1100px) {
  .nav { order: 3; margin-left: 0; }
  .live { margin-left: auto; }
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0;
    flex-direction: column; padding: 8px 16px 16px; background: var(--carbon-900); border-bottom: 1px solid var(--line);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 8px; border-radius: 8px; }
  .nav__toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav__toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar__inner { gap: 10px; }
  .brand__name small { display: none; }
  .live__time { display: none; }
  .brand__name { font-size: 1.15rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat dd { font-size: 1.6rem; }
  .champs { grid-template-columns: 1fr; }
  .section__head { align-items: flex-start; }
  .toolbar { width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  .search input { width: 100%; }
}
@media (max-width: 560px) {
  /* Todos / Pro / ProAm / Academy: a linha inteira, botões do mesmo tamanho */
  .seg { display: flex; width: 100%; }
  .seg__btn { flex: 1 1 0; padding: 6px 4px; font-size: 0.84rem; letter-spacing: 0.03em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* classificação da equipe no campeonato */
.standings--team caption { caption-side: top; text-align: left; padding: 12px 20px 4px; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-500); font-weight: 600; }
.standings--team td, .standings--team th { padding: 8px 6px; }
.standings--team td:first-child, .standings--team th:first-child { padding-left: 20px; }
.standings--team td:last-child, .standings--team th:last-child { padding-right: 20px; white-space: nowrap; }
.standings--team td .small { display: block; margin-top: 2px; font-size: 0.7rem; }
.standings__who { display: inline-flex; align-items: center; gap: 8px; }
