/* ============================================================
   GP WEATHER — Styles
   Mobile-first, dark theme, F1 aesthetic
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --c-bg:        #000000;
  --c-surface:   #0a0a0a;
  --c-card:      #111111;
  --c-card-alt:  #1a1a1a;
  --c-border:    #222222;
  --c-text:      #f0f0f0;
  --c-text-dim:  #888888;
  --c-gold:      #FFD700;
  --c-gold-dark: #b89b00;
  --c-red:       #FF0000;
  --c-red-glow:  rgba(255, 0, 0, .25);
  --c-green:     #00e676;
  --c-blue:      #2196f3;

  --r-card:  16px;
  --r-btn:   12px;
  --r-sm:    8px;

  --shadow-card: 0 4px 24px rgba(0,0,0,.6), 0 1px 4px rgba(0,0,0,.4);
  --shadow-glow: 0 0 20px rgba(255,215,0,.12);

  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Roboto', sans-serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur:  .35s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
a { color: var(--c-gold); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* Screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--c-bg);
  transition: opacity .4s var(--ease), visibility .4s;
}
.loader.hide {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.loader__ring {
  width: 56px; height: 56px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__text {
  margin-top: 16px;
  font-family: var(--font-head);
  font-size: .85rem;
  color: var(--c-text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-btn);
  font-size: .85rem; font-weight: 500;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn .material-icons-round { font-size: 18px; }
.btn--gold {
  background: var(--c-gold);
  color: #000;
}
.btn--gold:hover { background: #ffe44d; transform: translateY(-1px); }
.btn--gold:active { transform: translateY(0); }
.btn--ghost {
  border: 1px solid var(--c-border);
  color: var(--c-text);
  background: rgba(255,255,255,.04);
}
.btn--ghost:hover { border-color: var(--c-gold); color: var(--c-gold); }
.btn--icon {
  width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  transition: all var(--dur) var(--ease);
}
.btn--icon:hover { border-color: var(--c-gold); color: var(--c-gold); background: rgba(255,215,0,.08); }

/* ---------- Top Bar ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
}
.top-bar__brand {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.top-bar__logo { color: var(--c-text); }
.top-bar__logo--accent { color: var(--c-gold); }
.top-bar__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.top-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r-btn);
  font-size: .75rem;
  font-weight: 500;
  color: var(--c-text-dim);
  border: 1px solid var(--c-border);
  background: rgba(255,255,255,.04);
  transition: all var(--dur) var(--ease);
}
.top-bar__btn .material-icons-round { font-size: 16px; }
.top-bar__btn:hover {
  border-color: var(--c-gold);
  color: var(--c-gold);
}
.top-bar__btn--active {
  border-color: var(--c-gold);
  color: var(--c-gold);
  background: rgba(255,215,0,.08);
}

/* ---------- Language Picker ---------- */
.lang-picker {
  position: relative;
}
.lang-picker__trigger {
  min-width: 0;
}
.lang-picker__code {
  font-family: var(--font-head);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.lang-picker__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 180px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  z-index: 1001;
  padding: 4px 0;
}
.lang-picker__dropdown[hidden] { display: none; }
.lang-picker__option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  font-size: .8rem;
  color: var(--c-text-dim);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-picker__option:hover {
  background: rgba(255,215,0,.08);
  color: var(--c-gold);
}
.lang-picker__option--active {
  color: var(--c-gold);
  font-weight: 600;
  background: rgba(255,215,0,.05);
}
/* Scrollbar styling for dropdown */
.lang-picker__dropdown::-webkit-scrollbar { width: 4px; }
.lang-picker__dropdown::-webkit-scrollbar-track { background: transparent; }
.lang-picker__dropdown::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 55vh;
  display: flex; align-items: flex-end;
  padding: 32px 20px;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  background-size: cover; background-position: center;
  transform: scale(1.05);
  transition: transform 8s var(--ease);
}
.hero__bg.loaded { transform: scale(1); }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.85) 100%);
}
.hero__content {
  position: relative; z-index: 1;
  width: 100%; max-width: 900px;
  margin: 0 auto;
  animation: fadeUp .8s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__flag { margin-bottom: 16px; }
.checkered-strip {
  width: 120px; height: 8px;
  background: repeating-conic-gradient(#fff 0% 25%, #000 0% 50%) 0 0 / 8px 8px;
  border-radius: 2px;
}
.hero__round {
  font-family: var(--font-head);
  font-size: .7rem;
  letter-spacing: 4px;
  color: var(--c-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero__title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.hero__country-flag {
  width: 48px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.hero__title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(90deg, var(--c-text), var(--c-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__circuit {
  font-size: 1rem;
  color: var(--c-text-dim);
  margin-bottom: 2px;
}
.hero__date {
  font-size: .9rem;
  color: var(--c-text-dim);
  margin-bottom: 20px;
}
/* hero__actions removed — controls moved to sticky top bar */

/* Hero track map (mobile only) */
.hero__track-map {
  display: none;
}
.hero__track-map[hidden] { display: none !important; }
.hero__track-map img {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  margin: 0 auto;
  display: block;
}
/* Refresh button removed from DOM */

/* Scroll indicator (mobile) */
.hero__scroll-hint {
  display: none;
}
@media (max-width: 768px) {
  .hero__track-map:not([hidden]) {
    display: block;
    margin-top: 16px;
    margin-bottom: 24px;
  }
  .hero__scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    animation: scrollBounce 2s ease-in-out infinite;
  }
  .hero__scroll-hint__text {
    font-family: var(--font-head);
    font-size: .55rem;
    letter-spacing: 2px;
    color: var(--c-text-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .hero__scroll-hint .material-icons-round {
    font-size: 20px;
    color: var(--c-gold);
  }
  @keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: .6; }
    50% { transform: translateY(6px); opacity: 1; }
  }
  .track-card {
    margin-top: 24px;
  }
}

/* ---------- Countdown Timer ---------- */
.hero__countdown {
  margin-bottom: 20px;
}
.hero__countdown[hidden] { display: none; }
.hero__countdown-label {
  font-family: var(--font-head);
  font-size: .6rem;
  letter-spacing: 3px;
  color: var(--c-text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}
.hero__countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  padding: 8px 10px;
  background: rgba(255,215,0,.06);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.countdown-unit__value {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-separator {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--c-text-dim);
  line-height: 1;
  margin-bottom: 14px;
}
.countdown-unit__label {
  font-size: .5rem;
  color: var(--c-text-dim);
  letter-spacing: 1px;
  margin-top: 4px;
}
.hero__countdown-session {
  margin-top: 8px;
  font-size: .8rem;
  color: var(--c-text-dim);
  text-align: center;
}
.hero__countdown-session strong {
  color: var(--c-gold);
}

/* ---------- Ad Slots ---------- */
.ad-slot {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  text-align: center;
}
.ad-slot ins { min-height: 50px; }

/* ---------- Week Ahead ---------- */
.week-ahead {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 0;
}
.week-ahead__title {
  font-family: var(--font-head);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 12px;
}
.week-ahead__strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.week-ahead__strip::-webkit-scrollbar { height: 3px; }
.week-ahead__strip::-webkit-scrollbar-track { background: transparent; }
.week-ahead__strip::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.week-day {
  flex: 1 0 90px;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  scroll-snap-align: start;
}
.week-day__name {
  font-family: var(--font-head);
  font-size: .75rem;
  font-weight: 700;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.week-day__date {
  font-size: .65rem;
  color: var(--c-text-dim);
}
.week-day__icon {
  width: 48px;
  height: 48px;
  margin: 2px 0;
}
.week-day__temp {
  display: flex;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
}
.week-day__high {
  color: var(--c-text);
}
.week-day__low {
  color: var(--c-text-dim);
}
.week-day__pop {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: .65rem;
  color: var(--c-blue);
}

/* ---------- Sessions Grid ---------- */
.sessions {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 0;
  position: relative;
}
.sessions__grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: filter .4s var(--ease), opacity .4s var(--ease);
}


/* ---------- Session Card ---------- */
.session-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.session-card.visible {
  opacity: 1;
  transform: translateY(0);
}
/* No hover effect — cards are not clickable */
.session-card--rain {
  border-color: var(--c-red) !important;
  box-shadow: var(--shadow-card), 0 0 24px var(--c-red-glow) !important;
}

/* Card Header */
.session-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(255,215,0,.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--c-border);
}
.session-card__session-name {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-gold);
}
.session-card__time {
  font-size: .8rem;
  color: var(--c-text-dim);
}
.session-card__rain-badge {
  display: none;
  align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--c-red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.session-card--rain .session-card__rain-badge { display: inline-flex; }

/* Forecast Type Badge */
.session-card__forecast-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--c-border);
}
.session-card__forecast-badge--hourly {
  color: var(--c-gold);
  background: rgba(255,215,0,.06);
}
.session-card__forecast-badge--daily {
  color: #90caf9;
  background: rgba(144,202,249,.06);
}
.session-card__forecast-badge--current {
  color: #ff9800;
  background: rgba(255,152,0,.08);
}
/* Weather Snapshot */
.session-card__snapshot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.session-card__icon {
  width: 80px; height: 80px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(255,215,0,.15));
}
.session-card__temp-block {
  flex: 1;
}
.session-card__temp {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--c-text);
}
.session-card__temp-unit {
  font-size: 1.2rem;
  color: var(--c-text-dim);
  font-weight: 400;
}
.session-card__condition {
  font-size: .9rem;
  color: var(--c-text-dim);
  margin-top: 4px;
  text-transform: capitalize;
}
.session-card__feels {
  font-size: .78rem;
  color: var(--c-text-dim);
  margin-top: 2px;
}

/* Metrics Grid */
.session-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--c-border);
  border-top: 1px solid var(--c-border);
}
.metric {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--c-card);
}
/* No hover effect — metrics are not clickable */
.metric__icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: rgba(255,215,0,.08);
  color: var(--c-gold);
  font-size: 20px;
  flex-shrink: 0;
}
.metric__info { flex: 1; min-width: 0; }
.metric__label {
  font-size: .65rem;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
}
.metric__value {
  font-size: .95rem;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.3;
}
.metric__value[data-animate] {
  transition: color .3s;
}

