/* ── Reset & Base ─────────────────────────────────────────── */

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

body {
  background: #0a0a0a;
  color: #c0c0c0;
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.hidden {
  display: none !important;
}

/* ── Start Screen ─────────────────────────────────────────── */

#start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  z-index: 100;
  cursor: pointer;
  user-select: none;
}

.start-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.start-content h1 {
  font-size: 28px;
  font-weight: 400;
  color: #00cc88;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.start-content .subtitle {
  font-size: 14px;
  color: #668866;
  margin-bottom: 40px;
}

.start-content .instruction {
  font-size: 16px;
  color: #88aa88;
  animation: pulse 2s ease-in-out infinite;
}

.start-content .credit {
  font-size: 11px;
  color: #445544;
  margin-top: 30px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Main App Layout ──────────────────────────────────────── */

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

#canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 20px;
  overflow: hidden;
}

#radar-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ── Info Panel ───────────────────────────────────────────── */

#info-panel {
  width: 260px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 1px solid #1a1a1a;
  overflow-y: auto;
}

#info-panel h2 {
  font-size: 20px;
  font-weight: 400;
  color: #00cc88;
  letter-spacing: 1px;
}

#city-subtitle {
  font-size: 12px;
  color: #668866;
  margin-top: -12px;
}

#aircraft-count {
  font-size: 14px;
  color: #88aa88;
}

#count-number {
  font-size: 32px;
  font-weight: 700;
  color: #00cc88;
  display: block;
  margin-bottom: 2px;
}

/* ── Zone Navigation ──────────────────────────────────────── */

#zone-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zone-arrow {
  background: none;
  border: 1px solid #333;
  color: #88aa88;
  font-size: 18px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}

.zone-arrow:hover {
  border-color: #00cc88;
  color: #00cc88;
}

#zone-dots {
  display: flex;
  gap: 8px;
}

.zone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.zone-dot.active {
  background: #00cc88;
}

.zone-dot:hover {
  background: #668866;
}

/* ── Legend ────────────────────────────────────────────────── */

#legend {
  font-size: 12px;
}

#legend h3 {
  font-size: 11px;
  font-weight: 400;
  color: #556655;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #88aa88;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Credit Usage ─────────────────────────────────────────── */

#credit-info {
  font-size: 11px;
  color: #556655;
}

#credit-bar-container {
  width: 100%;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

#credit-bar {
  height: 100%;
  width: 0%;
  background: #00cc88;
  border-radius: 2px;
  transition: width 0.3s, background-color 0.3s;
}

#credit-text {
  display: block;
}

#controls-hint {
  font-size: 10px;
  color: #334433;
  margin-top: auto;
}

/* ── Debug / Audio Controls Panel ─────────────────────────── */

#debug-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid #2a2a2a;
  padding: 20px;
  z-index: 50;
  max-height: 90vh;
  overflow-y: auto;
}

#debug-panel h3 {
  font-size: 12px;
  font-weight: 400;
  color: #00cc88;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.control-group {
  margin-bottom: 14px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #88aa88;
  margin-bottom: 4px;
}

.control-group label span {
  color: #00cc88;
}

.control-group input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #1a1a1a;
  border-radius: 2px;
  outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00cc88;
  cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00cc88;
  border: none;
  cursor: pointer;
}

#export-settings {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #88aa88;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

#export-settings:hover {
  border-color: #00cc88;
  color: #00cc88;
}

/* ── Tooltip ──────────────────────────────────────────────── */

#tooltip {
  position: fixed;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid #2a2a2a;
  padding: 10px 14px;
  font-size: 11px;
  color: #c0c0c0;
  line-height: 1.5;
  pointer-events: none;
  z-index: 60;
  max-width: 200px;
}

#tooltip strong {
  color: #00cc88;
  font-size: 12px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }

  #canvas-container {
    flex: none;
    height: 60vh;
    padding: 10px;
  }

  #info-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #1a1a1a;
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    overflow-y: visible;
    height: auto;
  }

  #info-panel h2 {
    font-size: 16px;
  }

  #count-number {
    font-size: 24px;
  }

  #debug-panel {
    width: calc(100% - 20px);
    right: 10px;
    top: 10px;
  }

  #legend {
    display: none;
  }
}
