:root {
  --bg: #0e1218;
  --bg-soft: #151b24;
  --card: #1a212c;
  --card-2: #202938;
  --text: #f4f7fb;
  --muted: #a8b4c7;
  --line: #2f3a4f;
  --accent: #e10600;
  --accent-2: #00a3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, #1b2330 0%, transparent 36%),
    radial-gradient(circle at 88% 2%, #202d40 0%, transparent 34%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 8px, transparent 8px, transparent 16px),
    var(--bg);
  font-family: "Barlow", sans-serif;
}

.hero {
  border-bottom: 1px solid #3a4661;
  background:
    linear-gradient(95deg, rgba(225, 6, 0, 0.2), rgba(225, 6, 0, 0.02) 35%, transparent 58%),
    linear-gradient(145deg, #131924 0%, #111722 45%, #10151f 100%);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.8rem 1.2rem 2rem;
}

.eyebrow {
  margin: 0;
  color: #ff736f;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.page-badge {
  display: inline-block;
  margin: 0.1rem 0 0.8rem;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.admin-session-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.header-admin-logout {
  border: 1px solid #3f4c67;
  border-radius: 8px;
  padding: 0.28rem 0.5rem;
  background: #182132;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.header-admin-logout:hover {
  border-color: var(--accent);
}

.badge-active {
  background: #123f2f;
  border: 1px solid #2a8f6f;
  color: #cffff1;
}

.badge-build {
  background: #2d2648;
  border: 1px solid #6e63ac;
  color: #e3ddff;
}

.badge-soon {
  background: #3e2f17;
  border: 1px solid #9f7b34;
  color: #ffe8b7;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
  margin-top: 1.2rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid #3a4761;
  background: #1a2433;
  padding: 0.46rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: 120ms ease;
}

.top-nav a:hover {
  border-color: var(--accent);
  color: #ffd1cf;
  background: #311417;
}

.header-tools {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.header-drop {
  border: 1px solid #3a4761;
  border-radius: 10px;
  background: #151f2d;
  padding: 0.35rem 0.5rem;
  min-width: 210px;
}

.header-drop summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: #d5e2f7;
}

.header-login {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.header-login input {
  border: 1px solid #43506a;
  border-radius: 8px;
  padding: 0.43rem 0.55rem;
  background: #0f141d;
  color: var(--text);
  font-family: inherit;
}

.header-login button {
  border: 1px solid #5d2630;
  border-radius: 8px;
  padding: 0.43rem 0.67rem;
  background: #3d161e;
  color: #ffe9e8;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.header-login button:hover {
  border-color: var(--accent);
}

.header-login-info {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  max-width: 1100px;
  margin: 1.4rem auto 2rem;
  padding: 0 1.2rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(12, 1fr);
}

.card {
  grid-column: span 6;
  border: 1px solid var(--line);
  background:
    linear-gradient(175deg, rgba(255, 255, 255, 0.02), transparent 55%),
    var(--card);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.card h2 {
  margin: 0 0 0.42rem;
  font-size: 1.34rem;
}

.status {
  margin: 0 0 0.52rem;
  color: var(--muted);
}

.status span {
  color: #82cbff;
  font-weight: 700;
}

.card p:last-child {
  margin-bottom: 0;
}

.news-feature {
  border: 1px solid #4a2a31;
  border-radius: 12px;
  padding: 0.82rem;
  background:
    linear-gradient(120deg, rgba(225, 6, 0, 0.15), transparent 55%),
    #251c25;
}

.news-feature h3 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.15rem;
}

.news-tag {
  margin: 0;
  color: #ff8d89;
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.live-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  border: 1px solid #ff7975;
  background: #4a1013;
  color: #ffd8d7;
  font-size: 0.72rem;
  font-weight: 700;
  animation: livePulse 1.1s ease-in-out infinite;
}

.news-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.74rem;
}

.news-item {
  border: 1px solid #334159;
  border-radius: 10px;
  padding: 0.66rem 0.76rem;
  background: var(--card-2);
}

.news-item h4 {
  margin: 0 0 0.25rem;
}

.news-item p {
  margin: 0;
  color: var(--muted);
}
.news-item .admin-actions {
  margin-top: 0.45rem;
}

.building-group {
  margin-bottom: 0.8rem;
}

.building-group h5 {
  margin: 0 0 0.45rem;
  color: #aac3e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.building-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}

.building-card {
  min-height: 260px;
}

.building-image-wrap {
  height: 96px;
  border: 1px dashed #3f506d;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin: 0.45rem 0;
  background: #172030;
  overflow: hidden;
}

.building-level-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-neutral {
  background: #1f2f47;
  border: 1px solid #40618e;
  color: #d7e7ff;
}

.team-pill {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.team-redbull {
  background: #10284a;
  border: 1px solid #2f5ea3;
  color: #cde2ff;
}

.team-ferrari {
  background: #4a1216;
  border: 1px solid #aa3942;
  color: #ffd5d8;
}

.team-mercedes {
  background: #123d3b;
  border: 1px solid #2a8e89;
  color: #cefffb;
}

.card-intro,
.calendar-empty {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0.72rem 0 0.86rem;
}

.filters label {
  font-weight: 700;
  font-size: 0.9rem;
}

.filters select {
  border: 1px solid #3a4661;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: #121925;
  color: var(--text);
  font-family: inherit;
}

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

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.calendar-table th,
.calendar-table td {
  padding: 0.48rem;
  text-align: left;
  border-bottom: 1px solid #2f3a50;
}

.flag-icon {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  border: 0;
  vertical-align: -3px;
  margin-right: 0.35rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.flag-fallback {
  display: inline-block;
  margin-right: 0.35rem;
}

.calendar-table th {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #aac3e1;
}

.admin-box {
  margin-top: 0.94rem;
  border: 1px solid #314058;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #151c27;
}

.admin-box summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-form {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}

.admin-form label {
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  border: 1px solid #3b4862;
  border-radius: 8px;
  padding: 0.41rem 0.5rem;
  background: #0f151f;
  color: var(--text);
  font-family: inherit;
}

.admin-actions {
  grid-column: span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.admin-actions button,
.admin-item-actions button {
  border: 1px solid #3f4c67;
  border-radius: 8px;
  padding: 0.42rem 0.6rem;
  background: #182132;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-actions button:hover,
.admin-item-actions button:hover {
  border-color: var(--accent);
}

.admin-list {
  margin-top: 0.75rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px dashed #394860;
  padding: 0.42rem 0;
  font-size: 0.93rem;
}

.admin-item-actions {
  display: flex;
  gap: 0.35rem;
}

.team-panel {
  margin-top: 0.8rem;
  border-top: 1px solid #334157;
  padding-top: 0.7rem;
}

.team-panel h3 {
  margin: 0 0 0.4rem;
}

.team-page .hero-inner,
.team-page .grid,
.team-page .footer {
  max-width: 1380px;
}

.team-page #teamchef.card {
  grid-column: span 12;
}

.team-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 0.9rem;
}

.team-tab-btn {
  border: 1px solid #3f4c67;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  background: #182132;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.team-tab-btn.active,
.team-tab-btn:hover {
  border-color: var(--accent);
  background: #34171d;
}

.team-tab-section {
  margin-bottom: 0.7rem;
}

.team-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.team-overview-card {
  border: 1px solid #334159;
  border-radius: 10px;
  padding: 0.7rem;
  background: #1a2433;
}

.team-overview-card h4,
.team-overview-card h5 {
  margin: 0 0 0.4rem;
}

.team-overview-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.team-overview-list li {
  margin-bottom: 0.2rem;
}

.track-select {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid #3b4862;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #0f151f;
  color: var(--text);
  font-family: inherit;
}

.track-info-board {
  margin-top: 0.6rem;
  border: 1px solid #344865;
  border-radius: 10px;
  background: #1b2534;
  padding: 0.7rem;
}

.track-info-media {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.track-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}

.track-info-grid strong {
  display: block;
  color: #aac3e1;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.track-info-grid p {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

.dev-mode-grid {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.2rem;
}

.dev-cell {
  border: 1px solid #3c4b65;
  border-radius: 6px;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.2rem 0.1rem;
}

.dev-cell-ok {
  background: #1c2738;
  color: #d9e6fb;
}

.dev-cell-fail {
  background: #4a1e25;
  border-color: #a44754;
  color: #ffd9de;
  font-weight: 700;
}

.dev-cell-used {
  background: #3a3a3a;
  border-color: #7f7f7f;
  color: #ececec;
  text-decoration: line-through;
}

#devNumberHint {
  grid-column: span 2;
  margin: 0;
}

.dual-strategy-wrap {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 0.9fr) 1fr;
  gap: 0.45rem 0.65rem;
  margin-top: 0.4rem;
}

.dual-strategy-head {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  color: #aac3e1;
  font-weight: 700;
}

.dual-strategy-label {
  border: 1px dashed #3a4a63;
  border-radius: 8px;
  padding: 0.48rem 0.55rem;
  color: #b5c4da;
  background: #172131;
  font-size: 0.86rem;
  display: grid;
  align-items: center;
}

.drivers-card-full {
  grid-column: span 12;
}

.drivers-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.8rem;
}

.team-roster-card {
  border: 1px solid #344865;
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.04), transparent 56%),
    #1b2534;
  padding: 0.8rem;
}

.team-roster-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.team-color {
  width: 14px;
  height: 46px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.team-roster-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.team-roster-head p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.car-placeholder {
  border: 1px dashed #4f607b;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  min-height: 120px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
  padding: 0;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.1), rgba(0, 163, 255, 0.08));
}

.car-placeholder span {
  color: #c8d6ea;
  font-weight: 700;
  font-size: 0.86rem;
}

.car-image {
  display: block;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #0f141d;
}

.driver-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.driver-item {
  border: 1px solid #3a4d6a;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: #1f2b3b;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.driver-number {
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #5a6f92;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #d6e6ff;
}

.driver-item h4 {
  margin: 0;
  font-size: 0.98rem;
}

.driver-item p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.driver-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  vertical-align: -2px;
  margin-right: 0.35rem;
  border-radius: 2px;
}

.car-admin-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1.2fr auto auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #394860;
}

