/* T.T. Motorsports — shared styles (marshal screen + race control) */

:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-raise: #0f1115;
  --panel: #13161c;
  --panel-2: #1a1e26;
  --line: #242933;
  --line-2: #313744;
  --text: #f4f5f7;
  --muted: #a3abba;
  --faint: #6c7483;
  --red: #e10600;
  --red-hot: #ff2b1c;
  --red-deep: #7c0300;
  --amber: #ffb21a;
  --green: #1fd16b;
  --blue: #4b93ff;
  --radius: 16px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
  --checker: conic-gradient(#08090b 25%, #f4f5f7 0 50%, #08090b 0 75%, #f4f5f7 0);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(225, 6, 0, .2), transparent 62%),
    radial-gradient(800px 480px at -12% 112%, rgba(225, 6, 0, .09), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .014) 0 2px, transparent 2px 16px);
}
[hidden] { display: none !important; }
button { font: inherit; }
a { color: inherit; }

/* ---------- Brand & top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(8, 9, 11, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.checker {
  height: 10px;
  background: conic-gradient(#f4f5f7 25%, #0b0c0e 0 50%, #f4f5f7 0 75%, #0b0c0e 0) 0 0 / 10px 10px;
  opacity: .92;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.brand-logo {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55));
}
.brand-word { font: italic 800 21px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.brand-sub {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  color: var(--muted);
  font: 700 14px/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.bar-spacer { flex: 1; }
.race-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.race-chip span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.live-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.live-dot.live { background: var(--green); animation: pulse 2s infinite; }
.live-dot.reconnecting, .live-dot.polling { background: var(--amber); }
.live-dot.offline { background: var(--red-hot); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 209, 107, .55); }
  70% { box-shadow: 0 0 0 8px rgba(31, 209, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 209, 107, 0); }
}

/* ---------- Buttons & inputs ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: 700 16px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #46506a; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible, .finish-btn:focus-visible {
  outline: 3px solid rgba(255, 43, 28, .55);
  outline-offset: 2px;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--red-hot), var(--red));
  box-shadow: 0 10px 28px rgba(225, 6, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { border-color: transparent; filter: brightness(1.06); }
.btn-go {
  border-color: transparent;
  background: linear-gradient(180deg, #34e07f, #16b85b);
  color: #03140a;
  box-shadow: 0 8px 22px rgba(31, 209, 107, .25), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-go:hover { border-color: transparent; filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger { background: #a40d05; border-color: transparent; }
.btn-danger:hover { background: #c01208; border-color: transparent; }
.btn-sm { padding: 9px 12px; font-size: 14px; border-radius: 10px; }
.btn-xl {
  width: 100%;
  padding: 20px 24px;
  border-radius: 16px;
  font-size: clamp(26px, 6.6vw, 36px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: .1em;
}

.field { display: grid; gap: 8px; }
.field label, .label {
  display: block;
  color: var(--muted);
  font: 700 12px/1.2 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field .hint { color: var(--faint); font-size: 13px; line-height: 1.4; }
.input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  outline: none;
  background: var(--bg-raise);
  color: var(--text);
  font: 600 18px/1.3 var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { resize: vertical; min-height: 140px; font-weight: 500; font-size: 16px; }
.input::placeholder { color: var(--faint); font-weight: 500; }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(225, 6, 0, .22); }
.input-sm { padding: 9px 12px; font-size: 15px; border-radius: 10px; }
.select {
  appearance: none;
  max-width: 100%;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a3abba' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font: 600 15px/1.2 var(--font);
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--red); }
.select-lg { padding: 14px 40px 14px 14px; font-size: 18px; border-radius: 12px; }

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(255, 178, 26, .35);
  border-radius: 12px;
  background: rgba(255, 178, 26, .09);
  color: #ffd27a;
  font-weight: 500;
}
.notice.error { border-color: rgba(255, 60, 40, .4); background: rgba(255, 43, 28, .1); color: #ff9d92; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 80;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #1d222b;
  box-shadow: var(--shadow);
  font-weight: 600;
}
.toast.error { border-color: rgba(255, 60, 40, .5); color: #ffb3aa; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); border-color: #46506a; }
.icon-btn.danger:hover { color: #ff8a80; border-color: rgba(255, 60, 40, .5); }
.icon-btn.finish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 12px;
  border-color: transparent;
  background: #f4f5f7;
  color: #08090b;
  font: 700 13px/1 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.icon-btn.finish:hover { background: #fff; color: #08090b; }

.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; }
.seg button {
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 13px/1 var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--text); color: #08090b; }

.comp-badge {
  flex: none;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--text);
  color: #08090b;
  transform: skewX(-10deg);
  font: italic 800 20px/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.driver-name {
  min-width: 0;
  overflow: hidden;
  font: 700 21px/1.15 var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font: 700 12px/1 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ready { background: rgba(163, 171, 186, .12); color: var(--muted); }
.pill.countdown { background: rgba(255, 178, 26, .14); color: var(--amber); }
.pill.running { background: rgba(75, 147, 255, .16); color: #93bdff; }
.pill.running::before { animation: blink 1s steps(2, start) infinite; }
.pill.finished { background: rgba(31, 209, 107, .14); color: var(--green); }
@keyframes blink { to { visibility: hidden; } }

/* Race #: how many times the driver has raced */
.run-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 178, 26, .45);
  border-radius: 999px;
  color: var(--amber);
  font: 700 12px/1.2 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mobile { color: var(--muted); font-variant-numeric: tabular-nums; }