/* Precip Bar */
.session-card__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
  background: rgba(255,255,255,.015);
}
.precip-bar {
  flex: 1;
}
.precip-bar__label {
  font-size: .65rem;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.precip-bar__track {
  width: 100%; height: 6px;
  background: var(--c-card-alt);
  border-radius: 3px;
  overflow: hidden;
}
.precip-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-red));
  width: 0%;
  transition: width 1.2s var(--ease);
}
.precip-bar__value {
  font-size: .75rem;
  color: var(--c-text-dim);
  margin-top: 4px;
}
.wind-rose {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  min-width: 50px;
}
.wind-rose__arrow {
  font-size: 28px;
  color: var(--c-gold);
  transition: transform var(--dur) var(--ease);
  line-height: 1;
}
.wind-rose__dir {
  font-size: .6rem;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- Tire Strategy ---------- */
.session-card__tires {
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
  background: rgba(255,255,255,.02);
}
.tire-strategy__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: .6rem;
  letter-spacing: 2px;
  color: var(--c-text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tire-strategy__compounds {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.tire-compound {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--c-card-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  flex: 1;
  min-width: 0;
}
.tire-compound__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.2);
}
.tire-compound__name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
}
.tire-compound__tag {
  font-size: .5rem;
  letter-spacing: 1px;
  color: var(--c-text-dim);
  margin-left: auto;
  text-transform: uppercase;
  white-space: nowrap;
}
.tire-strategy__note {
  font-size: .72rem;
  color: var(--c-text-dim);
  line-height: 1.5;
}

