:root {
  --bg: #07111f;
  --line: rgba(149, 180, 217, 0.18);
  --text: #edf3ff;
  --muted: #98abc6;
  --accent: #ff6b2c;
  --accent-soft: #ff9a66;
  --gold: #ffd36a;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes table-row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 44, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(105, 210, 255, 0.24), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #091729 38%, #06101c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 90%);
  pointer-events: none;
  animation: view-enter 900ms ease both;
}

.page-shell {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 0 16px 40px;
}

.mode-switcher,
.section,
.records-card,
.summary-card,
.track-selector-panel {
  position: relative;
  z-index: 1;
}

.topbar,
.pilot-card-header,
.records-card-header,
.driver-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.number-chip,
.pilot-number,
.records-badge {
  font-family: "Russo One", sans-serif;
}

.nav-links,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-toggle,
.button,
.track-button {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.nav-toggle,
.button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.nav-toggle {
  min-height: 40px;
  padding: 0 15px;
  color: #eef3fb;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-toggle.is-active,
.button.is-active {
  color: #111;
  background: linear-gradient(135deg, #ffb86b, #ffe08c);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 184, 107, 0.28);
}

.nav-toggle:hover,
.button:hover,
.track-button:hover {
  transform: translateY(-2px);
}

.toolbar-input,
.toolbar-select {
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.toolbar-input:focus,
.toolbar-select:focus {
  outline: none;
  border-color: rgba(255, 211, 106, 0.46);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(255, 211, 106, 0.08);
}

.eyebrow,
.section-kicker,
.pilot-tag,
.panel-label,
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.eyebrow,
.section-kicker,
.panel-label,
.pilot-tag {
  color: var(--accent-soft);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.02;
}

.hero-text,
.section-heading p,
.info-panel p,
.driver-note,
.track-button-meta,
.summary-text {
  color: var(--muted);
  line-height: 1.65;
}

.button {
  text-decoration: none;
}

.button-primary {
  color: #111;
  background: linear-gradient(135deg, var(--gold), #fff0a9);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.button-danger {
  color: #ffd7d7;
  background: rgba(255, 86, 86, 0.12);
  border-color: rgba(255, 125, 125, 0.32);
}

.pilot-card,
.records-card,
.summary-card,
.track-selector-panel {
  backdrop-filter: blur(14px);
}

.mode-switcher {
  display: flex;
  justify-content: center;
  padding: 18px 0 18px;
}

.header-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 78px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18, 24, 34, 0.96), rgba(11, 16, 25, 0.96));
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: view-enter 360ms ease both;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  grid-column: 1;
  grid-row: 1;
}

.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #18345b, #0b1d38);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, filter 180ms ease;
}

.site-brand:hover .site-brand-mark {
  transform: rotate(-2deg) scale(1.04);
  filter: brightness(1.08);
}

.site-brand-logo {
  display: block;
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.site-brand-text strong {
  display: block;
  color: #f6f8fc;
  font-family: "Russo One", sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

.header-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.auth-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
}

.auth-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}

.auth-login .social-icon {
  width: 18px;
  height: 18px;
}

.auth-user-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 250px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.auth-user-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 211, 106, 0.36);
  background: rgba(255, 211, 106, 0.09);
}

.auth-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.62);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.auth-logout:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 106, 106, 0.46);
  background: rgba(255, 106, 106, 0.12);
  color: #ffb1b1;
}

.auth-logout:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.auth-logout svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #fff0a9);
  color: #10131b;
}

.auth-user-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.auth-user {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.auth-user strong {
  max-width: 190px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-role {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #f3f7ff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.social-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.social-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

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

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  filter: brightness(1.08);
}

.social-link-discord {
  background: linear-gradient(135deg, #5865f2, #7289ff);
}

.social-link-telegram {
  background: linear-gradient(135deg, #168bd2, #32b4f2);
}

.social-link-tiktok {
  background: linear-gradient(135deg, #151515, #343434);
}

.social-link-twitch {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.nav-links-centered {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav-links {
  min-width: 0;
}

.main-dashboard {
  margin-top: 0;
}

.dashboard-view {
  display: none;
}

.dashboard-view.is-active {
  display: block;
}

.section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(7, 17, 31, 0.62);
}

.section-heading {
  display: grid;
  gap: 10px;
  max-width: 76ch;
}

.tracks-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: none;
}

.races-heading {
  max-width: none;
}

.announcements-heading {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.section-heading h2 {
  font-size: clamp(2rem, 3.8vw, 3.3rem);
}

.track-search-field {
  display: grid;
  gap: 8px;
  width: min(100%, 360px);
}

.track-search-field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(160px, 0.45fr)) auto auto;
  gap: 14px;
  margin-top: 12px;
  align-items: end;
}

.race-filter-field {
  display: grid;
  gap: 8px;
}

.race-filter-field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-filter-reset {
  min-height: 48px;
  white-space: nowrap;
}

.race-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  user-select: none;
}

.race-filter-checkbox:hover {
  border-color: var(--accent);
  background-color: rgba(255, 107, 44, 0.08);
}

.checkbox-input {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.race-filter-checkbox span {
  white-space: nowrap;
}

.pilot-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(180px, 0.7fr)) auto;
  gap: 16px;
  align-items: end;
  margin-top: 22px;
}

.toolbar-group,
.toolbar-search,
.toolbar-views {
  display: grid;
  gap: 8px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-input,
.toolbar-select {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.toolbar-select option {
  color: #111;
}

.view-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.view-mode-button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.view-mode-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.view-mode-button.is-active {
  color: #111;
  background: linear-gradient(135deg, var(--gold), #fff0a9);
  border-color: transparent;
}

.pilot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.pilot-list-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pilot-list-cozy {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pilot-list-detailed {
  grid-template-columns: 1fr;
}

.pilot-list-item,
.pilot-card,
.profile-card,
.records-card,
.track-selector-panel,
.summary-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(14, 27, 46, 0.9), rgba(9, 19, 34, 0.95));
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.pilot-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.pilot-list-compact .pilot-list-item {
  min-height: 92px;
}

.pilot-list-cozy .pilot-list-item {
  min-height: 132px;
}

.pilot-list-detailed .pilot-list-item {
  min-height: 156px;
  align-items: flex-start;
}

.pilot-list-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 211, 106, 0.35);
}

.pilot-card:hover,
.records-card:hover,
.summary-card:hover,
.track-selector-panel:hover {
  border-color: rgba(255, 211, 106, 0.18);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 211, 106, 0.08);
}

.pilot-list-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pilot-list-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pilot-list-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.25rem;
  font-weight: 800;
}

.pilot-discord-status {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 8px;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 8px 18px rgba(88, 101, 242, 0.28);
}

.pilot-discord-status svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.pilot-list-meta,
.pilot-list-details {
  color: var(--muted);
}

.pilot-list-details {
  display: grid;
  gap: 6px;
  line-height: 1.55;
}

.podium-cups,
.track-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.podium-cup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 0;
  color: var(--muted);
  font-weight: 900;
}

.podium-cup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-family: "Russo One", sans-serif;
}

.podium-cup-count {
  font-size: 0.82rem;
}

.podium-cup-gold {
  border: 1px solid rgba(255, 211, 106, 0.28);
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.18), rgba(255, 211, 106, 0.06));
  color: #ffe08c;
}

.podium-cup-silver {
  border: 1px solid rgba(205, 220, 235, 0.24);
  background: linear-gradient(135deg, rgba(205, 220, 235, 0.15), rgba(205, 220, 235, 0.05));
  color: #dfe9f5;
}

.podium-cup-bronze {
  border: 1px solid rgba(210, 139, 77, 0.28);
  background: linear-gradient(135deg, rgba(210, 139, 77, 0.16), rgba(210, 139, 77, 0.05));
  color: #ffc08a;
}

.track-medals-panel {
  grid-column: 1 / -1;
}

.track-medal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.track-medal:hover {
  transform: translateY(-2px);
}

.track-medal-rank {
  font-family: "Russo One", sans-serif;
}

.track-medal-1 {
  border-color: rgba(255, 211, 106, 0.46);
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.18), rgba(255, 184, 107, 0.08));
}

.track-medal-2 {
  border-color: rgba(205, 220, 235, 0.38);
  background: linear-gradient(135deg, rgba(205, 220, 235, 0.14), rgba(152, 171, 198, 0.06));
}

.track-medal-3 {
  border-color: rgba(210, 139, 77, 0.42);
  background: linear-gradient(135deg, rgba(210, 139, 77, 0.14), rgba(255, 107, 44, 0.06));
}

.race-medals {
  gap: 10px;
}

.race-medal {
  border-radius: 16px;
  padding: 8px 12px;
}

.race-medal-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.result-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-family: "Russo One", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.result-position-podium {
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.result-position-podium-1 {
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.24), rgba(255, 184, 107, 0.08));
  color: #ffe08c;
}

.result-position-podium-2 {
  background: linear-gradient(135deg, rgba(205, 220, 235, 0.2), rgba(152, 171, 198, 0.06));
  color: #e9f2ff;
}

.result-position-podium-3 {
  background: linear-gradient(135deg, rgba(210, 139, 77, 0.22), rgba(255, 107, 44, 0.07));
  color: #ffc08a;
}

