/* Autorama de verdade: painel de cronometragem. Escuro, números tabulares, cor só onde informa
 * (cor da pista, melhor volta, estado). Sem fontes externas: funciona offline na mesa do autorama. */

:root {
  --bg: #0a0c0f;
  --panel: #10141a;
  --raised: #171c24;
  --line: #222934;
  --line-2: #323b49;
  --text: #e6e9ef;
  --muted: #8791a3;
  --dim: #566072;
  --green: #3fd37f;
  --red: #ff5d5d;
  --purple: #c18cff;
  --amber: #f5a524;
  --focus: #7fb0ff;
  --grid: #232a35;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-size: clamp(13px, min(1.15vw, 2vh), 20px);
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, #161b23 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.purple { color: var(--purple) !important; }
.green { color: var(--green) !important; }
.muted { color: var(--muted); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#screen-real { position: fixed; inset: 0; }
.app { height: 100%; display: flex; flex-direction: column; }

/* ---- barra de cima ---- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3.4rem;
  padding: 0 1rem;
  background: rgba(10, 12, 15, 0.9);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.brand b { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.18em; }
.brand-sub { color: var(--muted); font-size: 0.8rem; padding-left: 0.6rem; border-left: 1px solid var(--line-2); }
.brand-mark {
  width: 1.1rem; height: 1.1rem; border-radius: 0.15rem;
  background: conic-gradient(var(--text) 25%, #0a0c0f 0 50%, var(--text) 0 75%, #0a0c0f 0) 0 0 / 50% 50%;
  box-shadow: 0 0 0 1px var(--line-2);
}
.tabs { display: flex; gap: 0.15rem; margin-left: 1rem; height: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0 0.9rem; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 2rem; padding: 0 0.75rem;
  border: 1px solid var(--line); border-radius: 2rem; background: var(--panel);
  color: var(--muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--green); box-shadow: 0 0 0.5rem var(--green); }
.dot.bad { background: var(--red); }
.dot.wait { background: var(--amber); }

.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 2.3rem; padding: 0 0.95rem;
  border: 1px solid var(--line-2); border-radius: 0.45rem;
  background: var(--raised); color: var(--text);
  font-size: 0.88rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  touch-action: manipulation;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: #1f2630; border-color: #435063; }
.btn:active { background: #141922; }
.btn:disabled { opacity: 0.38; cursor: default; background: var(--raised); border-color: var(--line-2); }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--text); border-color: var(--text); color: #0a0c0f; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-icon { width: 2.3rem; padding: 0; }
.btn-icon.off { color: var(--red); }
.btn-sm { height: 1.85rem; padding: 0 0.6rem; font-size: 0.78rem; }
.danger { color: #ff8a8a; }
.btn-go {
  width: 100%; height: 3.1rem; margin-top: auto; flex: none;
  background: var(--green); border-color: var(--green); color: #04140a;
  font-size: 1rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.btn-go:hover { background: #5be496; border-color: #5be496; }
.btn-go.stop { background: transparent; border-color: var(--red); color: var(--red); }
.btn-go.stop:hover { background: rgba(255, 93, 93, 0.12); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 0.45rem; overflow: hidden; background: var(--panel); }
.seg-btn { height: 2.1rem; padding: 0 0.8rem; border: 0; border-right: 1px solid var(--line-2); background: none; color: var(--muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: #252d3a; color: var(--text); }

.switch { position: relative; width: 2.6rem; height: 1.5rem; flex: none; padding: 0; border: 1px solid var(--line-2); border-radius: 1.5rem; background: var(--raised); cursor: pointer; transition: background 0.15s; }
.switch i { position: absolute; top: 0.2rem; left: 0.2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch.on { background: rgba(63, 211, 127, 0.18); border-color: var(--green); }
.switch.on i { transform: translateX(1.1rem); background: var(--green); }

.slider { display: flex; align-items: center; gap: 0.7rem; }
.slider input { width: 11rem; accent-color: var(--text); }
.slider output { min-width: 3.2rem; text-align: right; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.select, .input {
  height: 2.3rem; padding: 0 0.7rem; min-width: 11rem; max-width: 100%;
  border: 1px solid var(--line-2); border-radius: 0.45rem; background: var(--panel); color: var(--text);
}
.input::placeholder { color: var(--dim); }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- corrida ---- */
.main { flex: 1 1 auto; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view-race {
  display: grid; grid-template-columns: minmax(0, 1fr) 27rem; gap: 1rem; padding: 1rem;
}
.col-cam { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 0.6rem; background: #000;
}
.stage-video, .stage-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-video { object-fit: contain; }
.stage-overlay { cursor: crosshair; touch-action: none; }
.stage-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  padding: 1.5rem; text-align: center; background: rgba(10, 12, 15, 0.88); color: var(--muted);
}
.stage-msg .ico { width: 2rem; height: 2rem; color: var(--dim); }
.stage-msg.bad .ico { color: var(--red); }
.stage-msg p { margin: 0; max-width: 28rem; }

.tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.2rem; }
.tool-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tool-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mark {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 2.1rem; padding: 0 0.8rem;
  border: 1px solid var(--line-2); border-radius: 0.45rem; background: var(--panel);
  color: var(--muted); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.mark i { width: 0.6rem; height: 0.6rem; border-radius: 0.15rem; background: var(--c); }
.mark:hover:not(:disabled) { color: var(--text); }
.mark.on { color: var(--text); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.mark:disabled { opacity: 0.4; cursor: default; }
.tool-sens input { width: 9rem; accent-color: var(--text); }
.hint { flex: none; margin: 0; font-size: 0.8rem; color: var(--muted); }

.col-race { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0.7rem; overflow-y: auto; scrollbar-width: thin; }
.board {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--panel);
}
.lights { display: flex; gap: 0.55rem; padding: 0.5rem 0.65rem; border-radius: 0.5rem; background: #05070a; border: 1px solid var(--line); }
.lights i { width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #2a1518; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); transition: background 0.06s; }
.lights i.on { background: #ff3b3b; box-shadow: 0 0 0.9rem rgba(255, 59, 59, 0.85); }
.lights i.go { background: var(--green); box-shadow: 0 0 0.9rem rgba(63, 211, 127, 0.85); }
.clock { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.clock-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.clock-value { font-family: var(--mono); font-size: 1.55rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }

.setup { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.racing .setup { display: none; }
.stepper { display: inline-flex; align-items: center; gap: 0.3rem; }
.stepper .btn-icon { width: 2.1rem; height: 2.1rem; }
.stepper-n { min-width: 5.4rem; text-align: center; font-family: var(--mono); font-size: 0.88rem; font-weight: 600; }

.lanes { flex: none; display: flex; flex-direction: column; gap: 0.7rem; }
.lane {
  display: flex; flex-direction: column; gap: 0.45rem; padding: 0.7rem 0.9rem 0.65rem;
  border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 0.6rem; background: var(--panel);
  transition: background 0.15s, box-shadow 0.15s;
}
.lane.lead { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.lane.flash { background: color-mix(in srgb, var(--c) 16%, var(--panel)); }
.lane.win { background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.lane-head { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.lane-no { width: 1.35rem; height: 1.35rem; flex: none; display: grid; place-items: center; border-radius: 0.25rem; background: var(--c); color: #0a0c0f; font-family: var(--mono); font-size: 0.78rem; font-weight: 800; }
.lane-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lane-tag { flex: none; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lane-tag.bad { color: var(--red); }
.lane-tag.ok { color: var(--green); }
.lane-tag.win { color: var(--c); }
.lane-main { display: flex; align-items: baseline; gap: 0.4rem; min-height: 2.9rem; }
.lane-time { font-family: var(--mono); font-size: 2.7rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lane-unit { color: var(--muted); font-size: 0.85rem; }
.lane-gap { margin-left: auto; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; color: var(--amber); }
.lane-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin: 0; padding-top: 0.45rem; border-top: 1px solid var(--line); }
.lane-stats dt { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lane-stats dd { margin: 0; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lane-laps { list-style: none; margin: 0; padding: 0; }
.racing .lane-laps { min-height: 3.7rem; } /* a lista não pula quando entra a primeira volta */
.lane-laps li { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: baseline; padding: 0.12rem 0; font-family: var(--mono); font-size: 0.84rem; font-variant-numeric: tabular-nums; border-top: 1px dashed var(--line); }
.lane-laps li:first-child { border-top: 0; }
.lane-laps .n, .lane-laps .d { color: var(--dim); }
.lane-meter { position: relative; height: 0.3rem; border-radius: 0.2rem; background: var(--line); overflow: hidden; }
.lane-meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); }
.lane-meter b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.lane-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }

.record { flex: none; display: flex; align-items: baseline; gap: 0.6rem; font-size: 0.82rem; color: var(--muted); }
.record b { font-family: var(--mono); font-size: 0.95rem; color: var(--purple); }
.record-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- páginas: histórico, recordes, ajustes ---- */
.view-history, .view-records, .view-settings { overflow-y: auto; scrollbar-width: thin; }
.page { width: min(66rem, 100%); margin: 0 auto; padding: 1.4rem 1rem 3rem; display: flex; flex-direction: column; gap: 1rem; }
.page h2 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.page-actions { display: flex; gap: 0.5rem; }
.note { margin: 0; padding: 0.55rem 0.8rem; border: 1px solid #5a4712; border-radius: 0.45rem; background: #231c0a; color: #f5c451; font-size: 0.85rem; }
.foot { margin: 0.4rem 0 0; color: var(--dim); font-size: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.card { padding: 0.9rem 1rem 0.5rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--panel); }
.card-title { margin: 0 0 0.3rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.card-title + .field { border-top: 0; }
.field-text { min-width: 0; flex: 1; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.field-hint { margin-top: 0.1rem; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.field > :last-child { flex: none; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding: 3.5rem 1rem; border: 1px dashed var(--line-2); border-radius: 0.6rem; color: var(--muted); text-align: center; }
.empty .ico { width: 2rem; height: 2rem; color: var(--dim); }
.empty p { margin: 0; }
.keys { margin: 0; padding-bottom: 0.4rem; }
.keys div { display: flex; align-items: center; gap: 0.8rem; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.keys div:first-child { border-top: 0; }
.keys dt { min-width: 4.5rem; font-family: var(--mono); font-size: 0.78rem; color: var(--text); }
.keys dd { margin: 0; color: var(--muted); font-size: 0.85rem; }

.hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.7rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--panel); }
.hero-label { flex: 1 0 100%; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hero-value { font-family: var(--mono); font-size: 3.2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-unit { color: var(--muted); }
.hero-who { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

.races { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.race { border: 1px solid var(--line); border-radius: 0.6rem; background: var(--panel); overflow: hidden; }
.race-row { width: 100%; display: grid; grid-template-columns: 14rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border: 0; background: none; text-align: left; cursor: pointer; }
.race-row:hover { background: var(--raised); }
.race-when { display: flex; flex-direction: column; min-width: 0; }
.race-when b { font-weight: 700; }
.race-when span { color: var(--muted); font-size: 0.8rem; }
.race-res { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; min-width: 0; }
.race-lane { display: inline-flex; align-items: baseline; gap: 0.5rem; font-size: 0.85rem; }
.race-lane span { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.race-row .ico { color: var(--dim); transition: transform 0.15s; }
.race.open .race-row .ico { transform: rotate(180deg); }
.race-detail { padding: 0.2rem 1rem 0.9rem; border-top: 1px solid var(--line); }
.race-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.7rem; }

/* ---- tabelas e gráfico ---- */
.detail { display: flex; flex-direction: column; gap: 0.9rem; }
.tbl-wrap { overflow-x: auto; }
.laps-wrap { max-height: 14rem; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th { padding: 0.45rem 0.5rem; text-align: left; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tbl td { padding: 0.5rem; border-top: 1px solid var(--line); }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .pos { width: 2.4rem; font-family: var(--mono); color: var(--muted); }
.tbl .who { display: flex; align-items: center; gap: 0.5rem; }
.tbl-laps th, .tbl-laps td { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.chip { width: 0.6rem; height: 0.6rem; flex: none; border-radius: 0.15rem; }
.badge { font-style: normal; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 0.25rem; background: #231c0a; border: 1px solid #5a4712; color: #f5c451; }
.chart { width: 100%; height: 11rem; }

/* ---- replay (foto-finish) e auto-sensibilidade ---- */
.modal-wide { width: min(56rem, 100%); }
.modal-narrow { width: min(32rem, 100%); }
.grow { flex: 1; }
.replay-stage { position: relative; border: 1px solid var(--line-2); border-radius: 0.5rem; overflow: hidden; background: #000; }
.replay-cv { display: block; width: 100%; height: auto; image-rendering: auto; }
.replay-msg { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 12, 15, 0.8); color: var(--muted); }
.replay-ctl { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0 0.4rem; flex-wrap: wrap; }
.replay-ctl input[type=range] { flex: 1 1 8rem; min-width: 6rem; accent-color: var(--text); }
.replay-clock { min-width: 5rem; text-align: right; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.replay-clock.hit { color: var(--amber); }
.auto-msg { margin: 0 0 0.8rem; color: var(--text); }
.prog { height: 0.35rem; border-radius: 0.25rem; background: var(--line); overflow: hidden; margin-bottom: 1rem; }
.prog i { display: block; height: 100%; width: 0; background: var(--text); }
.auto-row { display: grid; grid-template-columns: 7rem 1fr 3rem; align-items: center; gap: 0.7rem; padding: 0.35rem 0; }
.auto-row .lane-meter { height: 0.5rem; }
.auto-row.seen .auto-lab::after { content: " ✓"; color: var(--green); }
.auto-lab { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-val { text-align: right; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.auto-out { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.auto-out:empty { display: none; }
.auto-big { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.4rem; }
.auto-line { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); padding: 0.1rem 0; }

/* ---- resultado e avisos ---- */
.modal-back { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(4, 6, 9, 0.72); backdrop-filter: blur(4px); animation: fade 0.15s ease-out; }
.modal { width: min(46rem, 100%); max-height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 0.8rem; background: var(--panel); box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.6); animation: rise 0.18s ease-out; }
.modal-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem 0.8rem; }
.modal-kicker { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.modal h2 { margin: 0.1rem 0 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.modal-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 1.2rem 0.5rem; scrollbar-width: thin; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.8rem 1.2rem 1rem; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 1.4rem; z-index: 20; transform: translateX(-50%); padding: 0.55rem 1rem; border-radius: 0.45rem; background: var(--text); color: #0a0c0f; font-size: 0.85rem; font-weight: 600; box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.5); animation: rise 0.18s ease-out; transition: opacity 0.4s; }
.toast.out { opacity: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), 0.6rem); } }
.toast { --tx: -50%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- telas estreitas ou em pé (celular): tudo numa coluna, com rolagem ---- */
@media (max-aspect-ratio: 1/1), (max-width: 860px) {
  .view-race { display: block; overflow-y: auto; padding: 0.7rem; scrollbar-width: thin; }
  .col-cam { margin-bottom: 0.7rem; }
  .stage { flex: none; width: 100%; aspect-ratio: var(--ar, 4 / 3); max-height: 42vh; }
  .racing .stage { max-height: 26vh; }
  .col-race { overflow: visible; }
  .btn-go { position: sticky; bottom: 0.7rem; z-index: 2; margin-top: 0.3rem; box-shadow: 0 0 0 0.5rem var(--bg); }
  .grid-2 { grid-template-columns: 1fr; }
  .race-row { grid-template-columns: minmax(0, 1fr) auto; }
  .race-res { grid-column: 1 / -1; grid-row: 2; }
  .lane-time { font-size: 2.3rem; }
}
@media (max-width: 640px) {
  .brand-sub, .tab span, .pill span { display: none; }
  .tabs { margin-left: 0.3rem; }
  .tab { padding: 0 0.7rem; }
  .pill { padding: 0 0.6rem; }
  .field { flex-wrap: wrap; }
  .field > :last-child { flex: 1 1 100%; }
  .slider input { flex: 1; width: auto; }
  .select, .input { width: 100%; }
}
