:root {
  --panel: rgba(12, 28, 48, 0.92);
  --text: #f2f5f8;
  --muted: #a9b8c8;
  --accent: #ffcc33;
  --danger: #ff5a4f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #163e6b; color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px; }
.target, .score { background: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 22px; }
.target .label { color: var(--muted); font-size: 16px; }
.target strong { color: var(--accent); }
.timer { position: absolute; top: 70px; left: 16px; right: 16px; height: 22px; background: var(--panel); border-radius: 11px; overflow: hidden; }
#timer-bar { height: 100%; background: #4fc36b; transition: background 0.3s; }
#timer-bar.low { background: var(--danger); }
#timer-text { position: absolute; inset: 0; text-align: center; font-size: 14px; line-height: 22px; font-weight: 600; }
.keys { position: absolute; bottom: 12px; left: 16px; background: var(--panel); padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); }
#minimap { position: absolute; right: 16px; bottom: 12px; border: 2px solid rgba(255,255,255,0.6); border-radius: 6px; background: #163e6b; }

#toast { position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%); background: var(--panel); padding: 14px 24px; border-radius: 12px; font-size: 26px; font-weight: 700; color: #7dea93; pointer-events: none; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5, 15, 30, 0.45); padding: 16px; }
.overlay.bottom { align-items: flex-end; background: none; padding-bottom: 40px; }
.panel { background: var(--panel); border-radius: 14px; padding: 24px 28px; max-width: 460px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.panel h1 { margin: 0 0 8px; font-size: 34px; }
.panel h2 { margin: 0 0 8px; }
.panel p { color: var(--muted); }
.panel strong { color: var(--text); }
.modes { border: 0; padding: 0; margin: 16px 0; display: flex; gap: 10px; justify-content: center; }
.modes label { background: rgba(255,255,255,0.08); padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 18px; }
.modes label:has(input:checked) { background: var(--accent); color: #1b2530; font-weight: 700; }
.modes input { display: none; }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
select, button { font: inherit; border-radius: 8px; border: 0; padding: 8px 14px; }
button { background: var(--accent); color: #1b2530; font-weight: 700; font-size: 18px; cursor: pointer; margin: 6px 4px 0; }
button.secondary { background: rgba(255,255,255,0.15); color: var(--text); }
.hint { font-size: 13px; }

@media (max-width: 640px) {
  .target, .score { font-size: 16px; padding: 8px 10px; }
  #minimap { width: 160px; height: 80px; }
  .keys { display: none; }
}