/* Race strategy plan (RACE card only) */
.tire-strategy__race-plan {
  margin-bottom: 8px;
}
.tire-strategy__plan-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.tire-strategy__stops {
  font-family: var(--font-head);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--c-gold);
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.25);
  padding: 3px 10px;
  border-radius: var(--r-sm);
}
.tire-strategy__pit-window {
  font-size: .7rem;
  color: var(--c-text-dim);
}
.tire-strategy__stints {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.tire-strategy__stints--alt {
  opacity: .65;
}
.tire-stint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--c-card-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.tire-stint--alt { padding: 4px 8px; }
.tire-stint__compound {
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-text);
}
.tire-stint__laps {
  font-size: .65rem;
  color: var(--c-text-dim);
}
.tire-stint__label {
  font-size: .5rem;
  letter-spacing: 1px;
  color: var(--c-text-dim);
  margin-left: auto;
}
.tire-stint__arrow {
  font-size: 14px;
  color: var(--c-text-dim);
  opacity: .5;
}
.tire-stint__arrow--alt { font-size: 12px; }
.tire-strategy__alt-label {
  font-size: .6rem;
  color: var(--c-text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 8px 0 6px;
}

/* Strategy Factors (insights section) */
.insight-card--factors {
  grid-column: 1 / -1;
  border-color: rgba(255,255,255,.08);
}
.strategy-factors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 768px) {
  .strategy-factors { grid-template-columns: 1fr 1fr; }
}
.strategy-factor {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.strategy-factor__icon {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--c-gold);
  opacity: .7;
  flex-shrink: 0;
  margin-top: 1px;
  overflow: hidden;
}
.strategy-factor__title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}
.strategy-factor__detail {
  font-size: .7rem;
  color: var(--c-text-dim);
  line-height: 1.5;
}