.empty-state {
  padding: 32px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
  animation: soft-pop 240ms ease both;
}

.empty-state h3 {
  font-size: 1.3rem;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.pilot-list-number {
  color: var(--gold);
  font-family: "Russo One", sans-serif;
}

.pilot-discord-missing-filter {
  min-height: 48px;
  align-self: end;
}

.pilot-card {
  min-height: 100%;
}

.pilot-card.featured {
  border-color: rgba(255, 211, 106, 0.35);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 211, 106, 0.16);
}

.pilot-card h3,
.records-card h3,
.panel-head h3,
.summary-card h3 {
  margin-top: 8px;
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
}

.pilot-number,
.records-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-identity-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-header-rating {
  display: inline-flex;
  align-items: center;
}

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

.stat-box,
.info-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.stat-box {
  padding: 16px;
}

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

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
}

.lap-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.info-panel {
  padding: 18px;
}

.info-panel h4 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.info-panel.compact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 132px;
}

.info-panel.warning h4 {
  color: var(--gold);
}

.pilot-discord-panel {
  border-color: rgba(88, 101, 242, 0.34);
  background: rgba(88, 101, 242, 0.08);
}

.pilot-discord-panel p {
  overflow-wrap: anywhere;
}

.discord-link-muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.discord-username-field small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.pilot-steam-panel {
  border-color: rgba(102, 192, 244, 0.3);
  background: rgba(102, 192, 244, 0.08);
}

.pilot-steam-head,
.steam-game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pilot-steam-head h4 {
  margin: 0;
}

.steam-hours-total {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid rgba(102, 192, 244, 0.32);
  border-radius: 999px;
  color: #66c0f4;
  font-size: 0.82rem;
  font-weight: 800;
}

.steam-games-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.steam-game-row {
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.88rem;
}

.steam-game-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.steam-game-title span:last-child {
  overflow-wrap: anywhere;
}

.steam-game-icon,
.steam-game-icon-fallback {
  flex: 0 0 auto;
  width: 46px;
  height: 24px;
  border-radius: 5px;
}

.steam-game-icon {
  display: block;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.steam-game-icon-fallback {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(102, 192, 244, 0.24);
  background: rgba(102, 192, 244, 0.1);
  color: #66c0f4;
  font-size: 0.68rem;
  font-weight: 900;
}

.steam-game-row:first-child {
  border-top: 0;
}

.steam-game-row.is-empty {
  color: var(--muted);
}

.steam-game-row.is-empty .steam-game-icon {
  opacity: 0.46;
  filter: grayscale(0.85);
}

.steam-game-row strong {
  white-space: nowrap;
  color: #66c0f4;
  font-size: 0.86rem;
}

.steam-game-row.is-empty strong {
  color: var(--muted);
}

.section-tracks {
  min-height: calc(100vh - 150px);
}

.profile-shell {
  margin-top: 8px;
}

.profile-topbar {
  margin-bottom: 18px;
}

.back-button {
  min-width: 180px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.profile-layout > * {
  min-width: 0;
}

.profile-card {
  grid-column: 1;
  grid-row: 1;
}

.profile-laps-card {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}

.profile-laps-card .records-table-wrapper {
  overflow-x: hidden;
}

.profile-laps-card .records-table {
  min-width: 0;
  table-layout: fixed;
}

.profile-laps-card .records-table th:first-child,
.profile-laps-card .records-table td:first-child {
  width: 48%;
}

.profile-laps-card .records-table th:nth-child(2),
.profile-laps-card .records-table td:nth-child(2) {
  width: 34%;
}

.profile-laps-card .records-table th:last-child,
.profile-laps-card .records-table td:last-child {
  width: 18%;
}

.profile-laps-card .track-jump-button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-results-card {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 0;
}

.profile-cars-card {
  grid-column: 2;
  grid-row: 2;
}

.profile-cars-card .records-table-wrapper {
  overflow-x: hidden;
}

.profile-cars-card .records-table {
  min-width: 0;
  table-layout: fixed;
}

.profile-cars-card .records-table th:first-child,
.profile-cars-card .records-table td:first-child {
  width: 48%;
  overflow-wrap: anywhere;
}

.profile-cars-card .records-table th:nth-child(2),
.profile-cars-card .records-table td:nth-child(2),
.profile-cars-card .records-table th:nth-child(3),
.profile-cars-card .records-table td:nth-child(3) {
  width: 26%;
}

.races-shell {
  display: grid;
  margin-top: 24px;
}

.race-scroll-top {
  position: sticky;
  left: calc(100% - 58px);
  bottom: 22px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-top: 18px;
  border: 1px solid rgba(255, 211, 106, 0.24);
  border-radius: 999px;
  background: rgba(12, 24, 42, 0.86);
  color: var(--gold);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.race-scroll-top:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 211, 106, 0.52);
  background: rgba(24, 40, 65, 0.94);
}

.announcement-calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.announcement-toolbar-actions {
  grid-column: 1;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.announcement-create-button {
  min-height: 48px;
}

.announcement-month-switcher,
.announcement-view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.announcement-month-switcher {
  grid-column: 2;
  justify-self: center;
}

.announcement-view-controls {
  grid-column: 3;
  justify-self: end;
}

.announcement-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 211, 106, 0.24);
  border-radius: 50%;
  background: rgba(255, 211, 106, 0.08);
  color: var(--gold);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.announcement-icon-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 211, 106, 0.44);
  background: rgba(255, 211, 106, 0.14);
}

.announcement-current-month {
  min-width: 180px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  text-transform: capitalize;
}

.announcement-filter-toggle.active {
  border-color: rgba(255, 211, 106, 0.42);
  color: var(--gold);
}

.announcement-view-controls .view-mode-switch {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.announcement-mode-button,
.announcement-filter-toggle {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 10px;
}

.announcement-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.announcement-mode-button svg,
.announcement-filter-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.announcement-mode-button svg rect {
  fill: none;
}

.announcement-mode-button svg circle {
  fill: currentColor;
  stroke: none;
}

.announcement-mode-button.active,
.announcement-filter-toggle.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0a9);
  box-shadow: 0 12px 26px rgba(255, 211, 106, 0.2);
}

.announcement-filter-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1.5fr) minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 211, 106, 0.16);
  border-radius: 18px;
  background: rgba(12, 24, 42, 0.72);
}

.announcement-filter-panel[hidden] {
  display: none;
}

.announcement-status-field {
  min-width: 0;
}

.announcement-status-switch {
  display: flex;
  min-height: 48px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.announcement-status-button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.announcement-status-button.active {
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.95), rgba(255, 240, 169, 0.9));
  color: #111;
  box-shadow: 0 10px 22px rgba(255, 211, 106, 0.16);
}

.announcements-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.announcements-list-calendar {
  gap: 0;
}

.announcement-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(7, 17, 31, 0.6);
  box-shadow: var(--shadow);
}

.announcement-calendar-weekday {
  min-height: 42px;
  padding: 12px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.announcement-calendar-cell {
  min-height: 148px;
  padding: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.announcement-calendar-cell-muted {
  background: rgba(255, 255, 255, 0.01);
}

.announcement-calendar-cell-today {
  box-shadow: inset 0 0 0 1px rgba(255, 211, 106, 0.54);
}

.announcement-calendar-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 8px;
}

.announcement-calendar-day span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 900;
}

.announcement-calendar-day small {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
}

.announcement-calendar-events {
  display: grid;
  gap: 7px;
}

.announcement-event-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 211, 106, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.announcement-event-pill:hover,
.announcement-event-pill:focus-visible {
  border-color: rgba(255, 211, 106, 0.42);
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.18), rgba(255, 255, 255, 0.06));
  transform: translateY(-1px);
  outline: none;
}

.announcement-event-main {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.announcement-event-pill img {
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.announcement-event-emoji {
  flex: 0 0 auto;
  font-size: 1rem;
}

.announcement-event-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-event-pill strong {
  display: block;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.announcement-event-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.announcement-event-meta {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  justify-self: end;
}

.announcement-event-class {
  --race-class-color: #bfdbfe;
  --race-class-border: rgba(96, 165, 250, 0.24);
  --race-class-bg: rgba(96, 165, 250, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  min-width: 34px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--race-class-border);
  border-radius: 999px;
  background: var(--race-class-bg);
  color: var(--race-class-color);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.announcement-event-duration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.announcement-event-pill-compact {
  min-height: 46px;
  padding: 7px 8px;
  border-radius: 10px;
}

.announcement-event-pill-compact img {
  width: 22px;
  height: 16px;
}

.announcement-event-pill-compact .announcement-event-name {
  white-space: normal;
}

.announcement-event-pill-compact .announcement-event-meta {
  align-self: center;
}

.announcement-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(255, 211, 106, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 184, 107, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(12, 24, 42, 0.94), rgba(7, 17, 31, 0.72));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.announcement-card:hover,
.announcement-card:focus-visible {
  border-color: rgba(255, 211, 106, 0.38);
  transform: translateY(-1px);
  outline: none;
}

.announcement-main,
.announcement-schedule,
.announcement-details {
  min-width: 0;
}

.announcement-date {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-radius: 999px;
  background: rgba(255, 211, 106, 0.08);
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 900;
}

.announcement-main h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.announcement-flag {
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.16));
}

.announcement-country-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.announcement-country-badge img {
  width: 28px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.announcement-track-map {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 288px);
  aspect-ratio: 16 / 9;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.announcement-track-map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.track-map-open-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

.track-map-open-button span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.76);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.track-map-open-button:hover span,
.track-map-open-button:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.announcement-schedule {
  display: grid;
  gap: 10px;
}

.announcement-session {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.announcement-session span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.announcement-session strong {
  font-size: 1rem;
}

.announcement-details {
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.announcement-registration-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.announcement-rule {
  color: var(--text);
  font-weight: 900;
}

.announcement-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.announcement-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.announcement-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.announcement-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.announcement-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  line-height: 1;
}

.announcement-livery-link {
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.18), rgba(255, 184, 107, 0.08));
  border-color: rgba(255, 211, 106, 0.28);
  color: #ffe08c;
}

.announcement-discord-link {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.92), rgba(114, 137, 255, 0.7));
  border-color: rgba(114, 137, 255, 0.52);
  color: #fff;
}

