/* Egységes megjelenés a menükhöz és a kijelzőkhöz. A style.css elrendezéseire épül. */
:root {
  --panel: rgba(11, 15, 24, 0.8);
  --card: rgba(14, 19, 30, 0.94);
  --surface: rgba(255, 255, 255, 0.045);
  --line: rgba(148, 170, 210, 0.16);
  --line-strong: rgba(148, 170, 210, 0.32);
  --muted: #9aa8bf;
  --red-dark: #a70713;
  --radius: 14px;
  --glow: 0 0 0 3px rgba(255, 209, 102, 0.28);
}

/* ---------- Vezérlők ---------- */
button {
  border-color: var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 10px; transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); border-color: var(--line-strong); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: linear-gradient(135deg, #ff2b1f, var(--red-dark)); border-color: transparent; box-shadow: 0 6px 18px rgba(225, 6, 0, 0.28); }
button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #ff4a3d, #c40a17); }
button.primary:disabled { box-shadow: none; filter: grayscale(0.7); }
button.ghost { background: transparent; }
button.big { border-radius: 12px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: var(--glow); border-color: var(--accent); }
input, select {
  background: rgba(7, 11, 20, 0.75); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--line-strong); }
select:disabled, input:disabled { opacity: 0.55; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--red); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--red); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--red); width: 17px; height: 17px; }
input.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px; height: 24px; margin: 0; padding: 0;
  border-radius: 12px; background: rgba(255, 255, 255, 0.16); cursor: pointer; transition: background 0.2s;
}
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
input.switch:checked { background: var(--red); }
input.switch:checked::after { transform: translateX(20px); }

