/* ============================================================
   APEX — дизайн-система F1 Dashboard (референс: Desktop/index.html)
   Тёмная фиолетово-сиреневая «приборная» тема. Один акцент --violet.
   Шрифты: Manrope (текст) + Space Grotesk (цифры/метки).
   Загружается ПОСЛЕ style.css: переопределяет токены и компоненты.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #13111c;
  --sidebar: #15121f;
  --panel: #1a1826;
  --panel2: #221f31;
  --line: #2d2a3d;
  --muted: #8e88a3;
  --violet: #b18cff;
  --violet-soft: #b18cff10;
  --red: #ff665b;
  --mono: 'Space Grotesk', 'Segoe UI', sans-serif;
  --radius: 14px;

  /* Ретинт старых переменных (остальные страницы перекрашиваются сразу) */
  --bg-primary: #13111c;
  --bg-secondary: #1a1826;
  --bg-card: #1a1826;
  --bg-card-hover: #221f31;
  --text-primary: #f2effa;
  --text-secondary: #8e88a3;
  --accent: #b18cff;
  --accent-hover: #c9abff;
  --border: #2d2a3d;
  --shadow: rgba(0, 0, 0, 0.45);
  --table-stripe: rgba(177, 140, 255, 0.03);
  --input-bg: #171523;
  --skeleton: linear-gradient(90deg, #1a1826 25%, #252236 50%, #1a1826 75%);
  --nav-bg: #15121f;
  --chart-grid: rgba(177, 140, 255, 0.06);
  --chart-tick: #9891ad;
  --chart-label: #a29cb6;
  --chart-strong: #ded9ea;
  --tip-bg: #1e1a2b;
  --tip-border: #4a4260;
  --tip-text: #aca4c2;
  --tip-title: #f2effa;
  --tip-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glow-a: rgba(177, 140, 255, 0.05);
  --glow-b: rgba(177, 140, 255, 0.03);
  --glow-c: rgba(177, 140, 255, 0.02);
}

