@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #07090d;
  --bg-soft: #0b0e14;
  --panel: rgba(15, 19, 27, 0.86);
  --panel-solid: #0f131b;
  --panel-2: #131a25;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2f7;
  --muted: #8792a4;
  --muted-2: #5d6778;
  --accent: #d8ff3e;
  --accent-soft: rgba(216, 255, 62, 0.14);
  --orange: #ff6a3d;
  --pink: #ff3d81;
  --cyan: #62e6ff;
  --radius: 22px;
  --radius-sm: 14px;
  --font: 'Space Grotesk', 'DejaVu Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'DejaVu Sans Mono', monospace;
  --track-accent: #ff5a36;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(216, 255, 62, 0.08), transparent 60%),
    radial-gradient(900px 700px at 100% 12%, rgba(255, 61, 129, 0.09), transparent 58%),
    radial-gradient(1000px 900px at 50% 120%, rgba(70, 125, 255, 0.08), transparent 65%),
    var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 20%, black 0%, transparent 75%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hidden { display: none !important; }

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }

/* -------------------------------------------------------------------------- */
/* login                                                                       */
/* -------------------------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.login-orbit {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.orbit-a {
  width: 520px; height: 520px;
  left: -180px; top: 10%;
  border: 1px solid rgba(216, 255, 62, .18);
  box-shadow: inset 0 0 100px rgba(216,255,62,.05);
}
.orbit-b {
  width: 780px; height: 780px;
  right: -320px; bottom: -300px;
  border: 1px solid rgba(255, 61, 129, .14);
  box-shadow: inset 0 0 140px rgba(255,61,129,.06);
}

.login-card {
  width: min(660px, 100%);
  position: relative;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(150deg, rgba(255,255,255,.045), transparent 42%),
    rgba(10, 13, 19, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .22em;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand b { font-weight: 700; color: var(--accent); }
.brand .slash {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: -.2em;
  transform: translateY(-1px);
}
.brand.large { font-size: 20px; margin-bottom: 42px; }
.brand-name { letter-spacing: .11em; }
.brand-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1;
  color: #10130a;
  background: var(--accent);
  border-radius: 5px;
  padding: 3px 6px;
  transform: translateY(-1px);
}
.brand.large .brand-tag { font-size: 11px; padding: 4px 8px; }

.login-series {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 30px;
}
.login-series span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-series i {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}
.login-series .login-series-tag {
  color: #10130a;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.login-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--muted);
  margin-bottom: 16px;
}

.login h1 {
  margin: 0;
  font-size: clamp(64px, 12vw, 110px);
  line-height: .82;
  letter-spacing: -.07em;
  font-weight: 600;
}
.login h1 i {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -.04em;
}

.login-lede {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  margin: 28px 0 34px;
}

.login form label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.login-input-row { display: flex; gap: 10px; }
.login-input-row input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,.35);
  color: var(--text);
  outline: none;
  letter-spacing: .18em;
  transition: border-color .2s, box-shadow .2s;
}
.login-input-row input:focus {
  border-color: rgba(216,255,62,.6);
  box-shadow: 0 0 0 4px rgba(216,255,62,.08);
}
.login-error {
  min-height: 20px;
  color: #ff8b72;
  font-size: 13px;
  margin: 14px 0 0;
}
.login-note {
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* base app                                                                   */
/* -------------------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
  animation: fade .55s ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 2px 28px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.series-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(216,255,62,.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(216,255,62,.1), transparent 70%),
    rgba(255,255,255,.02);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  white-space: nowrap;
}
.series-pill-label { color: var(--accent); font-size: 8px; letter-spacing: .18em; }
.series-pill-format { color: var(--muted); }
.series-pill-format b { color: var(--text); font-weight: 600; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}
.status-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #556070;
  box-shadow: 0 0 0 4px rgba(85,96,112,.12);
}
.status-pill.online { color: var(--accent); border-color: rgba(216,255,62,.26); }
.status-pill.online .dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(216,255,62,.12), 0 0 18px rgba(216,255,62,.8);
  animation: pulse 1.8s infinite;
}
.status-pill.starting { color: var(--orange); border-color: rgba(255,106,61,.3); }
.status-pill.starting .dot { background: var(--orange); animation: pulse 1s infinite; }

.net-chip {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  font-family: var(--mono);
  font-size: 11px;
}
.net-label { color: var(--muted-2); font-size: 9px; letter-spacing: .16em; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.04); }

/* -------------------------------------------------------------------------- */
/* hero                                                                       */
/* -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  gap: 22px;
  min-height: 580px;
  margin-bottom: 22px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 12px 22px 4px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}
.eyebrow .line { width: 34px; height: 1px; background: var(--accent); display: inline-block; }

.hero h1 {
  margin: 0;
  font-size: clamp(68px, 8.2vw, 125px);
  line-height: .8;
  letter-spacing: -.075em;
  font-weight: 600;
}
.hero h1 i {
  display: inline-block;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -.045em;
  color: var(--accent);
  transform: translateX(2%);
}

.lede {
  max-width: 560px;
  margin: 34px 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

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

.series-strip {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  max-width: 650px;
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(216,255,62,.06), transparent 48%),
    rgba(0,0,0,.2);
}
.series-seg {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 116px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
}
.series-seg .seg-key {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #0b0e14;
}
.series-seg.p .seg-key { background: var(--cyan); }
.series-seg.q .seg-key { background: var(--accent); }
.series-seg.r .seg-key { background: var(--orange); }
.series-seg b { display: block; font-size: 22px; line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.series-seg small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.series-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 160px;
  padding: 13px 15px;
}
.series-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--accent);
}
.series-sub {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .06em;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .18s, border-color .18s, background .18s, color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary {
  background: var(--accent);
  color: #10130a;
  box-shadow: 0 10px 34px rgba(216,255,62,.16);
}
.btn.primary:hover { box-shadow: 0 14px 42px rgba(216,255,62,.26); }
.btn.ghost {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.025);
  color: var(--text);
}
.btn.ghost:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.06); }
.btn.small { padding: 10px 16px; font-size: 12px; }
.btn.danger { background: #ff6d54; color: #180b08; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: auto;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
}
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stat strong { font-size: clamp(22px, 2.2vw, 32px); line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.stat-sub { font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* hero track card */
.hero-track {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 580px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 22px;
  background:
    radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--track-accent) 24%, transparent), transparent 38%),
    linear-gradient(160deg, rgba(255,255,255,.04), transparent 45%),
    #0b0e14;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-track::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(black, transparent 85%);
}
.track-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 75% 22%, color-mix(in srgb, var(--track-accent) 20%, transparent), transparent 55%),
    linear-gradient(180deg, transparent 25%, rgba(0,0,0,.18) 100%);
}

