* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05060a;
  color: #cfe9ff;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden { display: none !important; }

/* ---------- Overlays ---------- */
#start-screen, #win-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 35%, #0b1024 0%, #05060a 72%);
}

.panel {
  width: min(860px, 94vw);
  padding: 26px 26px 20px;
  border: 1px solid #1d2b4d;
  border-radius: 14px;
  background: rgba(8, 12, 24, 0.9);
  box-shadow:
    0 0 70px rgba(0, 240, 255, 0.09),
    inset 0 0 50px rgba(0, 240, 255, 0.035);
}

.panel.win { width: min(420px, 90vw); text-align: center; }

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.28em;
  color: #00f0ff;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.75);
}

h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: 0.24em;
  color: #ff2bd6;
  text-shadow: 0 0 20px rgba(255, 43, 214, 0.75);
}

.sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #7f93b8;
}

/* ---------- Map ---------- */
#map {
  height: min(46vh, 380px);
  border-radius: 10px;
  border: 1px solid #1d2b4d;
  overflow: hidden;
  background: #0a0f1a;
}
.leaflet-container { background: #0a0f1a; }

/* ---------- Controls ---------- */
.controls {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7f93b8;
}
#diff-label { color: #00f0ff; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #00f0ff, #ff2bd6);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #0b1024;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 14px #00f0ff;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #0b1024;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 14px #00f0ff;
  cursor: pointer;
}

.diff-hint {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #4a5b7a;
}

button {
  margin-top: 6px;
  padding: 14px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #05060a;
  background: linear-gradient(90deg, #00f0ff, #7af9ff);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.4);
  transition: filter 0.15s ease;
}
button:hover { filter: brightness(1.15); }
button:disabled { opacity: 0.5; cursor: wait; }

#status {
  min-height: 16px;
  font-size: 12px;
  color: #ffb347;
}

.keys {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #4a5b7a;
}
.keys b { color: #7f93b8; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

#hud-speed {
  position: absolute;
  left: 24px; bottom: 22px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1;
  color: #00f0ff;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.85);
}
#hud-speed small {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: #4a7f9e;
  text-shadow: none;
}

#hud-dist {
  position: absolute;
  left: 50%; top: 18px;
  transform: translateX(-50%);
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: 0.14em;
  color: #ff2bd6;
  text-shadow: 0 0 18px rgba(255, 43, 214, 0.75);
}

#hud-timer {
  position: absolute;
  right: 24px; top: 18px;
  font-size: clamp(16px, 3vw, 22px);
  color: #cfe9ff;
  text-shadow: 0 0 14px rgba(207, 233, 255, 0.5);
}

#hud-arrow-wrap {
  position: absolute;
  left: 50%; bottom: 92px;
  transform: translateX(-50%);
}
#hud-arrow {
  font-size: clamp(32px, 6vw, 46px);
  color: #ff2bd6;
  text-shadow: 0 0 24px rgba(255, 43, 214, 0.95);
  will-change: transform;
}
