/* ============================================================
   FlugKontrolle – Style Sheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #58a6ff;
  --danger:    #f85149;
  --success:   #3fb950;
  --hud-h:     48px;
  --zoom-w:    44px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

/* ===== CANVAS ===== */
#gameCanvas {
  display: block;
  position: fixed;
  top: var(--hud-h);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--hud-h));
  cursor: crosshair;
  background: #0a0f14;
  touch-action: none;   /* let JS handle all touch events; prevents browser pan/zoom on canvas */
}

/* ===== HUD ===== */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hud-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

#hudLeft, #hudRight, #hudCenter {
  display: flex;
  align-items: center;
  gap: 20px;
}

#hudLeft span, #hudCenter span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

#scoreDisplay { color: #ffd700; }
#landedDisplay { color: var(--success); }
#diffDisplay { color: var(--muted); font-size: 13px; }

#spawnForecast {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}
.forecast-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  font-weight: 400;
}
.forecast-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: default;
  line-height: 1;
}
.forecast-chip canvas { display: block; }
/* Approaching: about to enter the map – pulse */
.forecast-chip-live {
  animation: forecast-approach 0.7s ease-in-out infinite alternate;
}
@keyframes forecast-approach {
  from { opacity: 0.65; transform: scale(0.95); }
  to   { opacity: 1;    transform: scale(1.08); }
}
/* Queued: pre-determined but not yet spawned – dimmed */
.forecast-chip-queued { opacity: 0.45; }
/* Countdown label below the icon */
.chip-countdown {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
/* Overflow counter */
.forecast-more {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  padding-left: 2px;
}

#hud button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
#hud button:hover { background: var(--border); border-color: var(--accent); }

/* ===== OVERLAYS ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.overlay.active { display: flex; }

.menu-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 48px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.menu-box.wide { max-width: 640px; }

.menu-box h1 { font-size: 2.4rem; letter-spacing: 2px; color: var(--accent); }
.menu-box h2 { font-size: 1.8rem; color: var(--text); }
.menu-box h3 { font-size: 1.1rem; color: var(--muted); margin-top: 4px; }
.subtitle { color: var(--muted); font-size: 1rem; margin-top: -10px; }

/* ===== BUTTONS ===== */
.big-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.big-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.big-btn:active { transform: translateY(0); }
.big-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.big-btn.secondary:hover { background: var(--border); }

/* ===== DIFFICULTY BUTTONS ===== */
.difficulty-select { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.difficulty-select label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

.btn-group { display: flex; gap: 8px; }
.diff-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.diff-btn:hover { border-color: var(--accent); color: var(--text); }
.diff-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ===== INSTRUCTIONS ===== */
.instructions {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.instructions li { display: flex; gap: 10px; align-items: flex-start; }

/* ===== AIRCRAFT LEGEND ===== */
#aircraftLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.legend-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
}
.legend-item .leg-icon { display: block; }
.legend-item .leg-name { font-size: 12px; color: var(--text); font-weight: 600; }
.legend-item .leg-speed { font-size: 11px; color: var(--muted); }
.legend-item .leg-pts { font-size: 11px; color: #ffd700; }

/* ===== ZOOM CONTROLS ===== */
#zoomControls {
  position: fixed;
  right: 16px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
#zoomControls button {
  width: var(--zoom-w);
  height: var(--zoom-w);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
#zoomControls button:hover { background: var(--border); border-color: var(--accent); }

/* ===== SPEED CONTROLS ===== */
#speedControls {
  position: fixed;
  right: 68px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted);
}
.speed-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.speed-btn:hover { border-color: var(--accent); color: var(--text); }
.speed-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ===== SCORE POPUP (JS-injected) ===== */
.score-popup {
  position: fixed;
  font-size: 22px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 50;
  animation: popUp 1.2s ease-out forwards;
}
.score-popup--neg {
  color: #ff5555;
}
@keyframes popUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-40px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.9); }
}

/* ===== GAME OVER – LOST COUNT ===== */
.lost-count {
  color: #ff6b6b;
  font-weight: 600;
  margin: 2px 0;
}

/* ===== HUD – LOST DISPLAY ===== */
.hud-lost {
  color: #ff6b6b;
  font-size: 0.85em;
}

/* ===== FEEDBACK TEXTAREA ===== */
.feedback-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  margin-top: 10px;
}

/* ===== COLLISION FLASH ===== */
.collision-flash {
  position: fixed;
  inset: 0;
  background: var(--danger);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  animation: flash 0.5s ease-out forwards;
}
@keyframes flash {
  0%   { opacity: 0.7; }
  100% { opacity: 0; }
}

#warningIndicator {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  animation: warningPulse 0.45s ease-in-out infinite alternate;
}

@keyframes warningPulse {
  from { opacity: 0.55; box-shadow: none; }
  to   { opacity: 1;    box-shadow: 0 0 8px rgba(248,81,73,0.5); }
}