.announcement-discord-publish-button {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.28), rgba(255, 211, 106, 0.1));
  border-color: rgba(114, 137, 255, 0.42);
  color: #dbe2ff;
}

.announcement-discord-publish-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.announcement-delete-button {
  cursor: pointer;
  background: rgba(255, 93, 93, 0.12);
  border-color: rgba(255, 93, 93, 0.32);
  color: #ffb4b4;
}

.announcement-delete-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.announcement-edit-button {
  cursor: pointer;
  background: rgba(255, 211, 106, 0.14);
  border-color: rgba(255, 211, 106, 0.34);
  color: #ffe08c;
}

.regulation-section {
  gap: 22px;
}

.regulation-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.regulation-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
}

.regulation-hero p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
}

.regulation-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.regulation-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.regulation-toc {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.regulation-toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.regulation-toc-section,
.regulation-toc-node {
  display: block;
}

.regulation-toc-section summary,
.regulation-toc-node summary,
.regulation-toc-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: rgba(241, 247, 255, 0.82);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  list-style: none;
}

.regulation-toc-section summary::-webkit-details-marker,
.regulation-toc-node summary::-webkit-details-marker {
  display: none;
}

.regulation-toc-section summary::after,
.regulation-toc-node summary::after {
  content: "\203A";
  color: #66cfff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.regulation-toc-section[open] > summary::after,
.regulation-toc-node[open] > summary::after {
  transform: rotate(90deg);
}

.regulation-toc-section summary:hover,
.regulation-toc-node summary:hover,
.regulation-toc-link:hover {
  color: #ffffff;
}

.regulation-toc-children {
  display: grid;
  gap: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(102, 207, 255, 0.2);
}

.regulation-toc-node .regulation-toc-children {
  padding-left: 10px;
}

.regulation-toc-link {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  color: rgba(241, 247, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 750;
}

.regulation-toc-section-link {
  padding: 9px 0;
}

.regulation-toc-number {
  min-width: 22px;
  color: #9ee3ff;
  font-weight: 900;
}
}

.regulation-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.regulation-article-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.regulation-article-head h3 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.regulation-body {
  display: grid;
  gap: 0;
  color: rgba(241, 247, 255, 0.9);
  line-height: 1.65;
}

.regulation-article-section {
  scroll-margin-top: 24px;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.regulation-section-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}

.regulation-section-summary::-webkit-details-marker,
.regulation-chapter summary::-webkit-details-marker {
  display: none;
}

.regulation-section-summary::after,
.regulation-chapter summary::after {
  content: "\203A";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #66cfff;
  font-size: 1.35rem;
  font-weight: 900;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.regulation-section-summary::after {
  grid-column: 3;
  grid-row: 1;
}

.regulation-article-section[open] > .regulation-section-summary::after,
.regulation-chapter[open] > summary::after {
  transform: rotate(90deg);
}

.regulation-article-section + .regulation-article-section {
  margin-top: 0;
}

.regulation-section-number {
  order: 3;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.regulation-section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.08rem, 1.5vw, 1.35rem);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.regulation-section-index {
  color: #9ee3ff;
  font-size: 0.9em;
}

.regulation-section-edit-button {
  grid-column: 2;
  grid-row: 1;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.regulation-section-content {
  display: grid;
  gap: 10px;
  padding: 0 0 24px 36px;
}

.regulation-section-content h4 {
  margin: 16px 0 2px;
  color: #ffffff;
  font-size: 1.04rem;
  line-height: 1.35;
}

.regulation-section-content h4:first-child {
  margin-top: 0;
}

.regulation-section-content p {
  margin: 0;
  color: rgba(241, 247, 255, 0.86);
}

.regulation-list-line {
  position: relative;
  padding-left: 18px;
}

.regulation-list-line::before {
  content: "";
  position: absolute;
  top: 0.82em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(102, 207, 255, 0.7);
}

.regulation-chapter {
  margin-top: 6px;
  padding-left: 18px;
  border-left: 2px solid rgba(102, 207, 255, 0.22);
}

.regulation-chapter summary,
.regulation-chapter-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 7px 0;
  list-style: none;
  color: rgba(245, 249, 255, 0.94);
  font-weight: 800;
}

.regulation-chapter summary {
  cursor: pointer;
}

.regulation-chapter-heading {
  grid-template-columns: auto minmax(0, 1fr);
}

.regulation-chapter summary:hover {
  color: #ffffff;
}

.regulation-chapter .regulation-chapter {
  margin-top: 4px;
  padding-left: 16px;
  border-left-color: rgba(255, 255, 255, 0.14);
}

.regulation-chapter .regulation-chapter summary,
.regulation-chapter .regulation-chapter-heading {
  min-height: 36px;
  font-weight: 750;
}

.regulation-summary-mark {
  min-width: 44px;
  color: #9ee3ff;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: left;
}

.regulation-chapter-content {
  display: grid;
  gap: 8px;
  padding: 0 0 10px 56px;
}

.regulation-chapter .regulation-chapter-content {
  padding-left: 48px;
}

.regulation-editor-grid {
  display: grid;
  grid-template-columns: 1.3fr 2fr 0.7fr;
  gap: 12px;
}

.regulation-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.regulation-editor-actions-top {
  margin-bottom: 12px;
}

.regulation-editor.is-section-mode .regulation-editor-section {
  margin-top: 0;
}

.regulation-editor-body {
  min-height: 420px;
  font-family: inherit;
}

.regulation-structure-editor {
  display: grid;
  gap: 14px;
}

.regulation-editor-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.regulation-editor-section-head,
.regulation-editor-subsection-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.regulation-editor-subsections {
  display: grid;
  gap: 10px;
}

.regulation-editor-subsection {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-left: calc((var(--regulation-editor-depth, 1) - 1) * 18px);
  border-left: 2px solid rgba(102, 207, 255, 0.42);
  background: rgba(0, 0, 0, 0.16);
}

.regulation-editor-subsection-head {
  grid-template-columns: minmax(80px, 0.18fr) minmax(0, 1fr) auto;
}

.regulation-editor-number {
  min-width: 0;
}

.regulation-editor-danger {
  color: #ffb4b4;
  border-color: rgba(255, 93, 93, 0.35);
  background: rgba(255, 93, 93, 0.1);
}

.regulation-editor-section .regulation-editor-body {
  min-height: 180px;
}

.regulation-editor-subsection .regulation-editor-body {
  min-height: 140px;
}

.races-list {
  display: grid;
  gap: 16px;
}

.race-card {
  margin-top: 0;
}

.race-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.race-card-winner {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.race-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.race-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.race-date-badge {
  min-width: 180px;
}

.race-class-badge {
  --race-class-color: #bfdbfe;
  --race-class-border: rgba(96, 165, 250, 0.24);
  --race-class-bg: rgba(96, 165, 250, 0.07);
  min-height: 24px;
  padding: 0 8px;
  border-color: var(--race-class-border);
  background: var(--race-class-bg);
  color: var(--race-class-color);
  font-size: 0.68rem;
  line-height: 1;
}

.race-class-chip {
  --race-class-color: #bfdbfe;
  --race-class-border: rgba(96, 165, 250, 0.22);
  --race-class-bg: rgba(96, 165, 250, 0.07);
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 0 7px;
  border: 1px solid var(--race-class-border);
  border-radius: 6px;
  background: var(--race-class-bg);
  color: var(--race-class-color);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.race-class-gt3 {
  --race-class-color: #93c5fd;
  --race-class-border: rgba(147, 197, 253, 0.34);
  --race-class-bg: rgba(59, 130, 246, 0.1);
}

.race-class-gt4 {
  --race-class-color: #6ee7b7;
  --race-class-border: rgba(110, 231, 183, 0.34);
  --race-class-bg: rgba(16, 185, 129, 0.1);
}

.race-class-gt2 {
  --race-class-color: #fca5a5;
  --race-class-border: rgba(252, 165, 165, 0.36);
  --race-class-bg: rgba(239, 68, 68, 0.1);
}

.race-class-cup {
  --race-class-color: #fde68a;
  --race-class-border: rgba(253, 230, 138, 0.38);
  --race-class-bg: rgba(245, 158, 11, 0.11);
}

.race-class-chl {
  --race-class-color: #f0abfc;
  --race-class-border: rgba(240, 171, 252, 0.34);
  --race-class-bg: rgba(217, 70, 239, 0.1);
}

.race-class-st {
  --race-class-color: #fdba74;
  --race-class-border: rgba(253, 186, 116, 0.34);
  --race-class-bg: rgba(249, 115, 22, 0.1);
}

.race-class-tcx {
  --race-class-color: #67e8f9;
  --race-class-border: rgba(103, 232, 249, 0.34);
  --race-class-bg: rgba(6, 182, 212, 0.1);
}

.race-class-endurance {
  --race-class-color: #c4b5fd;
  --race-class-border: rgba(196, 181, 253, 0.36);
  --race-class-bg: rgba(139, 92, 246, 0.11);
}

.race-class-mixed {
  --race-class-color: #d9f99d;
  --race-class-border: rgba(217, 249, 157, 0.34);
  --race-class-bg: rgba(132, 204, 22, 0.1);
}

.race-class-overall {
  --race-class-color: #e5e7eb;
  --race-class-border: rgba(229, 231, 235, 0.28);
  --race-class-bg: rgba(229, 231, 235, 0.07);
}

.car-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  vertical-align: top;
}

.car-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.car-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.car-name-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.car-brand-unknown { color: var(--muted); }

.race-rating-cell {
  white-space: nowrap;
}

.race-predicted-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(255, 211, 106, 0.36);
  border-radius: 6px;
  background: rgba(255, 211, 106, 0.09);
  color: #ffd36a;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.race-prediction-header,
.race-prediction-cell {
  width: 44px;
  min-width: 44px;
  max-width: 52px;
  text-align: center;
}

.race-prediction-cell {
  white-space: nowrap;
}

.race-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.race-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
  flex: 0 0 auto;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.race-card.is-open .race-chevron {
  transform: rotate(180deg);
  border-color: rgba(255, 211, 106, 0.28);
  background: rgba(255, 211, 106, 0.1);
}

.race-card.session-type-qualifying {
  --session-accent: #6ba3ff;
}

.race-card.session-type-qualifying .pilot-tag {
  background: rgba(107, 163, 255, 0.15);
  color: #6ba3ff;
}

.race-card.session-type-practice {
  --session-accent: #a78bff;
}

.race-card.session-type-practice .pilot-tag {
  background: rgba(167, 139, 255, 0.15);
  color: #a78bff;
}

.race-card.session-type-race {
  --session-accent: #ff6b2c;
}

.race-card.session-type-race .pilot-tag {
  background: rgba(255, 107, 44, 0.15);
  color: #ff6b2c;
}

.race-session-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.race-session-badge-race {
  background: rgba(255, 107, 44, 0.15);
  color: #ff6b2c;
}

.race-session-badge-qualifying {
  background: rgba(107, 163, 255, 0.15);
  color: #6ba3ff;
}

.race-session-badge-practice {
  background: rgba(167, 139, 255, 0.15);
  color: #a78bff;
}

.pilot-list-sort-meta {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.pilot-list-race-count {
  display: block;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 6px;
}

.race-results-panel {
  display: none;
  margin-top: 18px;
}

.race-card.is-open .race-results-panel {
  display: block;
  animation: view-enter 220ms ease both;
}

.race-session-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.race-session-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.race-session-actions {
  display: inline-flex;
  justify-content: flex-end;
  margin-left: auto;
}

.race-class-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
}

.track-class-switch {
  margin: 8px 0 10px;
}

.race-class-switch-button {
  --race-class-color: #bfdbfe;
  --race-class-border: rgba(96, 165, 250, 0.24);
  --race-class-bg: rgba(96, 165, 250, 0.07);
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--race-class-border);
  border-radius: 7px;
  background: var(--race-class-bg);
  color: var(--race-class-color);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.race-class-switch-button.is-active {
  background: color-mix(in srgb, var(--race-class-bg) 72%, var(--race-class-color) 28%);
  border-color: var(--race-class-color);
  color: #ffffff;
}

.race-session-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.race-session-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 211, 106, 0.35);
}

.race-session-button.is-active {
  color: #111;
  background: linear-gradient(135deg, #d8a8ff, #ffe08c);
  border-color: transparent;
}

.race-session-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.race-results-table {
  min-width: 1180px;
}

.race-order-header,
.race-order-cell {
  width: 104px;
  white-space: nowrap;
}

.race-order-controls {
  display: inline-grid;
  grid-template-columns: 30px 30px 30px;
  gap: 5px;
  align-items: center;
}

.race-order-drag,
.race-order-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.race-order-drag {
  cursor: grab;
  color: var(--gold);
}

.race-order-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.race-order-row.is-dragging {
  opacity: 0.45;
}

.race-order-row.is-drag-over {
  outline: 2px solid rgba(255, 211, 106, 0.45);
  outline-offset: -2px;
}

tbody.is-saving-order .race-order-button,
tbody.is-saving-order .race-order-drag {
  pointer-events: none;
  opacity: 0.58;
}

.race-results-empty {
  color: var(--muted);
  text-align: center;
}

.race-best-lap {
  color: #d8a8ff;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(186, 104, 255, 0.22);
}

.race-best-sector {
  color: #d8a8ff;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(186, 104, 255, 0.22);
}

.race-rating-up,
.race-rating-down,
.race-position-up,
.race-position-down {
  font-weight: 900;
}

.race-rating-up,
.race-position-up {
  color: #64f0b8;
}

.race-rating-down,
.race-position-down {
  color: #ff8d8d;
}

.race-position-change {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 0.86em;
  line-height: 1;
}

.race-team-drivers {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.race-team-driver-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.race-team-driver {
  line-height: 1.25;
}

.race-team-driver-stats {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.race-team-ratings {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
}

.endurance-results-table {
  min-width: 1180px;
}

.endurance-team-row {
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.endurance-team-row.is-expanded {
  background: rgba(255, 255, 255, 0.035);
}

.endurance-team-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.endurance-team-cell {
  display: grid;
  min-width: 220px;
}

.endurance-team-toggle {
  display: block;
  max-width: 100%;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: left;
  white-space: normal;
}

.endurance-driver-subrow td {
  border-top-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(241, 247, 255, 0.88);
}

.endurance-driver-subrow td.race-rating-up {
  color: #64f0b8;
}

.endurance-driver-subrow td.race-rating-down {
  color: #ff8d8d;
}

.endurance-team-gap td {
  height: 12px;
  padding: 0;
  background: transparent;
}

.endurance-team-gap-top td {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.endurance-team-gap-bottom td {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.endurance-driver-name {
  display: grid;
  gap: 2px;
}

.endurance-driver-name span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.endurance-driver-name .inline-nav-button:hover {
  color: #ffffff;
  text-decoration: none;
}

.race-penalty-cell {
  min-width: 132px;
}

.race-penalty-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.race-penalty-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 132px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 211, 106, 0.25);
  border-radius: 8px;
  background: rgba(255, 211, 106, 0.09);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.25;
  outline: none;
}

.race-penalty-chip.has-action {
  padding-right: 30px;
}

.race-penalty-chip > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-penalty-chip.is-dsq {
  border-color: rgba(255, 141, 141, 0.35);
  background: rgba(255, 141, 141, 0.11);
}

.race-penalty-chip.is-classification {
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(125, 211, 252, 0.1);
}

.race-penalty-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 40;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 190px;
  max-width: min(320px, 72vw);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(13, 19, 31, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.race-penalty-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 19, 31, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.race-penalty-chip:hover .race-penalty-tooltip,
.race-penalty-chip:focus-within .race-penalty-tooltip,
.race-penalty-chip:focus .race-penalty-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.race-penalty-tooltip-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.race-penalty-tooltip-row > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.race-penalty-tooltip-row > strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.race-penalty-empty {
  color: var(--muted);
  font-weight: 800;
}

.race-penalty-add,
.race-penalty-delete {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  font-weight: 900;
  cursor: pointer;
}

.race-penalty-add {
  width: 30px;
  height: 30px;
  background: rgba(100, 240, 184, 0.16);
  color: #64f0b8;
}

.race-protest-submit {
  min-height: 42px;
  padding: 0 14px;
}

.race-protest-indicator {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 141, 141, 0.36);
  border-radius: 50%;
  background: rgba(255, 141, 141, 0.13);
  color: #ffb3b3;
  font-weight: 950;
  cursor: pointer;
}

.race-penalty-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 16px;
  height: 16px;
  background: rgba(255, 141, 141, 0.18);
  color: #ff8d8d;
  font-size: 0.72rem;
  line-height: 1;
  overflow: hidden;
  text-indent: -999px;
}

.race-penalty-delete::before,
.race-penalty-delete::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.race-penalty-delete::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.race-penalty-delete::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.race-result-actions-cell {
  min-width: 96px;
  text-align: right;
  white-space: nowrap;
}

.race-exclusion-chip {
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 7px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.race-result-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(248, 113, 113, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 113, 113, 0.18), rgba(127, 29, 29, 0.2)),
    rgba(248, 113, 113, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(127, 29, 29, 0.12);
  color: #fecaca;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.race-result-time-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 8px;
  background: rgba(125, 211, 252, 0.12);
  color: #bae6fd;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.race-result-time-edit:hover {
  border-color: rgba(125, 211, 252, 0.62);
  background: rgba(125, 211, 252, 0.18);
  color: #ffffff;
}

.race-result-remove::before {
  content: "×";
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.2);
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1;
}

.race-result-remove:hover,
.race-exclusion-chip:hover {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(248, 113, 113, 0.18);
}

.race-result-remove:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.85);
  background:
    linear-gradient(180deg, rgba(248, 113, 113, 0.24), rgba(127, 29, 29, 0.28)),
    rgba(248, 113, 113, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 18px rgba(127, 29, 29, 0.22);
  color: #ffffff;
}

.race-result-remove:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 8px rgba(127, 29, 29, 0.24);
}

.race-exclusions-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.race-exclusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
}

