:root {
  --bg: #05060a;
  --glass: rgba(14, 17, 28, 0.58);
  --glass-strong: rgba(12, 15, 25, 0.86);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --muted: #8b93a7;
  --faint: #5b6275;
  --cyan: #22d3ee;
  --indigo: #6366f1;
  --violet: #a855f7;
  --rose: #f43f5e;
  --emerald: #34d399;
  --gold: #fbbf24;
  --grad: linear-gradient(120deg, #22d3ee 0%, #6366f1 40%, #a855f7 68%, #f43f5e 100%);
  --radius: 20px;
  --blur: blur(18px) saturate(140%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Pozadie ---------- */
#scene { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; z-index: 0; }
.backdrop { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
body.no-scene #scene { display: none; }
body.no-scene .backdrop {
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(50% 45% at 90% 20%, rgba(168, 85, 247, 0.16), transparent 70%),
    radial-gradient(60% 60% at 60% 110%, rgba(34, 211, 238, 0.14), transparent 70%),
    var(--bg);
  animation: drift 24s ease-in-out infinite alternate;
  background-size: 140% 140%;
}
body.no-scene .backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%);
}
/* Nad pohyblivou scénou by sa rozmazanie prepočítavalo každú snímku, čo je v aute drahé.
   Namiesto neho použijeme nepriehľadnejšie panely. */
body:not(.no-scene) .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(12, 15, 25, 0.8); }
@keyframes drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px rgba(0, 0, 0, 0.35);
}

#app {
  position: relative; z-index: 2;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px 10px;
}

/* ---------- Horná lišta ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px 8px 14px; border-radius: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #c7d2fe; background: rgba(99, 102, 241, 0.14); border: 1px solid rgba(129, 140, 248, 0.3);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.spacer { flex: 1; }

.seg { display: inline-flex; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 3px; }
.seg button, .tabs button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"], .tabs button[aria-pressed="true"] {
  color: var(--text); background: rgba(255, 255, 255, 0.1); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.ok .dot { background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.chip.warn .dot { background: var(--gold); }
.chip.bad .dot { background: var(--rose); }
.speed-chip b { font-family: var(--display); font-size: 16px; color: var(--text); }
.icon-btn {
  appearance: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.04); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--stroke-strong); background: rgba(255, 255, 255, 0.06); color: var(--text);
  font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 12px; cursor: pointer;
}
.btn.ghost { background: transparent; }
.btn.primary { border: 0; background: var(--grad); color: #fff; box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35); }
.btn.big { font-size: 18px; padding: 16px 30px; border-radius: 16px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Hlavná scéna ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 16px; min-height: 0;
}
.cockpit { position: relative; min-height: 0; display: grid; }
#gauge { width: 100%; height: 100%; min-height: 0; display: block; }
.engine-tag {
  position: absolute; left: 0; top: 0; max-width: min(340px, 34%);
  display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border-radius: 16px;
}
.engine-tag b { font-family: var(--display); font-size: 18px; }
.engine-tag span:last-child { color: var(--muted); font-size: 13px; line-height: 1.45; }
body.no-gauge .cockpit > * { display: none; }

/* ---------- Skupina ---------- */
.squad {
  border-radius: var(--radius); padding: 16px; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.squad-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.avatar {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; flex: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset;
}
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.me-title { color: #c7d2fe; font-size: 13px; font-weight: 500; }
.me-title .lvl { font-family: var(--display); font-weight: 700; }
.xp-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s; }
.xp-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.me-stats div { background: rgba(0, 0, 0, 0.2); border-radius: 10px; padding: 8px 10px; }
.me-stats b { display: block; font-family: var(--display); font-size: 16px; }
.me-stats small { color: var(--muted); font-size: 11px; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 3px; }
.tabs button { font-size: 13px; padding: 7px 10px; flex: 1; }
.tabs.big button { font-size: 15px; padding: 10px 18px; flex: none; }

#board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#board li {
  display: grid; grid-template-columns: 22px auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid transparent;
}
#board li.me { border-color: rgba(129, 140, 248, 0.45); background: rgba(99, 102, 241, 0.1); }
#board li.expandable { cursor: pointer; }
#board li.expandable .name::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; vertical-align: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
#board li.expandable.open .name::after { transform: rotate(-135deg); vertical-align: -1px; }
#board li.open {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.1) 50%, rgba(34, 211, 238, 0.08));
}
.me-detail { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; overflow: hidden; }
.me-detail.anim { animation: unroll .28s ease-out; }
@keyframes unroll { from { max-height: 0; opacity: 0; padding-top: 0; } to { max-height: 260px; opacity: 1; } }
#board .rank { font-family: var(--display); font-weight: 700; color: var(--faint); text-align: center; }
#board li:nth-child(1) .rank { color: var(--gold); }
#board li:nth-child(2) .rank { color: #cbd5e1; }
#board li:nth-child(3) .rank { color: #f59e0b; }
#board .who { min-width: 0; }
#board .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board .right { text-align: right; }
#board .metric { font-family: var(--display); font-weight: 700; font-size: 17px; white-space: nowrap; }
#board .mini { display: flex; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.tag { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.tag.you { background: rgba(99, 102, 241, 0.3); color: #e0e7ff; }
.empty { color: var(--muted); font-size: 14px; padding: 14px; text-align: center; border: 1px dashed var(--stroke-strong); border-radius: 14px; }

