/* Racer.LT Simulator - Romanas*/
:root {
  --bg: #070d1c; --bg2: #0b1428; --panel: rgba(12, 22, 44, .86); --panel-solid: #0d1830; --line: rgba(80, 150, 255, .22);
  --line-2: rgba(80, 150, 255, .4); --text: #e6eefc; --muted: #8fa3c4; --neon: #00c8ff; --neon-2: #7b4fff; --yellow: #ffd23a;
  --good: #22c55e; --bad: #ef4444; --top-h: 62px;
  --f-head: 'Exo 2', 'Rajdhani', sans-serif; --f-ui: 'Rajdhani', system-ui, sans-serif; --f-mono: 'Space Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 600 16px/1.35 var(--f-ui); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--neon); }
kbd { display: inline-block; min-width: 1.5em; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 5px; background: rgba(255,255,255,.06); font: 700 .8rem var(--f-mono); text-align: center; }
[hidden] { display: none !important; }

.sim { position: fixed; inset: 0; display: grid; grid-template-rows: var(--top-h) 1fr; }
.sim-top { display: flex; align-items: center; gap: 18px; padding: 0 18px; background: linear-gradient(180deg, #0c1730, #091123); border-bottom: 1px solid var(--line); z-index: 5; }
.sim-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.sim-logo-mark { width: 46px; height: 38px; }
.sim-logo-text { display: flex; flex-direction: column; line-height: 1; }
.sim-logo-text img { width: 132px; height: auto; display: block; }
.sim-logo-text small { margin-top: 3px; font: italic 800 .72rem var(--f-head); letter-spacing: .52em; color: var(--neon); padding-left: 2px; }
.sim-tabs { display: flex; flex: 1; justify-content: center; gap: 4px; height: 100%; }
.sim-tabs button { position: relative; padding: 0 18px; border: 0; background: none; color: #b9c8e4; font: 700 1.1rem var(--f-head); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.sim-tabs button:hover { color: #fff; }
.sim-tabs button.is-on { color: var(--neon); }
.sim-tabs button.is-on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--neon); box-shadow: 0 0 12px var(--neon); }
.sim-tab-gear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sim-pilot { flex: none; font-size: .95rem; display: flex; gap: 10px; align-items: center; }
.sim-pilot .sim-back { color: var(--muted); text-decoration: none; }
.sim-pilot b { color: var(--neon); }
.sim-main { position: relative; min-height: 0; }
.sim-tab { position: absolute; inset: 0; }
.sim-view { position: absolute; inset: 0; }
.sim-view canvas { display: block; width: 100% !important; height: 100% !important; outline: none; }

/* panels & controls */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.panel-title { margin: 0 0 12px; font: italic 900 1.6rem var(--f-head); text-transform: uppercase; letter-spacing: .01em; }
.panel-sub { margin: 0 0 8px; font: italic 800 1.05rem var(--f-head); text-transform: uppercase; color: #cfe0ff; }
.panel-sub small { color: var(--muted); font: 600 .85rem var(--f-ui); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 9px; background: rgba(20, 40, 80, .6); color: var(--text); font-weight: 700; text-decoration: none; cursor: pointer; text-transform: uppercase; letter-spacing: .03em; }
.btn:hover { border-color: var(--neon); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-sm { padding: 6px 11px; font-size: .9rem; }
.btn-primary { background: var(--neon); border-color: var(--neon); color: #04121f; }
.btn-primary:hover { color: #04121f; box-shadow: 0 0 18px rgba(0, 200, 255, .5); }
.btn-outline { background: transparent; border-color: var(--neon); color: var(--neon); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-go { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 14px 20px; border: 0; border-radius: 12px; background: var(--yellow); color: #111; cursor: pointer; box-shadow: 0 6px 24px rgba(255, 210, 58, .25); text-align: left; }
.btn-go b { font: italic 900 1.9rem/1 var(--f-head); }
.btn-go small { font-weight: 700; opacity: .75; margin-top: 4px; }
.btn-go:hover { filter: brightness(1.06); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { padding: 7px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; text-transform: uppercase; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on { background: rgba(0, 200, 255, .16); color: var(--neon); }
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 0 0 10px; }
.field > span { color: var(--muted); }
.field select, .field input, .ed-name, .ed-open, .num { min-width: 0; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #0a1430; color: var(--text); }
.field select { max-width: 230px; }
.field input[type=number] { width: 96px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--neon); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--neon); }

/* race lobby */
.race-lobby { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(280px, 380px) 1fr minmax(300px, 360px); gap: 18px; padding: 18px; pointer-events: none; }
.race-lobby > * { pointer-events: auto; }
.lobby-maps { grid-column: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px; }
.map-filter { margin-bottom: 12px; align-self: flex-start; flex-shrink: 0; flex-wrap: wrap; } /* longer words (EN/LV/RU) wrap instead of being squeezed */
.map-search, .week-card { flex-shrink: 0; }
.map-filter button { padding: 7px 10px; }
/* thin cyan scrollbars like the main site */
.sim * { scrollbar-width: thin; scrollbar-color: var(--neon) transparent; }
.sim ::-webkit-scrollbar { width: 6px; height: 6px; }
.sim ::-webkit-scrollbar-thumb { background: var(--neon); border-radius: 3px; }
.sim ::-webkit-scrollbar-track { background: transparent; }
.map-list { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.map-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(10, 20, 44, .7); cursor: pointer; text-align: left; color: var(--text); }
.map-card:hover { border-color: var(--line-2); }
.map-card.is-on { border-color: var(--neon); background: rgba(0, 200, 255, .1); box-shadow: inset 3px 0 0 var(--neon); }
.map-card b { font: italic 800 1.1rem var(--f-head); }
.map-card small { color: var(--muted); grid-column: 1; }
.map-card .lvl { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .8rem; padding: 3px 8px; border-radius: 99px; border: 1px solid currentColor; }
.lvl-1 { color: var(--good); } .lvl-2 { color: var(--yellow); } .lvl-3 { color: #ff7a45; }
.map-empty { color: var(--muted); padding: 10px 2px; }
.st-pending { color: var(--yellow); } .st-shared { color: var(--neon); } .st-private { color: var(--muted); }
.map-search { width: 100%; margin: 0 0 10px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: #0a1430; color: var(--text); }
.lobby-about { margin: 0 0 12px; color: var(--muted); font-weight: 500; }
.lobby-about summary { cursor: pointer; color: var(--text); font-weight: 700; }
.lobby-about p { white-space: pre-line; margin: 6px 0 0; max-height: 160px; overflow: auto; }
.lobby-top { margin: 0 0 14px; font: 700 .85rem var(--f-mono); }
.lobby-top:empty { display: none; }
.lobby-top h3 { margin: 0 0 6px; font: italic 800 .95rem var(--f-head); text-transform: uppercase; color: #cfe0ff; }
.lobby-top ol { margin: 0; padding: 0; list-style: none; max-height: 150px; overflow: auto; }
.lobby-top li { display: grid; grid-template-columns: 22px 1fr auto 22px; gap: 6px; padding: 2px 0; color: var(--muted); align-items: center; }
.top-replay { grid-column: 4; width: 22px; height: 20px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; color: var(--neon); cursor: pointer; font-size: .65rem; }
.top-replay:hover { border-color: var(--neon); }
.lobby-top li b { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-top li.is-me b, .lobby-top li.is-me { color: var(--yellow); }
.lobby-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.lobby-acts:empty { display: none; }
.ed-vis { max-width: 190px; }
.lobby-setup { grid-column: 3; align-self: start; padding: 18px; }
.lobby-desc { margin: -6px 0 14px; color: var(--muted); font-weight: 500; }
/* track rating: stars (finishers), like (anyone), totals */
.lobby-rate:empty, .res-rate:empty { display: none; }
.lobby-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -6px 0 12px; font-size: .9rem; color: var(--muted); }
.res-rate { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: .9rem; }
.stars { display: inline-flex; }
.stars button { border: 0; background: none; padding: 0 1px; font-size: 1.35rem; line-height: 1; color: #4a5672; cursor: pointer; }
.stars button.is-on { color: var(--yellow); }
.stars button:disabled { cursor: default; }
.stars:not(.is-locked) button:hover, .stars:not(.is-locked) button:hover ~ button { color: #4a5672; }
.stars:not(.is-locked):hover button { color: var(--yellow); }
.like { border: 1px solid var(--line-2); border-radius: 99px; background: none; color: var(--muted); padding: 2px 10px; cursor: pointer; font: 700 .85rem var(--f-ui); }
.like.is-on { border-color: #ff4f7a; color: #ff4f7a; background: rgba(255, 79, 122, .1); }
.map-card .card-rate { color: var(--yellow); font-style: normal; }
.lobby-best { margin: 4px 0 14px; color: var(--muted); font-family: var(--f-mono); font-size: .85rem; }
.lobby-best b { color: var(--yellow); }
.lobby-keys { margin-top: 14px; color: var(--muted); font-weight: 500; }
.lobby-keys summary { cursor: pointer; color: var(--text); font-weight: 700; }
.lobby-keys p { line-height: 1.9; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-head); }
.hud-box { background: rgba(8, 16, 34, .66); border: 1px solid rgba(120, 170, 255, .2); border-radius: 10px; padding: 6px 12px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hud-box span { font: 700 .82rem var(--f-ui); color: #b5c6e6; letter-spacing: .06em; }
.hud-box b { font: italic 800 1.5rem var(--f-head); color: #fff; }
.hud-box small { color: var(--neon); font: 700 .95rem var(--f-ui); margin-left: 4px; }
/* flying: only the 3D view + HUD, header comes back on pause */
.sim.is-flying { grid-template-rows: 1fr; }
.sim.is-flying .sim-top { display: none; }
.hud-logo { position: absolute; left: 16px; top: 12px; display: flex; flex-direction: column; opacity: .55; line-height: 1; }
.hud-logo img { width: 120px; height: auto; }
.hud-logo small { font: italic 800 .6rem var(--f-head); letter-spacing: .5em; color: var(--neon); margin-top: 2px; }
.sim:not(.is-flying) .hud-logo { display: none; }
.hud-lap { position: absolute; left: 16px; top: 14px; display: flex; flex-direction: column; min-width: 190px; }
.sim.is-flying .hud-lap { top: 58px; }
.hud-lap span b { font-size: 1.3rem; color: var(--neon); margin-left: 6px; }
.hud-lap strong { font: italic 900 2.1rem/1.05 var(--f-head); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.hud-lap em { font: 700 .95rem var(--f-mono); color: var(--yellow); font-style: normal; min-height: 1.2em; }
.hud-cp { position: absolute; right: 16px; top: 14px; }
.hud-cp b { font-size: 2rem; margin-left: 6px; color: var(--neon); }
.hud-stats { position: absolute; left: 16px; bottom: 16px; display: grid; gap: 6px; }
.hud-stats .hud-box { display: grid; grid-template-columns: 96px auto auto; align-items: baseline; }
.hud-bat { display: inline-block; width: 64px; height: 12px; border: 1px solid #9fb4d0; border-radius: 3px; margin-left: 8px; padding: 1px; vertical-align: middle; }
.hud-bat i { display: block; height: 100%; width: 100%; background: var(--good); border-radius: 1px; }
.hud-stats .hud-box:nth-child(3) { grid-template-columns: 96px auto auto auto; }
.hud-mode { color: var(--neon) !important; }
.flag { display: inline-block; width: 16px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
/* copyright: small, readable on any background (white + dark outline), never in the way */
.sim-copy { position: fixed; right: 8px; bottom: 3px; z-index: 50; pointer-events: none; font: 600 .68rem var(--f-ui); color: #fff; letter-spacing: .02em; white-space: nowrap;
  text-shadow: 0 0 2px #333, 1px 1px 1px #333, -1px -1px 1px #333, 1px -1px 1px #333, -1px 1px 1px #333; opacity: .85; }
.hud-map { position: absolute; right: 16px; bottom: 22px; width: 200px; height: 200px; border-radius: 50%; background: rgba(8, 16, 34, .7); border: 1px solid rgba(120, 170, 255, .3); }
.hud-thr { position: absolute; left: 50%; bottom: 14px; width: 160px; height: 6px; margin-left: -80px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.hud-thr i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--neon), var(--yellow)); }
.hud-msg { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font: italic 900 3.4rem var(--f-head); color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.6); transition: opacity .3s; }
.hud-msg.is-warn { color: var(--yellow); font-size: 2rem; }
.hud-msg.is-bad { color: #ff6b6b; font-size: 2rem; }
.hud-armed { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font: 700 1rem var(--f-ui); color: var(--yellow); letter-spacing: .08em; }
.hud-fps { position: absolute; top: 90px; right: 18px; font: 700 .8rem var(--f-mono); color: var(--muted); }
.hud-pause { position: absolute; top: 8%; left: 50%; margin-left: -24px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(8,16,34,.6); color: #fff; font: 900 1.2rem var(--f-head); pointer-events: auto; cursor: pointer; opacity: .2; transition: opacity .2s; }
.hud-pause:hover, .hud-pause:focus-visible { opacity: 1; } /* barely visible while flying, clear when the mouse is on it */

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 8, 18, .55); z-index: 4; }
.overlay-card { width: min(420px, calc(100% - 32px)); padding: 24px; display: grid; gap: 10px; text-align: center; }
.overlay-card p { color: var(--muted); margin: 0 0 6px; }
.results-total { font: italic 900 2.6rem var(--f-head); color: var(--yellow); }
.results-laps { margin: 0; padding: 0; list-style: none; font: 700 1rem var(--f-mono); color: #cfe0ff; }
.results-laps li.is-best { color: var(--good); }
.results-best { color: var(--neon) !important; font-weight: 700; }

/* editor */
#tab-editor { display: grid; grid-template-columns: 230px 1fr 300px; grid-template-rows: 58px 1fr 62px; }
#tab-editor .sim-view { position: relative; grid-column: 2; grid-row: 2; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.ed-title { margin: 0 12px 0 0; font: italic 900 1.45rem var(--f-head); white-space: nowrap; }
.ed-title b { color: var(--neon); }
.ed-mode { margin-right: 6px; }
.ed-mode button { padding: 6px 12px; }
.ed-env-tools:not([hidden]) { display: grid; gap: 6px; padding: 8px; margin-bottom: 8px; border: 1px dashed var(--yellow); border-radius: 9px; }
.ed-env-tools .ed-note { margin: 0; font-size: .82rem; color: var(--yellow); line-height: 1.25; }
/* "▶" glyph from a fallback font sat off-centre: icon is an SVG, text centred both ways */
.ed-test { margin-left: auto; min-width: 130px; justify-content: center; align-items: center; text-align: center; line-height: 1; padding-top: 10px; padding-bottom: 10px; }
.ed-test span { display: block; line-height: 1; padding-top: 1px; }

/* multiplayer */
.hud-mp i, .mp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.mp-dir:not([hidden]) { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--neon); }
.mp-note { margin: 10px 0 0; color: var(--muted); font-size: .88rem; font-weight: 500; }

/* multiplayer lobby: Solo / Together switch, room list (left), the room with 8 pilot seats (centre) */
.lobby-mode { display: flex; margin-bottom: 14px; flex-shrink: 0; }
.lobby-mode button { flex: 1; padding: 9px 10px; font-size: 1rem; }
.solo-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.room-new { margin-bottom: 4px; }
.room-group { margin: 10px 0 0; font: italic 800 .85rem var(--f-head); text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.room-card .room-n { grid-row: 1 / span 2; grid-column: 2; align-self: center; display: flex; flex-direction: column; align-items: flex-end; font: 700 1.05rem var(--f-mono); color: var(--muted); }
.room-card .room-n.is-live { color: var(--good); }
.room-card .room-n small { font: 600 .75rem var(--f-ui); color: var(--muted); }
.mp-room { grid-column: 2; align-self: start; max-height: 100%; overflow: auto; padding: 20px; }
.mpr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mpr-head .panel-title { margin-bottom: 2px; }
.mpr-sub, .mpr-text { margin: 0 0 12px; color: var(--muted); font-weight: 500; }
.mpr-text { max-width: 60ch; font-size: 1.02rem; }
.mpr-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 99px; font-size: .85rem; color: #cfe0ff; white-space: nowrap; }
.badge.is-warn { border-color: var(--yellow); color: var(--yellow); }
.mpr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 11px; }
.mpr-field { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.mpr-tools .mpr-field { margin: 0; }
.mpr-field > span { color: var(--muted); min-width: 90px; }
.mpr-tools .mpr-field > span { min-width: 0; }
.mpr-field input[type=text], .mpr-field select { min-width: 0; max-width: 300px; flex: 1; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #0a1430; color: var(--text); font: inherit; }
.mpr-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mpr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mpr-seat { --seat: var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 8px; min-height: 120px; border: 1px solid var(--line); border-top: 4px solid var(--seat); border-radius: 12px; background: rgba(10, 20, 44, .78); text-align: center; }
.mpr-seat.is-me { background: rgba(0, 200, 255, .08); border-color: var(--line-2); border-top-color: var(--seat); }
.mpr-seat.is-empty { justify-content: center; border: 1px dashed var(--line); background: rgba(10, 20, 44, .35); color: var(--muted); font-weight: 500; }
.mpr-av { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--seat); object-fit: cover; display: grid; place-items: center; background: #0a1430; color: var(--seat); font: italic 900 1.7rem var(--f-head); flex-shrink: 0; }
.mpr-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 800 1.05rem var(--f-head); }
.mpr-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 1.3em; }
.tag { padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: .75rem; color: #cfe0ff; }
.tag-dir { background: var(--yellow); color: #111; font-weight: 700; }
.mpr-state { font-size: .88rem; color: var(--muted); }
.mpr-state.is-ok { color: var(--good); }
.mpr-drone { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .85rem; color: #cfe0ff; max-width: 100%; }
.mpr-drone span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpr-drone em { font: normal 700 .68rem var(--f-mono); padding: 1px 6px; border-radius: 4px; background: rgba(0, 200, 255, .15); color: var(--neon); letter-spacing: .06em; }
.mpr-drone em.is-custom { background: #ff8a3d; color: #1a0d00; }
.mpr-btns { display: grid; gap: 5px; width: 100%; margin-top: auto; padding-top: 6px; }
.mpr-btns .btn { width: 100%; }
.btn-kick { border-color: rgba(239, 68, 68, .6); color: #ff8a8a; }
.btn-kick:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.mpr-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-lg { padding: 12px 20px; font-size: 1.02rem; }
.mpr-foot { position: sticky; bottom: -20px; z-index: 1; margin: 14px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: rgba(9, 17, 36, .97); }
.btn-start { background: var(--yellow); border-color: var(--yellow); color: #111; }
.btn-start:hover { color: #111; box-shadow: 0 0 18px rgba(255, 210, 58, .45); }
.btn-leave { margin-left: auto; border: 2px solid var(--bad); color: #ff8a8a; background: rgba(239, 68, 68, .1); }
.btn-leave:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-quit { margin-top: 6px; border: 2px solid var(--bad); color: #ff8a8a; background: rgba(239, 68, 68, .1); }
.btn-quit:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
/* spectators: room list 👁 button, stand under the seats, spectator HUD (no own drone: no stats / throttle / minimap) */
.room-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.room-watch { flex-direction: column; gap: 0; padding: 6px 12px; font-size: 1.2rem; }
.room-watch small { font: 700 .75rem var(--f-mono); color: var(--muted); min-height: 1em; }
.mpr-spect { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 4px; font-size: .92rem; }
.mpr-spect > b { margin-right: 4px; color: #cfe0ff; }
.mpr-muted { color: var(--muted); font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border: 1px solid var(--line-2); border-radius: 99px; }
.chip.is-me { border-color: var(--neon); color: var(--neon); }
.chip:not(:has(button)) { padding-right: 10px; }
.chip button { border: 0; background: none; color: #ff8a8a; cursor: pointer; font-weight: 700; padding: 0 5px; border-radius: 50%; }
.chip button:hover { background: var(--bad); color: #fff; }
.hud.is-watch .hud-stats, .hud.is-watch .hud-thr, .hud.is-watch .hud-armed, .hud.is-watch .hud-map { display: none; }
.hud.is-watch .hud-mp { pointer-events: auto; }
.hud-watch { display: none; }
.hud.is-watch .hud-watch { display: flex; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); gap: 8px; pointer-events: auto; }
.hud-watch button { min-width: 52px; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 22px; background: rgba(8, 16, 34, .7); color: #fff; font: 700 1rem var(--f-ui); cursor: pointer; }
.hud-watch button:active, .hud-watch button:hover { border-color: var(--neon); color: var(--neon); }
.hud.is-watch .hud-mp div { cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.hud.is-watch .hud-mp div:hover { background: rgba(255, 255, 255, .08); }
.hud-mp div.is-on { background: rgba(0, 200, 255, .2); }
.mpr-last { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.mpr-last h3 { margin: 0 0 6px; font: italic 800 .95rem var(--f-head); text-transform: uppercase; color: #cfe0ff; }
.mpr-last ol { margin: 0; padding-left: 22px; font: 700 .9rem var(--f-mono); }
.mpr-last small { color: var(--muted); font-family: var(--f-ui); }
.hud-mp { position: absolute; right: 16px; top: 80px; min-width: 180px; padding: 6px 10px; border-radius: 10px; background: rgba(8, 16, 34, .66); border: 1px solid rgba(120, 170, 255, .2); font: 700 .9rem var(--f-ui); }
.hud-mp div { display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; align-items: center; }
.hud-mp span { font-family: var(--f-mono); font-size: .8rem; color: var(--neon); }
.ed-name { flex: 1; min-width: 120px; max-width: 320px; font-weight: 700; }
.ed-open { max-width: 170px; }
.ed-left { grid-row: 2 / 4; border-radius: 0; border-width: 0 1px 0 0; padding: 10px; overflow: auto; }
.ed-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.ed-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10, 20, 44, .7); color: var(--text); font-size: .85rem; cursor: pointer; text-align: center; line-height: 1.1; }
.ed-item:hover { border-color: var(--line-2); }
.ed-item.is-on { border-color: var(--neon); background: rgba(0, 200, 255, .14); color: var(--neon); }
.ed-item svg { width: 34px; height: 34px; }
.ed-item.wide { grid-column: span 2; flex-direction: row; justify-content: center; }
.ed-item.wide svg { width: 20px; height: 20px; }
.ed-tools .field input, .ed-tools .field select { width: 110px; }
.ed-right { grid-row: 2 / 4; border-radius: 0; border-width: 0 0 0 1px; padding: 12px; display: flex; flex-direction: column; min-height: 0; }
.ed-list { list-style: none; margin: 0 0 12px; padding: 0; overflow: auto; flex: 1; min-height: 120px; max-height: 450px; border: 1px solid var(--line); border-radius: 10px; }
.ed-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid rgba(80,150,255,.08); cursor: pointer; font-size: .95rem; }
.ed-list li:hover { background: rgba(255,255,255,.04); }
.ed-list li.is-on { background: rgba(0, 200, 255, .16); color: var(--neon); }
.ed-list li i { font-style: normal; color: var(--neon); font-family: var(--f-mono); font-size: .8rem; margin-left: auto; }
.ed-props { flex: none; }
.ed-props h4 { margin: 0 0 8px; font: italic 800 1rem var(--f-head); text-transform: uppercase; color: #cfe0ff; display: flex; justify-content: space-between; }
.ed-props .row { display: grid; grid-template-columns: 74px repeat(3, 1fr); gap: 5px; align-items: center; margin-bottom: 6px; }
.ed-props .row span { color: var(--muted); font-size: .88rem; }
.ed-props .row input, .ed-props .row select { width: 100%; padding: 5px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; color: var(--text); font: 700 .88rem var(--f-mono); }
.ed-props .acts { display: flex; gap: 6px; margin-top: 8px; }
.ed-props p { color: var(--muted); font-weight: 500; }
.ed-props .ed-note { font-size: .82rem; margin: 0 0 6px; line-height: 1.25; }
.ed-stats { grid-column: 2; grid-row: 3; display: flex; align-items: center; gap: 22px; padding: 0 16px; border-top: 1px solid var(--line); background: var(--bg2); }
.ed-stats > div span { display: block; font-size: .75rem; color: var(--muted); letter-spacing: .06em; }
.ed-stats > div b { font: italic 800 1.25rem var(--f-head); }
.ed-status { font-size: .88rem; color: var(--good); max-width: 280px; line-height: 1.2; }
.ed-status.is-warn { color: var(--yellow); }
.ed-help { margin-left: auto; font-size: .8rem; color: var(--muted); font-weight: 500; max-width: 420px; line-height: 1.5; }

/* drone build */
#tab-build .sim-view { right: min(560px, 46vw); }
.bd-viewtools { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 14px; align-items: center; }
.bd-hint { color: var(--muted); font-size: .9rem; }
.bd-panel { position: absolute; top: 14px; right: 14px; bottom: 14px; width: min(540px, calc(46vw - 28px)); overflow: auto; padding: 18px; }
.bd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bd-head .panel-title { margin: 0 auto 0 0; }
.bd-head select { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #0a1430; max-width: 200px; }
.bd-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-card { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(10, 20, 44, .6); }
.bd-card svg { grid-row: span 3; width: 34px; height: 34px; fill: none; stroke: #cfe0ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bd-card label { font: 700 .78rem var(--f-ui); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.bd-card input, .bd-card select { width: 100%; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; font: italic 800 1.05rem var(--f-head); }
.bd-card small { color: var(--muted); font-weight: 500; }
.bd-card .pair { display: flex; gap: 6px; }
.bd-adv { margin-top: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.bd-adv summary { cursor: pointer; font: italic 800 1rem var(--f-head); text-transform: uppercase; }
.bd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
.bd-grid label { display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.bd-grid input { width: 100%; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; font: 700 .85rem var(--f-mono); }
.bd-pid { width: 100%; border-collapse: collapse; margin-top: 10px; }
.bd-pid th, .bd-pid td { padding: 4px; text-align: center; }
.bd-pid th { color: var(--muted); font-size: .85rem; }
.bd-pid td:first-child { text-align: left; font-weight: 700; }
.bd-pid input { width: 80px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; font: 700 .85rem var(--f-mono); }
.bd-foot { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 14px; align-items: stretch; }
.bd-twr { padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.bd-twr span { font: italic 800 .95rem var(--f-head); text-transform: uppercase; }
.bd-twr b { float: right; font: italic 900 1.7rem/1 var(--f-head); }
.bd-bar { display: flex; gap: 3px; margin: 10px 0 6px; }
.bd-bar i { flex: 1; height: 12px; border-radius: 2px; background: rgba(255,255,255,.1); }
.bd-twr small { color: var(--muted); }
.bd-warn { color: var(--bad); font-weight: 700; margin-top: 4px; }
.bd-foot .btn-go { width: auto; min-width: 190px; align-items: center; justify-content: center; text-align: center; }
.bd-lock { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--yellow); border-radius: 9px; color: var(--yellow); font-weight: 700; }
.bd-card input:disabled, .bd-card select:disabled, .bd-grid input:disabled, .bd-pid input:disabled { opacity: .5; }
.bd-note { color: var(--muted); font-size: .85rem; font-weight: 500; margin: 10px 0 0; }

/* settings */
#tab-settings { overflow: auto; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; padding: 18px; max-width: 1500px; margin: 0 auto; }
.st-card { padding: 18px; }
.st-card .panel-title { font-size: 1.3rem; }
.st-wide { grid-column: span 2; }
.st-axes { display: grid; gap: 5px; margin: 10px 0; }
.st-axis { display: grid; grid-template-columns: 70px 1fr 54px; gap: 8px; align-items: center; font: 700 .85rem var(--f-mono); color: var(--muted); }
.st-axis .bar { position: relative; height: 12px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.st-axis .bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--neon); }
.st-axis .bar.thr i { left: 0; }
.st-map { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .92rem; }
.st-map th, .st-map td { padding: 5px 4px; border-bottom: 1px solid rgba(80,150,255,.1); text-align: left; }
.st-map th { color: var(--muted); font-weight: 700; }
.st-map select, .st-map input[type=number] { padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; }
.st-cal { margin: 10px 0; padding: 12px; border: 1px solid var(--neon); border-radius: 11px; background: rgba(0, 200, 255, .07); }
.st-cal p { margin: 0 0 10px; font-size: 1.05rem; }
.st-cal .cand { color: var(--yellow); font-family: var(--f-mono); font-size: .9rem; }
.st-note { color: var(--muted); font-size: .9rem; font-weight: 500; }
.st-rates { display: grid; grid-template-columns: 1fr; gap: 12px; justify-items: center; }
.st-rates table { width: 100%; border-collapse: collapse; }
.st-rates th, .st-rates td { padding: 4px; text-align: center; }
.st-rates th { color: var(--muted); font-size: .85rem; }
.st-rates td:first-child { text-align: left; font-weight: 700; }
.st-rates input { width: 70px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #0a1430; font: 700 .85rem var(--f-mono); }
.st-rates canvas { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; background: #081126; }
.st-max { color: var(--muted); font: 700 .8rem var(--f-mono); }
.st-row { display: grid; grid-template-columns: 1fr 64px; gap: 2px 10px; align-items: center; margin-bottom: 12px; color: var(--muted); }
.st-row > span { grid-column: 1 / -1; }
.st-row output { font: 700 .9rem var(--f-mono); color: var(--text); text-align: right; }

.sim-loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--bg); z-index: 20; color: var(--muted); transition: opacity .3s; }
.sim-loading.is-done { opacity: 0; pointer-events: none; }
.sim-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(0,200,255,.2); border-top-color: var(--neon); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-noscript, .sim-fail { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: var(--bg); z-index: 30; padding: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; border-radius: 10px; background: #0d1830; border: 1px solid var(--neon); z-index: 50; font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.is-bad { border-color: var(--bad); }

/* smaller screens: game is desktop-first (radio via USB), keep it usable on tablets */
@media (max-width: 1100px) {
  .sim-tabs button { padding: 0 10px; font-size: .95rem; }
  .sim-tab-gear span { display: none; }
  .race-lobby { grid-template-columns: 1fr 1fr; overflow: auto; }
  .lobby-setup { grid-column: 2; }
  .race-lobby.is-mp .lobby-maps { max-height: 46vh; }
  .mp-room { grid-column: 1 / -1; grid-row: 2; max-height: none; }
  #tab-editor { grid-template-columns: 190px 1fr 250px; }
  .ed-help { display: none; }
  .st-wide { grid-column: auto; }
  .st-rates { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --top-h: 96px; }
  .sim-top { flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px; }
  .sim-tabs { order: 3; width: 100%; height: 38px; justify-content: space-between; }
  .sim-pilot { margin-left: auto; }
  .race-lobby { grid-template-columns: 1fr; overflow: auto; padding: 10px; }
  .lobby-setup, .lobby-maps { grid-column: 1; }
  .mp-room { grid-row: auto; }
  .mpr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-leave { margin-left: 0; }
  #tab-editor, #tab-build .sim-view { display: block; }
  .bd-panel { position: static; width: auto; margin: 10px; }
  #tab-build { overflow: auto; }
  #tab-build .sim-view { position: relative; height: 45vh; right: 0; }
  .bd-viewtools { display: none; }
  .hud-map { width: 120px; height: 120px; }
  .hud-stats .hud-box { grid-template-columns: 80px auto auto; padding: 3px 8px; }
  .hud-box b { font-size: 1.1rem; }
}

/* ===================================================================================================
   Phones / tablets (touch, no mouse – the same test as MOBILE in ui.js): on-screen sticks (TouchSticks in input.js).
   Race tab only (no editor, drone or settings); lobby in two columns: tracks + setup, or rooms + the room; compact HUD.
   =================================================================================================== */
@media (pointer: coarse) {
  :root { --top-h: 46px; }
  .sim-top { gap: 10px; padding: 0 10px; flex-wrap: nowrap; overflow-x: auto; }
  .sim-logo-mark { width: 34px; height: 28px; }
  .sim-logo-text img { width: 104px; height: auto; }
  .sim-logo-text small { font-size: .55rem; }
  .sim-tabs { order: 0; width: auto; height: 100%; }
  .sim-tabs [data-tab="editor"], .sim-tabs [data-tab="build"], .sim-tabs [data-tab="settings"] { display: none; }
  .sim-tabs button { padding: 0 10px; font-size: .9rem; }
  .sim-pilot { font-size: .85rem; }

  /* lobby: room list (left) + the room (right) */
  .race-lobby.is-mp .lobby-setup, .lobby-keys, .mp-dir { display: none !important; }
  .race-lobby:not(.is-mp) .lobby-setup { grid-column: 2; grid-row: 1; max-height: 100%; overflow: auto; padding: 12px; }
  .lobby-mode { margin-bottom: 8px; }
  /* solo on a phone: the whole left column scrolls (it is short in landscape), so the track list is always reachable */
  .race-lobby:not(.is-mp) .lobby-maps { overflow-y: auto; }
  .race-lobby:not(.is-mp) .solo-pane, .race-lobby:not(.is-mp) .map-list { flex: none; overflow: visible; }
  #soloPane .panel-title { display: none; }
  .week-card { padding: 6px 10px; margin-bottom: 8px; }
  .map-filter { flex-wrap: wrap; margin-bottom: 8px; }
  .map-filter button { padding: 6px 8px; font-size: .8rem; }
  /* the ARM button lights up in our cyan while armed */
  .touch-btns button.is-on { background: var(--neon); border-color: var(--neon); color: #04121f; box-shadow: 0 0 14px rgba(0, 200, 255, .6); }
  .race-lobby { grid-template-columns: minmax(220px, 32%) 1fr; grid-template-rows: minmax(0, 1fr); gap: 8px; padding: 8px; overflow: hidden; }
  .race-lobby .lobby-maps, .race-lobby.is-mp .lobby-maps { grid-column: 1; grid-row: 1; padding: 10px; max-height: none; min-height: 0; }
  .race-lobby .mp-room { grid-column: 2; grid-row: 1; max-height: 100%; padding: 12px; }
  .panel-title { font-size: 1.15rem; margin-bottom: 8px; }
  .room-group { margin-top: 6px; }
  .map-card { padding: 8px 10px; }
  .map-card b { font-size: .95rem; }
  .mpr-sub, .mpr-text, .mp-note { font-size: .82rem; }
  .mpr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
  .mpr-seat { min-height: 0; padding: 6px 4px; gap: 2px; border-top-width: 3px; }
  .mpr-seat.is-empty { min-height: 48px; font-size: .8rem; }
  .mpr-av { width: 34px; height: 34px; border-width: 2px; font-size: 1rem; }
  .mpr-name { font-size: .82rem; }
  .mpr-drone, .mpr-state, .tag { font-size: .7rem; }
  .mpr-tools { padding: 6px 8px; gap: 6px 10px; }
  .btn-lg { padding: 9px 12px; font-size: .88rem; }
  .mpr-foot { bottom: -12px; margin: 8px -12px -12px; padding: 8px 12px; }
  .btn-leave { margin-left: auto; }

  /* HUD: smaller boxes and numbers, minimap and pilot list out of the way */
  .sim.is-flying .hud-lap, .hud-lap { left: 8px; top: 8px; min-width: 0; }
  .hud-box { padding: 3px 8px; border-radius: 8px; }
  .hud-box span { font-size: .62rem; }
  .hud-box b { font-size: 1rem; }
  .hud-lap span b { font-size: .95rem; }
  .hud-lap strong { font-size: 1.35rem; }
  .hud-lap em { font-size: .72rem; }
  .hud-cp { right: 8px; top: 8px; }
  .hud-cp b { font-size: 1.2rem; }
  .hud-mp { right: 8px; top: 50px; min-width: 120px; padding: 4px 6px; font-size: .74rem; }
  .hud-mp div { grid-template-columns: 12px 1fr auto; gap: 4px; }
  .hud-mp span { font-size: .68rem; }
  .hud-stats { left: 8px; bottom: 8px; gap: 3px; }
  .hud-stats .hud-box { grid-template-columns: 62px auto auto; }
  .hud-stats .hud-box:nth-child(3) { grid-template-columns: 62px auto auto auto; }
  .hud-map { width: 104px; height: 104px; right: 8px; bottom: 18px; }
  .hud-msg { font-size: 2rem; }
  .hud-msg.is-warn, .hud-msg.is-bad { font-size: 1.25rem; }
  .hud-armed { bottom: 18px; font-size: .78rem; }
  .hud-thr { width: 110px; margin-left: -55px; bottom: 8px; }
  .hud-pause { top: 4%; width: 40px; height: 40px; margin-left: -20px; font-size: 1rem; opacity: .35; }
  .sim-copy { font-size: .58rem; }
  /* flying: sticks low in the corners, the stats / minimap move up out of the thumbs' way */
  .sim.is-flying .hud-stats { bottom: auto; top: 70px; }
  /* stats: numbers only (no labels, no volts), 2 × 2, about as wide as the lap timer; a small battery icon */
  .hud-stats { grid-template-columns: repeat(2, auto); gap: 3px; width: max-content; }
  .hud-stats .hud-box, .hud-stats .hud-box:nth-child(3) { grid-template-columns: auto auto; gap: 3px; align-items: center; padding: 2px 6px; border-radius: 6px; }
  .hud-stats .hud-box > span, .hud-stats #hudVolt { display: none; }
  .hud-stats .hud-box b { font-size: .82rem; }
  .hud-stats .hud-box small { font-size: .58rem; margin-left: 1px; }
  .hud-stats .hud-bat { order: -1; width: 16px; height: 9px; margin: 0 2px 0 0; padding: 1px; border-radius: 2px; position: relative; }
  .hud-stats .hud-bat::after { content: ''; position: absolute; right: -3px; top: 2px; width: 2px; height: 3px; background: #9fb4d0; border-radius: 0 1px 1px 0; }
  /* minimap: see-through, up under the gate counter; the pilot list below it */
  .sim.is-flying .hud-map { bottom: auto; top: 44px; background: rgba(8, 16, 34, .22); border-color: rgba(120, 170, 255, .18); opacity: .75; }
  .sim.is-flying .hud-mp { top: 154px; }
  .sim.is-flying .hud-armed { bottom: 92px; } /* above the ARM / reset / camera buttons */
}
/* phone held upright: rooms above the room; the race view asks to turn it */
@media (pointer: coarse) and (orientation: portrait) {
  .race-lobby { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .race-lobby .lobby-maps, .race-lobby.is-mp .lobby-maps { max-height: 34vh; }
  .race-lobby .mp-room { grid-column: 1; grid-row: 2; }
  /* solo, upright: tracks first (their list scrolls inside, ~40 % of the screen), the setup + SKRISTI under them; the page scrolls */
  .race-lobby:not(.is-mp) { grid-template-rows: max-content max-content; } /* not auto: the panels' min-height: 0 let rows shrink under each other */
  .race-lobby:not(.is-mp) .lobby-maps { max-height: none; overflow: visible; }
  .race-lobby:not(.is-mp) .map-list { max-height: 40vh; overflow: auto; }
  .race-lobby:not(.is-mp) .lobby-setup { grid-column: 1; grid-row: 2; max-height: none; overflow: visible; }
  .mpr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud::after { content: '↻ Pasukite telefoną gulsčiai'; position: absolute; left: 0; right: 0; bottom: 30%; text-align: center; font: 700 .9rem var(--f-ui); color: var(--muted); }
}
/* tournament room: the heat flown now; result share button */
.mpr-heat p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0; }
.chip.is-off { opacity: .5; }
.res-share:empty { display: none; }
.res-share { display: flex; justify-content: center; }
/* track of the week (lobby, above the track list) */
.week-card { display: grid; gap: 2px; width: 100%; text-align: left; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: inherit; font: inherit;
  border: 1px solid rgba(255, 210, 58, .45); background: linear-gradient(135deg, rgba(255, 210, 58, .14), rgba(123, 79, 255, .10)); }
.week-card:hover { border-color: #ffd23a; }
.week-card small { color: #ffd23a; font-weight: 700; letter-spacing: .03em; }
.week-card b { font-size: 1.05rem; }
.week-card span { color: var(--muted); font-size: .85rem; }
/* phones: Mode 2 on-screen sticks (left throttle + yaw, right pitch + roll) and arm / reset / camera */
.touch-sticks { position: absolute; inset: auto 0 0 0; height: 0; pointer-events: none; z-index: 3; }
.touch-pad { position: absolute; bottom: 22px; width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .28); background: rgba(8, 16, 34, .28); pointer-events: auto; touch-action: none; display: grid; place-items: center; }
.touch-pad:first-child { left: 22px; }
.touch-pad:nth-child(2) { right: 22px; width: 132px; height: 132px; } /* pitch / roll: 20 % bigger = finer control */
.touch-pad.is-thr { border-radius: 22px; }
.touch-pad i { width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 200, 255, .55); box-shadow: 0 0 12px rgba(0, 200, 255, .5); }
.touch-btns { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.touch-btns button { min-width: 48px; height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(8, 16, 34, .6); color: #fff; font: 700 .9rem var(--f-ui); touch-action: manipulation; }
/* pause / results overlays: multiplayer & tournament races get room buttons instead of the solo ones */
.overlay.is-mp .solo-only, .overlay:not(.is-mp) .mp-only { display: none !important; }
/* tournament room: no setup column (drone in the room panel, no practice 'Skristi') - the room takes its place */
.race-lobby.is-mp.is-cup .lobby-setup { display: none !important; }
@media (min-width: 1101px) and (pointer: fine) { .race-lobby.is-mp.is-cup { grid-template-columns: minmax(280px, 380px) 1fr; } }
.mpr-drone-fixed { margin: 6px 0 0; font-size: .9rem; }
/* tournament bracket over the game (the page's embed view in an iframe) */
.cup-frame { z-index: 6; }
.cup-frame-card { position: relative; width: min(1100px, calc(100% - 24px)); height: min(820px, calc(100% - 24px)); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cup-frame-card iframe { flex: 1; width: 100%; border: 0; background: #080810; }
.cup-frame-x { position: absolute; top: 8px; right: 8px; z-index: 1; }
.mpr-bracket { margin-left: 8px; vertical-align: middle; }
/* language switch (header, settings) – only the languages enabled in .env SIM_LANGS */
.sim-lang { margin-right: 12px; vertical-align: middle; }
.sim-lang button { padding: 4px 9px; font-size: .78rem; letter-spacing: .04em; }
.st-lang { flex-wrap: wrap; }
/* feedback button (header) + dialog */
.sim-fb { gap: 6px; padding: 4px 10px; font-size: .78rem; }
.fb-overlay { position: fixed; z-index: 50; }
.fb-card { width: min(480px, calc(100% - 24px)); text-align: left; }
.fb-card h3 { margin: 0; font: italic 900 1.4rem/1 var(--f-head); }
.fb-text, .fb-contact { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #0a1430; color: var(--text); font: inherit; resize: vertical; }
.fb-text:focus, .fb-contact:focus { outline: none; border-color: var(--neon); }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .sim-fb span { display: none; } }