/* ---------- База ---------- */
body {
  font: 12px 'Manrope', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.violet { color: var(--violet); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 3px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.icon {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* ---------- Оболочка: сайдбар ---------- */
.apex-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 212px;
  background: var(--sidebar); border-right: 1px solid var(--line);
  padding: 30px 19px 20px; display: flex; flex-direction: column;
  z-index: 20; overflow-y: auto;
}

.apex-logo {
  display: flex; align-items: center; gap: 8px; padding: 0 13px;
  font: italic 700 28px var(--mono); letter-spacing: -2px;
  color: var(--text-primary); text-decoration: none;
}
.apex-logo-mark {
  width: 30px; height: 25px; position: relative; display: block;
  background: var(--violet); flex-shrink: 0;
  clip-path: polygon(46% 0, 77% 0, 100% 100%, 68% 100%, 57% 45%, 32% 100%, 0 100%);
}
.apex-logo-mark:after {
  content: ''; position: absolute; width: 27px; height: 4px;
  background: var(--sidebar); bottom: 5px; transform: rotate(-22deg);
}
.apex-logo em { font-style: normal; color: var(--violet); font-size: 13px; margin-left: 2px; align-self: flex-start; margin-top: 6px; }

.sidebar-caption { font: 10px var(--mono); color: #7a7488; letter-spacing: 1.8px; margin: 34px 13px 15px; }

.apex-nav { display: grid; gap: 5px; }
.apex-nav a {
  padding: 11px 14px; display: flex; align-items: center; gap: 12px;
  color: #a49fb2; border-radius: 7px; font-size: 12px; font-weight: 600;
  transition: background .2s, color .2s;
}
.apex-nav a .icon { width: 18px; height: 18px; }
.apex-nav a:hover { background: #262335; color: #fff; }
.apex-nav a.active { color: var(--violet); background: var(--violet-soft); }
.apex-nav a.active:after {
  content: ''; height: 5px; width: 5px; background: var(--violet);
  border-radius: 50%; margin-left: auto;
}

.side-line { height: 1px; background: var(--line); margin: 18px 13px; }

.sidebar-bottom { margin-top: auto; padding-top: 14px; }
.season { display: flex; align-items: center; gap: 11px; padding: 5px 8px; }
.season-icon { border: 1px solid #453d5c; background: #292539; color: var(--violet); width: 33px; height: 33px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.season strong { font-size: 11px; display: block; }
.season small { font-size: 9px; color: var(--muted); display: block; margin-top: 3px; }
.season > span:last-child { margin-left: auto; font: 11px var(--mono); color: var(--muted); }

/* ---------- Main + топбар ---------- */
main { margin-left: 212px; padding: 0 34px 24px; max-width: 1900px; }
/* #app — контейнер страниц (внутри main), не должен наследовать паддинги main */
#app { margin-left: 0; padding: 0; max-width: none; }

.topbar {
  height: 82px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -34px; padding: 0 34px;
}
.breadcrumb { display: flex; align-items: center; gap: 11px; color: #7b7589; font-size: 10px; }
.breadcrumb .icon { width: 14px; height: 14px; }
.breadcrumb strong { color: #cec9db; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-badge { font: 9px var(--mono); letter-spacing: 1px; color: #b3adc2; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.topbar-badge .dot { color: var(--violet); box-shadow: 0 0 8px #b18cff50; }
.top-separator { width: 1px; height: 20px; background: var(--line); }

.icon-button { background: transparent; padding: 5px; display: grid; place-items: center; color: #a49fb1; border-radius: 5px; }
.icon-button:hover { color: var(--violet); background: var(--panel2); }

.avatar { height: 30px; width: 30px; border-radius: 50%; background: #3b3550; display: grid; place-items: center; color: #ddd7f0; font: 600 10px var(--mono); border: 3px solid #282338; box-shadow: 0 0 0 1px #463f5d; }

/* Поиск в топбаре */
.topbar-search {
  border: 1px solid var(--line); border-radius: 6px; background: #171523;
  padding: 7px 10px 7px 28px; font-size: 10px; color: var(--text-primary);
  width: 210px; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='none' stroke='%237d7793' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5'/%3E%3Cpath d='m15 15 6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center;
}
.topbar-search::placeholder { color: #837d97; }
.topbar-search:focus { border-color: #5c5279; }

/* Кнопка языка в стиле APEX */
#lang-toggle { background: transparent; color: #a49fb1; border: 0; font: 600 10px var(--mono); letter-spacing: 1px; padding: 5px 8px; border-radius: 5px; }
#lang-toggle:hover { color: var(--violet); background: var(--panel2); }

/* ---------- Заголовок секции ---------- */
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 29px 0 24px; gap: 14px; }
.eyebrow { font: 9px var(--mono); letter-spacing: 2px; color: #9891ad; text-transform: uppercase; }
.section-heading h1 { margin: 7px 0 0; font-size: 27px; font-weight: 700; letter-spacing: -1px; line-height: 1.3; color: var(--text-primary); }
.section-heading h1 .violet { color: var(--violet); }
.section-heading p { margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.date-pill { display: flex; align-items: center; gap: 9px; background: #1e1a2b; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; font-size: 10px; color: #c9c4d8; white-space: nowrap; }
.date-pill .icon { width: 14px; height: 14px; }

/* ---------- Hero (следующий ГП) ---------- */
.apex-hero {
  position: relative; min-height: 278px; border: 1px solid #4f4768;
  border-radius: var(--radius); overflow: hidden; background: #2a2539; isolation: isolate;
  display: flex; align-items: flex-end;
}
.apex-hero:before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(720px 320px at 85% 0%, rgba(177, 140, 255, 0.07), transparent 70%),
    linear-gradient(90deg, #1b1728 0%, #1b1728ed 25%, #1b172899 48%, #1b172810 78%),
    linear-gradient(0deg, #1a1626a6, transparent 70%);
}
.apex-hero:after {
  content: ''; position: absolute; z-index: 0; inset: 0;
  background: repeating-linear-gradient(125deg, transparent 0 110px, #c9abff04 111px 112px);
  pointer-events: none;
}
.hero-photo { position: absolute; right: 260px; top: 50%; transform: translateY(-50%) rotate(-8deg); z-index: 0; opacity: .16; filter: saturate(.4) brightness(.85); max-height: 130%; max-width: 34%; }
.hero-content { padding: 26px 30px; width: 65%; position: relative; z-index: 1; }

.race-badge { font: 9px var(--mono); letter-spacing: 1.2px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.race-badge .live-chip { color: var(--violet); display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b18cff40; background: #b18cff0d; padding: 4px 7px; border-radius: 4px; }
.race-badge .round-label { color: #c5bfd6; }

.apex-hero h2 {
  font: italic 700 clamp(46px, 5.2vw, 76px) / .95 var(--mono); letter-spacing: -4px;
  margin: 19px 0 4px; color: var(--text-primary);
}
.hero-subtitle { font: 500 14px var(--mono); letter-spacing: 5.7px; color: #e9e6f3; text-transform: uppercase; margin-left: 3px; }
.hero-location { display: flex; align-items: center; gap: 6px; color: #a29db4; font-size: 10px; margin-top: 15px; }
.hero-location .icon { width: 13px; height: 13px; }
.hero-bottom { display: flex; align-items: center; gap: 21px; margin-top: 22px; flex-wrap: wrap; }

.primary-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 15px; background: var(--violet); color: #1c142e;
  font-size: 11px; font-weight: 800; border-radius: 6px;
  transition: background .2s, transform .2s; text-decoration: none; border: 0; cursor: pointer;
}
.primary-link:hover { background: #c9abff; transform: translateY(-1px); color: #1c142e; }
.primary-link .icon { width: 14px; height: 14px; stroke-width: 2.2; }

.countdown-block { border-left: 1px solid #ffffff24; padding-left: 21px; display: flex; align-items: center; gap: 11px; }
.countdown-block > span { font-size: 9px; color: #aba5c0; line-height: 1.7; }
.countdown-block strong { font: 500 21px var(--mono); color: var(--text-primary); }
.countdown-block strong small { color: #8b85a0; font-size: 13px; }
.countdown-block .cd-num { font: 600 17px var(--mono); color: var(--text-primary); }
.countdown-block .cd-unit { font-size: 8px; color: #9891ad; font-weight: 700; margin: 0 5px 0 2px; }

.hero-top-right { position: absolute; right: 23px; top: 22px; display: flex; align-items: center; gap: 7px; font: 10px var(--mono); letter-spacing: 1px; color: #c5bfd6; z-index: 1; }
.hero-top-right img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }

/* Карточка трассы в hero */
.hero-circuit {
  position: absolute; right: 21px; bottom: 20px; width: 235px;
  border: 1px solid #ccc7dc30; background: #161223b8; backdrop-filter: blur(12px);
  border-radius: 9px; padding: 12px 16px; z-index: 1;
}
.circuit-head { display: flex; justify-content: space-between; font: 8px var(--mono); letter-spacing: 1.2px; color: #c0bcd2; margin-bottom: 6px; }
.circuit-head span:last-child { color: var(--violet); }
.hero-circuit img { display: block; width: 100%; height: 90px; object-fit: contain; object-position: center; filter: invert(86%) sepia(23%) saturate(900%) hue-rotate(210deg); }
.circuit-bottom { display: flex; justify-content: space-between; color: #948fa8; font-size: 8px; margin-top: 4px; }
.circuit-bottom b { font: 500 10px var(--mono); color: #e6e2f2; margin-right: 4px; }

.hero-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #b18cff20; z-index: 2; }
.hero-progress i { display: block; background: var(--violet); width: 0; height: 100%; transition: width 1s; }

/* ---------- Стат-карточки ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 25px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 17px 18px; position: relative; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #a29cb6; font-size: 10px; }
.stat-top .icon { width: 15px; height: 15px; color: #7d7793; }
.stat-value { font: 500 29px var(--mono); letter-spacing: -1px; margin: 11px 0 9px; line-height: 1.1; color: var(--text-primary); }
.stat-value small { font-size: 12px; letter-spacing: 0; color: #958fa9; margin-left: 4px; }
.stat-note { font-size: 9px; color: #908aa6; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.stat-note .team-dot { height: 6px; width: 6px; border-radius: 2px; background: #ff9c43; flex-shrink: 0; }
.stat-note a { color: inherit; text-decoration: none; }
.stat-note a:hover { color: var(--violet); }
.stat--magenta .stat-value, .stat--magenta .stat-top .icon { color: #f0a6d8; }
.stat--red .stat-value { color: var(--red); }
.stat--red .stat-top .icon { color: #a05a53; }

/* ---------- Контентная сетка ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1.53fr) minmax(310px, 1fr); gap: 20px; align-items: start; }
.right-column { display: grid; gap: 20px; }

/* ---------- Карточки (APEX-стиль, перекрывает .card) ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden; scroll-margin-top: 20px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none; padding: 0; margin-bottom: 0;
}
.card:hover { border-color: var(--line); box-shadow: none; }
.card-header, .card-heading { padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 0; margin-bottom: 0; }
.card h3, .card-heading h3, .card-title { font-size: 13px; font-weight: 700; margin: 0; letter-spacing: -.2px; color: var(--text-primary); }
.card-subtitle { margin-top: 6px; font-size: 9px; color: var(--muted); }
.heading-title { display: flex; align-items: center; gap: 8px; }
.heading-title > .icon { width: 15px; height: 15px; color: #948fa8; }

.small-tag {
  display: inline-flex; align-items: center; gap: 5px; color: #b0abc2;
  font: 8px var(--mono); letter-spacing: .7px; background: #292539;
  border: 1px solid #443d5b; padding: 5px 7px; border-radius: 4px; white-space: nowrap;
}
.small-tag.is-live { color: var(--violet); border-color: #b18cff40; }

.text-button { background: transparent; color: #9d97b5; padding: 3px; display: flex; align-items: center; gap: 5px; font-size: 9px; border: 0; cursor: pointer; }
.text-button:hover { color: var(--violet); }
.text-button .icon { width: 12px; height: 12px; }

/* ---------- Таблицы APEX ---------- */
.apex-table-scroll { overflow-x: auto; }
.card .apex-table-scroll table, .card table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; background: transparent; }
.card th {
  padding: 11px 12px; background: #171523; color: #837d97;
  font: 8px var(--mono); text-transform: uppercase; letter-spacing: 1px;
  border-top: 1px solid #2a2639; border-bottom: 1px solid #2a2639;
  font-weight: 400; height: auto;
}
.card th:first-child, .card td:first-child { padding-left: 20px; }
.card th:last-child, .card td:last-child { padding-right: 20px; }
.card td { padding: 12px; border-bottom: 1px solid #2b2739; font-size: 10px; height: 57px; color: var(--text-primary); }
.card tbody tr:last-child td { border-bottom: 0; }
.card tbody tr { transition: background .2s; background: transparent; }
.card tbody tr:hover { background: #b18cff05; }

td.apex-position { font: 500 13px var(--mono); color: #a3a0b4; width: 42px; padding-left: 20px; }
td.apex-position.first { color: var(--violet); }

/* Столбец позиции в обычных таблицах: единая ширина, центр, табличные цифры.
   Паддинги симметричны (не наследуют 20px-отступ первого столбца), чтобы
   заголовок и цифры не съезжали относительно друг друга. */
.card th.position, .card td.position {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  width: 64px;
  min-width: 64px;
  padding-left: 12px;
  padding-right: 12px;
}
.apex-driver { display: flex; align-items: center; gap: 9px; background: transparent; padding: 0; text-align: left; width: 100%; border: 0; color: inherit; cursor: pointer; text-decoration: none; }
.team-line { width: 3px; height: 24px; border-radius: 2px; background: var(--team, #666); flex-shrink: 0; }
.apex-driver-name { font-size: 10px; font-weight: 700; color: #ded9ea; }
.apex-driver-number { font: 9px var(--mono); color: #7d7793; margin-left: 5px; }
.apex-team-name { font-size: 8px; color: #8b85a0; margin-top: 4px; display: block; }
td.apex-points { font-family: var(--mono); font-size: 11px; color: #c6c1d7; }
td.apex-evo { font: 10px var(--mono); text-align: right; }

.table-footer {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; border-top: 1px solid var(--line); font-size: 8px; color: #8a84a1;
}
.table-footer span:last-child { display: flex; align-items: center; gap: 5px; }

/* ---------- Календарь (строки гонок) ---------- */
.calendar-list { padding: 0 20px 4px; }
.race-row {
  display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line);
  padding: 14px 0; width: 100%; background: transparent; text-align: left;
  border: 0; border-top: 1px solid var(--line); cursor: pointer; color: inherit;
  text-decoration: none; font: inherit;
}
.race-row:first-child { border-top: 0; }
.race-row:hover .race-name { color: var(--violet); }
/* Диапазон дат («24–26») шире одной даты: эластичный блок и компактный моно-шрифт. */
.race-date { width: auto; min-width: 44px; flex-shrink: 0; border-radius: 6px; padding: 7px 4px; text-align: center; background: #2a2539; border: 1px solid #3d3752; }
.race-date strong { display: block; font: 500 14px/1 var(--mono); color: var(--text-primary); white-space: nowrap; }
.race-date span { font: 7px var(--mono); color: #9d98b3; display: block; margin-top: 4px; white-space: nowrap; }
.race-name { font-size: 10px; font-weight: 700; color: var(--text-primary); transition: color .2s; }
.race-name img { width: 18px; height: 12px; border-radius: 2px; object-fit: cover; margin-right: 5px; vertical-align: -2px; }
.race-track { font-size: 8px; color: #8b85a0; margin-top: 5px; display: block; }
.round { font: 8px var(--mono); color: #77708e; margin-left: auto; white-space: nowrap; }
.calendar-note { margin: 5px 20px 15px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; gap: 6px; align-items: center; font-size: 8px; color: #8a84a1; }
.calendar-note .icon { height: 11px; width: 11px; }

/* ---------- Заглушка телеметрии (данные подбираем) ---------- */
.telemetry-placeholder { margin: 0 20px 20px; border: 1px dashed #4a4260; border-radius: 9px; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.telemetry-placeholder .icon { width: 30px; height: 30px; color: #6a6386; }
.telemetry-placeholder h4 { margin: 0; font-size: 12px; color: #c0bbd3; }
.telemetry-placeholder p { margin: 0; font-size: 9px; color: #8a84a1; max-width: 260px; line-height: 1.7; }
.telemetry-placeholder .signal { display: flex; align-items: end; gap: 3px; height: 17px; color: #5c5279; }
.telemetry-placeholder .signal i { width: 3px; background: currentColor; border-radius: 1px; }
.telemetry-placeholder .signal i:nth-child(1) { height: 5px; }
.telemetry-placeholder .signal i:nth-child(2) { height: 9px; }
.telemetry-placeholder .signal i:nth-child(3) { height: 13px; }
.telemetry-placeholder .signal i:nth-child(4) { height: 17px; }

/* ---------- Футер ---------- */
.apex-footer { display: flex; justify-content: space-between; gap: 15px; color: #736d8a; font-size: 8px; margin-top: 24px; line-height: 1.8; }
.apex-footer span:last-child { display: flex; align-items: center; gap: 6px; }

/* ---------- Скрытие старых элементов оболочки ---------- */
.header, .menu-toggle { display: none !important; }

/* ---------- Hover-карточки пилотов и команд ---------- */
.f1-hovercard {
  position: fixed; z-index: 12000; pointer-events: auto;
  filter: drop-shadow(0 18px 50px rgba(0,0,0,0.65));
  animation: hcIn 0.16s ease;
}
@keyframes hcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hc { display: flex; border-radius: 12px; overflow: hidden; }

/* Карточка пилота: компактная, тёмная база + умеренный градиент
   команды (цветной текст читается на тёмном). */
.hc-driver {
  width: 300px; height: 176px;
  background: linear-gradient(135deg, rgba(var(--hc-team-rgb), 0.38), #0c1226 55%);
  --hc-team-rgb: 76, 81, 96;
  border: 1px solid rgba(var(--hc-team-rgb), 0.5);
}
.hc-driver .hc-body { flex: 1; padding: 16px 14px 12px 18px; min-width: 0; display: flex; flex-direction: column; }
.hc-driver .hc-top { display: flex; align-items: baseline; gap: 10px; }
.hc-driver .hc-number {
  font: 700 30px/1 var(--mono); color: #fff;
  text-shadow: 0 0 18px rgba(var(--hc-team-rgb), 0.9);
}
.hc-driver .hc-name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }
.hc-driver .hc-team { display: none; } /* легаси-класс перекрывается карточкой команды */
.hc-driver .hc-dteam { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--hc-team); margin-top: 5px; }
.hc-driver .hc-photo {
  width: 118px; flex-shrink: 0; position: relative; overflow: hidden;
}
.hc-driver .hc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hc-driver .hc-stats { margin-top: auto; display: flex; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; gap: 18px; }
.hc-driver .hc-stat b { display: block; font: 700 16px/1.1 var(--mono); color: #fff; }
.hc-driver .hc-stat span { font-size: 8.5px; color: #8f89a6; text-transform: uppercase; letter-spacing: 1px; }

/* Карточка команды — как на app.formula1dashboard.com/teams:
   широкая 16:9, нежный градиент цвета команды, имя + шасси, кружки
   пилотов справа, болид с эллипсом-тенью снизу, водяной знак-лого
   на фоне, при hover машина "подъезжает" выше. */
.hc-team {
  flex-direction: column; width: 348px; aspect-ratio: auto; height: 240px;
  background-color: #0c1226;
  background-image: linear-gradient(180deg, rgba(var(--hc-team-rgb), 0.4), rgba(var(--hc-team-rgb), 0.12));
  --hc-team-rgb: 76, 81, 96;
  border: 1px solid rgba(var(--hc-team-rgb), 0.5);
}
.hc-team-head { display: flex; flex-direction: row; justify-content: space-between; padding: 14px 16px 0; z-index: 3; }
.hc-team-name { font-size: 18px; font-weight: 800; color: var(--hc-team); letter-spacing: 0.3px; white-space: nowrap; }
.hc-team-chassis { font-size: 10px; color: #8a84a1; }
.hc-team-drivers { display: flex; gap: 6px; }
.hc-team-drivers img {
  height: 42px; width: 42px; border-radius: 50%; object-fit: cover; object-position: top center;
  border: 2px solid rgb(var(--hc-team-rgb)); background: rgba(10, 12, 20, 0.9);
}
.hc-team-car-wrap { position: absolute; bottom: 58px; left: 18px; right: 18px; z-index: 2; }
.hc-team-car-wrap::before {
  content: ''; position: absolute; left: -6%; right: -6%; top: 8%; bottom: -14px;
  background: radial-gradient(ellipse 62% 55% at 50% 62%, rgba(4,5,9,0.97) 0%, rgba(4,5,9,0.78) 55%, rgba(4,5,9,0) 100%);
  filter: blur(10px);
  animation: hcDim 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hcDim { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
.hc-team-car {
  width: 100%; height: 96px; object-fit: contain; object-position: center bottom; display: block;
  position: relative; z-index: 2; transform: translateY(0); transition: transform 0.3s ease;
}
/* Синхронное движение: hover в зоне болида ИЛИ лого двигает оба сразу. */
.f1-hovercard .hc-team:has(.hc-team-car-wrap:hover, .hc-team-logo-zone:hover) .hc-team-car { transform: translateY(-6px); }
.f1-hovercard .hc-team:has(.hc-team-car-wrap:hover, .hc-team-logo-zone:hover) .hc-team-watermark { background-position: center 42%; }
.hc-team-shadow {
  position: absolute; bottom: -12px; left: 5%; right: 5%; height: 26px; z-index: 1; opacity: 0.5;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, transparent 70%);
}
.hc-team-watermark {
  position: absolute; inset: 0; z-index: 0; background-repeat: no-repeat;
  background-position: center 30%; background-size: 55%;
  -webkit-mask-image: linear-gradient(to top, transparent 10%, black 78%);
  mask-image: linear-gradient(to top, transparent 10%, black 78%);
  opacity: 0.9; transition: background-position 0.3s ease;
  filter: drop-shadow(0 0 22px rgba(var(--hc-team-rgb), 0.5));
  pointer-events: none;
}
/* Зона лого для hover: совпадает с видимым положением водяного знака. */
.hc-team-logo-zone {
  position: absolute; left: 22.5%; right: 22.5%; top: 32%; bottom: 30%;
  z-index: 1; pointer-events: auto; background: transparent;
}
.hc-team .hc-stats {
  display: flex; gap: 0; margin-top: auto; background: rgba(10, 12, 20, 0.88);
  border-top: 1px solid rgba(255,255,255,0.1); position: relative; z-index: 3;
}
.hc-team .hc-stat { flex: 1; padding: 10px 8px 8px; text-align: center; }
.hc-team .hc-stat + .hc-stat { border-left: 1px solid rgba(255,255,255,0.08); }
.hc-team .hc-stat b, .hc-team .hc-stat .hc-span { display: block; font: 700 14px/1.2 var(--mono); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-team .hc-stat span { font-size: 8.5px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Адаптив ---------- */
@media (min-width: 1550px) {
  main#app { padding-inline: 45px; }
  .topbar { margin: 0 -45px; padding: 0 45px; }
  .apex-hero { min-height: 320px; }
  .hero-content { padding: 33px 36px; }
  .apex-hero h2 { font-size: 86px; }
  .hero-circuit { width: 285px; padding: 16px 22px; }
  .hero-circuit img { height: 115px; }
  .stats-grid { gap: 20px; }
  .content-grid { gap: 24px; }
  .card td { height: 61px; }
}

@media (max-width: 1150px) {
  .apex-sidebar { width: 180px; padding-inline: 12px; }
  main#app { margin-left: 180px; padding-inline: 24px; }
  .topbar { margin: 0 -24px; padding: 0 24px; }
  .content-grid { grid-template-columns: minmax(0, 1.25fr) minmax(290px, 1fr); gap: 16px; }
  .hero-content { padding-left: 24px; }
  .apex-hero h2 { font-size: 62px; }
  .hero-circuit { width: 207px; }
  .topbar-search { width: 170px; }
}

@media (max-width: 960px) {
  .apex-sidebar { width: 76px; padding: 30px 12px 20px; align-items: center; }
  .apex-logo { padding: 0; }
  .apex-logo .logo-text, .apex-logo em, .sidebar-caption, .nav-label, .side-info span, .sidebar-bottom, .side-line, .season { display: none; }
  .apex-nav { width: 100%; margin-top: 28px; }
  .apex-nav a { justify-content: center; padding: 12px; }
  .apex-nav a.active:after { display: none; }
  main#app { margin-left: 76px; }
  .content-grid { grid-template-columns: minmax(0, 1.4fr) minmax(285px, 1fr); }
  .hero-subtitle { font-size: 13px; letter-spacing: 5px; }
  .topbar-search { width: 140px; }
}

@media (max-width: 780px) {
  .content-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero-circuit { display: none; }
  .hero-photo { display: none; }
  .hero-content { width: 100%; }
  .apex-hero h2 { font-size: 57px; }
}

@media (max-width: 590px) {
  .apex-sidebar { inset: auto 0 0; width: 100%; height: 62px; padding: 7px 10px; border-right: 0; border-top: 1px solid #47405f; background: #191526f5; backdrop-filter: blur(15px); flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; }
  .apex-logo { display: none; }
  .apex-nav { display: flex; justify-content: flex-start; gap: 2px; margin: 0; width: auto; }
  .apex-nav a { padding: 8px 10px; flex-direction: column; gap: 4px; border-radius: 6px; flex-shrink: 0; }
  .nav-label { display: block; font-size: 7px; }
  .apex-nav .icon { width: 17px; height: 17px; }
  main#app { margin-left: 0; padding: 0 16px 90px; }
  .topbar { height: 64px; margin: 0 -16px; padding: 0 16px; }
  .breadcrumb { font-size: 9px; gap: 8px; }
  .topbar-badge { display: none; }
  .top-separator { display: none; }
  .topbar-search { width: 120px; }
  .section-heading h1 { font-size: 23px; }
  .apex-hero { min-height: 250px; }
  .apex-hero h2 { font-size: 46px; }
  .hero-content { padding: 20px; }
  .countdown-block { padding-left: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