.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.count { color: var(--text); background: rgba(255,255,255,.08); padding: 1px 7px; border-radius: 99px; letter-spacing: 0; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.medal-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 12px 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke);
  position: relative; min-width: 0;
}
.medal-card.mine { border-color: rgba(251, 191, 36, 0.55); background: linear-gradient(180deg, rgba(251, 191, 36, 0.12), rgba(255, 255, 255, 0.02)); }
.medal-card.mine::after { content: "TY"; position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700; letter-spacing: .08em; color: #1a1205; background: var(--gold); padding: 2px 5px; border-radius: 5px; }
.medal-card .ml { font-size: 12px; font-weight: 600; line-height: 1.25; }
.medal-card .mh { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.medal-card.locked .ml { color: var(--muted); }
.medals.compact { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.medals.compact .medal-card { padding: 10px 6px 8px; }
.medals.compact .ml { font-size: 11px; font-weight: 500; }
.medal { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); transition: transform .2s; }
.medal-card:not(.locked):hover .medal { transform: translateY(-2px) scale(1.04); }
.medal.locked { opacity: .55; }

/* ---------- Spodný dok ---------- */
.dock-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.dock { grid-column: 2; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 18px; }
.dock-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 12px; border-radius: 13px; text-align: left; color: var(--muted);
}
.dock-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.dock-btn span { display: flex; flex-direction: column; line-height: 1.15; }
.dock-btn small { font-size: 11px; color: var(--faint); letter-spacing: .04em; }
.dock-btn b { font-size: 14px; color: var(--text); font-weight: 600; white-space: nowrap; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--stroke-strong); }
.toggle-btn {
  appearance: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 14px; border-radius: 13px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 14px; font-weight: 500;
}
.toggle-btn[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(120deg, #f97316, #f43f5e); box-shadow: 0 6px 24px rgba(244, 63, 94, 0.35); }
.toggle-btn:disabled { opacity: .35; cursor: default; }
.vol { display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); }
.vol input { width: 120px; accent-color: var(--violet); }
.pedal {
  appearance: none; cursor: pointer; border-radius: 18px; font-family: var(--display); font-size: 18px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); touch-action: none; min-height: 64px;
}
.pedal:first-child { grid-column: 1; }
.pedal.gas { grid-column: 3; }
.pedal.active { color: #fff; background: rgba(255, 255, 255, 0.14); }
.pedal.gas.active { background: var(--grad); border-color: transparent; }
body:not(.sim-mode) .pedal, body:not(.show-pedals) .pedal { visibility: hidden; }
body:not(.show-desc) .engine-tag { display: none; }

/* ---------- Aréna: bez scény aj budíkov ostane len skupina ---------- */
body.arena .stage { grid-template-columns: 1fr; }
body.arena .cockpit { display: none; }
body.arena .squad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; padding: 22px; align-content: start; }
body.arena .medals { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
body.arena .medals.compact { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

/* ---------- Štúdio (výber zvuku, scény, budíkov) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.45); }
.sheet {
  position: fixed; z-index: 31; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(1100px, calc(100vw - 32px)); max-height: min(72dvh, 680px); overflow: auto;
  border-radius: 24px; padding: 18px; background: rgba(12, 15, 25, 0.96);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  animation: sheet-in .22s ease-out;
}
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card {
  appearance: none; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  padding: 10px 10px 14px; border-radius: 18px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.035);
  color: var(--text); transition: border-color .15s, transform .15s, background .15s;
}
.card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.06); }
.card[aria-pressed="true"] { border-color: transparent; background: linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.card .thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; display: block; background: #070910; overflow: hidden; }
.card .thumb.off { display: grid; place-items: center; color: var(--faint); background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px), #070910; }
.card .ct { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
.card .ct b { font-family: var(--display); font-size: 16px; }
.card p { margin: 0; padding: 0 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; }
.kind.ice { color: #fdba74; background: rgba(249, 115, 22, 0.14); }
.kind.synth { color: #a5f3fc; background: rgba(34, 211, 238, 0.12); }
.kind.samples { color: #d8b4fe; background: rgba(168, 85, 247, 0.14); }
.wave-thumb { width: 100%; height: 100%; }

/* ---------- Nastavenia ---------- */
dialog {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke-strong); border-radius: 22px;
  padding: 22px; width: min(460px, calc(100vw - 32px)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog h2 { margin: 0 0 16px; font-family: var(--display); font-size: 22px; }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
dialog label.inline { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 15px; }
dialog input:not([type]), dialog input[type="text"] {
  font: inherit; font-size: 17px; color: var(--text); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--stroke-strong);
  border-radius: 12px; padding: 11px 13px; width: 100%;
}
dialog input:focus { outline: 2px solid rgba(129, 140, 248, 0.6); outline-offset: 1px; }
dialog input[type="radio"], dialog input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--violet); }
dialog fieldset { border: 1px solid var(--stroke-strong); border-radius: 14px; display: flex; gap: 22px; padding: 10px 14px 12px; }
dialog legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- Upozornenia ---------- */
#toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 10px; pointer-events: none; width: min(440px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 18px;
  background: var(--glass-strong); border: 1px solid rgba(251, 191, 36, 0.4);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(251, 191, 36, 0.12);
  animation: toast-in .35s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.info { border-color: var(--stroke-strong); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.toast .tt { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.toast.info .tt { color: #c7d2fe; }
.toast .tb { font-weight: 600; word-break: break-all; }
.toast .ti { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.06); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* ---------- Úvod ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; text-align: center;
  background:
    radial-gradient(50% 40% at 30% 20%, rgba(99, 102, 241, 0.3), transparent 70%),
    radial-gradient(45% 40% at 75% 75%, rgba(244, 63, 94, 0.18), transparent 70%),
    radial-gradient(40% 40% at 80% 20%, rgba(34, 211, 238, 0.16), transparent 70%),
    rgba(5, 6, 10, 0.96);
}
.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 560px; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(44px, 7vw, 76px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.hero small { color: var(--faint); font-size: 12.5px; }
.start-name { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.start-name input {
  font: inherit; font-size: 18px; text-align: center; color: var(--text); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-strong); border-radius: 14px; padding: 12px 16px; width: min(320px, 80vw);
}
#startBtn:disabled { opacity: .6; }

/* ---------- Menšie obrazovky ---------- */
@media (max-width: 1100px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100dvh; }
  .stage { grid-template-columns: 1fr; }
  .cockpit { height: min(62dvh, 560px); }
  body.arena .squad { grid-template-columns: 1fr; }
  .dock-row { grid-template-columns: 1fr 1fr; }
  .dock { grid-column: 1 / -1; grid-row: 1; flex-wrap: wrap; justify-content: center; }
  .pedal:first-child { grid-column: 1; grid-row: 2; }
  .pedal.gas { grid-column: 2; grid-row: 2; }
  body:not(.sim-mode) .pedal, body:not(.show-pedals) .pedal { display: none; }
}
@media (max-width: 640px) {
  #app { padding: 10px 16px; gap: 10px; }
  .brand-name { font-size: 17px; }
  .live-pill { display: none; }
  #statusChip, #netChip span:last-child { display: none; }
  .cockpit { height: 52dvh; }
  .engine-tag { position: static; max-width: none; margin-top: 8px; }
  .cockpit { display: flex; flex-direction: column; height: auto; }
  #gauge { height: 46dvh; }
  .dock-btn { padding: 8px; }
  .dock-btn small { display: none; }
  .toggle-btn span { display: none; }
  .vol input { width: 80px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card p { display: none; }
}