.race-exclusion-chip strong {
  color: #ffffff;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.penalty-modal-dialog {
  width: min(560px, 100%);
}

.penalty-modal-driver {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.edit-checkbox-field {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.edit-checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.protest-list-modal-dialog {
  width: min(680px, 100%);
}

.race-protest-list {
  display: grid;
  gap: 12px;
}

.race-protest-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.race-protest-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.race-protest-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.race-protest-item b,
.race-protest-item strong {
  color: var(--text);
}

.race-protest-penalty {
  justify-self: start;
  min-height: 34px;
  margin-top: 4px;
}

.race-protest-delete {
  justify-self: start;
  min-height: 34px;
  margin-top: 4px;
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.race-protest-login-text {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-rating-card {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
}

.irating-badge {
  --license-color: #9aa4b2;
  --license-rgb: 154, 164, 178;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 7px;
  border: 1px solid rgba(var(--license-rgb), 0.45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--license-rgb), 0.26), rgba(var(--license-rgb), 0.1)),
    rgba(8, 18, 32, 0.82);
  box-shadow: 0 12px 26px rgba(var(--license-rgb), 0.12);
  color: var(--text);
  font-weight: 900;
}

.irating-license {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--license-color);
  color: #081220;
  font-size: 0.95rem;
  line-height: 1;
}

.irating-badge strong {
  color: var(--text);
  font-size: 1rem;
}

.irating-badge span:last-child {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
}

.irating-badge.is-compact {
  gap: 6px;
  padding: 4px 7px 4px 4px;
  border-radius: 7px;
  box-shadow: none;
}

.irating-badge.is-compact .irating-license {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 0.78rem;
}

.irating-badge.is-compact strong {
  font-size: 0.86rem;
}

.rating-driver-label {
  max-width: 82px;
  overflow: hidden;
  color: rgba(241, 247, 255, 0.72);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-with-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rating-delta-text {
  font-size: 0.82rem;
  font-weight: 950;
}

.irating-badge .rating-delta-up {
  color: #64f0b8;
}

.irating-badge .rating-delta-down {
  color: #ff8d8d;
}

.irating-badge .rating-delta-zero {
  color: var(--muted);
}

.rating-delta-up {
  color: #64f0b8;
}

.rating-delta-down {
  color: #ff8d8d;
}

.rating-delta-zero {
  color: var(--muted);
}

.rating-empty {
  color: var(--muted);
  font-weight: 900;
}

.race-rating-cell {
  min-width: 126px;
}

.race-rating-cell,
.race-team-ratings {
  align-items: center;
  gap: 7px;
}

.race-rating-cell {
  white-space: nowrap;
}

.race-team-ratings {
  display: grid;
  justify-items: start;
}

.license-r {
  --license-color: #8f98a5;
  --license-rgb: 143, 152, 165;
}

.license-d {
  --license-color: #ff6b6b;
  --license-rgb: 255, 107, 107;
}

.license-c {
  --license-color: #ffb000;
  --license-rgb: 255, 176, 0;
}

.license-b {
  --license-color: #39d98a;
  --license-rgb: 57, 217, 138;
}

.license-a {
  --license-color: #4dabf7;
  --license-rgb: 77, 171, 247;
}

.license-s {
  --license-color: #c77dff;
  --license-rgb: 199, 125, 255;
}

.license-s .irating-license {
  color: #12071f;
  background: linear-gradient(135deg, #c77dff, #ffd36a);
}

.license-value {
  --license-color: #9aa4b2;
  --license-rgb: 154, 164, 178;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 30px;
  padding: 2px 8px;
  border: 1px solid rgba(var(--license-rgb), 0.42);
  border-radius: 8px;
  background: rgba(var(--license-rgb), 0.18);
  color: var(--license-color);
}

.license-value.license-s {
  color: #ffd36a;
}

.elo-license-guide {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.elo-license-intro {
  display: grid;
  gap: 6px;
  max-width: 940px;
}

.elo-license-intro h3,
.elo-license-intro p {
  margin: 0;
}

.elo-license-intro h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.elo-license-intro p:not(.pilot-tag) {
  color: var(--muted);
  line-height: 1.55;
}

.elo-license-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(138px, 1fr));
  gap: 10px;
}

.elo-license-card {
  --license-color: #9aa4b2;
  --license-rgb: 154, 164, 178;
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 174px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(var(--license-rgb), 0.56);
  border-radius: 10px;
  background:
    radial-gradient(circle at 16px 12px, rgba(var(--license-rgb), 0.38), transparent 34%),
    linear-gradient(150deg, rgba(var(--license-rgb), 0.28), rgba(var(--license-rgb), 0.08) 62%),
    rgba(8, 18, 32, 0.78);
  box-shadow: 0 16px 34px rgba(var(--license-rgb), 0.16);
}

.elo-license-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--license-color);
  box-shadow: 0 0 18px rgba(var(--license-rgb), 0.62);
}

