:root {
  --bg-color: #050505;
  --panel-bg: #101820;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --gold: #FFB81C;
  --gold-dim: rgba(255, 184, 28, 0.2);
  --gold-glow: 0 0 15px rgba(255, 184, 28, 0.6);
  --error-red: #ff1744;
  --success-green: #00e676;
}

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

body {
  font-family: 'Courier New', Courier, monospace; /* Tech aesthetic */
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
  overscroll-behavior-y: none; /* Prevents pull-to-refresh on roof */
}

/* Base Utility Classes */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* Overlays */
.overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(5, 5, 5, 0.95);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000; transition: opacity 0.3s;
}
.overlay:not(.active) { opacity: 0; pointer-events: none; }
.permission-card {
  background: var(--panel-bg); padding: 2rem; border-radius: 12px;
  text-align: center; max-width: 90%; border: 1px solid var(--gold);
  box-shadow: var(--gold-glow);
}
.permission-card h1 { color: var(--gold); margin: 1rem 0; font-size: 2rem; }

/* Buttons */
.btn-primary, .btn-secondary {
  background: var(--gold); color: var(--bg-color);
  border: none; padding: 12px 24px; border-radius: 4px;
  font-size: 1.1rem; font-weight: bold; cursor: pointer;
  margin-top: 1rem; width: 100%; text-transform: uppercase;
}
.btn-secondary { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.btn-secondary:disabled { border-color: var(--text-secondary); color: var(--text-secondary); }

/* Header */
header {
  display: flex; justify-content: space-between; padding: 15px;
  background: var(--panel-bg); border-bottom: 1px solid var(--gold);
}
.header-left { display: flex; align-items: center; gap: 10px; font-weight: bold; color: var(--gold); }
.btn-icon { background: none; border: none; cursor: pointer; padding: 5px; }

/* Main HUD */
main { padding: 10px; display: flex; flex-direction: column; align-items: center; }

.compass-container {
  position: relative; width: 300px; height: 300px; margin: 20px auto;
  border-radius: 50%; border: 2px solid var(--gold-dim);
  background: radial-gradient(circle, var(--panel-bg) 0%, var(--bg-color) 100%);
}
canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Readouts */
#guidance-section { display: flex; justify-content: space-between; width: 100%; max-width: 350px; margin-top: 10px; }
.guidance-line { font-size: 1.2rem; font-weight: bold; }
#numeric-targets { color: var(--gold); text-shadow: var(--gold-glow); font-size: 1.5rem; }

/* Efficiency Bar */
#efficiency-section { width: 100%; max-width: 350px; margin: 20px 0; text-align: center; }
#efficiency-bar-container { width: 100%; height: 20px; background: var(--panel-bg); border: 1px solid var(--text-secondary); border-radius: 10px; overflow: hidden; }
#efficiency-bar { height: 100%; background: var(--gold); width: 0%; transition: width 0.1s linear, background-color 0.3s; }
.locked #efficiency-bar { background: var(--success-green); }

/* Controls */
#controls-section { width: 100%; max-width: 350px; background: var(--panel-bg); padding: 15px; border-radius: 8px; border: 1px solid var(--gold-dim); }
.control-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
input[type="range"] { width: 60%; accent-color: var(--gold); }
.panel-number-input { width: 50px; background: var(--bg-color); color: var(--gold); border: 1px solid var(--gold); text-align: center; padding: 5px; }
