*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

#game-wrap {
  position: relative;
  width: 640px;
  height: 480px;
  overflow: hidden;
  border: 1px solid #0a2060;
  box-shadow: 0 0 40px rgba(0,180,255,0.15), 0 0 80px rgba(0,80,200,0.08);
}

#game-canvas {
  display: block;
  width: 640px;
  height: 480px;
  cursor: none;
}

/* ─── CROSSHAIR ─────────────────────────────────── */
#crosshair {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  pointer-events: none;
  display: none;
}
#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.85);
}
#crosshair::before { width: 2px; height: 14px; top: 0; left: 6px; }
#crosshair::after  { width: 14px; height: 2px; top: 6px; left: 0; }

/* ─── INTERACTION HINT ──────────────────────────── */
#hint {
  position: absolute;
  bottom: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,10,30,0.75);
  border: 1px solid #00e5ff;
  color: #00e5ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 20px;
  pointer-events: none;
  display: none;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
}

/* ─── ZONE LABEL ────────────────────────────────── */
#zone-label {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  color: rgba(0,229,255,0.7);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
  display: none;
  text-shadow: 0 0 10px rgba(0,229,255,0.5);
}

/* ─── PROGRESS HUD ──────────────────────────────── */
#progress-hud {
  position: absolute;
  top: 12px; right: 12px;
  display: none;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(120,160,220,0.8);
  letter-spacing: 0.05em;
}
.hud-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hud-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(40,60,100,0.9);
  border: 1px solid rgba(0,140,200,0.4);
  transition: background 0.4s, box-shadow 0.4s;
}
.hud-dot.done {
  background: #00e5ff;
  box-shadow: 0 0 6px rgba(0,229,255,0.8);
  border-color: #00e5ff;
}

/* ─── SPLASH SCREEN ─────────────────────────────── */
#splash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #031030 0%, #000510 65%, #000208 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow: hidden;
}

/* Star field canvas */
#splash-stars {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Animated rings */
.splash-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.15);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  animation: ringPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.ring-1 { width: 240px; height: 240px; animation-delay: 0s;    border-color: rgba(0,229,255,0.18); }
.ring-2 { width: 400px; height: 400px; animation-delay: 0.9s;  border-color: rgba(80,80,255,0.12); }
.ring-3 { width: 560px; height: 560px; animation-delay: 1.8s;  border-color: rgba(120,0,200,0.09); }
@keyframes ringPulse {
  0%, 100% { transform: translate(-50%,-50%) scale(0.95); opacity: 0.5; }
  50%       { transform: translate(-50%,-50%) scale(1.05); opacity: 1;   }
}

/* Inner content */
.splash-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 590px;
  padding: 0 16px;
}