.elo-license-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.elo-license-card-top > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.elo-license-card strong {
  color: var(--text);
  font-size: 0.98rem;
}

.elo-license-card span:not(.irating-license) {
  color: var(--license-color);
  font-size: 0.82rem;
  font-weight: 950;
}

.elo-license-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(241, 247, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.45;
}

.elo-license-card.license-r {
  --license-color: #8f98a5;
  --license-rgb: 143, 152, 165;
}

.elo-license-card.license-d {
  --license-color: #ff6b6b;
  --license-rgb: 255, 107, 107;
}

.elo-license-card.license-c {
  --license-color: #ffb000;
  --license-rgb: 255, 176, 0;
}

.elo-license-card.license-b {
  --license-color: #39d98a;
  --license-rgb: 57, 217, 138;
}

.elo-license-card.license-a {
  --license-color: #4dabf7;
  --license-rgb: 77, 171, 247;
}

.elo-license-card.license-s {
  --license-color: #c77dff;
  --license-rgb: 199, 125, 255;
}

.rating-chart {
  position: relative;
  margin-top: 18px;
  min-height: 220px;
  padding: 8px 0 26px;
}

.rating-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
}

.rating-chart-grid {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.rating-chart-y-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-anchor: end;
  dominant-baseline: central;
}

.rating-chart-line {
  fill: none;
  stroke: #64f0b8;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(100, 240, 184, 0.28));
}

.rating-chart-point {
  fill: #ffd36a;
  stroke: rgba(8, 18, 32, 0.96);
  stroke-width: 3;
}

.rating-chart-hitbox {
  fill: transparent;
  cursor: default;
}

.rating-chart-tooltip {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.rating-chart-tooltip rect {
  fill: rgba(8, 18, 32, 0.98);
  stroke: rgba(255, 211, 106, 0.32);
  stroke-width: 1;
}

.rating-chart-tooltip text {
  fill: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
  alignment-baseline: central;
}

.rating-chart-point-group:hover .rating-chart-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.rating-chart-point-group:hover .rating-chart-point {
  fill: #64f0b8;
}

.rating-chart-labels {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.number-input-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.number-input-shell span {
  color: var(--gold);
  font-weight: 900;
}

.number-input-shell .toolbar-input {
  border: 0;
  background: transparent;
  padding-left: 0;
}

.penalties-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 211, 106, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.penalty-list {
  display: grid;
  gap: 10px;
}

.penalty-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(7, 17, 31, 0.45);
}

.penalty-item p,
.penalty-item span,
.penalty-empty {
  color: var(--muted);
  line-height: 1.5;
}

.penalty-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--gold);
}

.penalty-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 90px minmax(220px, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.edit-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.66);
}

.edit-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(840px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 24, 34, 0.98), rgba(8, 13, 22, 0.98));
  box-shadow: var(--shadow);
}

.edit-modal-head,
.edit-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edit-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.field-hint {
  margin-top: -4px;
  color: rgba(219, 226, 239, 0.48);
  font-size: 0.76rem;
  font-weight: 700;
}

.edit-field-wide {
  grid-column: 1 / -1;
}

.edit-textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.edit-modal-status {
  min-height: 22px;
  color: var(--gold);
}

.pilot-merge-dialog {
  max-width: 760px;
  overflow-x: hidden;
}

.pilot-merge-dialog .edit-form-grid,
.pilot-merge-dialog .edit-field {
  min-width: 0;
}

.pilot-merge-dialog .toolbar-select {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding-inline: 14px;
  border-radius: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilot-merge-direction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 18px;
}

