﻿:root {
  /* ===== COLOR TOKENS ===== */
  --bg: #0b0f14;
  --bg-soft: #121922;
  --card: rgba(18, 25, 34, 0.9);
  --card-2: rgba(25, 34, 46, 0.9);
  --line: rgba(255, 255, 255, 0.08);

  --text: #ecf3ff;
  --muted: #9fb0c5;

  --accent: #ff5b2e;
  --accent-2: #ffd166;
  --gold: #f5c451;
  --silver: #b8c4d4;
  --bronze: #d28b5f;
  --green: #39d98a;
  --red: #ef4444;

  /* ===== SHARED UI TOKENS ===== */
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

/* ===== RESET / BASE ===== */


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 91, 46, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 24%);
}

html {
  scroll-padding-top: 84px;
}

.top-nav,
.container {
  position: relative;
  z-index: 2;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body.monza-bg-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.08) 0%, rgba(8, 12, 18, 0.12) 38%, rgba(8, 12, 18, 0.18) 100%),
    url("./fun-stats/monza.jpg") center center / cover no-repeat;
}

body.monza-bg-page .site-video-bg {
  display: none;
}

body.monza-bg-page .site-video-overlay {
  background:
    linear-gradient(
      180deg,
        rgba(8, 12, 18, 0.03) 0%,
      rgba(8, 12, 18, 0.06) 36%,
      rgba(8, 12, 18, 0.1) 100%
    );
}

body.lite-background .site-video-bg {
  display: none;
}

body.lite-background .site-video-overlay {
  background:
    linear-gradient(
      180deg,
      rgba(11, 15, 20, 0.82) 0%,
      rgba(11, 15, 20, 0.88) 55%,
      rgba(11, 15, 20, 0.94) 100%
    );
}

.reveal-ready {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-ready.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

/* ===== VIDEO BACKGROUND ===== */

.site-video-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.site-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  object-fit: cover;
  transform: translate(-50%, -50%) scale(1.05);
  pointer-events: none;
}

.site-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(11, 15, 20, 0.45) 0%,
      rgba(11, 15, 20, 0.62) 55%,
      rgba(11, 15, 20, 0.82) 100%
    );
}

/* ===== TOP NAVIGATION ===== */

.top-nav {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(12, 17, 26, 0.94), rgba(12, 17, 26, 0.88));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.top-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.top-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.top-nav-brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  flex: 0 0 auto;
}

.top-nav-brand-text {
  display: inline-block;
}

.top-nav-center {
  display: flex;
  justify-content: center;
  min-width: 0;
  position: relative;
}

.top-nav-socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.top-nav-menu > [hidden] {
  display: none !important;
}

.top-nav-actions {
  display: flex;
  justify-content: flex-end;
}

.top-nav-more {
  position: relative;
  display: none;
}

.top-nav-more.is-visible {
  display: block;
}

.top-nav-more-toggle {
  gap: 8px;
}

.top-nav-more-icon {
  font-size: 1rem;
  line-height: 1;
}

.top-nav-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(12, 17, 26, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.top-nav-more-menu[hidden] {
  display: none !important;
}

.top-nav-more-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #f4f8ff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-nav-more-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 209, 102, 0.26);
}

.top-nav-link-primary,
.top-nav-link-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.top-nav-link-primary,
.nav-link-primary,
.top-nav .btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff7d57);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(255, 91, 46, 0.28);
}

.top-nav-link-primary:hover,
.nav-link-primary:hover,
.top-nav .btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(255, 91, 46, 0.36);
}

.top-nav-link-secondary,
.nav-link-secondary {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f4f8ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.top-nav-link-secondary:hover,
.nav-link-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 209, 102, 0.42);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 209, 102, 0.16),
    0 14px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.nav-social {
  min-width: 42px;
  min-height: 42px;
  padding: 10px;
  font-size: 0.86rem;
  letter-spacing: 0.015em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.nav-social.nav-social-discord {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.34);
}

.nav-social.nav-social-telegram {
  background: linear-gradient(135deg, #27a7e7, #168ac7);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(39, 167, 231, 0.3);
}

.nav-social:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.nav-social.nav-social-discord:hover {
  box-shadow: 0 16px 34px rgba(88, 101, 242, 0.42);
}

.nav-social.nav-social-telegram:hover {
  box-shadow: 0 16px 34px rgba(39, 167, 231, 0.38);
}

.nav-social.nav-social-tiktok {
  background: linear-gradient(135deg, #151515, #2b2b2b);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.nav-social.nav-social-tiktok:hover {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}

.nav-social.nav-social-youtube {
  background: linear-gradient(135deg, #ff2a23, #cc181e);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(204, 24, 30, 0.34);
}

.nav-social.nav-social-youtube:hover {
  box-shadow: 0 16px 34px rgba(204, 24, 30, 0.42);
}

.nav-social.nav-social-twitch {
  background: linear-gradient(135deg, #9146ff, #6f2cff);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(145, 70, 255, 0.34);
}

.nav-social.nav-social-twitch:hover {
  box-shadow: 0 16px 34px rgba(145, 70, 255, 0.42);
}

.social-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Wide safety table needs horizontal scroll area */
.safety-table-dynamic {
  min-width: 980px;
}

/* ===== HERO ===== */

.hero {
  padding: 10px 0 4px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 91, 46, 0.12), rgba(255, 255, 255, 0.03)),
    var(--card);
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.05) 40%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 10px 12px;
  align-items: stretch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1 {
  margin: 0 0 4px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  max-width: min(100%, 1080px);
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-main-column {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  align-self: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  padding-top: 0;
  margin-left: 0;
}

.hero-copy .eyebrow {
  margin-bottom: 8px;
}

.hero-hourly-promo {
  position: relative;
  overflow: hidden;
  grid-column: 2 / 3;
  grid-row: 1;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 91, 46, 0.14)),
    rgba(21, 19, 20, 0.92);
  box-shadow: 0 18px 38px rgba(255, 91, 46, 0.14);
}

.hero-hourly-promo-title {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 209, 102, 0.46);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.14);
  color: #ffd166;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 0 26px rgba(255, 209, 102, 0.18);
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.hero-hourly-promo-title:hover,
.hero-hourly-promo-title:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.8);
  background: rgba(255, 209, 102, 0.22);
  color: #fff2bd;
}

.hero-hourly-promo-title:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.62);
  outline-offset: 3px;
}

.hero-hourly-promo-title.pulse-attention {
  animation: pulseAttention 2.1s infinite, hourlyPromoBlink 1.35s ease-in-out infinite;
}

@keyframes hourlyPromoBlink {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.28);
  }
  50% {
    text-shadow:
      0 0 18px rgba(255, 209, 102, 0.78),
      0 0 34px rgba(255, 91, 46, 0.52);
  }
}

.hero-hourly-promo-note {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.hero-hourly-winner-card {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 82px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 91, 46, 0.08)),
    rgba(14, 18, 24, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 38px rgba(0, 0, 0, 0.24);
}

.hero-hourly-winner-card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -34px;
  width: 210px;
  height: 210px;
  background: url("./assets/crown.png") center / contain no-repeat;
  opacity: 0.2;
  transform: rotate(12deg);
  pointer-events: none;
}

.hero-hourly-winner-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -48px auto;
  width: 210px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-hourly-winner-copy,
.hero-hourly-winner-media {
  position: relative;
  z-index: 1;
}