/* ---------- Kártyák, fejlécek ---------- */
body.in-menu #menu .screen:not([data-screen="main"]) { background: radial-gradient(circle at 20% 0%, rgba(225, 6, 0, 0.14), transparent 55%); }
.card {
  position: relative; border-radius: 20px; padding: 22px 26px; border-color: var(--line);
  background: linear-gradient(165deg, rgba(23, 30, 46, 0.96), rgba(11, 15, 25, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card::before { content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--red), var(--accent), transparent); }
.screen.active .card, .modal.show .card { animation: rise 0.22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .screen.active .card, .modal.show .card { animation: none; } }
.card header { gap: 16px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card header h2 { font-size: 24px; font-style: italic; font-weight: 800; letter-spacing: -0.01em; }
.card footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); align-items: center; }
h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 18px 0 10px; }
h3::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--red); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); }
.tabs button.on, .tabs button.on:hover { background: var(--red); color: #fff; }

/* ---------- Listák, táblák, csapatok ---------- */
.track-card canvas { background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)); border: 1px solid var(--line); border-radius: var(--radius); }
.team { position: relative; border-radius: var(--radius); background: var(--surface); transition: transform 0.15s, border-color 0.15s; }
.team:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.team.chosen { border-color: var(--accent); border-top-color: var(--team); background: rgba(255, 209, 102, 0.08); }
.edit-team { width: 100%; margin-top: 7px; padding: 6px; font-size: 12px; border-color: var(--accent); color: var(--accent); }
.meter i { background: linear-gradient(90deg, var(--red), var(--accent)); }
#rooms li, #members li { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.chatlog { border: 1px solid var(--line); border-radius: 11px; }
th { text-transform: uppercase; font-size: 11px; letter-spacing: 0.07em; }
tr:hover td { background: rgba(255, 255, 255, 0.03); }
.tile, .offer, .upgrade, .trophy-card { border-radius: var(--radius); }
.shop { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); }
#livery-preview, #editor-preview { border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Beállítások ---------- */
.groups { display: grid; grid-template-columns: 1fr; gap: 12px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 6px; }
.group h3 { margin: 12px 0 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.group h3 + .row { border-top: 0; }
.row > span { display: flex; flex-direction: column; gap: 2px; }
.row b { font-size: 14px; }
.row small { color: var(--muted); font-size: 12px; }
.row select, .row input:not(.switch), .row button { width: 200px; flex: none; }

/* ---------- Segítség ---------- */
.keygrid, .infogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.keycard, .info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.keycard { display: flex; flex-direction: column; gap: 3px; }
.keycard small { color: var(--muted); font-size: 12px; }
.keys { display: flex; gap: 6px; margin-bottom: 8px; }
kbd {
  min-width: 38px; padding: 8px 10px; text-align: center; font: 800 14px/1 "Segoe UI", system-ui, sans-serif;
  border: 1px solid var(--line-strong); border-bottom-width: 4px; border-radius: 8px; background: linear-gradient(180deg, #2b364f, #1a2235);
}
.info .icon { font-size: 26px; }
.info h4 { margin: 8px 0 4px; font-size: 15px; }
.info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- Versenyhétvége ---------- */
.calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.calendar li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.calendar small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.calendar span { font-size: 12px; font-weight: 700; color: var(--accent); min-height: 17px; }
.calendar li.now { border-color: var(--red); background: rgba(225, 6, 0, 0.16); }
.calendar li.past { opacity: 0.75; }
.calendar .met { color: #06d6a0; }
.calendar .missed { color: #ff6b81; }
.objective {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 16px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: linear-gradient(110deg, rgba(255, 209, 102, 0.14), rgba(225, 6, 0, 0.08));
}
.objective > div:first-child { display: flex; flex-direction: column; gap: 9px; }
.objective > div:first-child b { font-size: 19px; }
.heat { display: flex; gap: 3px; }
.heat i { width: 20px; height: 7px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
.heat i.on { background: linear-gradient(90deg, var(--accent), var(--red)); }
.stakes { display: flex; gap: 8px; flex-wrap: wrap; }
.stakes .tile b { font-size: 18px; white-space: nowrap; }
.stakes .plus b { color: #7ee8a7; }
.stakes .minus b { color: #ff6b81; }
.stakes .budget b { color: var(--accent); }
#hub-wait { margin: 0 auto 0 0; }
body.hub-open #results, body.hub-open #hud, body.hub-open #ceremony, body.hub-open #announcer { display: none; }

/* ---------- Ablakok, belépés, szerkesztő ---------- */
.modal { position: fixed; inset: 0; display: none; overflow: auto; padding: 18px; z-index: 15; background: rgba(4, 7, 12, 0.78); }
.modal.show { display: flex; }
#editor-saved li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 10px; }
#editor-saved li.note { border: 0; padding: 0; }
#editor-saved .name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
#editor-saved button { padding: 4px 10px; font-size: 12px; }
#editor-preview { width: 100%; height: auto; display: block; background: #2a303b; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#gate { z-index: 30; background: linear-gradient(120deg, rgba(5, 8, 14, 0.95), rgba(40, 6, 12, 0.88)); }
.gate-box { margin: auto; width: min(420px, 100%); }
.gate-box .logo { margin-bottom: 16px; }
#gate-form { display: flex; flex-direction: column; gap: 6px; }
#gate-form .field { font-size: 13px; }
#gate-error { margin: 2px 0; min-height: 18px; color: #ff8a98; font-size: 13px; font-weight: 700; }
#gate-local { width: 100%; }
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Főmenü és profil ---------- */
.account-line { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.account-line button { padding: 4px 10px; font-size: 12px; }
.db-history { margin-top: 6px; }

/* ---------- Story mód ---------- */
.story-start p { color: var(--muted); line-height: 1.55; max-width: 70ch; }
.story-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.story-side { display: flex; flex-direction: column; gap: 10px; }
.story-team { display: flex; flex-direction: column; padding: 10px 14px; border-left: 5px solid; border-radius: 10px; background: var(--surface); }
.story-team small, .kicker { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.story-stat { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 12px; color: var(--muted); }
.story-stat b { color: var(--text); }
.story-stat .meter { grid-column: 1 / -1; display: block; height: 5px; }
.story-stat .meter i { transition: width 0.4s; }
.story-road li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-left: 2px solid var(--line); font-size: 12px; color: var(--muted); }
.story-road li.now { border-color: var(--red); color: var(--text); font-weight: 700; }
.story-road li.past { border-color: var(--accent); }
.story-road .met { color: #06d6a0; }
.story-road .missed { color: #ff6b81; }
.story-stage { display: flex; flex-direction: column; min-width: 0; }
.story-stage h4 { margin: 2px 0 12px; font-size: 22px; font-style: italic; }
.dialog { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; padding-right: 6px; scroll-behavior: smooth; }
.bubble { display: flex; gap: 10px; align-items: flex-start; max-width: 88%; animation: rise 0.25s ease-out; }
.bubble .avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; border: 2px solid rgba(255, 255, 255, 0.35); }
.bubble > div { padding: 9px 13px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--surface); }
.bubble small { color: var(--accent); font-size: 11px; font-weight: 700; }
.bubble p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; }
.bubble.me { flex-direction: row-reverse; align-self: flex-end; }
.bubble.me > div { border-radius: 14px 4px 14px 14px; background: rgba(225, 6, 0, 0.16); }
.story-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.story-controls .choice { flex: 1 1 200px; text-align: left; padding: 12px 14px; border-color: var(--accent); }
.briefing { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.briefing.success { border-color: #06d6a0; background: rgba(6, 214, 160, 0.09); }
.briefing.failure { border-color: #ff6b81; background: rgba(255, 107, 129, 0.08); }
.briefing p { margin: 6px 0; }
.briefing .goal { font-size: 17px; font-weight: 800; }
.briefing .bonus { color: var(--accent); }
.briefing .place { font-size: 40px; font-weight: 900; font-style: italic; }
@media (max-width: 760px) {
  .story-layout { grid-template-columns: 1fr; }
  .story-side { order: 2; }
}

/* ---------- Futam közbeni panelek és eredmények ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); }
#hud {
  --hud-surface: #131b27;
  --hud-inset: #0b111a;
  --hud-line: #303c4d;
  --hud-highlight: #ffd166;
}
#hud .panel {
  background: var(--hud-surface);
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 5px 16px #0005;
  font-variant-numeric: tabular-nums;
}
#race-title, .hud-clock > span, .lap-count > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
#pos-row { margin-top: 5px; align-items: center; }
#pos { font-size: 38px; letter-spacing: -.055em; }
#pos-total { align-self: end; margin: 0 0 4px 1px; font-size: 12px; }
.lap-count {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 1px;
  border-left: 1px solid var(--hud-line);
  padding-left: 10px;
}
#lap { font-size: 17px; line-height: 1.05; }
#standings { margin-top: 7px; }
#standings li { height: 21px; border-radius: 3px; }
#standings li:nth-child(odd) { background: #ffffff06; }
#standings li.focus {
  background: #ffd1661c;
  box-shadow: inset 2px 0 var(--hud-highlight);
  color: var(--hud-highlight);
}
#standings .idx { text-align: center; }
#standings .gap { width: 52px; }
#standings .gap.inpit { background: #63caff26; border-radius: 3px; padding-right: 4px; }
#standings .gap.out { color: #ff8590; }
.hud-clock { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
#timer { font-size: clamp(20px, 3vw, 29px); line-height: 1.1; letter-spacing: -.055em; }
.hud-lap-times { margin-top: 8px; border-top: 1px solid var(--hud-line); padding-top: 5px; }
.hud-lap-times .split { display: flex; justify-content: space-between; gap: 4px; line-height: 1.55; }
.hud-lap-times .split:last-child b { color: var(--hud-highlight); }
#sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 7px 0; }
#sectors > span { display: grid; justify-items: center; gap: 2px; border-radius: 4px; background: var(--hud-inset); padding: 4px 1px; font-size: 10px; }
#sectors b { font-size: 11px; }
#minimap {
  width: 100%;
  height: auto;
  background: radial-gradient(ellipse at center, #1b2735, var(--hud-inset) 75%);
  border: 1px solid #ffffff0e;
}
#ping:not(:empty) { margin-top: 5px; }
#hud .bar { background: #ffffff16; height: 5px; border-radius: 2px; }
#hud .bar > div { border-radius: inherit; }
#hud .bar-label { text-transform: uppercase; letter-spacing: .05em; }
#hud .bar-label i { text-transform: none; letter-spacing: 0; }
#bottomright {
  position: fixed; right: 12px; bottom: 12px;
  display: flex; gap: 6px; align-items: stretch;
  font-variant-numeric: tabular-nums;
}
#bottomright .panel { position: static; padding: 12px; border-radius: 9px; }
#carstatus { width: 256px; }
body.spectating #carstatus { display: none; }
.status-row { display: flex; align-items: center; gap: 9px; }
.status-row .bar-label { margin-top: 0; }
.status-row .grow { flex: 1; }
#tyre-letter {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px;
  border: 3px solid var(--hud-highlight); border-radius: 50%;
  background: var(--hud-inset); font-weight: 800;
}
#carstatus .damage {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px; margin-top: 8px; font-size: 11px; color: var(--muted);
}
#carstatus .damage > span {
  display: grid; gap: 2px; padding: 4px 7px;
  background: var(--hud-inset); border-radius: 4px;
}
#carstatus .damage b { font-size: 12px; }
.boxrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
#next-tyre { display: flex; gap: 4px; }
#next-tyre button {
  width: 30px; height: 30px; padding: 0; border-radius: 5px;
  border: 1px solid var(--c); color: var(--c); background: var(--hud-inset);
  font-size: 12px; font-weight: 800;
}
#next-tyre button:hover:not(.on) { background: #273344; }
#next-tyre button.on { color: #101620; background: var(--c); }
#btn-pit {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px;
  padding: 3px 7px; border-color: #47718a; border-radius: 5px;
  background: #183341; font-size: 11px; font-weight: 800; text-transform: uppercase;
}
#bottomright kbd {
  min-width: 0; padding: 2px 4px; border: 1px solid var(--hud-line);
  border-radius: 3px; background: var(--hud-inset); color: var(--muted);
  font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1.2;
}
#speedo { width: 166px; }
.drive-gauge {
  --rpm-angle: 0deg;
  --boost-angle: 0deg;
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 49%, #1b263b 3%, #0c1320 73%);
  border: 1px solid #61779a42;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.gauge-arc {
  position: absolute;
  border-radius: 50%;
  background: conic-gradient(from 235deg, var(--arc-color) 0deg var(--arc-angle),
    #3b4860 var(--arc-angle) 250deg, transparent 250deg);
  mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--arc-weight)), #000 calc(100% - var(--arc-weight) + 1px));
}
.rpm-arc { inset: 12px; --arc-weight: 7px; --arc-angle: var(--rpm-angle); --arc-color: #52df8a; }
.boost-arc { inset: 3px; --arc-weight: 5px; --arc-angle: var(--boost-angle); --arc-color: #459fff; }
.drive-gauge.boosting .boost-arc { --arc-color: #92e8ff; }
.drive-gauge.boosting { box-shadow: 0 0 14px #4fc4ff62; }
.gauge-center {
  position: absolute;
  inset: 22% 17% auto;
  display: grid;
  justify-items: center;
  text-align: center;
}
#speed { font-size: 37px; font-weight: 850; letter-spacing: -.055em; line-height: .96; }
.gauge-unit, .gauge-gear span, .gauge-boost > span {
  color: #b7c4d9;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.gauge-unit { margin-top: 4px; }
.gauge-gear { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
#gear { color: var(--accent); font-size: 19px; line-height: 1; }
.gauge-boost { position: absolute; inset: auto 0 8px; display: flex; justify-content: center; align-items: center; gap: 4px; }
.gauge-boost b { color: #89ceff; font-size: 10px; }
#bottomright .gauge-boost kbd { padding: 1px 3px; font-size: 8px; }
#pit-state {
  padding: 5px 7px; border-radius: 4px; font-size: 11px; font-weight: 700;
}
#pit-state { margin-top: 6px; background: #5ad1ff17; color: #8cdeff; }
#pit-state:empty { display: none; }
@media (max-width: 900px) {
  .hud-clock { flex-wrap: wrap; }
  #timer { margin-left: auto; }
}
@media (max-height: 540px) {
  #minimap { max-height: 105px; object-fit: contain; }
}
#results { border-radius: 20px; border-top: 3px solid var(--red); background: linear-gradient(165deg, rgba(23, 30, 46, 0.96), rgba(11, 15, 25, 0.96)); }
#results h2 { font-style: italic; }

@media (max-width: 620px) {
  .card { padding: 18px 16px; }
  .row { flex-wrap: wrap; }
  .row select, .row input:not(.switch), .row button { width: 100%; }
}

/* ---------- Keskeny képernyő: semmi ne lógjon ki ---------- */
.settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field select, .field input { width: 100%; max-width: 100%; }
.sector-table th { white-space: normal; width: auto; letter-spacing: 0; }
@media (max-width: 560px) {
  .sector-table th, .sector-table td { padding: 3px; font-size: 11px; }
  .columns.two > div { overflow-x: auto; }
}

/* ---------- Érintős irányítás ---------- */
#touch { display: none; }
body.touch #touch { display: block; }
body.spectating #touch .left, body.spectating #touch .right, body.ceremony #touch { display: none; }
#touch .pad { position: fixed; display: flex; gap: 10px; align-items: flex-end; z-index: 3; }
#touch .left { left: 12px; bottom: 14px; }
#touch .right { right: 12px; bottom: 14px; }
#touch .tools { left: 50%; bottom: 14px; transform: translateX(-50%); gap: 6px; }
#touch button { width: 70px; height: 70px; padding: 0; border-radius: 50%; font-size: 26px; background: var(--panel); touch-action: none; -webkit-touch-callout: none; }
#touch button.gas { height: 96px; border-radius: 36px; border-color: #06d6a0; }
#touch button.small { width: 56px; height: 56px; font-size: 20px; }
#touch .tools button { width: 40px; height: 40px; font-size: 16px; }
#touch button.down { background: var(--red); }
body.touch #bottomright { bottom: auto; top: 46%; }
@media (max-height: 540px) {
  body.touch #bottomright {
    top: auto; bottom: 108px;
    zoom: min(calc(var(--hud-scale, 1) * 0.62), 0.68);
  }
}

/* ---------- Keskeny kijelző futam közben ---------- */
@media (max-width: 720px) {
  #tower, #topright, #bottomright { zoom: calc(var(--hud-scale, 1) * 0.62); }
  #gaps, #ping, #setup-info { display: none; }
  #bottomright { zoom: min(calc(var(--hud-scale, 1) * 0.62), 0.68); }
  #announcer { top: auto; bottom: 34%; font-size: 12px; }
  #radio { bottom: 27%; font-size: 12px; }
  #flag { top: auto; bottom: 41%; font-size: 12px; white-space: normal; width: max-content; max-width: 90vw; }
  #overtake { top: 38%; }
  #center { font-size: 40px; white-space: normal; width: 90vw; }
  body:not(.touch) #bottomright { bottom: 8px; right: 8px; }
  body.touch #bottomright { top: auto; bottom: 111px; right: 8px; }
  body.touch #touch .tools { bottom: 128px; }
  #touch button { width: 62px; height: 62px; }
  #touch .pad { gap: 6px; }
  #touch button.gas { height: 86px; }
}

/* A Segítség kártyafelületei a versenymenükben és a műszerfalon. */
.menu-block, .race-options, .result-finisher {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.menu-block { padding: 14px; align-self: start; }
.menu-block > h3:first-child { margin-top: 0; }
details > summary { cursor: pointer; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.race-options { grid-column: 1 / -1; padding: 8px 10px; }
.race-options > summary, .editor-fields summary { font-size: 13px; font-weight: 750; }
.race-options .settings { margin-top: 9px; }
.race-setup .track-card canvas {
  display: block;
  max-height: 146px;
  object-fit: contain;
  background: radial-gradient(ellipse at 50% 40%, #31405b, #121a2a 76%);
}
.race-setup .track-name { margin-top: 9px; }
.race-setup .track-tag { line-height: 1.35; }
.race-setup select, .editor-fields select, .editor-fields input:not([type="range"]) {
  min-height: 35px;
  padding: 6px 9px;
}
:is([data-screen="race"], [data-screen="champ"], [data-screen="lobby"]) .teams {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  align-items: start;
}
.team-head b { overflow-wrap: anywhere; }
.team-details { margin-top: 5px; padding: 2px 0; font-size: 11px; color: var(--muted); }
.team-details .stats { margin: 5px 0 0; }
.team-details .meter i { background: linear-gradient(90deg, var(--team), var(--accent)); }
.team .edit-team { margin-top: 3px; }
.team .seat { min-height: 28px; }
.team .seat.selected, .team .seat.selected:hover {
  background: var(--red);
  border-color: #ffaba2;
}
[data-screen="lobby"] .lobby-layout {
  grid-template-columns: minmax(205px, 0.85fr) minmax(225px, 1fr) minmax(0, 2fr);
  align-items: start;
}
#lobby-sub { color: var(--muted); font-size: 13px; }
#lobby-title { overflow-wrap: anywhere; }
.lobby-social .chatlog { height: clamp(95px, 17vh, 156px); }
.lobby-social #chat-input { min-width: 0; flex: 1; }
.lobby-social #chat-form { display: flex; flex-wrap: nowrap; gap: 5px; }
.lobby-social #chat-form button { padding-inline: 8px; }

#editor .card { width: min(940px, 100%); }
#editor .editor-layout { grid-template-columns: minmax(250px, 1fr) minmax(0, 1.2fr); gap: 14px; }
.editor-fields { display: grid; align-content: start; gap: 8px; }
.editor-fields .field { margin-top: 6px; min-width: 0; }
.editor-fields details[open] > summary { margin-bottom: 8px; }
#editor-preview { background: radial-gradient(ellipse at 50% 55%, #3a4760, #182030 75%); }
#editor-state { min-height: 0; margin-bottom: 0; }

.profile-rank {
  margin-bottom: 12px;
  background: radial-gradient(ellipse at 0% 0%, #ffd16619, transparent 52%), var(--surface);
}
.profile-rank > .meter { display: block; height: 5px; }
.profile-rank .tiles { margin-bottom: 0; }
.profile-rank .tile { padding: 7px 9px; }
#profile-body .trophies { grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); }
#profile-body .trophy-card { padding: 10px 8px; }
#profile-body .trophy-card.got { background: radial-gradient(ellipse at top, #ffd16627, #ffffff06); }
#profile-body .trophy-card .icon { font-size: 23px; }
#profile-records { margin-top: 0; }
#profile-history li { padding-block: 7px; }

#results {
  width: min(680px, calc(100vw - 24px));
  max-height: min(780px, 92dvh);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(9px);
}
#results::before, #hud .panel::before {
  content: "";
  position: absolute;
  inset: 0 12px auto;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--red), var(--accent), transparent);
  pointer-events: none;
}
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
#results-position { text-align: right; flex: none; }
#results-position b { color: var(--accent); font-size: 25px; line-height: 1; }
#results-position span { display: block; color: var(--muted); font-size: 10px; }
#results-sub { margin-bottom: 0; }
.race-results { margin: 0; font-variant-numeric: tabular-nums; }
.race-results thead { position: sticky; top: 0; z-index: 1; }
.race-results th, .race-results td { width: auto; padding: 5px 6px; font-size: 12px; text-align: right; white-space: nowrap; }
.race-results thead th { background: #202a3c; color: #d7e0f0; font-size: 9px; letter-spacing: .035em; }
.race-results .driver { text-align: left; }
.race-results tbody .driver {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--text);
  border-left: 3px solid var(--entrant);
}
.race-results small { display: block; color: var(--muted); font-size: 10px; }
.race-results tbody .place { color: var(--muted); }
.race-results tbody .finish, .race-results tbody .points { font-weight: 700; }
.race-results tbody .fastest { color: #ddadff; font-weight: 750; }
.race-results tbody .penalty { color: #ff9a8f; }
.race-results tbody tr:nth-child(even) { background: #ffffff05; }
.race-results tbody tr.me { background: #ffd16618; }
.race-results tbody tr.me .place, .race-results tbody tr.me .driver { color: var(--accent); }
#results h2 { font-size: clamp(21px, 3vw, 29px); }
#results-tabs { gap: 4px; }
#results-tabs button.on { background: var(--red); border-color: transparent; color: white; }
#results-podium { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 8px; }
#results-podium:empty { display: none; }
.result-finisher {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  padding: 6px;
  border-top: 2px solid var(--team);
}
.result-finisher .place { grid-row: span 2; color: var(--muted); font-size: 19px; font-weight: 850; }
.result-finisher.winner {
  background: linear-gradient(120deg, #ffd16624, #ffffff08);
  border-top-color: var(--accent);
}
.result-finisher.winner .place { color: var(--accent); }
.result-finisher b, .result-finisher small { font-size: 12px; overflow-wrap: anywhere; line-height: 1.15; }
.result-finisher small { color: var(--muted); font-variant-numeric: tabular-nums; }
#results-body { border: 1px solid var(--line); border-radius: 9px; background: #070d1647; }
#results-body .table li { gap: 6px; padding-block: 4px; font-size: 13px; }
#results-body .table li.me { background: #ffd16613; }
#results-body .table .name { min-width: 0; overflow-wrap: anywhere; }
#results-body .table .extra { font-size: 11px; text-align: right; }
#results-body .table .value { min-width: 82px; }
#results-timer:empty { display: none; }
#results footer { flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
#results-earnings summary .sum { display: inline-flex; width: calc(100% - 19px); }
#results-trophies { font-size: 12px; }

#hud .panel { --hud-surface: #141d2c; border-radius: 12px; }
#bottomright .panel { position: relative; }
#bottomright { align-items: flex-end; }
#bottomright .panel { padding: 9px 10px; }
#carstatus { width: 223px; }
#next-tyre button { width: 26px; height: 26px; }
#btn-pit { min-height: 26px; }
#damage-ok { color: #80dbc2; margin-top: 4px; font-size: 10px; }
#carstatus .damage[hidden] { display: none; }
#topright { width: 182px; }
#timer { font-size: 23px; }
#tower { width: 200px; zoom: min(var(--hud-scale, 1), var(--tower-fit, 1.5)); }
.tower-labels, #standings li {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 26px 49px;
  align-items: center;
  gap: 4px;
}
.tower-labels {
  padding: 5px 3px 4px;
  border-bottom: 1px solid var(--hud-line);
  font-size: 9px;
  color: #aab8cf;
}
.tower-labels > :nth-child(3) { text-align: center; }
.tower-labels > :last-child { text-align: right; }
#standings { margin-top: 3px; }
#standings li { height: 18px; font-size: 12px; }
#standings .idx {
  width: auto;
  border-left: 3px solid var(--entrant);
  border-radius: 2px;
  background: #080f1c;
  color: #d7e1ef;
}
#standings .tyre { justify-self: center; }
#standings .gap { width: auto; }
#standings li.focus .idx, #standings li.focus .gap { color: var(--accent); }
.list-pages {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.list-pages button { min-width: 32px; min-height: 26px; padding: 0 6px; font-size: 18px; line-height: 1; }
#results-pages { width: min(174px, 100%); align-self: center; }


@media (max-width: 960px) {
  [data-screen="lobby"] .lobby-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 720px) {
  #editor .editor-layout, [data-screen="lobby"] .lobby-layout { grid-template-columns: minmax(0, 1fr); }
  .lobby-social { order: 2; }
  [data-screen="lobby"] .lobby-layout > div:last-child { grid-column: auto; }
}
@media (max-width: 540px) {
  #results { padding: 12px; max-height: 92dvh; }
  .race-results th, .race-results td { padding-inline: 3px; font-size: 11px; }
  .race-results thead th { font-size: 8px; white-space: normal; }
  #results-body .table .idx { width: 20px; flex: none; }
  #results-body .table li { display: grid; grid-template-columns: 20px 4px minmax(0, 1fr) auto; }
  #results-body .table .extra { grid-area: 2 / 3 / auto / -1; text-align: left; }
  #results-body .table .extra:empty { display: none; }
  #results-body .table .value { grid-area: 1 / 4; min-width: 0; }
  #results footer button { padding: 7px 9px; }
}

@media (max-height: 430px) {
  #results { padding: 8px 12px; }
  .results-heading { margin-bottom: 4px; padding-bottom: 4px; }
  #results h2 { font-size: 20px; }
  #results-trophies { margin-bottom: 4px; }
  #results-earnings { margin-bottom: 4px; padding-block: 4px; }
  #results-podium { margin-bottom: 4px; }
  #results footer { margin-top: 5px; padding-top: 5px; }
  #results footer button { padding: 5px 9px; }
}

@media (max-width: 720px) {
  #tower { zoom: min(calc(var(--hud-scale, 1) * 0.62), var(--tower-fit, 1.5)); }
}

/* Beállítások, szponzorok, történet és profilcélok. */
[data-screen="settings"] .card.medium { width: min(750px, 100%); }
[data-settings-page] { padding-block: 4px; }
[data-settings-page] .row:first-child { border-top: 0; }
[data-settings-page] .row { min-height: 47px; }
#sponsors-body > .tiles { margin-top: 0; }
#sponsors-body > .tabs { margin-top: 12px; }
#sponsors-body .offers { grid-template-columns: repeat(auto-fit, minmax(min(195px, 100%), 1fr)); }
#sponsors-body .offer { background: var(--surface); }
.locked-offers { margin-top: 12px; }
.locked-offers > summary, .story-itinerary > summary { font-size: 13px; font-weight: 700; }
.locked-offers[open] > summary, .story-itinerary[open] > summary { margin-bottom: 8px; }
#sponsors-body .locked { opacity: 0.8; }
.story-start { padding: clamp(14px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(140deg, #ffd16615, transparent 70%), var(--surface); }
.story-start h3 { margin-top: 0; color: var(--text); font-size: clamp(19px, 3vw, 29px); text-transform: none; }
.story-stage > .kicker { color: var(--accent); }
.story-partner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  padding: 8px 10px;
  margin: 0 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #070e19a0;
  font-size: 12px;
}
.briefing + .story-partner { margin: 8px 0 0; }
.story-partner small { color: var(--muted); margin-left: auto; }
.story-stage > button { align-self: flex-end; margin-top: 10px; }
.profile-goals .info h4 { margin: 0 0 4px; }
.profile-goals progress { display: block; width: 100%; height: 7px; margin: 10px 0 3px; accent-color: var(--accent); }
.profile-goals small { color: var(--muted); }
.profile-goals .complete { color: #7ee8a7; }

#league-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
#league-history { margin-top: 12px; }
#league-history > summary { font-weight: 750; }
#league-history .tabs { margin-top: 8px; }
#league-round-detail { overflow-x: auto; }

/* Főmenü. A jobb oldali autót a játék jelenete rajzolja. */
body.in-menu #menu:has(.screen.active[data-screen="main"]) {
  background: linear-gradient(90deg, #090e19f5 0%, #090e19dc 30%, #090e194d 55%, #090e1900 72%);
}
.home { width: min(520px, 100%); margin: auto auto auto clamp(6px, 4vw, 64px); }
.home-heading { margin-bottom: clamp(12px, 2.8vh, 26px); }
.home .logo {
  margin: 0;
  font-size: clamp(40px, 5.2vw, 77px);
  letter-spacing: -.075em;
  line-height: 1;
  text-shadow: 0 7px 30px #0008;
}
.home .account-line { flex-wrap: wrap; justify-content: flex-start; gap: 5px 10px; margin-top: 10px; }
.home .account-switch { border-color: #8395b044; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-grid button { min-width: 0; text-align: left; }
.home-race {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
  min-height: 85px;
  padding: 12px clamp(11px, 2.2vw, 20px);
  border-color: #ff847b85;
  border-radius: 14px;
  background: linear-gradient(118deg, #d41f27, #901421 57%, #681025);
  box-shadow: 0 12px 30px #09020a7a;
}
.home-race::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 44%;
  background: repeating-linear-gradient(124deg, #ffae9d35 0 2px, transparent 2px 12px);
  mask-image: linear-gradient(90deg, transparent, #000);
}
.home-race:hover:not(:disabled), .home-race:focus-visible { background: linear-gradient(118deg, #e42b32, #aa1928 57%, #7b1831); }
.home-race b { display: block; font-size: clamp(21px, 3.2vw, 34px); font-style: italic; line-height: 1.05; }
.home-race small, .home-mode small { display: block; margin-top: 5px; font-size: 11px; font-weight: 500; line-height: 1.25; }
.home-race small { color: #ffe3e1; }
.home-mode-icon { display: block; font-size: 18px; line-height: 1; }
.home-race .home-mode-icon { color: #fff; font-size: clamp(19px, 2.4vw, 28px); }
.home-arrow { font-size: 26px; font-weight: 500; }
.home-mode {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 11px 9px;
  min-height: 87px;
  background: linear-gradient(150deg, #253145f0, #151e2cf5);
  border-radius: 12px;
}
.home-mode b { overflow-wrap: anywhere; font-size: clamp(12px, 1.5vw, 16px); }
.home-mode small { margin-top: 0; color: #bdc9db; }
.home-tools { margin-top: 10px; }
.home-tools #badge { margin: 0 0 7px; background: #101927e8; }
.home-tools #badge .avatar { border-radius: 11px; background: #83232c; }
.home-tools nav { display: flex; flex-wrap: wrap; gap: 7px; }
.home-tools nav button { padding: 7px 11px; font-size: 12px; }
.home-showcase {
  position: absolute;
  right: max(4vw, 18px);
  bottom: max(6vh, 14px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 38vw;
  padding: 7px;
  text-align: center;
  background: #121b2bd9;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.home-car-info { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.home-showcase b { border-bottom: 2px solid var(--team, var(--accent)); padding-bottom: 3px; line-height: 1.1; }
.home-showcase span { font-size: 11px; color: #c1ccdf; }
.home-showcase button { width: 40px; height: 40px; padding: 0; font-size: 24px; line-height: 1; }
@media (max-width: 1000px) and (min-height: 551px), (max-width: 720px) {
  body.in-menu #menu:has(.screen.active[data-screen="main"]) {
    background: linear-gradient(0deg, #090e19f7, #090e19df 47%, #090e1966 67%, transparent 90%);
  }
  .screen[data-screen="main"] { flex-direction: column-reverse; gap: 9px; }
  .home { margin: 0 auto; }
  .home-showcase { position: static; align-self: center; margin: auto 0 0; max-width: 95%; text-align: center; }
}
@media (max-width: 560px), (max-height: 550px) {
  .home .logo { font-size: clamp(36px, 7vw, 50px); }
  .home-race { min-height: 66px; }
  .home-mode { min-height: 70px; padding: 8px 6px; }
  .home-tools #badge { padding: 6px 9px; }
  .home-tools #badge .avatar { width: 32px; height: 32px; }
}

/* ---------- Előnézet és tervező ---------- */
.preview-canvas { cursor: grab; touch-action: none; }
.preview-canvas:active { cursor: grabbing; }
.preview-tools { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.preview-tools button { padding: 4px 11px; font-size: 12px; }
.preview-tools button.on { border-color: #ffd166; color: #ffd166; }
#livery-form { margin-top: 8px; }
.editor-fields .pair > .check, .editor-fields .pair > .logo-preview { grid-column: 1 / -1; }
.logo-preview { width: 96px; height: 96px; justify-self: center; }
.logo-preview.off { opacity: 0.35; }
.logo-badge { flex: none; vertical-align: middle; }
.name > .logo-badge { margin-right: 6px; }
#editor-saved li:not(.note) { flex-wrap: wrap; justify-content: flex-end; }
#editor-saved li .name { flex: 1 1 calc(100% - 40px); }
#editor-saved input.name { min-width: 0; padding: 4px 8px; }

/* ---------- Autóbeállítás ---------- */
.setup-form { display: grid; gap: 8px; align-content: start; }
.setup-form .preset-row { margin: 0; }
.setup-form .setup-row { margin: 0; }
.setup-form .setup-row small { display: block; margin: 2px 0 0; font-size: 11.5px; line-height: 1.35; }
.setup-advice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setup-advice p { flex: 1 1 220px; margin: 0; }
.setup-advice button { padding: 5px 11px; font-size: 12px; }
.setup-effects { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 3px 16px; }
.effect { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 8px; font-size: 12px; }
.effect em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.effect-meter { position: relative; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.effect-meter::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.55); }
.effect-meter i { position: absolute; top: 0; bottom: 0; }
.effect-meter .better { background: #35c27a; }
.effect-meter .worse { background: #e5484d; }
#setup .card { width: min(720px, 100%); }

/* ---------- Versenynaptár és szezon ---------- */
.calendar-editor { margin-top: 10px; }
.calendar-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 220px; overflow: auto; }
.calendar-pick button { padding: 5px 8px; font-size: 12px; text-align: left; }
.calendar-pick button.on { border-color: #ffd166; color: #ffd166; }
#season .card { width: min(1040px, 100%); }
#season-body { max-height: min(58vh, 520px); overflow: auto; margin-top: 10px; }
.season-scroll { overflow-x: auto; }
.season-table { border-collapse: collapse; font-size: 12px; white-space: nowrap; width: 100%; }
.season-table th, .season-table td { padding: 4px 7px; border-bottom: 1px solid var(--line); text-align: center; }
.season-table th.driver { text-align: left; text-transform: none; color: inherit; font-size: 12px; border-left: 3px solid var(--entrant); }
.season-table tr.me { background: rgba(255, 209, 102, 0.14); }
.season-table td.p1 { background: rgba(255, 201, 60, 0.35); font-weight: 800; }
.season-table td.p2 { background: rgba(217, 225, 234, 0.25); }
.season-table td.p3 { background: rgba(209, 133, 74, 0.3); }
.season-table td.scored { background: rgba(53, 194, 122, 0.16); }
.season-table td.out { color: #ff8085; }
.season-table td.none { opacity: 0.6; }
.season-table td.fastest { box-shadow: inset 0 -2px 0 #b57bff; }
.season-table td.total { font-weight: 800; }
.duel .history b.won { color: #35c27a; }
.duel .history b.lost { color: #ff8085; }

/* ---------- Adatlapok és Story-mentések ---------- */
.team-about p { margin: 6px 0; font-size: 12px; line-height: 1.4; }
.driver-card { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.driver-card b { font-size: 12.5px; }
.driver-card small { color: #ffd166; font-size: 11px; }
.driver-card p { margin: 0 0 3px; font-size: 11px; }
.driver-card .stat { display: grid; grid-template-columns: minmax(74px, 1fr) 28px 16px; align-items: center; gap: 4px; font-size: 10.5px; }
.driver-card em { font-style: normal; text-align: right; }
.story-slots { margin-bottom: 12px; flex-wrap: wrap; }
.story-controls button:disabled { opacity: 0.5; }


/* ---------- Görgetősávok: vékony, sötét, a felülethez illő ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 170, 210, 0.38) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(148, 170, 210, 0.34); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 209, 102, 0.6); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
/* A pályaválasztó listája: a sáv ne takarja el a gombokat, és a lista szélig ne lógjon ki. */
.calendar-pick { padding-right: 6px; scrollbar-gutter: stable; overscroll-behavior: contain; border-radius: 10px; }

/* ---------- Csapat adatlapja: kis ablak ---------- */
#team-sheet .card { width: min(580px, 100%); border-top: 4px solid var(--team, var(--red)); }
#team-sheet-title { display: flex; align-items: center; gap: 10px; }
#team-sheet-title .swatch { width: 16px; height: 16px; border-radius: 5px; background: var(--team); }
.sheet-about p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.sheet-about .note { color: var(--muted); font-size: 12px; }
#team-sheet .stats { display: grid; gap: 6px; margin: 12px 0 14px; }
#team-sheet .stat { font-size: 12px; }
#team-sheet .stat span:first-child { width: 86px; }
#team-sheet .meter { height: 6px; }
#team-sheet .meter i { background: linear-gradient(90deg, var(--team), var(--accent2, var(--accent))); }
.sheet-drivers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet-drivers .driver-card { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sheet-drivers .driver-card b { font-size: 14px; }
.sheet-drivers .driver-card p { font-size: 12px; line-height: 1.4; }
.sheet-drivers .driver-card .stat { grid-template-columns: minmax(80px, 1fr) 54px 20px; font-size: 11.5px; }
@media (max-width: 560px) { .sheet-drivers { grid-template-columns: 1fr; } }
.team .team-sheet-open { width: 100%; margin-top: 6px; padding: 4px 10px; font-size: 12px; }