.car-admin-item input[type="file"] {
  color: var(--muted);
  font-size: 0.84rem;
}

.car-admin-item button {
  border: 1px solid #3f4c67;
  border-radius: 8px;
  padding: 0.36rem 0.52rem;
  background: #182132;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.car-admin-item button:hover {
  border-color: var(--accent);
}

.hidden {
  display: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 1.2rem 1.4rem;
  color: #8f9fb6;
  font-size: 0.92rem;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(225, 6, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0); }
}

@media (max-width: 760px) {
  .card {
    grid-column: span 12;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    grid-column: span 1;
  }

  .team-overview-grid {
    grid-template-columns: 1fr;
  }

  .track-info-grid {
    grid-template-columns: 1fr;
  }

  .dual-strategy-wrap {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .dual-strategy-label,
  .dual-strategy-head {
    display: none;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .header-drop {
    width: 100%;
  }

  .car-admin-item {
    grid-template-columns: 1fr;
  }
}

.btn-link {
  display: inline-block;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 20, 40, 0.55);
  color: #f2f6ff;
  text-decoration: none;
  font-weight: 700;
}

.btn-link:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.admin-panel-wrap {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(12, 1fr);
}

.race-array-block {
  display: grid;
  gap: 0.3rem;
}

.race-array-row {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.race-array-row input,
.race-array-row select {
  width: 100%;
}

/* Alternative Design: Race Control Light */
:root {
  --bg: #edf1f6;
  --bg-soft: #f7f9fc;
  --card: #ffffff;
  --card-2: #f4f7fb;
  --text: #121820;
  --muted: #5f6c7d;
  --line: #d6dde8;
  --accent: #d40f1f;
  --accent-2: #0077c8;
  --ink: #111820;
  --panel-shadow: 0 16px 40px rgba(31, 45, 66, 0.1);
}

body {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(18, 24, 32, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 24, 32, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f9fbfd 0%, #e8edf4 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, #d40f1f, #111820 44%, #0077c8);
  z-index: 20;
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.9)),
    repeating-linear-gradient(135deg, rgba(18, 24, 32, 0.06) 0 1px, transparent 1px 14px);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: clamp(1rem, 8vw, 9rem);
  top: 1.4rem;
  width: min(34vw, 360px);
  height: 7px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--ink));
  transform: skewX(-24deg);
}