.hero-hourly-winner-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.hero-hourly-winner-label {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-hourly-winner-name {
  min-width: 0;
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  font-weight: 950;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-hourly-winner-meta {
  min-width: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-hourly-winner-media {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.hero-hourly-winner-car {
  position: absolute;
  right: -8px;
  bottom: -2px;
  width: min(190px, 46%);
  height: auto;
  max-height: 102px;
  object-fit: contain;
  opacity: 0.52;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.34));
}

.hero-hourly-card {
  --hero-hourly-track-photo: none;
  position: relative;
  grid-column: 2 / 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 209, 102, 0.26);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 193, 86, 0.14), rgba(255, 91, 46, 0.08)),
    rgba(36, 33, 38, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero-hourly-card:hover,
.hero-hourly-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 46px rgba(0, 0, 0, 0.28);
}

.hero-hourly-card:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.55);
  outline-offset: 3px;
}

.hero-hourly-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(8, 12, 18, 0.25) 0%, rgba(8, 12, 18, 0.25) 38%, rgba(8, 12, 18, 0.25) 100%),
    radial-gradient(circle at top right, rgba(255, 184, 77, 0.08), transparent 32%),
    var(--hero-hourly-track-photo);
  background-position: center, top right, center;
  background-size: cover, auto, cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-hourly-card > * {
  position: relative;
  z-index: 1;
}

.hero-hourly-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.hero-hourly-eyebrow {
  margin: 0;
  color: #ffcc5c;
  font-size: 0.84rem;
}

.hero-hourly-meta {
  display: grid;
  gap: 10px;
}

.hero-hourly-meta-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.hero-hourly-meta-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-hourly-meta-value {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.hero-hourly-meta-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.hero-hourly-meta-time {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-hourly-card .btn.hero-hourly-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff8b2c, #ff5b2e);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(255, 91, 46, 0.28);
}

.hero-hourly-btn {
  align-self: stretch;
}

.hero-hourly-actions {
  display: grid;
  gap: 10px;
}

.hero-hourly-btn.is-disabled {
  opacity: 0.75;
  pointer-events: none;
}

.hero-hourly-btn.is-voted {
  background: linear-gradient(135deg, #ffd166, #ffb347);
  color: #101418;
  box-shadow: 0 14px 28px rgba(255, 209, 102, 0.22);
}

.hero-hourly-votes {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.42);
  color: #f6f0dc;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  backdrop-filter: blur(10px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

/* ===== HERO ACTIONS + ONLINE WIDGET ===== */

.hero-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 0;
  max-width: none;
}

.hero-actions.hero-actions-stacked-mobile {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "today races online online"
    "driver driver online online"
    "stats stats stats stats";
  gap: 8px;
  margin-top: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.hero-actions.hero-actions-stacked-mobile .btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 52px;
  padding: 12px 16px;
  align-self: stretch;
  flex: 0 0 auto;
}

.hero-primary-actions {
  display: contents;
}

.btn-today-stats {
  grid-area: today;
}

.btn-last-races {
  grid-area: races;
}

.btn-driver-day {
  grid-area: driver;
}

.hero-online-card {
  grid-area: online;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.hero-online-card:hover,
.hero-online-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 179, 71, 0.4);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

.hero-online-card:focus-visible {
  outline: 2px solid rgba(255, 179, 71, 0.68);
  outline-offset: 2px;
}

.hero-online-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.hero-online-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-online-range {
  font-size: 12px;
  white-space: nowrap;
  color: var(--muted);
}

.hero-online-chart-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: end;
  flex: 1;
  min-height: 0;
}

.hero-online-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 100px;
  padding-top: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-online-bar-group {
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.hero-online-bar {
  width: 100%;
  max-width: 28px;
  min-height: 4px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #ffb347 0%, #ff8a00 40%, #ff5b2e 100%);
  box-shadow: 0 8px 18px rgba(255, 91, 46, 0.25);
}

.hero-online-date {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  color: var(--muted);
}

.hero-online-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 100px;
  padding-bottom: 8px;
  font-size: 11px;
  color: var(--muted);
}

.hero-online-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  font-size: 13px;
  color: var(--muted);
}

.hero-funnel-card {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.hero-copy h1 {
  font-size: clamp(26px, 3.4vw, 42px);
}

.hero-funnel-title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
}

.hero-funnel-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.hero-funnel-link {
  font-weight: 900;
  text-decoration: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.hero-funnel-link:hover,
.hero-funnel-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-funnel-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

.hero-funnel-link-telegram {
  color: #27a7e7;
  text-shadow: 0 0 18px rgba(39, 167, 231, 0.24);
}

.hero-funnel-link-telegram:hover,
.hero-funnel-link-telegram:focus-visible {
  color: #6ed0ff;
  text-shadow: 0 0 22px rgba(39, 167, 231, 0.42);
}

.hero-funnel-link-discord {
  color: #5865f2;
  text-shadow: 0 0 18px rgba(88, 101, 242, 0.24);
}

.hero-funnel-link-discord:hover,
.hero-funnel-link-discord:focus-visible {
  color: #8d96ff;
  text-shadow: 0 0 22px rgba(88, 101, 242, 0.42);
}

.hero-funnel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-cta-primary,
.hero-cta-secondary {
  min-height: 48px;
  padding-inline: 18px;
}



/* ===== LANGUAGE SWITCH ===== */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  z-index: 3;
}

.lang-switch-floating {
  position: absolute;
  top: 10px;
  right: 24px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 56px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
th.sortable:focus-visible,
tr.is-interactive-row:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.92);
  outline-offset: 2px;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), #ff7d57);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 91, 46, 0.25);
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  line-height: 1;
}

.lang-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff7d57);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 91, 46, 0.25);
}

.btn-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

/* Primary CTA in hero */
.btn-today-stats,
.btn-last-races {
  position: relative;
  width: auto;
  min-width: 260px;
  min-height: 104px;
  padding: 18px 20px;
  border-radius: 20px;
  align-self: flex-start;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--text);
  border: 1px solid rgba(255, 184, 77, 0.26);
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.14), rgba(255, 91, 46, 0.10));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 12px 28px rgba(255, 91, 46, 0.16);
}

.btn-today-stats:hover,
.btn-last-races:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.18), rgba(255, 91, 46, 0.14));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 16px 34px rgba(255, 91, 46, 0.22);
}

/* Secondary hero CTA with highlighted accent border */
.btn-driver-day {
  position: relative;
  width: auto;
  min-width: 260px;
  min-height: 104px;
  padding: 18px 20px;
  border-radius: 20px;
  align-self: flex-start;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--text);
  border: 1px solid rgba(255, 184, 77, 0.26);
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.14), rgba(255, 91, 46, 0.10));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 12px 28px rgba(255, 91, 46, 0.16);
}

.btn-driver-day:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.18), rgba(255, 91, 46, 0.14));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 16px 34px rgba(255, 91, 46, 0.22);
}

/* Pulsing attention ring for primary CTA */
.pulse-attention {
  animation: pulseAttention 2.1s infinite;
}

@keyframes pulseAttention {
  0% {
    box-shadow:
      0 0 0 0 rgba(255, 184, 77, 0.34),
      0 10px 30px rgba(255, 140, 0, 0.16);
  }
  70% {
    box-shadow:
      0 0 0 12px rgba(255, 184, 77, 0),
      0 10px 30px rgba(255, 140, 0, 0.16);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 184, 77, 0),
      0 10px 30px rgba(255, 140, 0, 0.16);
  }
}

/* ===== HERO MINI STATS ===== */