.pilot-merge-summary {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pilot-merge-summary span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pilot-merge-summary strong,
.pilot-merge-summary p {
  overflow-wrap: anywhere;
}

.pilot-merge-summary strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.pilot-merge-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pilot-merge-arrow {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 900;
}

.pilot-merge-warning {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.admin-role-form,
.admin-preset-form {
  display: grid;
  gap: 16px;
}

.admin-preset-form {
  grid-column: 1 / -1;
}

.admin-users-card {
  grid-column: 1 / -1;
}

.admin-users-count {
  min-width: 42px;
  height: 32px;
  padding: 0 12px;
  border-color: rgba(255, 211, 106, 0.34);
  background: rgba(255, 211, 106, 0.1);
  color: var(--gold);
}

.announcement-form-card,
.announcement-form-grid {
  display: grid;
  gap: 16px;
}

.announcement-editor-modal[hidden] {
  display: none;
}

.announcement-modal-dialog {
  width: min(1120px, 100%);
}

.announcement-details-dialog {
  width: min(980px, 100%);
}

.announcement-details-dialog .edit-modal-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.announcement-details-date {
  margin-top: 10px;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 900;
}

.announcement-details-modal-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.announcement-details-map {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.announcement-details-map img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.announcement-details-modal-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.announcement-details-modal-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.announcement-details-sessions,
.announcement-details-modal-list {
  display: grid;
  gap: 10px;
}

.announcement-details-modal-list p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.announcement-details-modal-list span,
.announcement-details-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.announcement-details-modal-list strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.announcement-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.announcement-session-builder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.announcement-session-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.announcement-session-template legend {
  padding: 0 6px;
  color: var(--gold);
  font-weight: 900;
}

.announcement-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.48);
}

.announcement-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.announcement-preview-heading h3 {
  margin: 2px 0 0;
}

.announcement-preview pre {
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 13, 0.62);
  color: rgba(255, 255, 255, 0.88);
  font: 600 0.9rem/1.55 "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.preset-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.preset-preview {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.42);
}

.preset-preview summary {
  padding: 12px 14px;
  color: var(--gold);
  font-weight: 900;
  cursor: pointer;
}

.preset-preview pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.admin-roles-list {
  display: grid;
  gap: 12px;
}

.admin-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-role-item > div:first-child {
  min-width: 0;
}

.admin-role-item strong {
  overflow-wrap: anywhere;
}

.admin-role-item p {
  margin-top: 4px;
  color: var(--muted);
}

.admin-role-lock {
  width: auto;
}

.session-source-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(216, 168, 255, 0.28);
  border-radius: 999px;
  background: rgba(216, 168, 255, 0.1);
  color: #e8c8ff;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: help;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.session-source-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.session-source-chip-r {
  border-color: rgba(255, 116, 99, 0.38);
  background: rgba(255, 116, 99, 0.13);
  color: #ffb3a8;
}

.session-source-chip-q {
  border-color: rgba(255, 211, 106, 0.42);
  background: rgba(255, 211, 106, 0.14);
  color: #ffe08c;
}

.session-source-chip-fp {
  border-color: rgba(105, 220, 255, 0.36);
  background: rgba(105, 220, 255, 0.12);
  color: #aeeeff;
}

.session-source-chip-unknown {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.session-source-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: max-content;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(8, 18, 32, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.session-source-chip:hover::after,
.session-source-chip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.tracks-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}

.track-selector-panel {
  position: sticky;
  top: 18px;
}

.track-selector {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(152, 171, 198, 0.35) rgba(255, 255, 255, 0.04);
}

.track-selector::-webkit-scrollbar {
  width: 10px;
}

.track-selector::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.track-selector::-webkit-scrollbar-thumb {
  background: rgba(152, 171, 198, 0.32);
  border-radius: 999px;
  border: 2px solid rgba(9, 19, 34, 0.85);
}

.track-selector::-webkit-scrollbar-thumb:hover {
  background: rgba(152, 171, 198, 0.5);
}

.track-search-empty {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.track-button {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.track-button.is-active {
  border-color: rgba(255, 211, 106, 0.35);
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.15), rgba(255, 107, 44, 0.08));
  animation: soft-pop 220ms ease both;
}

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

.track-button-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.track-button-flag {
  width: 22px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

.track-button:hover .track-button-flag {
  transform: scale(1.08);
}

.track-results-panel {
  min-width: 0;
}

.track-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 18px;
}

.compact-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-text {
  margin-top: 12px;
}

.track-table-card {
  margin-top: 18px;
}

.track-table-card .records-table {
  min-width: 1040px;
}

.track-map-frame {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 211, 106, 0.25), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 247, 250, 0.94));
  overflow: hidden;
}

.track-map-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(220px, 320px);
  gap: 20px;
  align-items: center;
  margin-top: 20px;
}

.track-map-image {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  padding: 16px;
}

.track-map-open-button-large .track-map-image {
  pointer-events: none;
}

.has-open-modal {
  overflow: hidden;
}

.track-map-modal[hidden] {
  display: none;
}

.track-map-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.track-map-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 8, 18, 0.82);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.track-map-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1120px);
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(12, 24, 42, 0.98), rgba(7, 17, 31, 0.94));
  box-shadow: var(--shadow);
}

.track-map-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.track-map-modal-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

.track-map-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.track-map-modal-close:hover {
  transform: rotate(90deg);
  border-color: rgba(255, 211, 106, 0.35);
  background: rgba(255, 211, 106, 0.1);
}

.track-map-modal-frame {
  display: grid;
  place-items: center;
  min-height: 0;
  max-height: calc(100vh - 168px);
  padding: clamp(18px, 3vw, 34px);
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
}

.track-map-modal-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
}

.track-map-meta {
  display: grid;
  gap: 10px;
  align-content: center;
}

.track-country-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}