.section-title {
  margin: 0;
  font: 700 18px/1 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.section-head .grow { flex: 1; }
.count-tag { color: var(--muted); font-weight: 600; }
.empty {
  padding: 18px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  color: var(--muted);
}

/* ---------- Start lights (marshal screen) ---------- */

.lights-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 14px 16px;
  border: 1px solid #3a1310;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, #220a07, #070708 75%);
  text-align: center;
}
.cd-driver { color: var(--muted); font: 700 16px/1.3 var(--display); letter-spacing: .12em; text-transform: uppercase; overflow-wrap: anywhere; }
.lights {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 14px);
  padding: 12px 16px;
  border: 1px solid #23262d;
  border-radius: 18px;
  background: #0c0d10;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .7), 0 16px 40px rgba(0, 0, 0, .5);
}
.light {
  width: clamp(30px, 9vw, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #2b2e35, #121317 70%);
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .6);
  transition: background .06s linear, box-shadow .06s linear;
}
.light.on {
  background: radial-gradient(circle at 35% 32%, #ff8a7e, #ff1f0f 42%, #8a0400 100%);
  box-shadow: 0 0 22px 5px rgba(255, 30, 10, .55), inset 0 -4px 10px rgba(0, 0, 0, .3);
}
.light.go {
  background: radial-gradient(circle at 35% 32%, #b5ffd2, #1fd16b 42%, #075f2c 100%);
  box-shadow: 0 0 22px 5px rgba(31, 209, 107, .55), inset 0 -4px 10px rgba(0, 0, 0, .3);
}
.count-num {
  margin: 2px 0;
  font: italic 800 clamp(96px, min(28vw, 20vh), 190px)/.9 var(--display);
  font-variant-numeric: tabular-nums;
}
.count-num.ready { font-size: clamp(48px, min(14vw, 11vh), 96px); color: var(--muted); letter-spacing: .06em; }
.count-num.go { color: var(--green); text-shadow: 0 0 40px rgba(31, 209, 107, .55); }
.count-num.pop { animation: pop .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(1.35); opacity: .3; } to { transform: scale(1); opacity: 1; } }
.count-label { color: var(--muted); font: 700 13px/1 var(--font); letter-spacing: .22em; text-transform: uppercase; }

/* ---------- Marshal screen ---------- */

.view-switch { display: none; padding: 14px 16px 0; justify-content: center; }
.view-switch .seg { width: 100%; max-width: 480px; }
.view-switch .seg button { flex: 1; padding: 13px 10px; font-size: 14px; }
.view-switch .badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.marshal-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}
.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.panel-sub { margin: 6px 0 0; color: var(--muted); font: 700 14px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }

.add-row { display: flex; align-items: stretch; gap: 10px; }
.add-row .select { flex: 1; min-width: 0; }
.race-no {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  width: 72px;
  padding: 4px 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2);
}
.race-no span { color: var(--muted); font: 700 10px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; }
.race-no input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 800 24px/1.1 var(--display);
  text-align: center;
}
.race-no:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .22); }
.race-no input:disabled { color: var(--faint); }

.grid-list, .track-list, .recent-list { display: grid; gap: 10px; }
.grid-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-raise);
}
.grid-info { display: grid; flex: 1; gap: 4px; min-width: 0; }
.grid-info .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.grid-row .btn-go { padding: 14px 18px; font-size: 18px; }