.hero-side {
  display: grid;
  grid-area: stats;
  grid-row: auto;
  gap: 2px;
  width: 100%;
  max-width: none;
  margin-left: 0;
}

.hero-side-compact {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr);
  gap: 6px;
}

.mini-stat {
  min-height: 56px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-2);
  margin-top: 2px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.mini-stat:hover,
.driver-stat-card:hover,
.driver-highlight-card:hover,
.race-summary-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.mini-label {
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

.mini-value {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.mini-note {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.mini-stat-bestlap {
  min-height: 56px;
}

.mini-stat-compact {
  min-height: 42px;
  padding: 5px 12px;
}

.mini-stat-compact .mini-value {
  margin-top: 6px;
  font-size: clamp(1rem, 2vw, 1rem);
  line-height: 0.8;
}


.mini-stat-compact .mini-note {
  margin-top: 4px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.hero-stats-row {
  display: contents;
}

.hero-top3-panel {
  min-width: 0;
  align-self: end;
}

.cards-top3.cards-top3-hero {
  gap: 8px;
}

.cards-top3-hero .pilot-card {
  min-height: 0;
  padding: 9px 10px;
  border-radius: 14px;
  box-shadow: none;
}

.cards-top3-hero .pilot-topline {
  gap: 6px;
  margin-bottom: 5px;
}

.cards-top3-hero .pilot-rank {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.cards-top3-hero .pilot-rank-wrap {
  gap: 4px;
}

.cards-top3-hero .pilot-name {
  font-size: 14px;
}

.cards-top3-hero .pilot-topline-car {
  width: 46px;
  height: 28px;
}

.cards-top3-hero .pilot-card .muted {
  font-size: 11px;
  line-height: 1.2;
}

.cards-top3-hero .pilot-lap-line {
  gap: 6px;
}

.cards-top3-hero .pilot-meta {
  gap: 5px;
  margin-top: 7px;
}

.cards-top3-hero .meta-box {
  padding: 5px 6px;
  border-radius: 10px;
}

.cards-top3-hero .meta-label {
  margin-bottom: 2px;
  font-size: 9px;
}

.cards-top3-hero .meta-value {
  font-size: 13px;
}

.hero-card-page {
  display: block;
}

.cars-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.cars-hero-copy-card {
  display: grid;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(15, 19, 26, 0.44);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(8, 11, 17, 0.18);
}

.cars-hero-card .page-hero-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cars-hero-card .page-hero-subtitle {
  max-width: 760px;
}

.page-hero-copy .hero-subtitle {
  margin-bottom: 0;
}

.page-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cars-hero-spotlight {
  display: grid;
  gap: 12px;
  min-height: 100%;
  margin-top: 0;
  padding: 16px 18px;
  align-self: start;
}

.cars-hero-spotlight-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cars-hero-spotlight-image {
  width: min(100%, 240px);
  height: auto;
  max-height: 132px;
  object-fit: contain;
}

.cars-hero-spotlight-name {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
}

.cars-hero-spotlight-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cars-hero-spotlight-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.cars-hero-spotlight-stat-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.cars-hero-spotlight-stat-value {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 900px) {
  .cars-hero-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-hero-stats,
  .cars-hero-spotlight-meta {
    grid-template-columns: 1fr;
  }
}

.driver-hero-card {
  padding: 18px 20px;
}

.driver-title-name {
  display: inline;
}

#driver-page-name {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.driver-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  margin-left: auto;
  color: var(--text);
}

.driver-rank-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.driver-rank-value {
  color: inherit;
}

.driver-rank-pill.rank-1 {
  color: var(--gold);
  border-color: rgba(245, 196, 81, 0.34);
  background: rgba(245, 196, 81, 0.12);
}

.driver-rank-pill.rank-2 {
  color: var(--silver);
  border-color: rgba(184, 196, 212, 0.34);
  background: rgba(184, 196, 212, 0.12);
}

.driver-rank-pill.rank-3 {
  color: var(--bronze);
  border-color: rgba(210, 139, 95, 0.34);
  background: rgba(210, 139, 95, 0.12);
}

.driver-rank-pill.rank-default {
  color: #e8eef8;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.driver-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.driver-stat-card,
.driver-highlight-card {
  min-height: 40px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.driver-stat-label,
.driver-highlight-label,
.driver-stat-note {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}

.driver-stat-value,
.driver-highlight-value {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.stat-with-trend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.driver-stat-mainline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.driver-stat-side {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.driver-stat-note {
  margin-top: 4px;
}

.driver-highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin-right: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 800;
}

.empty-inline {
  color: var(--muted);
}

.driver-penalties-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.driver-penalty-card {
  overflow: hidden;
}

.driver-penalty-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.driver-penalty-list {
  padding: 12px 16px 16px;
}

.penalty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.penalty-item:last-child {
  border-bottom: none;
}

.penalty-name {
  color: var(--text);
}

.penalty-value {
  color: var(--accent-2);
  font-weight: 800;
}

.server-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.server-status-wrap-total {
  align-items: baseline;
}

.server-total-label {
  font-size: 13px;
  font-weight: 700;
  color: #edf2ff;
}

.server-status {
  font-weight: 600;
}

.server-status.online {
  color: #22c55e;
}

.server-status.offline {
  color: #ef4444;
}

.server-status.degraded {
  color: #f59e0b;
}

.server-players {
  opacity: 0.8;
  font-size: 14px;
}

.server-sticky-widget {
  position: fixed;
  top: 106px;
  right: 22px;
  z-index: 1100;
  width: min(190px, calc(100vw - 44px));
  display: grid;
  gap: 7px;
}

.server-sticky-head {
  padding: 0 2px;
}

.server-sticky-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 242, 255, 0.78);
}

.server-sticky-cards {
  display: grid;
  gap: 7px;
}

.server-sticky-card {
  --server-card-bg: none;
  position: relative;
  overflow: hidden;
  min-height: 76px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(8, 12, 19, 0.22), rgba(8, 12, 19, 0.78)),
    var(--server-card-bg);
  background-position: center;
  background-size: cover;
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.24),
    0 8px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
}

.server-sticky-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(8, 12, 19, 0.16), rgba(8, 12, 19, 0.7));
}

.server-sticky-card-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
}

.server-sticky-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  text-align: right;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.server-sticky-card-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.server-sticky-card-status .server-status {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.server-sticky-card-status .server-players {
  font-size: 0.98rem;
  font-weight: 900;
  color: #ffffff;
  opacity: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.32);
}


/* ===== SECTIONS ===== */

.section {
  padding: 18px 0 12px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.section-subtitle-hint {
  color: #ff9a62;
}

.car-thumb {
  display: block;
  width: 34px;
  height: 20px;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.car-thumb-inline {
  width: 30px;
  height: 18px;
}

.car-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  vertical-align: middle;
}

.car-label-inline > span,
.car-label-inline > a {
  min-width: 0;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 16px;
  flex-wrap: wrap;
}

.filter-meta.is-empty {
  margin-top: 0;
}

.filter-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-meta-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.filter-chip-label {
  color: var(--accent-2);
}

.btn-filter-clear {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
}

.search-input {
  width: min(280px, 100%);
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20, 28, 38, 0.94), rgba(17, 24, 33, 0.9));
  color: var(--text);
  outline: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.search-input::placeholder {
  color: #bdd0e6;
}

.search-input:focus {
  border-color: rgba(255, 91, 46, 0.72);
  background:
    linear-gradient(180deg, rgba(23, 31, 42, 0.98), rgba(20, 28, 38, 0.94));
  box-shadow:
    0 0 0 4px rgba(255, 91, 46, 0.16),
    0 14px 30px rgba(0, 0, 0, 0.22);
}

