:root {
  --bg: #0f1420;
  --panel: rgba(17, 24, 39, 0.92);
  --panel-solid: #111827;
  --line: rgba(255, 255, 255, 0.12);
  --txt: #e8edf6;
  --muted: #9aa6bd;
  --accent: #38bdf8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--txt); }
#map { position: absolute; inset: 0; z-index: 1; background: #223; }

.hidden { display: none !important; }

/* ---------- HUD superior ---------- */
#hud { position: absolute; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 10px; pointer-events: none; }
#scoreboard { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.score { display: flex; align-items: center; gap: 6px; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 10px; color: var(--txt); font-size: 13px; cursor: pointer;
  backdrop-filter: blur(6px); }
.score.active { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.score .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.score .n { font-weight: 700; min-width: 16px; text-align: right; }
.signal-wrap { display: flex; flex-direction: column; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 9px; backdrop-filter: blur(6px); pointer-events: auto; }
.signal-label { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.signal { font-weight: 700; font-size: 13px; }
.signal.good { color: #34d399; } .signal.ok { color: #fbbf24; } .signal.bad { color: #f87171; }

/* ---------- Estado / captura ---------- */
#statusWrap { position: absolute; bottom: 92px; left: 0; right: 0; z-index: 500;
  display: flex; justify-content: center; pointer-events: none; }
#status { background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; backdrop-filter: blur(6px);
  max-width: 90%; text-align: center; }

/* ---------- Controles ---------- */
#controls { position: absolute; bottom: 16px; right: 12px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px; }
.ctrl { width: 46px; height: 46px; border-radius: 12px; font-size: 20px;
  background: var(--panel); color: var(--txt); border: 1px solid var(--line);
  cursor: pointer; backdrop-filter: blur(6px); }
.ctrl:active { transform: scale(0.94); }

/* ---------- Mando de simulación ---------- */
#simpad { position: absolute; bottom: 16px; left: 12px; z-index: 500;
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pad-mid { display: flex; gap: 44px; }
.pad { width: 48px; height: 48px; border-radius: 12px; font-size: 18px;
  background: var(--panel); color: var(--txt); border: 1px solid var(--line);
  cursor: pointer; backdrop-filter: blur(6px); touch-action: none; user-select: none; }
.pad:active { background: var(--accent); color: #04121a; }

/* ---------- Pantalla de inicio ---------- */
#startScreen { position: absolute; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(120% 120% at 50% 0%, #16203a 0%, #0b1020 60%); overflow: auto; }
.start-card { width: 100%; max-width: 460px; background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.start-card h1 { margin: 0 0 4px; font-size: 24px; }
.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.mode-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.mode-card { text-align: left; background: #0d1526; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; color: var(--txt); cursor: pointer; }
.mode-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mode-card.disabled { opacity: 0.5; cursor: not-allowed; }
.mc-top { display: flex; justify-content: space-between; align-items: center; }
.mode-card p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.soon { font-size: 10px; background: #24304a; color: var(--muted);
  padding: 2px 7px; border-radius: 999px; }

.setup { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lbl { font-size: 13px; color: var(--muted); min-width: 58px; }
.seg { display: inline-flex; background: #0d1526; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--txt);
  padding: 8px 14px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--accent); color: #04121a; font-weight: 700; }
.owner-pick { gap: 6px; }
.owner-opt { display: inline-flex; align-items: center; gap: 6px; background: #0d1526;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px;
  color: var(--txt); cursor: pointer; font-size: 13px; }
.owner-opt .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.owner-opt.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.sim-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

.start-btn { width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: var(--accent); color: #04121a; font-size: 16px; font-weight: 800; cursor: pointer; }
.start-btn:active { transform: scale(0.99); }
.hint { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