/* Badge */
.splash-badge {
  display: inline-block;
  background: rgba(0,80,160,0.25);
  border: 1px solid rgba(0,180,255,0.3);
  color: rgba(0,220,255,0.7);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

#splash h1 {
  color: #00e5ff;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 0 24px rgba(0,229,255,0.55), 0 0 48px rgba(0,100,210,0.35);
  margin-bottom: 6px;
  line-height: 1;
}
.splash-sub {
  color: rgba(140,185,255,0.65);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Station cards */
.station-cards {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  justify-content: center;
}
.station-card {
  flex: 1;
  background: rgba(0,10,28,0.7);
  border-radius: 4px;
  padding: 12px 10px 14px;
  border: 1px solid transparent;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.station-card:hover {
  transform: translateY(-2px);
}
.sc-cyan   { border-color: rgba(0,229,255,0.35);  box-shadow: 0 0 12px rgba(0,180,255,0.08); }
.sc-purple { border-color: rgba(176,68,255,0.35); box-shadow: 0 0 12px rgba(140,40,255,0.08); }
.sc-gold   { border-color: rgba(255,215,0,0.35);  box-shadow: 0 0 12px rgba(220,160,0,0.08); }
.sc-icon {
  font-size: 20px;
  margin-bottom: 7px;
  display: block;
  line-height: 1;
}
.sc-cyan   .sc-icon { color: #00e5ff; text-shadow: 0 0 10px rgba(0,229,255,0.7); }
.sc-purple .sc-icon { color: #c06aff; text-shadow: 0 0 10px rgba(176,68,255,0.7); }
.sc-gold   .sc-icon { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.7); }
.sc-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.sc-cyan   .sc-name { color: #44eeff; }
.sc-purple .sc-name { color: #cc88ff; }
.sc-gold   .sc-name { color: #ffd700; }
.sc-desc {
  color: rgba(160,190,230,0.6);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* How to play */
.how-to-play {
  background: rgba(0,10,30,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 12px 16px 14px;
  margin-bottom: 18px;
  text-align: left;
}
.htp-title {
  color: rgba(140,180,220,0.5);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
}
.htp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 20px;
  margin-bottom: 10px;
}
.htp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(160,200,240,0.7);
  font-size: 11px;
}
.htp-item span { line-height: 1.3; }
.htp-tip {
  color: rgba(130,165,210,0.55);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 10px;
  margin: 0;
}
.htp-tip em { color: rgba(255,215,0,0.7); font-style: normal; font-weight: 600; }

kbd {
  display: inline-block;
  background: rgba(0,60,130,0.45);
  border: 1px solid rgba(0,180,255,0.35);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10px;
  font-family: inherit;
  color: #44ddff;
  white-space: nowrap;
  flex-shrink: 0;
}

#start-btn {
  background: linear-gradient(135deg, rgba(0,180,255,0.12) 0%, rgba(0,80,200,0.08) 100%);
  border: 1px solid rgba(0,229,255,0.55);
  color: #00e5ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 11px 40px;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,229,255,0.18), inset 0 0 20px rgba(0,229,255,0.04);
  transition: all 0.25s;
  position: relative;
}
#start-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 20%, rgba(0,229,255,0.15) 50%, transparent 80%);
  opacity: 0;
  transition: opacity 0.25s;
}
#start-btn:hover {
  background: linear-gradient(135deg, rgba(0,229,255,0.18) 0%, rgba(0,120,255,0.12) 100%);
  box-shadow: 0 0 32px rgba(0,229,255,0.32), inset 0 0 24px rgba(0,229,255,0.08);
  transform: translateY(-1px);
}
#start-btn:hover::before { opacity: 1; }

/* ─── MAIN OVERLAY ──────────────────────────────── */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,4,16,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(3px);
}
#overlay.hidden { display: none; }

#overlay-panel {
  position: relative;
  background: linear-gradient(135deg, rgba(0,12,35,0.96) 0%, rgba(0,6,22,0.98) 100%);
  border: 1px solid rgba(0,229,255,0.4);
  border-radius: 4px;
  padding: 28px 28px 22px;
  width: 540px;
  max-height: 440px;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(0,229,255,0.1),
    0 0 30px rgba(0,100,200,0.2),
    0 0 60px rgba(0,60,140,0.1),
    inset 0 0 30px rgba(0,20,60,0.5);
}
#overlay-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e5ff, #b044ff, transparent);
  border-radius: 4px 4px 0 0;
}

#overlay-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 1px solid rgba(0,229,255,0.3);
  color: rgba(0,229,255,0.7);
  font-size: 14px;
  width: 26px; height: 26px;
  border-radius: 2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
#overlay-close:hover {
  background: rgba(0,229,255,0.1);
  color: #00e5ff;
}

#overlay-title {
  color: #00e5ff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(0,229,255,0.4);
}

#overlay-prompt {
  color: rgba(140,180,220,0.85);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