.track-country-flag {
  width: 24px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.track-map-meta h4 {
  font-size: 1.5rem;
}

.track-map-description {
  color: var(--muted);
  line-height: 1.6;
}

.track-overview-card {
  padding: 24px;
}

.records-table-wrapper {
  margin-top: 20px;
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.records-table th,
.records-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.records-table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.records-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.records-table tbody tr {
  transition: background 160ms ease, color 160ms ease;
}

.track-jump-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.inline-nav-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.track-jump-button:hover,
.inline-nav-button:hover,
.table-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.records-empty-cell {
  color: var(--muted);
  text-align: center;
}

.elo-rating-table th:first-child,
.elo-rating-table td:first-child {
  width: 56px;
  color: var(--muted);
  font-weight: 900;
}

.elo-rating-table th:nth-child(6),
.elo-rating-table td:nth-child(6),
.elo-rating-table th:nth-child(7),
.elo-rating-table td:nth-child(7),
.elo-rating-table th:nth-child(8),
.elo-rating-table td:nth-child(8) {
  text-align: right;
}

.elo-rating-table th:nth-child(4),
.elo-rating-table td:nth-child(4) {
  width: 72px;
  color: var(--muted);
  font-weight: 900;
}

.elo-rating-table th:nth-child(5),
.elo-rating-table td:nth-child(5) {
  min-width: 220px;
}

.elo-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: inherit;
  cursor: pointer;
}

.elo-sort-button:hover,
.elo-sort-button.is-active {
  color: var(--gold);
}

.elo-sort-arrow {
  display: inline-block;
  min-width: 1ch;
  color: var(--gold);
  font-weight: 950;
}

.elo-rating-table th:nth-child(6) .elo-sort-button,
.elo-rating-table th:nth-child(7) .elo-sort-button,
.elo-rating-table th:nth-child(8) .elo-sort-button {
  justify-content: flex-end;
}

.track-jump-time {
  font-weight: 700;
}

.profile-track-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.profile-track-flag {
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.profile-track-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .pilot-toolbar,
  .pilot-list,
  .profile-layout {
    grid-template-columns: 1fr;
  }

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

  .profile-card,
  .profile-laps-card,
  .profile-results-card,
  .profile-cars-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 980px) {
  .elo-license-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
  }

  .site-brand {
    grid-column: auto;
    grid-row: auto;
    justify-content: center;
  }

  .header-socials {
    grid-column: auto;
    grid-row: auto;
    justify-content: center;
    justify-self: center;
  }

  .auth-panel {
    grid-column: auto;
    grid-row: auto;
    justify-content: center;
    justify-self: center;
  }

  .nav-links-centered {
    grid-column: auto;
    grid-row: auto;
    flex-wrap: wrap;
  }

  .pilot-list,
  .tracks-layout,
  .track-map-layout,
  .track-summary,
  .announcement-card,
  .announcement-filter-panel,
  .race-filters,
  .pilot-columns {
    grid-template-columns: 1fr;
  }

  .announcement-calendar-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .announcement-toolbar-actions,
  .announcement-month-switcher,
  .announcement-view-controls {
    grid-column: auto;
    justify-self: stretch;
  }

  .announcement-toolbar-actions {
    justify-content: stretch;
  }

  .announcement-view-controls {
    justify-content: space-between;
  }

  .announcement-calendar {
    grid-template-columns: 1fr;
  }

  .announcement-calendar-weekday,
  .announcement-calendar-cell-muted {
    display: none;
  }

  .announcement-calendar-cell {
    min-height: 0;
    border-right: 0;
  }

  .announcement-details-modal-grid {
    grid-template-columns: 1fr;
  }

  .pilot-merge-direction {
    grid-template-columns: 1fr;
  }

  .pilot-merge-arrow {
    min-height: 28px;
    transform: rotate(90deg);
  }

  .announcement-status-switch {
    flex-wrap: wrap;
  }

  .announcement-status-button {
    flex-basis: 110px;
    min-height: 40px;
  }

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

  .announcement-actions {
    justify-content: flex-start;
  }

  .track-selector-panel {
    position: static;
  }

  .penalty-form,
  .edit-form-grid,
  .announcement-form-grid,
  .announcement-session-builder,
  .preset-form-grid,
  .regulation-layout,
  .regulation-editor-grid,
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .regulation-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .regulation-section-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .regulation-section-edit-button {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .regulation-section-summary::after {
    grid-column: 2;
    grid-row: 1;
  }

  .regulation-section-content {
    padding: 0 14px 18px;
  }

  .regulation-chapter summary {
    gap: 8px;
    padding: 7px 0;
  }

  .regulation-chapter-content {
    padding: 0 0 10px 18px;
  }

  .regulation-chapter .regulation-chapter-content {
    padding-left: 16px;
  }

  .regulation-chapter {
    padding-left: 12px;
  }

  .regulation-summary-mark {
    min-width: 36px;
  }

  .regulation-editor-section-head,
  .regulation-editor-subsection-head {
    grid-template-columns: 1fr;
  }

  .regulation-toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .elo-license-grid {
    grid-template-columns: 1fr;
  }

  .elo-license-card {
    min-height: 0;
  }

  body::before {
    display: none;
  }

  .page-shell {
    width: 100%;
    max-width: 100%;
    padding-inline: 10px;
    padding-top: 0;
  }

  .mode-switcher,
  .section,
  .records-card,
  .pilot-card,
  .summary-card,
  .track-selector-panel {
    border-radius: 24px;
  }

  .pilot-card-header,
  .records-card-header,
  .race-card-top,
  .driver-identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links,
  .hero-actions,
  .auth-panel,
  .penalty-form {
    width: 100%;
  }

  .auth-user {
    width: 100%;
  }

  .auth-user-button {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }

  .nav-toggle,
  .button {
    width: 100%;
  }

  .announcement-month-switcher,
  .announcement-view-controls,
  .announcement-create-button {
    width: 100%;
  }

  .announcement-filter-toggle {
    width: 48px;
    min-width: 48px;
  }

  .announcement-current-month {
    flex: 1 1 auto;
    min-width: 0;
  }

  .view-mode-switch {
    width: 100%;
  }

  .view-mode-button {
    flex: 1 1 0;
  }

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

  .section {
    padding: 18px 14px;
  }

  .header-bar,
  .announcements-heading,
  .race-card-badges,
  .lap-card-actions {
    width: 100%;
  }

  .announcements-heading {
    grid-template-columns: 1fr;
  }

  .race-date-badge,
  .race-count-badge,
  .records-badge {
    min-width: 0;
    width: 100%;
  }

  .records-table {
    min-width: 620px;
  }

  .profile-laps-card .records-table {
    min-width: 0;
  }

  .penalty-item,
  .admin-role-item,
  .edit-modal-head,
  .edit-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(255, 107, 44, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 44%);
  transition: grid-template-columns 220ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 106, 0.28) transparent;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(9, 16, 28, 0.98), rgba(7, 12, 21, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(255, 107, 44, 0.18), transparent 34%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.32);
}

.app-main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  scrollbar-gutter: stable;
}

.mode-switcher {
  display: none;
}

.sidebar-brand,
.app-topbar,
.app-topbar-title,
.app-topbar-actions,
.sidebar-socials {
  display: flex;
  align-items: center;
}

.sidebar-brand {
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

.app-sidebar .site-brand {
  min-width: 0;
}

.app-sidebar .site-brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.app-sidebar .site-brand-text {
  min-width: 0;
  line-height: 1;
}

.app-sidebar .site-brand-text span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-sidebar .site-brand-text strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-family: "Russo One", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-collapse,
.sidebar-mobile-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.sidebar-collapse:hover,
.sidebar-mobile-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 211, 106, 0.34);
}

.sidebar-collapse svg,
.sidebar-mobile-toggle svg,
.app-nav-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.app-shell.is-sidebar-collapsed .sidebar-collapse svg {
  transform: rotate(180deg);
}

.app-nav {
  display: grid;
  gap: 8px;
}

.app-nav .app-nav-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 14px;
  border-radius: 14px;
  color: rgba(237, 243, 255, 0.78);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.app-nav .app-nav-item[hidden] {
  display: none;
}

.app-nav .app-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.app-nav .app-nav-item.is-active {
  color: #130e08;
  background: linear-gradient(135deg, #ff9f54, #ffd36a);
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(255, 107, 44, 0.25);
}

.app-nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
}

.app-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
}

.donation-widget {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 107, 44, 0.2), transparent 48%),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.donation-widget-content {
  display: grid;
  gap: 9px;
}

.donation-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.donation-widget-label,
.donation-widget-status {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.donation-widget-label {
  color: var(--gold);
}

.donation-widget-status {
  color: var(--muted);
}

.donation-widget-amount {
  color: var(--text);
  font-family: "Russo One", sans-serif;
  font-size: 0.78rem;
}

.donation-widget-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.donation-widget-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 18px rgba(255, 107, 44, 0.42);
  transition: width 500ms ease;
}

.donation-widget-recent {
  display: grid;
  gap: 6px;
  max-height: 148px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  list-style: none;
}

.donation-widget-recent::-webkit-scrollbar {
  display: none;
}

.donation-widget-recent li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.donation-widget-recent li::before {
  content: "";
  display: none;
}