.hero-inner {
  max-width: 1240px;
  padding: 2rem 1.4rem 1.45rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
  gap: 1rem 1.6rem;
  align-items: end;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.08em;
  grid-column: 1;
}

h1 {
  margin: 0.18rem 0 0.6rem;
  color: var(--ink);
  max-width: 820px;
  font-size: clamp(1.95rem, 3.8vw, 3.8rem);
  letter-spacing: 0;
  text-transform: uppercase;
  grid-column: 1;
}

.lead {
  color: #445062;
  font-size: 1.02rem;
  grid-column: 1;
}

.page-badge {
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  grid-column: 1;
  justify-self: start;
}

.badge-active {
  background: #e9f8f1;
  border-color: #69be95;
  color: #156140;
}

.badge-build {
  background: #eef2ff;
  border-color: #95a5d8;
  color: #293d84;
}

.badge-soon {
  background: #fff6df;
  border-color: #e2b85d;
  color: #835b11;
}

.top-nav {
  grid-column: 1 / -1;
  gap: 0;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--panel-shadow);
}

.top-nav a {
  flex: 1 1 128px;
  color: #222b36;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 0.72rem 0.85rem;
  text-align: center;
  font-size: 0.86rem;
}

.top-nav a:last-child {
  border-right: 0;
}