.filter-select {
  min-width: 150px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20, 28, 38, 0.94), rgba(17, 24, 33, 0.9));
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.filter-select:focus {
  border-color: rgba(255, 91, 46, 0.72);
  outline: none;
  box-shadow:
    0 0 0 4px rgba(255, 91, 46, 0.16),
    0 14px 30px rgba(0, 0, 0, 0.22);
}

/* ===== TOP 3 ===== */

.cards-top3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pilot-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)), var(--card);
  box-shadow: var(--shadow);
}

.pilot-card.top1 {
  background: linear-gradient(180deg, rgba(245, 196, 81, 0.16), rgba(255, 255, 255, 0.03)), var(--card);
}

.pilot-card.top2 {
  background: linear-gradient(180deg, rgba(184, 196, 212, 0.14), rgba(255, 255, 255, 0.03)), var(--card);
}

.pilot-card.top3 {
  background: linear-gradient(180deg, rgba(210, 139, 95, 0.16), rgba(255, 255, 255, 0.03)), var(--card);
}

.pilot-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}

.pilot-rank-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pilot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.top1 .pilot-rank {
  color: var(--gold);
}

.top2 .pilot-rank {
  color: var(--silver);
}

.top3 .pilot-rank {
  color: var(--bronze);
}

.pilot-topline .trend-badge {
  flex: 0 0 auto;
}

.pilot-name {
  margin: 0;
  min-width: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pilot-topline-car {
  margin-left: auto;
  flex: 0 0 auto;
  width: 60px;
  height: 36px;
}

.pilot-card .muted {
  font-size: 13px;
  line-height: 1.35;
}

.pilot-lap-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pilot-lap-car {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.pilot-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.meta-box {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.meta-label {
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

.meta-value {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

/* ===== TABLES ===== */

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
  position: relative;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

thead tr {
  background: rgba(255, 255, 255, 0.04);
}

th {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 25, 34, 0.96);
  backdrop-filter: blur(10px);
}

th.sortable {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: 0.2s ease;
}

th.sortable:hover {
  color: var(--text);
}

th.sortable::after {
  content: "\2195";
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}

th.sortable.sort-asc::after {
  content: "\2191";
  color: var(--accent-2);
}

th.sortable.sort-desc::after {
  content: "\2193";
  color: var(--accent);
}

td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 15px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:not(.is-interactive-row):hover {
  transform: none;
}

tbody tr.is-driver-preview-row {
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

tbody tr.is-driver-preview-row:hover,
tbody tr.is-driver-preview-row:focus-visible {
  background: rgba(255, 91, 46, 0.07);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 76, 0.22);
}

tbody tr.is-driver-preview-row td:last-child {
  position: relative;
  padding-right: 28px;
}

tbody tr.is-driver-preview-row td:last-child::after {
  content: "\2197";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 209, 102, 0.72);
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.18s ease, color 0.18s ease;
}

tbody tr.is-driver-preview-row:hover td:last-child::after,
tbody tr.is-driver-preview-row:focus-visible td:last-child::after {
  color: var(--accent-2);
  transform: translateY(-50%) translateX(1px);
}

.races-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.driver-races-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.races-table tbody tr:hover {
  background: rgba(255, 91, 46, 0.07);
  transform: translateY(-1px);
}

.driver-races-table tbody tr:hover {
  background: rgba(255, 91, 46, 0.07);
  transform: translateY(-1px);
}

.is-interactive-row:focus-visible {
  background: rgba(255, 91, 46, 0.08);
}

.race-track-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.race-track-name {
  font-weight: 800;
}

.race-track-meta,
.race-note {
  font-size: 13px;
  color: var(--muted);
}

.race-winner {
  font-weight: 700;
}

.positions-delta {
  font-weight: 700;
  color: var(--text);
}

.positions-delta.delta-positive {
  color: var(--green);
}

.positions-delta.delta-negative {
  color: var(--red);
}

.positions-delta.delta-neutral {
  color: var(--text);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.trend-badge-compact {
  padding: 2px 6px;
  font-size: 0.72rem;
}

.trend-badge.trend-up {
  color: var(--green);
  border-color: rgba(57, 217, 138, 0.2);
  background: rgba(57, 217, 138, 0.12);
}

.trend-badge.trend-down {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.12);
}

.trend-arrow {
  font-size: 0.74em;
}

.rank-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.rank-1 {
  color: var(--gold);
}

.rank-2 {
  color: var(--silver);
}

.rank-3 {
  color: var(--bronze);
}

.driver-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 91, 46, 0.9), rgba(255, 209, 102, 0.9));
  color: #101418;
  font-size: 14px;
  font-weight: 900;
}

.driver-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.driver-name {
  font-weight: 700;
  color: var(--text);
}

.driver-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.driver-link:hover {
  color: var(--accent-2);
}

.driver-link:focus-visible {
  color: var(--accent-2);
}