.donation-widget-recent li:first-child::before {
  content: "\041f\043e\0441\043b\0435\0434\043d\0438\0435";
  display: block;
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.donation-widget-recent span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donation-widget-recent strong {
  color: var(--gold);
}

.donation-widget-recent small {
  grid-column: 1 / -1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.64rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.donation-widget-action {
  border: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9f54, #ffd36a);
  color: #130e08;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.donation-widget-action:hover,
.donation-widget-action:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.donation-widget-action:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.48;
}

.donation-widget-action-icon {
  font-family: "Russo One", sans-serif;
  font-size: 1rem;
}

.donation-widget.has-error .donation-widget-status {
  color: #ffb1b1;
}

.sidebar-mini-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-socials {
  gap: 10px;
}

.sidebar-socials .social-link {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  text-decoration: none;
}

.sidebar-socials .social-icon {
  width: 24px;
  height: 24px;
}

.app-shell.is-sidebar-collapsed .app-sidebar {
  align-items: center;
  padding-inline: 14px;
}

.app-shell.is-sidebar-collapsed .site-brand-text,
.app-shell.is-sidebar-collapsed .app-nav-label,
.app-shell.is-sidebar-collapsed .sidebar-mini-label,
.app-shell.is-sidebar-collapsed .donation-widget-content,
.app-shell.is-sidebar-collapsed .donation-widget-action-text {
  display: none;
}

.app-shell.is-sidebar-collapsed .donation-widget {
  width: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.is-sidebar-collapsed .donation-widget-action {
  width: 58px;
  min-height: 52px;
  border-radius: 14px;
}

.app-shell.is-sidebar-collapsed .sidebar-brand {
  flex-direction: column;
}

.app-shell.is-sidebar-collapsed .app-nav .app-nav-item {
  width: 58px;
  justify-content: center;
  padding: 0;
}

.app-shell.is-sidebar-collapsed .sidebar-socials {
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 16px 28px;
  background: rgba(7, 13, 23, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.app-topbar-title {
  min-width: 0;
  gap: 14px;
}

.app-kicker {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-topbar h1 {
  margin: 0;
  color: var(--text);
  font-family: "Russo One", sans-serif;
  font-size: clamp(1.45rem, 1.1rem + 1vw, 2.15rem);
  line-height: 1;
}

.sidebar-mobile-toggle {
  display: none;
}

.main-dashboard {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px 28px 42px;
}

.app-main .race-filters,
.app-main .pilot-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.app-main .race-filter-reset,
.app-main .race-filter-checkbox,
.app-main .pilot-filter-reset {
  width: 100%;
  min-width: 0;
}

.app-main .race-filter-checkbox span {
  white-space: normal;
}

.app-main .dashboard-view {
  min-height: calc(100vh - 78px);
}

.app-main .dashboard-view.is-active {
  display: grid;
}

.app-main .section {
  min-height: calc(100vh - 146px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-main .section-heading {
  max-width: none;
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-main .section-heading h2 {
  font-size: clamp(2.2rem, 2vw + 1.2rem, 4rem);
}

.section {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(14, 24, 39, 0.82), rgba(9, 16, 28, 0.78)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell.is-sidebar-collapsed {
    display: block;
    min-height: 100vh;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .app-shell.is-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.is-sidebar-collapsed .app-sidebar {
    align-items: stretch;
  }

  .app-shell.is-sidebar-collapsed .site-brand-text,
  .app-shell.is-sidebar-collapsed .app-nav-label,
  .app-shell.is-sidebar-collapsed .sidebar-mini-label,
  .app-shell.is-sidebar-collapsed .donation-widget-content,
  .app-shell.is-sidebar-collapsed .donation-widget-action-text {
    display: block;
  }

  .app-shell.is-sidebar-collapsed .donation-widget {
    width: auto;
    padding: 15px;
    border: 1px solid rgba(255, 211, 106, 0.22);
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 107, 44, 0.2), transparent 48%),
      rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .app-shell.is-sidebar-collapsed .donation-widget-action {
    width: auto;
    min-height: 40px;
    border-radius: 12px;
  }

  .app-shell.is-sidebar-collapsed .sidebar-brand {
    flex-direction: row;
  }

  .app-shell.is-sidebar-collapsed .app-nav .app-nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0 14px;
  }

  .app-shell.is-sidebar-collapsed .sidebar-socials {
    flex-direction: row;
  }

  .app-main {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    transition: opacity 180ms ease;
  }

  .app-shell.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-mobile-toggle {
    display: grid;
  }

  .sidebar-collapse {
    display: none;
  }

  .app-topbar {
    padding: 14px 16px;
  }

  .main-dashboard {
    padding: 18px 12px 32px;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-topbar-actions,
  .app-topbar-actions .auth-panel,
  .auth-user-button,
  .auth-login {
    width: 100%;
  }

  .app-nav .app-nav-item {
    width: 100%;
  }
}

.championships-list,
#championship-rounds-editor,
.championship-schedule {
  display: grid;
  gap: 14px;
}

.championship-form {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

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

.championship-form-grid .edit-field-wide,
.championship-round-result,
.championship-round-points {
  grid-column: 1 / -1;
}

.championship-editor-heading,
.championship-actions,
.championship-hero,
.championship-round,
.championship-round-state {
  display: flex;
  align-items: center;
}

.championship-editor-heading,
.championship-hero {
  justify-content: space-between;
  gap: 18px;
}

.championship-editor-heading h4,
.championship-layout h4 {
  margin: 0;
}

.championship-rounds-editor {
  display: grid;
  gap: 12px;
}

.championship-announcement-import {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.championship-round-editor {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.7fr 1.1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.championship-round-editor legend {
  padding: 0 8px;
  color: var(--gold);
  font-weight: 900;
}

.championship-round-remove {
  position: absolute;
  top: -10px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 106, 106, 0.4);
  border-radius: 50%;
  background: #321a22;
  color: #ffb1b1;
  font-size: 1.25rem;
  cursor: pointer;
}

.championship-card {
  overflow: hidden;
}

.championship-hero {
  padding: 0;
  cursor: pointer;
  list-style: none;
}

.championship-hero::-webkit-details-marker {
  display: none;
}

.championship-card[open] .championship-hero {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.championship-hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.championship-expand-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.championship-card[open] .championship-expand-icon {
  transform: rotate(225deg);
}

.championship-body {
  padding-top: 18px;
}

.championship-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.championship-tab {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.championship-tab.is-active {
  border-color: rgba(255, 211, 106, 0.32);
  background: rgba(255, 211, 106, 0.12);
  color: var(--gold);
}

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

.championship-hero h3 {
  margin: 5px 0 8px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.championship-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.championship-summary {
  min-width: 150px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-radius: 18px;
  background: rgba(255, 211, 106, 0.07);
  text-align: center;
}

.championship-summary strong {
  display: block;
  color: var(--gold);
  font-size: 1.7rem;
}

.championship-summary span,
.championship-round-main span,
.championship-round-main p,
.championship-round-state span {
  color: var(--muted);
  font-size: 0.76rem;
}

.championship-points-system {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 0;
  overflow-x: auto;
}

.championship-points-system span {
  color: var(--muted);
}

.championship-points-system b {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
}

.championship-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.2fr);
  gap: 22px;
}

.championship-layout > div {
  min-width: 0;
}

.championship-schedule,
.championship-table {
  margin-top: 12px;
}

.championship-round {
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.championship-round.is-completed {
  border-color: rgba(99, 221, 151, 0.24);
}

.championship-round-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 211, 106, 0.12);
  color: var(--gold);
  font-weight: 900;
}

.championship-round-main {
  min-width: 0;
  flex: 1;
}

.championship-round-main strong {
  display: block;
  margin-bottom: 9px;
  line-height: 1.45;
}

.championship-round-main p {
  margin: 0;
}

.championship-round-details {
  display: grid;
  gap: 5px;
  margin: 0;
}

.championship-round-details > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.championship-round-details dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.championship-round-details dd {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.championship-round-points-list {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  overflow-x: auto;
}

.championship-round-points-list span {
  flex: 0 0 auto;
}

.championship-round-points-list b {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
}

.championship-round-state {
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.championship-round.is-completed .championship-round-state > span {
  color: #76dda1;
}

.championship-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.championship-standings-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 106, 0.42) rgba(255, 255, 255, 0.06);
}

.championship-standings-scroll-top {
  display: none;
  height: 18px;
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.championship-standings-scroll-top.is-scrollable {
  display: block;
}

.championship-standings-scroll-spacer {
  height: 1px;
}

.championship-standings-scroll-top.is-scrollable + .championship-standings-scroll {
  margin-top: 6px;
}

.championship-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0;
}

.championship-table th,
.championship-table td {
  height: 62px;
  text-align: center;
  vertical-align: middle;
}

.championship-rank-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 48px;
  min-width: 48px;
  background: #111925;
}

.championship-driver-cell {
  position: sticky;
  left: 48px;
  z-index: 4;
  width: clamp(220px, 24vw, 340px);
  min-width: 220px;
  max-width: 340px;
  background: #111925;
  text-align: left !important;
  white-space: normal;
}

.championship-driver-link {
  max-width: 100%;
  color: var(--text);
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.championship-table thead .championship-rank-cell,
.championship-table thead .championship-driver-cell {
  z-index: 6;
  background: #182231;
}

.championship-stage-header {
  width: clamp(128px, 12vw, 170px);
  min-width: 128px;
  padding: 7px 9px !important;
}

.championship-stage-link {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  min-height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.championship-stage-link.is-static {
  cursor: default;
}

button.championship-stage-link:hover small {
  color: var(--gold);
}

.championship-stage-header .championship-stage-flag,
.championship-stage-header strong,
.championship-stage-header small {
  display: block;
}

.championship-stage-header .championship-stage-flag {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.championship-stage-header .championship-stage-flag-fallback {
  height: auto;
  border-radius: 0;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: none;
  object-fit: initial;
}

.championship-stage-header strong {
  max-width: 100%;
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.championship-stage-header small {
  color: var(--muted);
  font-size: 0.58rem;
}

.championship-stage-header.is-upcoming {
  background: rgba(255, 255, 255, 0.025);
}

.championship-stage-header.is-upcoming .championship-stage-flag {
  color: rgba(255, 255, 255, 0.42);
}

.championship-stage-cell {
  min-width: 128px;
  color: var(--muted);
}

.championship-stage-cell strong {
  display: block;
  color: inherit;
  font-size: 1rem;
}

.championship-stage-cell span {
  display: block;
  margin-top: 2px;
  color: currentColor;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.championship-stage-cell.is-podium {
  box-shadow: inset 0 0 0 1px currentColor;
}

.championship-stage-cell.is-podium-1 {
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.25), rgba(255, 184, 72, 0.08));
  color: #ffd76a;
}

.championship-stage-cell.is-podium-2 {
  background: linear-gradient(135deg, rgba(205, 217, 230, 0.22), rgba(160, 177, 197, 0.07));
  color: #d8e2ec;
}

.championship-stage-cell.is-podium-3 {
  background: linear-gradient(135deg, rgba(205, 127, 78, 0.25), rgba(153, 83, 46, 0.08));
  color: #df9a6b;
}

.championship-total-cell {
  position: sticky;
  right: 0;
  z-index: 4;
  width: 82px;
  min-width: 82px;
  border-left: 1px solid rgba(255, 211, 106, 0.2);
  background: #182231;
  color: var(--gold);
}

.championship-table thead .championship-total-cell {
  z-index: 6;
}

.championship-total-cell strong {
  font-size: 1.08rem;
}

.championship-delete {
  border-color: rgba(255, 106, 106, 0.3);
  color: #ffb1b1;
}

@media (max-width: 1100px) {
  .championship-layout {
    grid-template-columns: 1fr;
  }

  .championship-announcement-import {
    grid-template-columns: 1fr;
  }

  .championship-round-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .championships-heading,
  .championship-hero,
  .championship-editor-heading,
  .championship-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .championship-form-grid,
  .championship-round-editor {
    grid-template-columns: 1fr;
  }

  .championship-round-result {
    grid-column: auto;
  }

  .championship-round-points {
    grid-column: auto;
  }

  .championship-summary {
    width: 100%;
  }

  .championship-hero-meta {
    width: 100%;
  }

  .championship-expand-icon {
    margin-left: auto;
  }

  .championship-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .championship-round {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .championship-round-details > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .championship-round-state {
    width: 100%;
    align-items: flex-start;
    padding-left: 46px;
    text-align: left;
  }

  .championship-driver-cell {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