.track-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 2;
}
.hero-flag { font-size: 22px; line-height: 1; }
.track-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--muted);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,.2);
}

.track-visual {
  position: relative;
  flex: 1;
  min-height: 250px;
  margin: 8px -4px 0;
  display: grid;
  place-items: center;
}
.track-visual svg { width: 100%; height: 100%; overflow: visible; }
.track-visual .track-halo {
  fill: none;
  stroke: var(--track-accent);
  stroke-width: 18;
  opacity: .09;
  filter: blur(10px);
}
.track-visual .track-line {
  fill: none;
  stroke: var(--track-accent);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--track-accent) 55%, transparent));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw 1.5s cubic-bezier(.2,.8,.2,1) forwards;
}
.track-visual .track-ghost {
  fill: none;
  stroke: rgba(255,255,255,.12);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}
.track-visual .start-dot { fill: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.track-visual .runner { fill: #fff; filter: drop-shadow(0 0 9px #fff); }

.track-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
  padding-top: 10px;
}
.track-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: color-mix(in srgb, var(--track-accent) 85%, white);
  margin-bottom: 8px;
}
.track-bottom h2 {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: .9;
  letter-spacing: -.06em;
  font-weight: 600;
}
.track-bottom p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.track-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.track-actions {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 2;
  margin-top: 20px;
}
.track-actions .btn { flex: 1; }