/* ---------- Session Results ---------- */
.session-card--results {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.session-card__results-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--c-gold);
  color: #000;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.results-body {
  padding: 8px 16px 16px;
}
.results-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: .6rem;
  font-weight: 700;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
}
.results-header__pos { width: 24px; text-align: center; }
.results-header__driver { flex: 1; }
.results-header__times {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 180px;
  text-align: center;
}
.results-header__time { width: 80px; text-align: right; }
.results-header__points { width: 40px; text-align: right; }
.results-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease);
}
/* No hover effect — results rows are not clickable */
.results-row--p1 { background: rgba(255,215,0,.08); }
.results-row--p2 { background: rgba(192,192,192,.06); }
.results-row--p3 { background: rgba(205,127,50,.06); }
.results-row__pos {
  width: 24px;
  text-align: center;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 800;
  color: var(--c-text-dim);
}
.results-row--p1 .results-row__pos { color: var(--c-gold); }
.results-row--p2 .results-row__pos { color: #c0c0c0; }
.results-row--p3 .results-row__pos { color: #cd7f32; }
.results-row__driver { flex: 1; min-width: 0; }
.results-row__code {
  font-size: .8rem;
  font-weight: 700;
  color: var(--c-text);
  margin-right: 6px;
}
.results-row__team {
  font-size: .65rem;
  color: var(--c-text-dim);
}
.results-row__times {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 180px;
}
.results-row__q-time {
  font-size: .7rem;
  color: var(--c-text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.results-row__q-time--best {
  color: var(--c-gold);
  font-weight: 600;
}
.results-row__time {
  width: 80px;
  text-align: right;
  font-size: .7rem;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.results-row__points {
  width: 40px;
  text-align: right;
  font-size: .7rem;
  font-weight: 600;
  color: var(--c-text-dim);
}
.results-row__fastest {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Results Pending State */
.session-card--pending {
  border-color: var(--c-border);
}
.results-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.results-pending__icon {
  font-size: 36px;
  color: var(--c-gold);
  animation: pendingPulse 2s ease-in-out infinite;
}
@keyframes pendingPulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
.results-pending__text {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  color: var(--c-text);
  margin-top: 12px;
  letter-spacing: 1px;
}
.results-pending__sub {
  font-size: .72rem;
  color: var(--c-text-dim);
  margin-top: 6px;
}

/* Mobile: tighten Q times */
@media (max-width: 480px) {
  .results-header__times,
  .results-row__times {
    width: 130px;
    gap: 2px;
  }
  .results-row__q-time { font-size: .6rem; }
  .results-row__time { width: 60px; font-size: .6rem; }
  .results-row__points { width: 32px; font-size: .6rem; }
}

/* Speed-line divider between cards */
.speed-line {
  width: 60%;
  max-width: 200px;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  opacity: .3;
}

/* ---------- AI Insights ---------- */
.insights {
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 16px;
}
.insights[hidden] { display: none; }
.insights__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.insights__heading .material-icons-round { font-size: 22px; }
.insights__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Insight Card */
.insight-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
/* No hover effect — insight cards are not clickable */
.insight-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.insight-card__icon {
  font-size: 18px;
  color: var(--c-gold);
}
.insight-card__title {
  font-family: var(--font-head);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.insight-card__body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.insight-card__value {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
}
.insight-card__level {
  font-family: var(--font-head);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
}
.insight-card__level--low {
  color: var(--c-green);
  background: rgba(0,230,118,.1);
}
.insight-card__level--moderate {
  color: var(--c-gold);
  background: rgba(255,215,0,.1);
}
.insight-card__level--high {
  color: #ff9800;
  background: rgba(255,152,0,.1);
}
.insight-card__level--very-high {
  color: var(--c-red);
  background: rgba(255,0,0,.1);
}
.insight-card__bar {
  width: 100%;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.insight-card__bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s var(--ease);
}
.insight-card__desc {
  font-size: .72rem;
  color: var(--c-text-dim);
  line-height: 1.45;
}

/* AI Summary Card — spans full width */
.insight-card--summary {
  grid-column: 1 / -1;
  border-color: var(--c-gold);
  background: linear-gradient(135deg, rgba(255,215,0,.04) 0%, var(--c-card) 100%);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  padding: 18px 20px;
}
.insight-card__summary {
  font-size: .85rem;
  color: var(--c-text);
  line-height: 1.65;
  margin-bottom: 8px;
}
.insight-card__strategy {
  font-size: .75rem;
  color: var(--c-gold);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
}

/* Prediction List — full width in grid */
.insight-card--prediction {
  grid-column: 1 / -1;
}
.insight-card__predictions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.insight-prediction {
  display: flex;
  align-items: center;
  gap: 8px;
}
.insight-prediction__pos {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-gold);
  min-width: 20px;
}
.insight-prediction__info {
  flex: 1;
  min-width: 0;
}
.insight-prediction__name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-text);
  display: block;
}
.insight-prediction__sub {
  font-size: .7rem;
  color: var(--c-text-dim);
}
.insight-prediction__bar {
  width: 60px;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
}
.insight-prediction__bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--c-gold);
  transition: width 1s var(--ease);
}
.insight-prediction__reason {
  display: block;
  font-size: .68rem;
  color: var(--c-text-dim);
  line-height: 1.4;
  margin-top: 2px;
  font-style: italic;
}
.insight-prediction__pct {
  font-family: var(--font-head);
  font-size: .7rem;
  color: var(--c-text-dim);
  min-width: 32px;
  text-align: right;
}

/* ---------- F1 News ---------- */
.news {
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 16px;
}
.news[hidden] { display: none; }
.news__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.news__heading .material-icons-round { font-size: 22px; }
.news__grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.news-item:hover {
  border-color: var(--c-gold);
  background: var(--c-card-alt);
  text-decoration: none;
}
.news-item__source {
  font-family: var(--font-head);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-gold);
  text-transform: uppercase;
  white-space: nowrap;
  width: 95px;
  flex-shrink: 0;
  margin-top: 2px;
}
.news-item__body {
  flex: 1;
  min-width: 0;
}
.news-item__title {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.4;
}
.news-item__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .72rem;
  color: var(--c-text-dim);
  line-height: 1.5;
  margin-top: 4px;
}
.news-item__time {
  font-size: .65rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  margin-top: 2px;
}