.today-stat-value .driver-link,
.today-detail-main .driver-link,
.today-detail-sub .driver-link {
  position: relative;
  font-weight: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.today-stat-value .driver-link:hover,
.today-detail-main .driver-link:hover,
.today-detail-sub .driver-link:hover,
.today-stat-value .driver-link:focus-visible,
.today-detail-main .driver-link:focus-visible,
.today-detail-sub .driver-link:focus-visible {
  color: var(--accent-2);
  border-bottom-color: rgba(255, 209, 102, 0.42);
}

.driver-link-heading {
  color: var(--text);
}

.driver-link-subtle {
  color: var(--muted);
}

.driver-name-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.driver-row-hint,
.driver-link-hint {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.driver-row-hint {
  border: 1px solid rgba(255, 138, 76, 0.22);
  background: rgba(255, 91, 46, 0.08);
  color: #ffd6ba;
}

.driver-link-hint {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.best-lap-value {
  color: #a300f5;
  text-shadow: 0 0 12px rgba(163, 0, 245, 0.2);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.pill-session-r {
  color: var(--green);
}

.pill-session-q {
  color: var(--accent-2);
}

.muted {
  color: var(--muted);
}

/* ===== PAGINATION ===== */

.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.pagination-info {
  font-size: 13px;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.page-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #ff7d57);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 91, 46, 0.25);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-dots {
  padding: 0 2px;
  color: var(--muted);
  font-weight: 700;
}

/* ===== MODALS ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 16, 0.78);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  padding-top: 140px;
}

.modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 184, 77, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(11, 15, 20, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-card-activity {
  width: min(1140px, 100%);
}

.modal-card-slot {
  --modal-track-photo: none;
  max-height: none;
  overflow: visible;
  background:
    linear-gradient(112deg, rgba(7, 11, 16, 0.28) 0%, rgba(7, 11, 16, 0.28) 38%, rgba(7, 11, 16, 0.28) 100%),
    radial-gradient(circle at top right, rgba(255, 184, 77, 0.12), transparent 30%),
    var(--modal-track-photo),
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(11, 15, 20, 0.98));
  background-position: center, top right, center, center;
  background-size: cover, auto, cover, cover;
  background-repeat: no-repeat;
}

.modal-header {
  margin-bottom: 14px;
  padding-right: 42px;
}

.modal-title {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--text);
}

.modal-subtitle {
  margin: 0;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.03);
}

.today-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.today-stat-card,
.today-detail-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.today-stat-label,
.today-detail-title {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.today-stat-value {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.today-stat-value-sm {
  font-size: 1.05rem;
  line-height: 1.35;
}

.today-stats-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.today-detail-main {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.today-detail-side-inline {
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.today-detail-sub {
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.activity-controls {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.activity-month-picker {
  display: grid;
  gap: 8px;
}

.activity-month-picker span {
  font-size: 0.82rem;
  color: var(--muted);
}

.activity-month-picker select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.activity-days-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.activity-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

.activity-day-pill strong {
  color: var(--accent);
}

.activity-day-pill:hover,
.activity-day-pill.is-active {
  border-color: rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.12);
}

.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.activity-summary-card,
.activity-panel,
.activity-hour-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.activity-summary-card-accent {
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.12), rgba(255, 255, 255, 0.045));
  border-color: rgba(255, 179, 71, 0.22);
}

.activity-summary-label {
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.activity-summary-value {
  font-size: clamp(1rem, 1.8vw, 1.38rem);
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
}

.activity-layout {
  display: block;
}

.activity-panel {
  min-width: 0;
}

.activity-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.activity-panel-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.activity-panel-note {
  font-size: 0.92rem;
  color: var(--muted);
  text-align: right;
}

.activity-hours-list {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

.activity-hour-bar-card {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.activity-hour-unique {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1;
}

.activity-hour-bar-stage {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 150px;
  padding: 10px 0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.02);
}

.activity-hour-bar-vertical {
  display: block;
  width: min(100%, 16px);
  min-height: 2px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #ffd36a 0%, #ff9a2f 45%, #ff5b2e 100%);
  box-shadow: 0 10px 22px rgba(255, 91, 46, 0.22);
}

.activity-hour-bar-card.is-prime .activity-hour-bar-stage {
  background:
    linear-gradient(180deg, rgba(255, 179, 71, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  outline: 1px solid rgba(255, 179, 71, 0.28);
}

.activity-hour-bar-card.is-prime .activity-hour-bar-vertical {
  background: linear-gradient(180deg, #ffe08b 0%, #ffb347 38%, #ff6d2e 100%);
  box-shadow: 0 12px 24px rgba(255, 179, 71, 0.28);
}

.activity-hour-axis-label {
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.02em;
}

body.modal-open {
  overflow: hidden;
}

.hourly-modal-details {
  display: grid;
  gap: 12px;
}

.hourly-modal-details-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 68px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(16, 20, 27, 0.58);
  backdrop-filter: blur(10px);
}

.hourly-modal-cta-btn {
  width: auto;
  min-width: 180px;
  justify-content: center;
  gap: 8px;
  padding-left: 18px;
  padding-right: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a43, #ff6b2d);
  box-shadow: 0 12px 24px rgba(255, 107, 45, 0.24);
}

.hourly-modal-cta-meta {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: #eef3ff;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}

.hourly-modal-subtitle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.hourly-modal-subtitle-card,
.hourly-modal-side-card,
.hourly-modal-left-cluster {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(22, 27, 35, 0.46);
  backdrop-filter: blur(14px);
}

.hourly-modal-subtitle-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.hourly-modal-subtitle-label,
.hourly-modal-label {
  color: rgba(213, 224, 239, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
}

.hourly-modal-subtitle-value {
  color: #f4f8ff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hourly-modal-subtitle-card:nth-child(1) .hourly-modal-subtitle-value,
.hourly-modal-subtitle-card:nth-child(2) .hourly-modal-subtitle-value {
  font-size: 1.08rem;
}

.hourly-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.hourly-modal-left-cluster {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(116, 120, 129, 0.18);
}

.hourly-modal-panel-grid {
  display: grid;
  gap: 10px;
}

.hourly-modal-panel-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hourly-modal-panel-item {
  display: grid;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 14px;
  min-height: 158px;
  align-content: start;
  background: linear-gradient(180deg, rgba(40, 43, 49, 0.82), rgba(30, 33, 40, 0.78));
}

.hourly-modal-side-stack {
  display: grid;
  gap: 10px;
}

.hourly-modal-side-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: rgba(20, 27, 38, 0.92);
  border-color: rgba(171, 123, 83, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 117, 0.06);
}

.hourly-modal-side-card-combined {
  align-content: start;
}

.hourly-modal-side-card-compact {
  gap: 8px;
}

.hourly-modal-side-section {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(13, 18, 28, 0.74);
}

.hourly-modal-side-section-weather .hourly-modal-token-list {
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: space-between;
}

.hourly-modal-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hourly-modal-panel-item .hourly-modal-token-list {
  align-content: flex-start;
}

.hourly-modal-panel-item .hourly-modal-token {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.hourly-modal-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #eef3ff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.hourly-modal-token-primary {
  border-color: rgba(211, 121, 82, 0.52);
  background: rgba(132, 73, 51, 0.34);
  color: #ffe2cf;
}

.hourly-modal-token-muted {
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 248, 255, 0.78);
}

.hourly-modal-token-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.94;
}

/* ===== DRIVER OF THE DAY MODAL ===== */

.driver-day-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.driver-day-card-wide {
  grid-column: span 3;
}

.driver-day-card-wide .today-stat-value {
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}

.modal-card-driver-preview {
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header-driver-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.btn-driver-preview-link {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 143, 82, 0.92);
  border-radius: 16px;
  background: linear-gradient(180deg, #ff7a3d, #f05a22);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(240, 90, 34, 0.28);
}

.btn-driver-preview-link:hover,
.btn-driver-preview-link:focus-visible {
  background: linear-gradient(180deg, #ff8b57, #f56a37);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(240, 90, 34, 0.34);
}

.driver-preview-stats-grid {
  margin-top: 0;
}

.driver-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

#driver-of-day-content.is-empty {
  opacity: 0.45;
}

.modal-card-race {
  width: min(1080px, 100%);
}

.race-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.race-summary-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

#race-results-table tr.race-result-row-highlight {
  background: rgba(255, 122, 61, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 154, 98, 0.28);
}

#race-results-table tr.race-result-row-highlight:hover,
#race-results-table tr.race-result-row-highlight:focus-visible {
  background: rgba(255, 122, 61, 0.16);
}

#race-results-table tr.race-result-row-highlight .driver-name,
#race-results-table tr.race-result-row-highlight .positions-delta,
#race-results-table tr.race-result-row-highlight td {
  color: inherit;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.24);
}

.race-summary-label {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.race-summary-value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.table-card-modal {
  border-radius: 18px;
}

/* ===== FOOTER ===== */

.footer {
  padding: 26px 0 42px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.footer-text {
  max-width: 760px;
  font-size: 13px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease;
}

.footer-links .footer-social-link {
  width: 38px;
  padding: 0;
}

.footer-links a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.twitch-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
  width: min(320px, calc(100vw - 22px));
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, width 0.22s ease;
}

.twitch-widget.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.twitch-widget.is-expanded {
  width: min(50vw, 780px);
}

.twitch-widget.is-collapsed {
  width: min(320px, calc(100vw - 22px));
}

.twitch-widget-shell {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(145, 70, 255, 0.32);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(145, 70, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(17, 22, 31, 0.96), rgba(10, 14, 21, 0.96));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    0 10px 26px rgba(145, 70, 255, 0.16);
  backdrop-filter: blur(12px);
}

.twitch-widget.is-platform-youtube .twitch-widget-shell {
  border-color: rgba(255, 63, 58, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 63, 58, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(17, 22, 31, 0.96), rgba(10, 14, 21, 0.96));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    0 10px 26px rgba(255, 63, 58, 0.14);
}

.twitch-widget-header {
  display: grid;
  gap: 10px;
  padding: 14px 14px 10px;
}

.twitch-widget-title-wrap {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.twitch-widget-title-wrap:hover .twitch-widget-title,
.twitch-widget-title-wrap:focus-visible .twitch-widget-title {
  color: #ffffff;
}

.twitch-widget-title {
  color: #edf2ff;
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.twitch-widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.twitch-widget-open,
.twitch-widget-expand,
.twitch-widget-hide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf2ff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.twitch-widget-open:hover,
.twitch-widget-open:focus-visible,
.twitch-widget-expand:hover,
.twitch-widget-expand:focus-visible,
.twitch-widget-hide:hover,
.twitch-widget-hide:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(145, 70, 255, 0.42);
  color: #ffffff;
  transform: translateY(-1px);
}

.twitch-widget.is-platform-youtube .twitch-widget-open:hover,
.twitch-widget.is-platform-youtube .twitch-widget-open:focus-visible,
.twitch-widget.is-platform-youtube .twitch-widget-expand:hover,
.twitch-widget.is-platform-youtube .twitch-widget-expand:focus-visible,
.twitch-widget.is-platform-youtube .twitch-widget-hide:hover,
.twitch-widget.is-platform-youtube .twitch-widget-hide:focus-visible {
  border-color: rgba(255, 63, 58, 0.42);
}

.twitch-widget-player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070b;
}

.twitch-widget-player-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.twitch-widget-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(145, 70, 255, 0.32);
  border-radius: 999px;
  background:
    radial-gradient(circle at top right, rgba(145, 70, 255, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(17, 22, 31, 0.96), rgba(10, 14, 21, 0.96));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.3),
    0 10px 26px rgba(145, 70, 255, 0.16);
  color: #edf2ff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.twitch-widget-launcher[hidden] {
  display: none;
}

.twitch-widget-launcher:hover,
.twitch-widget-launcher:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(145, 70, 255, 0.48);
  color: #ffffff;
}