/* -------------------------------------------------------------------------- */
/* dashboard                                                                  */
/* -------------------------------------------------------------------------- */

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255,255,255,.035), transparent 36%),
    var(--panel);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.panel-index {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: .05em;
  padding-top: 2px;
}
.panel h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.02em;
}
.panel-actions { display: flex; gap: 7px; align-items: center; }
.rot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--muted-2);
  white-space: nowrap;
}
.rot-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #556070;
}
.rot-status.on { color: var(--accent); border-color: rgba(216,255,62,.3); }
.rot-status.on .dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(216,255,62,.8);
  animation: pulse 1.8s infinite;
}
.hint {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted-2);
  white-space: nowrap;
}

.rotation-panel { grid-column: span 7; }
.weekend-panel { grid-column: span 5; }
.atmosphere-panel { grid-column: span 4; }
.garage-panel { grid-column: span 8; }
.live-panel { grid-column: span 7; }
.terminal-panel { grid-column: span 5; }

.chip-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: .18s;
}
.chip-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.07); }
.chip-btn.accent { color: #111408; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chip-btn.accent:hover { box-shadow: 0 0 22px rgba(216,255,62,.22); }

/* rotation */
.preset-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
}
.preset-row label { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; }
.preset-row select {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 12px;
}
.preset-row select option { background: #111720; }

.rot-strip {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr .7fr;
  gap: 8px;
  margin-bottom: 12px;
}
.rot-strip > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}
.rot-strip span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.rot-strip b {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rot-strip .rot-now {
  border-color: rgba(216,255,62,.24);
  background: rgba(216,255,62,.05);
}
.rot-strip .rot-now b { color: var(--accent); }
.rot-strip .rot-next b { color: var(--text); }

.rotation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}
.rotation-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 10px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  transition: .18s;
}
.rotation-item:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.rotation-item.current { border-color: color-mix(in srgb, var(--item-accent, var(--accent)) 45%, transparent); background: color-mix(in srgb, var(--item-accent, var(--accent)) 9%, transparent); }
.rotation-item.next { border-color: color-mix(in srgb, var(--item-accent, var(--accent)) 26%, transparent); }
.rotation-item.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--item-accent, var(--accent)) 35%, transparent); }
.rotation-item .rot-map {
  width: 34px; height: 26px;
  flex: 0 0 34px;
  opacity: .8;
}
.rotation-item .rot-map svg { width: 100%; height: 100%; }
.rotation-item .rot-map path { fill: none; stroke: var(--item-accent, var(--accent)); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.rotation-item .rot-map .mini-ghost { stroke: rgba(255,255,255,.14); stroke-width: 9; }
.rotation-item .rot-map .mini-line { stroke-width: 4; }
.rotation-item .rot-copy { flex: 1; min-width: 0; }
.rotation-item .rot-name { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rotation-item .rot-sub { display: block; font-family: var(--mono); font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.rotation-item .rot-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #10130a;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .12em;
}
.rot-tools { display: flex; gap: 2px; opacity: .45; transition: .18s; }
.rotation-item:hover .rot-tools { opacity: 1; }
.rot-tools button {
  width: 20px; height: 20px;
  border: 0; border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.rot-tools button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.rot-tools button.remove:hover { color: #ff8b72; }

.rotation-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.rotation-foot .delay { font-family: var(--mono); font-size: 9px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rotation-foot .delay input {
  width: 48px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
}

/* switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  width: 30px; height: 17px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid var(--line);
  position: relative;
  transition: .2s;
  flex: 0 0 auto;
}
.switch span::after {
  content: "";
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--muted);
  top: 2px; left: 2px;
  transition: .2s;
}
.switch input:checked + span { background: rgba(216,255,62,.16); border-color: rgba(216,255,62,.4); }
.switch input:checked + span::after { transform: translateX(13px); background: var(--accent); }

/* weekend */
.session-stack { display: flex; flex-direction: column; gap: 8px; }
.session-row {
  display: grid;
  grid-template-columns: 34px minmax(70px, 1fr) 58px 62px 58px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}
.session-badge {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #0b0e14;
}
.session-badge.P { background: var(--cyan); }
.session-badge.Q { background: var(--accent); }
.session-badge.R { background: var(--orange); }
.session-label { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-label small { display: block; font-family: var(--mono); font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.session-field { display: flex; flex-direction: column; gap: 3px; }
.session-field span { font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: var(--muted-2); text-transform: uppercase; }
.session-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  padding: 5px 5px;
  font-family: var(--mono);
  font-size: 10px;
  outline: none;
  text-align: center;
}
.session-field input:focus { border-color: rgba(216,255,62,.4); }
.weekend-foot {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.weekend-foot label { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.weekend-foot input {
  width: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  padding: 5px 6px;
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

/* atmosphere */
.weather-visual {
  position: relative;
  height: 118px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 30%, rgba(216,255,62,.2), transparent 34%),
    linear-gradient(180deg, #111722, #0a0d13);
}
.weather-visual .sun {
  position: absolute;
  width: 42px; height: 42px;
  border-radius: 50%;
  right: 24%; top: 18%;
  background: var(--accent);
  box-shadow: 0 0 48px rgba(216,255,62,.55);
  transition: transform .3s, opacity .3s;
}
.weather-visual .cloud {
  position: absolute;
  height: 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  filter: blur(.4px);
  transition: .3s;
}
.weather-visual .cloud::before, .weather-visual .cloud::after {
  content: "";
  position: absolute;
  bottom: 3px;
  border-radius: 50%;
  background: inherit;
}
.weather-visual .cloud::before { width: 22px; height: 22px; left: 10px; }
.weather-visual .cloud::after { width: 16px; height: 16px; right: 8px; }
.weather-visual .c1 { width: 74px; left: 12%; top: 46%; }
.weather-visual .c2 { width: 58px; right: 10%; top: 62%; opacity: .55; }
.rain-lines {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: repeating-linear-gradient(115deg, transparent 0 15px, rgba(120,220,255,.5) 16px 17px, transparent 18px 30px);
  background-size: 120px 120px;
  animation: rain .7s linear infinite;
  transition: opacity .3s;
}
.weather-visual.rainy .rain-lines { opacity: .6; }
.weather-visual.rainy .sun { opacity: .25; }
.weather-visual.rainy .cloud { background: rgba(255,255,255,.38); }
.weather-visual.night { background: linear-gradient(180deg, #080b16, #0b0d14); }
.weather-visual.night .sun { background: #dbe8ff; box-shadow: 0 0 30px rgba(190,215,255,.5); }
.weather-visual.wet .rain-lines { opacity: .35; }

.sliders { display: flex; flex-direction: column; gap: 13px; }
.sliders label { display: grid; grid-template-columns: 76px 1fr 46px; align-items: center; gap: 10px; }
.sliders label span { font-family: var(--mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sliders label b { font-family: var(--mono); font-size: 10px; font-weight: 500; text-align: right; color: var(--text); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(216,255,62,.45);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(216,255,62,.45);
  cursor: pointer;
}

/* forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  font-size: 12px;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field select:focus { border-color: rgba(216,255,62,.45); background: rgba(0,0,0,.3); }
.field select option { background: #111720; }
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.apply-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.dirty {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--orange);
  opacity: 0;
  transform: translateY(3px);
  transition: .2s;
}
.dirty.show { opacity: 1; transform: translateY(0); }

/* live */
.live-panel { display: flex; flex-direction: column; min-height: 310px; }
.leaderboard { display: flex; flex-direction: column; gap: 5px; }
.lb-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 62px 52px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.lb-row:first-child { border-color: rgba(216,255,62,.22); background: rgba(216,255,62,.05); }
.lb-pos { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lb-row:first-child .lb-pos { color: var(--accent); }
.lb-driver { min-width: 0; }
.lb-driver b { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-driver small { display: block; font-family: var(--mono); font-size: 8px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lb-best { font-family: var(--mono); font-size: 10px; text-align: right; color: var(--text); }
.lb-laps { font-family: var(--mono); font-size: 9px; text-align: right; color: var(--muted); }
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
}
.empty-mark { font-size: 28px; color: var(--accent); opacity: .6; margin-bottom: 8px; }
.empty-state p { margin: 0 0 4px; font-size: 13px; }
.empty-state span { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.live-conditions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cond { display: flex; flex-direction: column; gap: 3px; }
.cond span { font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: var(--muted-2); text-transform: uppercase; }
.cond b { font-family: var(--mono); font-size: 10px; font-weight: 500; }

/* terminal */
.terminal-panel { display: flex; flex-direction: column; }
.terminal-panel pre {
  flex: 1;
  margin: 0;
  min-height: 258px;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: rgba(0,0,0,.3);
  color: #aab4c5;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-panel pre::-webkit-scrollbar, .rotation-list::-webkit-scrollbar { width: 6px; height: 6px; }
.terminal-panel pre::-webkit-scrollbar-thumb, .rotation-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }

/* footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 2px 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 8, .72);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(600px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    linear-gradient(150deg, rgba(255,255,255,.05), transparent 42%),
    #0d1118;
  box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.modal-card h2 { margin: 0 0 10px; font-size: 42px; line-height: .95; letter-spacing: -.05em; }
.modal-lede { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 22px; }
.connect-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0,0,0,.2);
}
.connect-block span { font-family: var(--mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); min-width: 84px; }
.connect-block code { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--accent); overflow-wrap: anywhere; }
.connect-steps { margin: 22px 0 12px; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.connect-steps code, .modal-note code { font-family: var(--mono); font-size: 10px; color: var(--cyan); }
.connect-json {
  margin: 0 0 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,.3);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
}
.modal-note { color: var(--muted-2); font-size: 10px; line-height: 1.6; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border: 1px solid rgba(216,255,62,.3);
  border-radius: 999px;
  background: rgba(13,17,24,.92);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  box-shadow: 0 14px 40px rgba(0,0,0,.4);
  transition: .25s;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,106,61,.5); color: #ffb39e; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rain { to { background-position: -60px 120px; } }

/* -------------------------------------------------------------------------- */
/* responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding-top: 18px; }
  .hero-track { min-height: 520px; }
  .rotation-panel, .weekend-panel, .atmosphere-panel, .garage-panel, .live-panel, .terminal-panel { grid-column: span 12; }
  .rotation-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .live-panel { min-height: auto; }
}

@media (max-width: 760px) {
  .app { width: calc(100% - 26px); padding-top: 14px; }
  .topbar { align-items: flex-start; padding-bottom: 18px; }
  .topbar-right { gap: 7px; }
  .net-chip, .series-pill { display: none; }
  .brand { font-size: 12px; }
  .hero h1 { font-size: clamp(58px, 17vw, 92px); }
  .hero-track { min-height: 470px; border-radius: 22px; }
  .series-strip { margin-top: 24px; }
  .series-seg { min-width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .series-meta { min-width: 100%; }
  .rot-strip { grid-template-columns: 1fr 1fr; }
  .rot-strip .rot-count { grid-column: 1 / -1; }
  .panel-actions { flex-wrap: wrap; justify-content: flex-end; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .rotation-list { grid-template-columns: 1fr; max-height: 360px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .session-row { grid-template-columns: 34px minmax(60px, 1fr) 52px 56px 52px; }
  .weekend-foot, .rotation-foot { flex-wrap: wrap; }
  .footer { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 30px 24px; }
  .login h1 { font-size: clamp(58px, 18vw, 90px); }
  .login-input-row { flex-direction: column; }
  .live-conditions { grid-template-columns: repeat(3, 1fr); }
}