/* ===== MAP SELECTION GRID ===== */
#mapGrid, .map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 2px;
}

/* Map card thumbnail preview */
.map-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.map-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #1a1d23;
  border: 1px solid var(--border);
}

.map-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-card:hover { border-color: var(--accent); background: #161b22; transform: translateY(-1px); }
.map-card.selected { border-color: var(--accent); background: rgba(88,166,255,0.08); }

.map-card-header { display: flex; justify-content: space-between; align-items: center; }
.map-card-name   { font-size: 15px; font-weight: 700; color: var(--text); }
.map-card-desc   { font-size: 12px; color: var(--muted); line-height: 1.4; flex: 1; }
.map-card-tags   { display: flex; gap: 6px; flex-wrap: wrap; }

.map-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.map-badge.diff-leicht, .map-badge.diff-easy   { background: rgba(63,185,80,.2);  color: #3fb950; }
.map-badge.diff-normal                          { background: rgba(88,166,255,.2); color: #58a6ff; }
.map-badge.diff-schwer, .map-badge.diff-hard   { background: rgba(244,162,97,.2); color: #f4a261; }
.map-badge.diff-experte, .map-badge.diff-expert{ background: rgba(248,81,73,.2);  color: #f85149; }
.map-badge.diff-random  { background: rgba(139,148,158,.2); color: #8b949e; }
.map-badge.test         { background: rgba(199,125,255,.2); color: #c77dff; }

.map-ap-count { font-size: 11px; color: var(--muted); }
.map-tag { font-size: 10px; color: var(--muted); background: var(--border); padding: 1px 6px; border-radius: 3px; }

/* ===== MAP SECTION TABS ===== */
.map-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.map-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  margin-bottom: -2px;
  transition: color .15s, background .15s, border-color .15s;
}
.map-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.map-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.map-section { display: none; }
.map-section.active { display: block; }

/* ===== SERVER MAP CONTROLS ===== */
.server-map-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.server-search {
  flex: 1;
  min-width: 130px;
  padding: 6px 10px;
  background: #1a2233;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.server-search:focus { border-color: var(--accent); }
.server-select {
  padding: 5px 8px;
  background: #1a2233;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.server-order-btn {
  padding: 5px 10px;
  background: #1a2233;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.server-order-btn:hover { background: rgba(88,166,255,.15); border-color: var(--accent); }
.server-map-grid { max-height: 320px; overflow-y: auto; }

/* ===== SERVER MAP CARD META ===== */
.map-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.card-stars { white-space: nowrap; }
.star-full  { color: #ffd700; }
.star-empty { color: #3a3f4a; }
.map-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.map-type-predefined { background: rgba(0,180,216,.15);  color: #00b4d8; }
.map-type-random     { background: rgba(88,166,255,.15);  color: #58a6ff; }
.map-type-creator    { background: rgba(44,198,83,.15);   color: #2dc653; }

/* ===== RATING WIDGET (game over) ===== */
.rating-wrap {
  text-align: center;
  padding: 10px 0 6px;
  border-top: 1px solid var(--border);
  margin: 4px 0 8px;
}
.rating-label { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.star-input   { display: inline-flex; gap: 4px; cursor: pointer; font-size: 30px; line-height: 1; }
.star-btn {
  color: #333;
  transition: color .1s, transform .1s;
  user-select: none;
}
.star-btn:hover, .star-btn.active { color: #ffd700; transform: scale(1.2); }
.rating-status {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  min-height: 16px;
}

/* ===== HUD USER CHIP ===== */
#hudUser {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.hud-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.hud-avatar-placeholder { font-size: 18px; line-height: 1; }
.hud-username {
  font-size: 12px;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-logout-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color .15s, background .15s;
}
.hud-logout-btn:hover { color: var(--text); background: var(--border); }
.hud-login-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.hud-login-btn:hover { background: var(--accent); color: #000; }

/* ===== MENU LOGIN AREA ===== */
.menu-login-area {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.menu-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.menu-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* ===== GAME OVER – SCORE SUBMIT ===== */
.score-submit {
  text-align: center;
  font-size: 13px;
  min-height: 22px;
  margin: 6px 0 10px;
}
.score-submit a { color: var(--accent); }
.score-saving  { color: var(--muted); }
.score-saved   { color: #58a6ff; }
.score-newbest { color: #ffd700; font-weight: 700; }
.score-error   { color: #f97316; }
.score-login   { color: var(--muted); }

/* ===== LEADERBOARD ===== */
.leaderboard-wrap {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.lb-title {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 8px;
  font-weight: 600;
}
.lb-loading, .lb-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lb-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.lb-table tbody td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
.lb-table tbody tr:last-child td { border-bottom: none; }
.lb-table tbody tr:hover { background: rgba(255,255,255,.03); }
.lb-table tr.lb-me { background: rgba(88,166,255,.08); }
.lb-table tr.lb-me td { color: #58a6ff; }
.lb-rank  { width: 36px; text-align: center; }
.lb-player { display: flex; align-items: center; gap: 7px; }
.lb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.lb-avatar-placeholder { font-size: 18px; flex-shrink: 0; }
.lb-score { font-weight: 700; white-space: nowrap; }
.lb-diff  { color: var(--muted); font-size: 12px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== MODAL OVERLAYS (username prompt, profile) ===== */
/* NOTE: display is intentionally NOT set here — .overlay sets display:none,
   .overlay.active sets display:flex. Adding display:flex here would always
   override the base .overlay { display:none } rule and break hiding logic. */
.modal-overlay {
  background: rgba(0,0,0,.72);
  z-index: 200;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 420px;
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 48px #0009;
}
.modal-box h2 { text-align: center; font-size: 1.5rem; margin: 0; }
.modal-subtitle { text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 18px;
}
.modal-btns { display: flex; gap: 12px; justify-content: center; }

/* ===== HUD PROFILE BUTTON ===== */
.hud-profile-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.hud-profile-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }

/* ===== TEST MAP CARD ===== */
.test-map-card {
  border-color: #f4a261 !important;
  background: rgba(244,162,97,.06) !important;
}
.test-map-card:hover { background: rgba(244,162,97,.14) !important; }
.test-map-card.selected { background: rgba(244,162,97,.20) !important; }

/* ===== CARD CREATOR LABEL ===== */
.card-creator {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ── Language Dropdown ── */
.lang-switcher {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.lang-dropdown {
  position: relative;
}
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.lang-trigger:hover,
.lang-dropdown.open .lang-trigger {
  background: rgba(255,255,255,.11);
  border-color: var(--accent);
}
.lang-flag {
  width: 22px;
  height: auto;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}
.lang-name-en {
  font-size: 11px;
  opacity: 0.5;
  font-weight: 400;
}
.lang-name  { font-size: 14px; font-weight: 500; }
.lang-arrow {
  font-size: 10px;
  opacity: .55;
  margin-left: 2px;
  transition: transform .2s;
}
.lang-dropdown.open .lang-arrow { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 195px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  z-index: 1000;
  animation: langDropUp .15s ease;
}
@keyframes langDropUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: background .12s;
  white-space: nowrap;
}
.lang-option:hover  { background: rgba(255,255,255,.08); }
.lang-option.active {
  background: rgba(88,166,255,.15);
  color: var(--accent);
  font-weight: 600;
}
.lang-option .lang-name { flex: 1; }
.lang-browser-hint {
  font-size: 13px;
  opacity: .45;
}
.lang-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 8px;
}

/* ===== GAME SETTINGS TOGGLE ===== */
.settings-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}
.settings-section h3 {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 10px;
}
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 0;
  user-select: none;
}
.settings-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 650px) {
  :root {
    --hud-h: 44px;
  }

  #hud { padding: 0 8px; }
  #hudLeft, #hudRight, #hudCenter { gap: 8px; }
  #hudLeft span, #hudCenter span  { font-size: 12px; }
  #hud button { padding: 4px 8px; font-size: 12px; }

  /* Collapse the spawn forecast on very small screens */
  #spawnForecast { max-width: 38vw; overflow: hidden; }

  /* Speed controls: hide label, shrink buttons, anchor bottom-right */
  #speedControls {
    right: 0;
    bottom: 0;
    border-radius: 10px 0 0 0;
    gap: 3px;
    padding: 5px 6px;
    flex-wrap: wrap;
    max-width: 200px;
    justify-content: flex-end;
  }
  #speedControls > span[data-i18n] { display: none; }
  .speed-btn { padding: 4px 7px; font-size: 11px; min-height: 32px; }

  /* Zoom buttons: shift up because speed bar is now smaller */
  #zoomControls { bottom: 56px; }

  /* HUD buttons – minimum touch target 44px */
  #hud button { min-height: 36px; }
  #menuBtnHud  { min-width: 36px; padding: 0; }
}

/* ===== BUILD BADGE ===== */
#buildBadge {
  position: fixed;
  bottom: 6px;
  left: 10px;
  font-size: 10px;
  font-family: monospace;
  color: rgba(255,255,255,0.22);
  pointer-events: none;
  z-index: 50;
  letter-spacing: 0.03em;
  user-select: none;
}

/* ===== BETA DISCLAIMER MODAL ===== */
#betaModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#betaModal.active { display: flex; }

.beta-box {
  background: var(--surface);
  border: 2px solid #f4a261;
  border-radius: 16px;
  padding: 40px 44px;
  max-width: 500px;
  width: 92%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.beta-icon {
  font-size: 42px;
  line-height: 1;
}
.beta-box h2 {
  font-size: 1.5rem;
  color: #f4a261;
}
.beta-box p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.beta-box p strong { color: var(--text); }
.beta-box a { color: var(--accent); }