.twitch-widget.is-platform-youtube .twitch-widget-launcher {
  border-color: rgba(255, 63, 58, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 63, 58, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(17, 22, 31, 0.96), rgba(10, 14, 21, 0.96));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.3),
    0 10px 26px rgba(255, 63, 58, 0.14);
}

.twitch-widget.is-platform-youtube .twitch-widget-launcher:hover,
.twitch-widget.is-platform-youtube .twitch-widget-launcher:focus-visible {
  border-color: rgba(255, 63, 58, 0.48);
}

.top-guide-scrim {
  position: fixed;
  inset: 0;
  z-index: 1180;
  background: rgba(7, 11, 17, 0.38);
  pointer-events: none;
}

.top-guide {
  position: fixed;
  top: 120px;
  left: 22px;
  z-index: 1250;
  width: min(320px, calc(100vw - 44px));
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 91, 46, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(18, 24, 34, 0.97), rgba(10, 14, 21, 0.97));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    0 10px 30px rgba(255, 91, 46, 0.12);
  backdrop-filter: blur(16px);
}

.top-guide-progress {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 214, 199, 0.92);
}

.top-guide-title {
  margin: 10px 0 0;
  font-size: 1.15rem;
  line-height: 1.2;
  color: #f7fbff;
}

.top-guide-body {
  margin: 12px 0 0;
  color: rgba(226, 234, 245, 0.9);
  line-height: 1.6;
  font-size: 0.96rem;
}

.top-guide-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.top-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #edf2ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.top-guide-btn:hover,
.top-guide-btn:focus-visible {
  transform: translateY(-1px);
  color: #ffffff;
}

.top-guide-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.top-guide-btn-primary {
  background: linear-gradient(135deg, rgba(255, 91, 46, 0.92), rgba(255, 141, 87, 0.88));
  border-color: rgba(255, 141, 87, 0.5);
  color: #fff6f0;
}

.top-guide-btn-secondary:hover,
.top-guide-btn-secondary:focus-visible,
.top-guide-btn-ghost:hover,
.top-guide-btn-ghost:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.top-guide-launcher {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 1240;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 91, 46, 0.3);
  background:
    radial-gradient(circle at top left, rgba(255, 91, 46, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(18, 24, 34, 0.97), rgba(10, 14, 21, 0.97));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 8px 24px rgba(255, 91, 46, 0.14);
  color: #f7fbff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.top-guide-launcher:hover,
.top-guide-launcher:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 141, 87, 0.5);
}

.top-guide-highlight {
  position: relative;
  z-index: 1190;
  border-radius: 24px;
  box-shadow:
    0 0 0 3px rgba(255, 91, 46, 0.78),
    0 0 0 10px rgba(255, 91, 46, 0.12),
    0 24px 54px rgba(0, 0, 0, 0.28);
}

.top-guide-highlight.btn-last-races {
  border-radius: 999px;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.community-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(10, 14, 21, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 34px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.community-card:hover,
.community-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.24);
}

.community-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-card-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.community-card-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.community-card-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.community-card-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.community-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff6d4;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.community-card-cta::after {
  content: "↗";
  font-size: 0.95rem;
  line-height: 1;
}