.track-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: var(--bg-raise);
}
.track-row.countdown { border-left-color: var(--amber); }
.track-info { display: grid; gap: 4px; min-width: 0; }
.name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.track-time { font: 800 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.track-time.wait { color: var(--amber); font-size: 26px; }
.finish-btn {
  position: relative;
  min-width: 132px;
  min-height: 68px;
  padding: 0 18px 0 34px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #f4f5f7;
  color: #08090b;
  font: italic 800 26px/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease;
}
.finish-btn::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  background: var(--checker) 0 0 / 10px 10px;
}
.finish-btn:active { transform: scale(.97); }
.finish-btn:disabled { opacity: .55; cursor: progress; }

.recent-row {
  display: grid;
  grid-template-columns: 44px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.recent-row:last-child { border-bottom: 0; }
.recent-row .comp-badge { font-size: 15px; padding: 4px 7px; }
.recent-row .driver-name { font-size: 17px; }
.recent-time { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- Race control ---------- */

.admin-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}
.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.control { display: grid; gap: 6px; min-width: 0; }
.control .label { margin: 0; font-size: 11px; }
.control-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#raceSelect { min-width: 240px; }
.open-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(31, 209, 107, .12);
  color: var(--green);
  font: 700 13px/1 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.open-badge svg { width: 15px; height: 15px; }
.share { margin-left: auto; display: grid; gap: 6px; min-width: 0; }
.share a { overflow: hidden; color: var(--text); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.kpi .label { margin: 0; font-size: 11px; }
.kpi-value { font: 800 36px/1 var(--display); font-variant-numeric: tabular-nums; }
.kpi-sub { overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }

.ontrack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.ontrack-grid > .empty { grid-column: 1 / -1; }
.track-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: var(--panel);
}
.track-card.countdown { border-left-color: var(--amber); }
.track-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-top .comp-badge { font-size: 18px; padding: 5px 8px; }
.track-card .track-time { font-size: 50px; }
.track-card .track-time.wait { font-size: 30px; }
.track-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.track-actions .btn-finish-sm { flex: 1; border: 0; background: #f4f5f7; color: #08090b; }
.track-actions .btn-finish-sm:hover { background: #fff; }

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
table.standings { width: 100%; min-width: 920px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  font: 700 11px/1.2 var(--font);
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.standings td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.standings tr.st-running td, .standings tr.st-countdown td { background: rgba(75, 147, 255, .05); }
.standings .num { text-align: right; }
.standings .driver { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.standings .clock { color: var(--muted); }
.standings .time { font: 700 19px/1 var(--display); }
.standings .net { font: 800 20px/1 var(--display); }
.standings .net.neg { color: #ff8a80; }
.standings .comp { color: var(--muted); font-weight: 600; }
.standings .run { font: 800 20px/1 var(--display); color: var(--amber); }
.standings .dash { color: var(--faint); }
.standings .tag { color: var(--muted); font: 700 13px/1 var(--font); letter-spacing: .08em; }

.row-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ---------- Sign-in ---------- */

.login-wrap { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-card {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.login-head { display: grid; justify-items: center; gap: 10px; margin-bottom: 4px; text-align: center; }
.login-logo { display: block; width: 120px; height: 120px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .6)); }
.login-card h1 { margin: 4px 0 0; font: italic 800 40px/1 var(--display); text-transform: uppercase; }
.login-card p { margin: 0; color: var(--muted); }

/* ---------- Dialog ---------- */

.modal {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.modal form { display: grid; gap: 16px; padding: 22px; }
.modal h3 { margin: 0; font: 800 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.modal p { margin: 0; color: var(--muted); white-space: pre-line; }
.modal .select { width: 100%; padding: 12px 38px 12px 12px; font-size: 16px; }
.modal-fields { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share { margin-left: 0; width: 100%; }
  .marshal-main { grid-template-columns: minmax(0, 1fr); }
  .view-switch { display: flex; }
  .marshal-main[data-view="start"] .finish-panel,
  .marshal-main[data-view="finish"] .start-panel { display: none; }
}
@media (max-width: 560px) {
  .brand-word, .btn-label { display: none; }
  .brand-logo { width: 40px; height: 40px; }
  #raceSelect { min-width: 0; width: 100%; }
  .control { width: 100%; }
  .kpi-value { font-size: 30px; }
  .track-row { gap: 10px; padding: 10px; }
  .track-row > .comp-badge { font-size: 16px; padding: 5px 7px; }
  .track-time { font-size: 32px; }
  .finish-btn { min-width: 112px; min-height: 62px; padding: 0 12px 0 28px; font-size: 22px; }
  .finish-btn::before { width: 16px; background-size: 8px 8px; }
  .grid-row .btn-go { padding: 13px 14px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .count-num.pop, .live-dot.live, .pill.running::before { animation: none; }
}