.top-nav a:hover {
  color: #fff;
  background: var(--ink);
}

.header-tools {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin-top: 0;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: start;
}

.header-drop {
  width: 100%;
  min-width: 0;
  border-color: var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(31, 45, 66, 0.08);
}

.header-drop summary {
  color: var(--ink);
}

.header-login input,
.admin-form input,
.admin-form select,
.filters select,
.track-select {
  border-color: #c6cfdb;
  background: #fff;
  color: var(--text);
}

.header-login button,
.admin-actions button,
.admin-item-actions button,
.car-admin-item button,
.header-admin-logout {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}

.header-login button:hover,
.admin-actions button:hover,
.admin-item-actions button:hover,
.car-admin-item button:hover,
.header-admin-logout:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.grid {
  max-width: 1240px;
  margin: 1.2rem auto 2.2rem;
  gap: 1rem;
  align-items: start;
}

.card {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--panel-shadow);
}

.card h2 {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.45rem;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status,
.card-intro,
.calendar-empty,
.news-item p,
.driver-item p,
.team-roster-head p,
.track-info-grid p,
.team-overview-list {
  color: var(--muted);
}

.status span {
  color: var(--accent-2);
}

.news-feature {
  border-color: #f0c6ca;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(212, 15, 31, 0.11), transparent 68%),
    #fff7f8;
}

.news-feature h3 {
  color: var(--ink);
}

.news-tag {
  color: var(--accent);
}

.live-badge {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.news-item,
.team-overview-card,
.track-info-board,
.team-roster-card,
.driver-item,
.admin-box {
  border-color: var(--line);
  border-radius: 7px;
  background: var(--card-2);
}

.news-item {
  border-left: 5px solid var(--accent-2);
}

.team-pill,
.team-tab-btn,
.driver-number {
  border-radius: 5px;
}

.team-redbull {
  background: #e7effc;
  border-color: #8fb2e6;
  color: #153c78;
}

.team-ferrari {
  background: #ffe9eb;
  border-color: #e58d96;
  color: #8f101b;
}

.team-mercedes {
  background: #e4f8f5;
  border-color: #7dc9c0;
  color: #14625a;
}

.team-neutral {
  background: #edf2f7;
  border-color: #b9c5d4;
  color: #253246;
}

.calendar-table {
  border: 1px solid var(--line);
  background: #fff;
}

.calendar-table th {
  color: #fff;
  background: var(--ink);
}

.calendar-table th,
.calendar-table td {
  border-bottom-color: var(--line);
}

.calendar-table tr:nth-child(even) td {
  background: #f7f9fc;
}

.admin-box summary,
.filters label,
.team-panel h3,
.team-overview-card h4,
.team-overview-card h5,
.track-info-grid strong,
.building-group h5,
.dual-strategy-head {
  color: var(--ink);
}

.team-tab-btn {
  border-color: #c6cfdb;
  background: #fff;
  color: var(--ink);
}

.team-tab-btn.active,
.team-tab-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.team-color {
  border-radius: 3px;
}

.car-placeholder,
.building-image-wrap {
  border-color: #c6cfdb;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(212, 15, 31, 0.06), rgba(0, 119, 200, 0.08)),
    #fff;
}

.car-placeholder span {
  color: #526073;
}

.car-image {
  background: #fff;
}

.driver-number {
  border-color: #b7c4d5;
  color: var(--ink);
  background: #fff;
}

.admin-item,
.car-admin-item {
  border-bottom-color: #cfd8e5;
}

.building-card {
  background: #fff;
}

.dev-cell {
  border-color: #c2cbd8;
}

.dev-cell-ok {
  background: #f2f6fb;
  color: #213047;
}

.dev-cell-fail {
  background: #ffe8eb;
  border-color: #de7e89;
  color: #92121f;
}

.dev-cell-used {
  background: #e1e5eb;
  border-color: #a5afbd;
  color: #596575;
}

.dual-strategy-label {
  border-color: #c6cfdb;
  background: #fff;
  color: #526073;
}

.btn-link {
  border-radius: 6px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.footer {
  max-width: 1240px;
  color: #6a7686;
}

@media (max-width: 860px) {
  body::before {
    width: 5px;
  }

  .hero::after {
    display: none;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 1.45rem;
  }

  .header-tools {
    grid-column: 1;
    grid-row: auto;
  }

  .top-nav a {
    flex-basis: 50%;
  }
}

@media (max-width: 760px) {
  .top-nav a {
    flex-basis: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .top-nav a:last-child {
    border-bottom: 0;
  }
}

.theme-toggle {
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0.48rem 0.7rem;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(31, 45, 66, 0.12);
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.header-tools .theme-toggle {
  flex: 0 0 auto;
}

.header-tools .admin-session-row {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.header-tools .admin-session-row .page-badge {
  margin: 0;
}

button:not(.team-tab-btn):not(.theme-toggle) {
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0.42rem 0.62rem;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:not(.team-tab-btn):not(.theme-toggle):hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button:not(.team-tab-btn):not(.theme-toggle):disabled {
  border-color: #b8c2d1;
  background: #d8dee8;
  color: #697586;
  cursor: not-allowed;
}

.hero-inner > .theme-toggle {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}

:root[data-theme="dark"] {
  --bg: #0d121a;
  --bg-soft: #151d29;
  --card: #161f2b;
  --card-2: #1d2836;
  --text: #f4f7fb;
  --muted: #aab6c7;
  --line: #334257;
  --accent: #ff3b44;
  --accent-2: #35a8ff;
  --ink: #f7faff;
  --panel-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] body {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #101720 0%, #0b1017 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

[data-theme="dark"] .hero {
  border-bottom-color: #29364a;
  background:
    linear-gradient(115deg, rgba(17, 24, 35, 0.98), rgba(13, 18, 26, 0.93)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 14px);
}

[data-theme="dark"] h1,
[data-theme="dark"] .card h2,
[data-theme="dark"] .news-feature h3,
[data-theme="dark"] .admin-box summary,
[data-theme="dark"] .filters label,
[data-theme="dark"] .team-panel h3,
[data-theme="dark"] .team-overview-card h4,
[data-theme="dark"] .team-overview-card h5,
[data-theme="dark"] .track-info-grid strong,
[data-theme="dark"] .building-group h5,
[data-theme="dark"] .dual-strategy-head {
  color: var(--ink);
}

[data-theme="dark"] .lead {
  color: #c3ccda;
}

[data-theme="dark"] .top-nav,
[data-theme="dark"] .card,
[data-theme="dark"] .calendar-table {
  background: var(--card);
}

[data-theme="dark"] .top-nav {
  border-color: var(--line);
}

[data-theme="dark"] .top-nav a {
  color: #f1f5fb;
  border-right-color: var(--line);
}

[data-theme="dark"] .top-nav a:hover {
  background: var(--accent);
}

[data-theme="dark"] .header-drop {
  border-color: var(--line);
  background: rgba(22, 31, 43, 0.92);
}

[data-theme="dark"] .header-drop summary {
  color: #f1f5fb;
}

[data-theme="dark"] .header-login input,
[data-theme="dark"] .admin-form input,
[data-theme="dark"] .admin-form select,
[data-theme="dark"] .filters select,
[data-theme="dark"] .track-select {
  border-color: #465872;
  background: #0f1620;
  color: var(--text);
}

[data-theme="dark"] .header-login input::placeholder,
[data-theme="dark"] .admin-form input::placeholder {
  color: #7f8b9d;
}

[data-theme="dark"] .badge-active {
  background: #123f2f;
  border-color: #2a8f6f;
  color: #cffff1;
}

[data-theme="dark"] .badge-build {
  background: #2d2648;
  border-color: #6e63ac;
  color: #e3ddff;
}

[data-theme="dark"] .badge-soon {
  background: #3e2f17;
  border-color: #9f7b34;
  color: #ffe8b7;
}

[data-theme="dark"] .news-feature {
  border-color: #62333b;
  background:
    linear-gradient(90deg, rgba(255, 59, 68, 0.16), transparent 68%),
    #251c25;
}

[data-theme="dark"] .news-item,
[data-theme="dark"] .team-overview-card,
[data-theme="dark"] .track-info-board,
[data-theme="dark"] .team-roster-card,
[data-theme="dark"] .driver-item,
[data-theme="dark"] .admin-box,
[data-theme="dark"] .building-card {
  border-color: var(--line);
  background: var(--card-2);
}

[data-theme="dark"] .calendar-table th {
  color: #101720;
  background: #f4f7fb;
}

[data-theme="dark"] .calendar-table tr:nth-child(even) td {
  background: #141d29;
}

[data-theme="dark"] .calendar-table th,
[data-theme="dark"] .calendar-table td {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .team-redbull {
  background: #10284a;
  border-color: #2f5ea3;
  color: #cde2ff;
}

[data-theme="dark"] .team-ferrari {
  background: #4a1216;
  border-color: #aa3942;
  color: #ffd5d8;
}

[data-theme="dark"] .team-mercedes {
  background: #123d3b;
  border-color: #2a8e89;
  color: #cefffb;
}

[data-theme="dark"] .team-neutral {
  background: #1f2f47;
  border-color: #40618e;
  color: #d7e7ff;
}

[data-theme="dark"] .team-tab-btn,
[data-theme="dark"] .driver-number,
[data-theme="dark"] .dual-strategy-label {
  border-color: #465872;
  background: #111a26;
  color: var(--text);
}

[data-theme="dark"] .team-tab-btn.active,
[data-theme="dark"] .team-tab-btn:hover {
  border-color: var(--accent);
  background: #3a151c;
  color: #fff;
}

[data-theme="dark"] .car-placeholder,
[data-theme="dark"] .building-image-wrap {
  border-color: #465872;
  background:
    linear-gradient(135deg, rgba(255, 59, 68, 0.1), rgba(53, 168, 255, 0.1)),
    #101720;
}

[data-theme="dark"] .car-placeholder span {
  color: #c8d6ea;
}

[data-theme="dark"] .car-image {
  background: #0f141d;
}

[data-theme="dark"] .admin-item,
[data-theme="dark"] .car-admin-item {
  border-bottom-color: #3a4a60;
}

[data-theme="dark"] .dev-cell {
  border-color: #3c4b65;
}

[data-theme="dark"] .dev-cell-ok {
  background: #1c2738;
  color: #d9e6fb;
}

[data-theme="dark"] .dev-cell-fail {
  background: #4a1e25;
  border-color: #a44754;
  color: #ffd9de;
}

[data-theme="dark"] .dev-cell-used {
  background: #3a3a3a;
  border-color: #7f7f7f;
  color: #ececec;
}

[data-theme="dark"] .footer {
  color: #95a3b8;
}

[data-theme="dark"] .theme-toggle {
  border-color: #52647d;
  background: #202b3b;
}

[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--accent-2);
  background: #123553;
}

[data-theme="dark"] button:not(.team-tab-btn):not(.theme-toggle) {
  border-color: #52647d;
  background: #202b3b;
  color: #f7faff;
}

[data-theme="dark"] button:not(.team-tab-btn):not(.theme-toggle):hover {
  border-color: var(--accent-2);
  background: #123553;
  color: #fff;
}

[data-theme="dark"] button:not(.team-tab-btn):not(.theme-toggle):disabled {
  border-color: #344258;
  background: #151d29;
  color: #6d7b8f;
}

@media (max-width: 860px) {
  .hero-inner > .theme-toggle {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}