.community-card-telegram {
  background:
    radial-gradient(circle at top right, rgba(39, 167, 231, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(15, 28, 38, 0.94), rgba(10, 14, 21, 0.92));
}

.community-card-telegram .community-card-icon-wrap {
  background: linear-gradient(135deg, #27a7e7, #168ac7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(39, 167, 231, 0.28);
}

.community-card-discord {
  background:
    radial-gradient(circle at top right, rgba(88, 101, 242, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(18, 21, 40, 0.94), rgba(10, 14, 21, 0.92));
}

.community-card-discord .community-card-icon-wrap {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(88, 101, 242, 0.3);
}

.community-card-youtube {
  background:
    radial-gradient(circle at top right, rgba(255, 42, 35, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(36, 18, 18, 0.94), rgba(10, 14, 21, 0.92));
}

.community-card-youtube .community-card-icon-wrap {
  background: linear-gradient(135deg, #ff2a23, #cc181e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(204, 24, 30, 0.3);
}

.community-card-twitch {
  background:
    radial-gradient(circle at top right, rgba(145, 70, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(27, 18, 44, 0.94), rgba(10, 14, 21, 0.92));
}

.community-card-twitch .community-card-icon-wrap {
  background: linear-gradient(135deg, #9146ff, #6f2cff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(145, 70, 255, 0.3);
}

.community-card-tiktok {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(10, 14, 21, 0.92));
}

.community-card-tiktok .community-card-icon-wrap {
  background: linear-gradient(135deg, #151515, #2b2b2b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

/* ===== UTILITY / STATE ===== */

.empty-box {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  text-align: center;
}

.loading {
  padding: 24px 0;
  color: var(--muted);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1420px) {
  html {
    scroll-padding-top: 132px;
  }

  .top-nav-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "menu menu";
    align-items: center;
    gap: 10px;
    padding: 10px 16px 12px;
  }

  .top-nav-socials {
    display: none;
  }

  .top-nav-brand {
    grid-area: brand;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-nav-actions {
    grid-area: actions;
    justify-content: flex-end;
  }

  .top-nav-center {
    grid-area: menu;
    display: block;
    width: 100%;
    min-width: 0;
  }

  .top-nav-menu {
    display: flex;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    padding: 2px 0 0;
  }

  .top-nav-center::after {
    display: none;
  }

  .top-nav-link-primary,
  .top-nav-link-secondary {
    flex: 0 0 auto;
    padding: 9px 15px;
    font-size: 0.8rem;
  }

  .nav-social {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    font-size: 0.84rem;
  }
}

@media (max-width: 1420px) and (min-width: 721px) {
  .top-nav-inner {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "brand socials menu actions";
    align-items: center;
    padding: 10px 16px;
  }

  .top-nav-brand {
    grid-area: brand;
  }

  .top-nav-socials {
    grid-area: socials;
    display: flex;
  }

  .top-nav-center {
    grid-area: menu;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: visible;
  }

  .top-nav-menu {
    width: auto;
    overflow: visible;
    justify-content: center;
    padding: 0;
  }

  .top-nav-center::after {
    display: none;
  }

  .top-nav-actions {
    grid-area: actions;
  }

  .top-nav-more-menu {
    z-index: 30;
  }
}

@media (max-width: 980px) {
  html {
    scroll-padding-top: 132px;
  }

  .hero-grid,
  .cards-top3 {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-main-column,
  .hero-hourly-promo,
  .hero-hourly-card,
  .hero-actions-row,
  .hero-side {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-side {
    max-width: none;
    margin-left: 0;
  }

  .hero-card {
    padding: 24px;
  }

  .section-title {
    font-size: 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-tools {
    width: 100%;
  }

  .filter-meta {
    align-items: stretch;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .top-nav-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand socials actions"
      "menu menu menu";
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px;
  }

  .top-nav-brand {
    grid-area: brand;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-nav-socials {
    grid-area: socials;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .top-nav-actions {
    grid-area: actions;
    justify-content: flex-end;
  }

  .top-nav-center {
    grid-area: menu;
    display: block;
    width: 100%;
    min-width: 0;
  }

  .top-nav-menu {
    display: flex;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 0;
  }

  .top-nav-center::after {
    display: none;
  }

  .top-nav-link-primary,
  .top-nav-link-secondary {
    flex: 0 0 auto;
    padding: 10px 15px;
    font-size: 0.8rem;
  }

  .nav-social {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    font-size: 0.84rem;
  }

  .hero {
    padding-top: 20px;
  }

  .hero-actions.hero-actions-stacked-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "today races"
      "driver driver"
      "online online"
      "stats stats";
    gap: 10px;
    align-items: stretch;
  }

  .hero-side {
    grid-column: 1 / -1;
  }

  .hero-side-compact {
    grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr);
  }

  .hero-actions-stacked-mobile .btn,
  .btn-today-stats,
  .btn-last-races,
  .btn-driver-day {
    width: 100%;
    min-width: 0;
    max-width: none;
    align-self: stretch;
    padding: 13px 14px;
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .hero-actions-row {
    grid-template-columns: 1fr;
  }

  .hero-hourly-card {
    margin-bottom: 6px;
  }

  .hero-hourly-winner-card {
    min-height: 82px;
  }

  .hero-online-card {
    min-height: 108px;
    max-height: none;
  }

  .cards-top3.cards-top3-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-card-page {
    grid-template-columns: 1fr;
  }

  .driver-stats-grid,
  .driver-highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-penalties-grid {
    grid-template-columns: 1fr;
  }

  .today-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-stats-details {
    grid-template-columns: 1fr;
  }

  .activity-controls,
  .activity-summary-grid {
    grid-template-columns: 1fr;
  }

  .driver-day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .race-modal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-day-card-wide {
    grid-column: span 2;
  }

  .modal-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .modal-card,
  .modal-card.modal-card-driver {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    margin: 0;
    padding: 20px 14px 14px;
    border-radius: 18px;
  }

  .modal-header {
    margin-bottom: 16px;
    padding-right: 44px;
  }

  .hourly-modal-subtitle-grid,
  .hourly-modal-grid {
    grid-template-columns: 1fr;
  }

  .hourly-modal-panel-grid-three {
    grid-template-columns: 1fr;
  }

  .hourly-modal-panel-item {
    min-height: 0;
  }

  .hourly-modal-details-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hourly-modal-cta-btn {
    width: 100%;
  }

  .modal-header-driver-preview {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-driver-preview-link {
    width: 100%;
    justify-content: center;
  }

  .today-stat-card,
  .today-detail-card,
  .driver-day-card {
    min-width: 0;
    padding: 14px;
  }

  .today-stat-value,
  .today-detail-main {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .today-detail-sub,
  .today-stat-label,
  .modal-subtitle {
    overflow-wrap: anywhere;
  }

  .activity-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-panel-note {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .hero-stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 140px;
  }

  .container {
    width: min(100% - 20px, 1200px);
  }

  .hero {
    padding-top: 18px;
  }

  .hero-card {
    padding: 18px;
    border-radius: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .pilot-name {
    font-size: 20px;
  }

  .mini-value {
    font-size: 24px;
  }

  .pagination-wrap {
    align-items: stretch;
  }

  .pagination {
    width: 100%;
  }

  .page-btn {
    flex: 1 1 auto;
  }

  .lang-switch-floating {
    top: 14px;
    right: 14px;
  }

  .lang-btn {
    min-width: 45px;
    min-height: 34px;
    padding: 0 7px;
  }

  .lang-flag {
    width: 24px;
    height: 17px;
  }

  .top-nav-inner {
    padding-left: 10px;
    padding-right: 10px;
  }

  .top-nav-brand {
    gap: 0;
  }

  .top-nav-brand-text {
    display: none;
  }

  .top-nav-brand-logo {
    width: 38px;
    height: 38px;
  }

  .top-nav-link-primary,
  .top-nav-link-secondary {
    padding: 9px 13px;
    font-size: 0.8rem;
  }

  .nav-social {
    min-width: 36px;
    min-height: 36px;
    padding: 7px;
    font-size: 0.72rem;
  }

  .social-icon {
    width: 16px;
    height: 16px;
  }

  .hero-actions.hero-actions-stacked-mobile {
    grid-template-columns: 1fr;
    grid-template-areas:
      "today"
      "races"
      "driver"
      "online"
      "stats";
  }

  .hero-side-compact,
  .cards-top3.cards-top3-hero {
    grid-template-columns: 1fr;
  }

  .hero-actions-stacked-mobile .btn,
  .btn-driver-day,
  .btn-today-stats,
  .btn-last-races {
    width: 100%;
    min-width: 0;
  }

  .hero-side .mini-value {
    font-size: 16px;
  }

  .cards-top3-hero .pilot-name {
    font-size: 14px;
  }

  .hero-hourly-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .hero-hourly-meta-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero-hourly-winner-card {
    min-height: 96px;
  }

  .hero-hourly-winner-media {
    min-height: 0;
  }

  .hero-hourly-winner-card::before {
    width: 150px;
    height: 150px;
    opacity: 0.18;
  }

  .hero-hourly-winner-car {
    width: min(160px, 62%);
  }

  .btn-today-stats,
  .btn-last-races,
  .btn-driver-day {
    font-size: 0.92rem;
  }

  .hero-primary-actions {
    grid-template-columns: 1fr;
  }

  .hero-stats-row {
    grid-template-columns: 1fr;
  }

  .mini-stat-compact {
    padding: 12px 14px;
  }

  .page-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .page-hero-stats .mini-stat {
    min-height: 0;
  }

  .page-hero-stats .mini-value,
  .page-hero-stats .mini-note,
  .page-hero-stats .driver-link {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .page-hero-stats .mini-value {
    font-size: clamp(0.8rem, 4.1vw, 1.7rem);
    line-height: 1.05;
  }

  .page-hero-stats .mini-note {
    line-height: 1.25;
  }

  .page-hero-copy .hero-subtitle.page-hero-subtitle {
    font-size: 16px;
  }

  .modal-overlay {
    padding: 8px;
  }

  .modal-overlay.is-open {
    padding-top: var(--top-nav-modal-offset, 84px);
  }

  .modal-card,
  .modal-card.modal-card-driver {
    max-height: calc(100dvh - 16px);
    padding: 18px 12px 12px;
  }

  .modal-card.modal-card-slot {
    overflow: auto;
    max-height: calc(100dvh - 16px);
  }

  .modal-card-driver-preview {
    height: calc(100dvh - var(--top-nav-modal-offset, 84px) - 8px);
    padding-bottom: 12px;
  }

  .driver-preview-scroll {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .hourly-modal-panel,
  .hourly-modal-weather,
  .hourly-modal-subtitle-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hourly-modal-left-cluster,
  .hourly-modal-side-card,
  .hourly-modal-side-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .driver-name-meta {
    gap: 6px;
  }

  .today-stats-grid,
  .driver-day-grid {
    grid-template-columns: 1fr;
  }

  .hero-funnel-actions {
    flex-direction: column;
  }

  .hero-cta-primary,
  .hero-cta-secondary {
    width: 100%;
  }

  .driver-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-highlights-grid {
    grid-template-columns: 1fr;
  }

  .modal-card-driver-preview .driver-preview-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-meta-left,
  .filter-chip-row {
    width: 100%;
  }

  .race-modal-summary {
    grid-template-columns: 1fr;
  }

  .driver-day-card-wide {
    grid-column: span 1;
  }

  .today-stat-value {
    font-size: 1.2rem;
  }

  .today-stat-value-sm,
  .today-detail-main,
  .today-detail-sub {
    font-size: 0.95rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .twitch-widget {
    right: 16px;
    bottom: 16px;
    width: min(320px, calc(100vw - 32px));
  }

  .twitch-widget.is-expanded {
    width: min(50vw, calc(100vw - 32px));
  }

  .community-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    width: 100%;
  }

  .footer-links a {
    flex: 1 1 auto;
  }

  .hero-online-chart {
    gap: 6px;
    height: 90px;
  }

  .hero-online-scale {
    height: 90px;
  }

  .hero-online-bar {
    max-width: 22px;
  }

  .hero-online-range {
    font-size: 11px;
  }
}

/* ===== FUN STATS PAGE ===== */

.fun-hero-card {
  overflow: hidden;
}

.fun-period-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.fun-period-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fun-period-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fun-period-btn:hover {
  color: var(--text);
}

.fun-period-btn.active {
  background: linear-gradient(135deg, rgba(255, 91, 46, 0.92), rgba(255, 209, 102, 0.92));
  color: #11161d;
  box-shadow: 0 12px 30px rgba(255, 91, 46, 0.22);
}

.fun-period-range {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.fun-summary-grid,
.fun-awards-grid,
.fun-lists-grid {
  display: grid;
  gap: 18px;
}

.fun-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.fun-awards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fun-lists-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fun-summary-card,
.fun-award-card,
.fun-list-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(15, 21, 31, 0.92), rgba(11, 15, 20, 0.9));
  box-shadow: var(--shadow);
}

.fun-summary-card {
  padding: 22px;
}

.fun-summary-label,
.fun-award-label,
.fun-list-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fun-summary-value {
  margin-top: 10px;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  font-weight: 900;
}

.fun-summary-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.fun-summary-card-driver-note .fun-summary-value {
  font-size: clamp(1.25rem, 1.6vw, 1.7rem);
  line-height: 1.1;
}

.fun-summary-card-driver-note .fun-summary-note {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fun-award-card {
  padding: 24px;
  position: relative;
}

.fun-award-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.14);
}

.fun-award-card-accent::before {
  background: linear-gradient(90deg, #ff5b2e, #ffd166);
}

.fun-award-card-warm::before {
  background: linear-gradient(90deg, #ffd166, #ff8a3d);
}

.fun-award-card-gold::before {
  background: linear-gradient(90deg, #ffe28a, #f5c451);
}

.fun-award-card-cool::before {
  background: linear-gradient(90deg, #67d1ff, #5d9cff);
}

.fun-award-card-clean::before {
  background: linear-gradient(90deg, #39d98a, #9cf7cb);
}

.fun-award-card-danger::before {
  background: linear-gradient(90deg, #ef4444, #ff8c7a);
}

.fun-award-card-neutral::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08));
}

.fun-award-title {
  margin-top: 14px;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.25;
}

.fun-award-title .driver-link-heading {
  font-size: inherit;
}

.fun-award-note {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.fun-list-card {
  padding: 22px;
}

.fun-lists-grid .fun-list-card:nth-child(1) {
  background:
    radial-gradient(circle at top right, rgba(255, 120, 72, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(26, 18, 18, 0.96), rgba(14, 14, 18, 0.92));
}

.fun-lists-grid .fun-list-card:nth-child(2) {
  background:
    radial-gradient(circle at top right, rgba(98, 170, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(16, 21, 31, 0.96), rgba(11, 15, 20, 0.92));
}

.fun-lists-grid .fun-list-card:nth-child(3) {
  background:
    radial-gradient(circle at top right, rgba(76, 217, 136, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(16, 27, 23, 0.96), rgba(11, 15, 20, 0.92));
}

.fun-lists-grid .fun-list-card:nth-child(4) {
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(30, 24, 14, 0.96), rgba(14, 14, 18, 0.92));
}

.fun-lists-grid .fun-list-card:nth-child(5) {
  background:
    radial-gradient(circle at top right, rgba(205, 146, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(26, 18, 33, 0.96), rgba(12, 14, 20, 0.92));
}

.fun-lists-grid .fun-list-card:nth-child(6) {
  background:
    radial-gradient(circle at top right, rgba(142, 220, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(15, 24, 30, 0.96), rgba(11, 15, 20, 0.92));
}

.fun-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.fun-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.fun-list-item-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.fun-list-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(255, 91, 46, 0.14);
  color: #ffd8c7;
}

.fun-list-main {
  min-width: 0;
  font-weight: 700;
}

.fun-list-side {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

@media (max-width: 1080px) {
  .fun-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fun-lists-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .twitch-widget,
  .twitch-widget.is-expanded {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .twitch-widget-header {
    gap: 8px;
  }

  .twitch-widget-actions {
    flex-wrap: wrap;
  }

  .fun-period-toolbar {
    align-items: stretch;
  }

  .fun-period-switch {
    width: 100%;
  }

  .fun-period-btn {
    flex: 1 1 0;
  }

  .fun-summary-grid,
  .fun-awards-grid,
  .fun-lists-grid {
    grid-template-columns: 1fr;
  }

  .fun-list-item {
    grid-template-columns: auto 1fr;
  }

  .fun-list-side {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 1279px) {
  .server-sticky-widget,
  .top-guide,
  .top-guide-launcher,
  .top-guide-scrim {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .site-video-bg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-video-bg {
    display: none;
  }

  .reveal-ready,
  .reveal-ready.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pulse-attention {
    animation: none;
  }

  .top-nav,
  .lang-switch,
  .modal-overlay {
    backdrop-filter: none;
  }

  .btn,
  .top-nav-link-primary,
  .top-nav-link-secondary,
  .page-btn,
  .modal-close,
  .twitch-widget,
  .twitch-widget-open,
  .twitch-widget-expand,
  .twitch-widget-hide,
  .twitch-widget-launcher {
    transition: none;
  }
}