/* overlay fields */
.overlay-field {
  margin-bottom: 14px;
}
.overlay-field label {
  display: block;
  color: rgba(0,229,255,0.75);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.overlay-field textarea,
.overlay-field input[type="text"] {
  width: 100%;
  background: rgba(0,20,50,0.6);
  border: 1px solid rgba(0,180,255,0.3);
  border-radius: 2px;
  color: #d0e8ff;
  font-size: 12px;
  font-family: inherit;
  padding: 8px 10px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.overlay-field textarea:focus,
.overlay-field input[type="text"]:focus {
  border-color: rgba(0,229,255,0.6);
  box-shadow: 0 0 10px rgba(0,180,255,0.15);
}
.overlay-field textarea { min-height: 70px; }

.tip-box {
  background: rgba(176,68,255,0.08);
  border: 1px solid rgba(176,68,255,0.25);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 11px;
  color: rgba(200,160,255,0.85);
  line-height: 1.6;
}
.tip-box strong {
  color: rgba(220,180,255,0.95);
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#overlay-save {
  width: 100%;
  margin-top: 6px;
  background: transparent;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,229,255,0.15);
  transition: all 0.2s;
}
#overlay-save:hover {
  background: rgba(0,229,255,0.1);
  box-shadow: 0 0 20px rgba(0,229,255,0.3);
}

/* reflection overlay purple tint */
.overlay-reflection #overlay-panel {
  border-color: rgba(176,68,255,0.4);
}
.overlay-reflection #overlay-panel::before {
  background: linear-gradient(90deg, transparent, #b044ff, #00e5ff, transparent);
}
.overlay-reflection #overlay-title { color: #c06aff; text-shadow: 0 0 12px rgba(176,68,255,0.5); }
.overlay-reflection #overlay-save  { border-color: #b044ff; color: #b044ff; box-shadow: 0 0 12px rgba(176,68,255,0.15); }
.overlay-reflection #overlay-save:hover { background: rgba(176,68,255,0.1); box-shadow: 0 0 20px rgba(176,68,255,0.3); }

/* ─── FINAL SUMMARY ─────────────────────────────── */
#summary {
  position: absolute;
  inset: 0;
  background: rgba(0,2,12,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  backdrop-filter: blur(4px);
}
#summary.hidden { display: none; }

#summary-panel {
  background: linear-gradient(160deg, rgba(0,10,30,0.97) 0%, rgba(0,4,18,0.99) 100%);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 4px;
  padding: 32px 32px 26px;
  width: 580px;
  max-height: 450px;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 0 40px rgba(255,180,0,0.15), 0 0 80px rgba(200,100,0,0.08);
  position: relative;
}
#summary-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #ffd700, #00e5ff, #ffd700, transparent);
}
.summary-beacon {
  font-size: 40px;
  margin-bottom: 12px;
  animation: beaconPulse 2s ease-in-out infinite;
  display: block;
}
@keyframes beaconPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(255,215,0,0.6); transform: scale(1); }
  50% { text-shadow: 0 0 40px rgba(255,215,0,1), 0 0 60px rgba(255,180,0,0.6); transform: scale(1.05); }
}
#summary-panel h2 {
  color: #ffd700;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
}
.summary-sub {
  color: rgba(200,180,120,0.7);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  text-transform: uppercase;
}
#summary-body {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.summary-section {
  background: rgba(0,20,50,0.5);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 3px;
  padding: 12px 14px;
}
.summary-section h3 {
  color: rgba(255,215,0,0.85);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.summary-section p {
  color: rgba(180,210,240,0.8);
  font-size: 11px;
  line-height: 1.65;
}
#summary-close {
  background: transparent;
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 36px;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255,215,0,0.2);
  transition: all 0.2s;
}
#summary-close:hover {
  background: rgba(255,215,0,0.08);
  box-shadow: 0 0 28px rgba(255,215,0,0.35);
}

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0,10,30,0.5); }
::-webkit-scrollbar-thumb { background: rgba(0,180,255,0.3); border-radius: 2px; }