@media (min-width: 640px) {
  .news { max-width: 1200px; }
}
@media (min-width: 1024px) {
  .news { max-width: 1400px; }
  .news__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* ---------- Live Session Card ---------- */
.session-card--live {
  border-color: var(--c-red);
  box-shadow: var(--shadow-card), 0 0 30px var(--c-red-glow);
  grid-column: 1 / -1 !important;
}
.session-card--live:hover {
  border-color: var(--c-red);
}
.session-card__header--live {
  background: linear-gradient(90deg, rgba(255,0,0,.08) 0%, transparent 100%);
}

/* LIVE Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--c-red);
  color: #fff;
  font-family: var(--font-head);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.live-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}

/* Live Card Body */
.live-card__body {
  padding: 12px 16px;
}
.live-card__positions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 12px;
}
.live-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease);
}
/* No hover effect — live rows are not clickable */
.live-row--p1 { background: rgba(255,215,0,.08); }
.live-row--p2 { background: rgba(192,192,192,.06); }
.live-row--p3 { background: rgba(205,127,50,.06); }
.live-row__pos {
  width: 24px;
  text-align: center;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 800;
  color: var(--c-text-dim);
}
.live-row--p1 .live-row__pos { color: var(--c-gold); }
.live-row--p2 .live-row__pos { color: #c0c0c0; }
.live-row--p3 .live-row__pos { color: #cd7f32; }
.live-row__driver {
  flex: 1;
  min-width: 0;
}
.live-row__code {
  font-size: .8rem;
  font-weight: 700;
  color: var(--c-text);
  padding-left: 8px;
  margin-right: 6px;
}
.live-row__team {
  font-size: .65rem;
  color: var(--c-text-dim);
}
.live-row__tire {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* Race Control Messages */
.live-card__race-control {
  border-top: 1px solid var(--c-border);
  padding-top: 10px;
  margin-bottom: 10px;
}
.live-rc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  color: var(--c-text-dim);
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}
.live-rc--yellow {
  background: rgba(255,215,0,.08);
  color: var(--c-gold);
}
.live-rc--red {
  background: rgba(255,0,0,.08);
  color: var(--c-red);
}
.live-rc--green {
  background: rgba(0,230,118,.08);
  color: var(--c-green);
}
.live-rc__flag {
  font-weight: 700;
  font-size: .65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-width: 50px;
}
.live-rc__msg {
  flex: 1;
}

/* Live Weather */
.live-card__weather {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}
.live-wx {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--c-text-dim);
}
.live-wx .material-icons-round {
  color: var(--c-gold);
}

/* Live card exit animation */
.live-card--exiting {
  animation: liveCardExit .5s var(--ease) forwards;
}
@keyframes liveCardExit {
  to { opacity: 0; transform: translateY(-20px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Live card responsive */
@media (min-width: 640px) {
  .live-card__positions {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1024px) {
  .live-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .live-card__race-control {
    border-top: none;
    border-left: 1px solid var(--c-border);
    padding-left: 16px;
    padding-top: 0;
    margin-bottom: 0;
  }
  .live-card__weather {
    grid-column: 1 / -1;
  }
}

/* ---------- Historical Weather ---------- */
.historical {
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 16px;
}
.historical[hidden] { display: none; }
.historical__inner {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}
.historical__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.historical__heading .material-icons-round {
  font-size: 22px;
}
.historical__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.historical-card {
  background: var(--c-card-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 16px;
}
/* No hover effect — historical cards are not clickable */
.historical-card__year {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--c-gold);
  margin-bottom: 12px;
}
.historical-card__stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.historical-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--c-text);
}
.historical-stat .material-icons-round {
  font-size: 18px;
  color: var(--c-text-dim);
}

/* ---------- Track Card ---------- */
.track-card {
  position: relative;
  max-width: 100%;
  margin: 40px 0 0;
  padding: 32px 20px;
  background: var(--c-card);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.track-card__checkered {
  position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-conic-gradient(#333 0% 25%, transparent 0% 50%) 0 0 / 6px 6px;
}
.track-card__heading {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-gold);
  margin-bottom: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.track-card__heading .material-icons-round { font-size: 24px; }
.track-card__body {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.track-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.track-stat {
  padding: 14px;
  background: var(--c-card-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.track-stat__label {
  font-size: .65rem;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.track-stat__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
}
.track-card__map {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  overflow: hidden;
}
.track-card__map img {
  width: 100%;
  height: auto;
  min-height: 250px;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.track-card__map iframe {
  width: 100%;
  height: 100%;
  min-height: 250px;
  border: 0;
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.2);
}
.track-card__map-placeholder {
  text-align: center;
  color: var(--c-text-dim);
}
.track-card__map-placeholder .material-icons-round {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: .3;
}
.track-card__map-placeholder p {
  font-size: .8rem;
}

/* ---------- Error State ---------- */
.error-state {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
  padding: 40px 20px;
}
.error-state[hidden] { display: none; }
.error-state__icon {
  font-size: 64px;
  color: var(--c-text-dim);
  margin-bottom: 16px;
}
.error-state__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--c-text);
}
.error-state__msg {
  font-size: .9rem;
  color: var(--c-text-dim);
  margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 40px 20px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}
.footer__inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.footer__brand { margin-bottom: 16px; }
.footer__logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-text);
}
.footer__logo--accent { color: var(--c-gold); }
.footer__tagline {
  font-size: .8rem;
  color: var(--c-text-dim);
  margin-top: 4px;
}
.footer__links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer__links a {
  font-size: .8rem;
  color: var(--c-text-dim);
  transition: color var(--dur);
}
.footer__links a:hover { color: var(--c-gold); text-decoration: none; }
.footer__social {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.footer__copy {
  font-size: .7rem;
  color: var(--c-text-dim);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  background: var(--c-card);
  border: 1px solid var(--c-gold);
  border-radius: var(--r-btn);
  font-size: .85rem;
  color: var(--c-gold);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 10000;
  transition: transform .35s var(--ease), opacity .35s;
  opacity: 0;
  pointer-events: none;
}
.toast[hidden] { display: block; } /* allow transition */
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Skeleton / No-data placeholder ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--c-card-alt) 25%, var(--c-border) 50%, var(--c-card-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Tablet+ (≥640px) ---------- */
@media (min-width: 640px) {
  .hero { min-height: 50vh; padding: 48px 32px; }
  .hero__title { font-size: clamp(2rem, 4vw, 3.2rem); }
  .hero__country-flag { width: 56px; }

  .sessions { padding: 32px 24px 0; max-width: 1200px; }
  .sessions__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  /* Hide decorative speed lines in grid layout */
  .sessions__grid > .speed-line {
    display: none;
  }

  .insights { max-width: 1200px; }

  .track-card { padding: 40px 32px; }
  .track-card__body {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* ---------- Desktop (≥1024px) ---------- */
@media (min-width: 1024px) {
  .hero { min-height: 45vh; padding: 64px 48px; }

  .sessions { padding: 40px 32px 0; max-width: 1400px; }
  .sessions__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
  }
  .sessions__grid > .session-card {
    grid-column: span 2; /* 3 per row */
  }
  .sessions__grid > .session-card--wide {
    grid-column: span 3; /* 2 per row, splitting evenly */
  }
  /* Reset tablet full-span rule at desktop */
  .sessions__grid > .session-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
  .sessions__grid > .session-card--wide:last-child:nth-child(odd) {
    grid-column: span 3;
  }

  .insights { max-width: 1400px; }
  .insights__grid { grid-template-columns: repeat(4, 1fr); }
  .insight-card--summary { grid-column: 1 / -1; }
  .insight-card--prediction { grid-column: span 2; }

  .track-card { padding: 48px; }
  .track-card__stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] {
  --font-head: 'Roboto', sans-serif;
}
[dir="rtl"] .lang-picker__option {
  text-align: right;
}
[dir="rtl"] .hero__content {
  text-align: right;
}
[dir="rtl"] .hero__title-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .hero__countdown-label,
[dir="rtl"] .hero__countdown-session {
  text-align: center;
}
[dir="rtl"] .session-card__header {
  flex-direction: row-reverse;
}
[dir="rtl"] .metric {
  flex-direction: row-reverse;
}
[dir="rtl"] .metric__info {
  text-align: right;
}
[dir="rtl"] .session-card__forecast-badge {
  flex-direction: row-reverse;
}
[dir="rtl"] .tire-strategy__label {
  flex-direction: row-reverse;
}
[dir="rtl"] .tire-compound {
  flex-direction: row-reverse;
}
[dir="rtl"] .tire-compound__tag {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .tire-stint__label {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .tire-stint__arrow {
  transform: scaleX(-1);
}
[dir="rtl"] .live-row__code {
  padding-left: 0;
  padding-right: 8px;
  margin-right: 0;
  margin-left: 6px;
}
[dir="rtl"] .news-item {
  flex-direction: row-reverse;
}
[dir="rtl"] .news-item__source {
  text-align: right;
}
[dir="rtl"] .results-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .results-header-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .results-row__time,
[dir="rtl"] .results-header__time {
  text-align: left;
}
[dir="rtl"] .results-row__points,
[dir="rtl"] .results-header__points {
  text-align: left;
}
[dir="rtl"] .insight-card__header {
  flex-direction: row-reverse;
}
[dir="rtl"] .insight-card__body {
  flex-direction: row-reverse;
}
[dir="rtl"] .insight-prediction {
  flex-direction: row-reverse;
}
[dir="rtl"] .insight-prediction__pct {
  text-align: left;
}
[dir="rtl"] .strategy-factor {
  flex-direction: row-reverse;
}
[dir="rtl"] .footer__inner {
  text-align: center;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Focus Visible (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

/* ---------- Cookie Consent Banner ---------- */
.cookie-consent {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10001;
  background: var(--c-card);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.6);
  padding: 16px 24px;
  animation: slideUp .4s var(--ease);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cookie-consent__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.cookie-consent__text {
  font-size: .85rem;
  color: var(--c-text-dim);
  line-height: 1.5;
  flex: 1 1 300px;
}
.cookie-consent__text a {
  color: var(--c-gold);
  text-decoration: underline;
}
.cookie-consent__btn {
  flex-shrink: 0;
  padding: 10px 32px;
  font-size: .9rem;
  font-weight: 600;
}

/* ---------- Legal Pages ---------- */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  min-height: 100vh;
}
.legal-page__nav {
  margin-bottom: 32px;
}
.legal-page__nav a {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-gold);
  text-decoration: none;
}
.legal-page h1 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
}
.legal-page__updated {
  font-size: .8rem;
  color: var(--c-text-dim);
  margin-bottom: 32px;
}
.legal-page h2 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-gold);
  margin-top: 32px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.legal-page p,
.legal-page li {
  font-size: .9rem;
  color: var(--c-text-dim);
  line-height: 1.7;
  margin-bottom: 12px;
}
.legal-page ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}
.legal-page a {
  color: var(--c-gold);
}
.legal-page__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  font-size: .75rem;
  color: var(--c-text-dim);
  text-align: center;
}

/* ---------- Tire Tread Texture ---------- */
.tire-texture {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10h20M10 0v20' stroke='%23222' stroke-width='.5'/%3E%3C/svg%3E");
  background-size: 20px 20px;
}
