/* ============================================================
   SolarStorm — Elite-Style Cockpit CSS
   ============================================================ */

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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  color: #00ffcc;
  user-select: none;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================
   HUD Overlay (rendered via Phaser HTML overlay or Canvas)
   ============================================================ */

/* ---- Auth Screens ---- */
.auth-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, #0a1628 0%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  color: #00ffcc;
  text-shadow: 0 0 30px #00ffcc, 0 0 60px #00ffcc55;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  animation: titlePulse 3s ease-in-out infinite;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: #0088aa;
  letter-spacing: 0.5em;
  margin-bottom: 3rem;
  text-transform: uppercase;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 30px #00ffcc, 0 0 60px #00ffcc55; }
  50% { text-shadow: 0 0 50px #00ffcc, 0 0 100px #00ffcc88; }
}

.auth-box {
  background: rgba(0, 20, 40, 0.8);
  border: 1px solid #00ffcc44;
  border-radius: 4px;
  padding: 2.5rem 3rem;
  min-width: 360px;
  box-shadow: 0 0 40px #00ffcc22, inset 0 0 60px #00000088;
}

.auth-box h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: #00ffcc;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 0.15em;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  color: #0088aa;
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #00ffcc44;
  border-radius: 2px;
  padding: 0.7rem 1rem;
  color: #00ffcc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 10px #00ffcc44;
}

.auth-btn {
  width: 100%;
  background: linear-gradient(180deg, #00ccaa 0%, #006688 100%);
  border: none;
  border-radius: 2px;
  padding: 0.8rem 1rem;
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s;
  text-transform: uppercase;
}

.auth-btn:hover {
  background: linear-gradient(180deg, #00ffcc 0%, #00aacc 100%);
  box-shadow: 0 0 20px #00ffcc88;
}

.auth-btn.secondary {
  background: rgba(0, 100, 136, 0.4);
  color: #00ffcc;
  border: 1px solid #00ffcc44;
  font-weight: 400;
  margin-top: 0.5rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #0088aa;
}

.auth-switch a {
  color: #00ffcc;
  text-decoration: none;
  cursor: pointer;
}

.auth-error {
  color: #ff4444;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
  min-height: 1.2em;
}

/* ============================================================
   HTML Auth Overlay (injected into body by Login/Register scenes)
   ============================================================ */
#auth-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, #0a1628 0%, #020810 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.auth-title-wrap {
  text-align: center;
}

.auth-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: #00ffcc;
  text-shadow: 0 0 30px #00ffcc, 0 0 80px #00ffcc55;
  letter-spacing: 0.15em;
  animation: titlePulse 3s ease-in-out infinite;
}

.auth-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  color: #0088aa;
  letter-spacing: 0.5em;
  margin-top: 0.4rem;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 30px #00ffcc, 0 0 80px #00ffcc55; }
  50%       { text-shadow: 0 0 50px #00ffcc, 0 0 120px #00ffcc88; }
}

.auth-box {
  background: rgba(0, 15, 35, 0.85);
  border: 1px solid #00ffcc44;
  border-radius: 6px;
  padding: 2rem 2.5rem;
  width: min(420px, 90vw);
  box-shadow: 0 0 60px #00ffcc15, inset 0 0 40px #00000066;
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: #0088aa;
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  background: rgba(0, 8, 20, 0.8);
  border: 1px solid #00ffcc33;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  color: #00ffcc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 12px #00ffcc44;
}

.auth-field input::placeholder {
  color: #005566;
}

.auth-error {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  min-height: 1.2em;
  text-align: center;
  margin: 0.5rem 0;
}

.auth-btn {
  width: 100%;
  background: linear-gradient(180deg, #00ccaa 0%, #006688 100%);
  border: none;
  border-radius: 3px;
  padding: 0.85rem 1rem;
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s;
  text-transform: uppercase;
}

.auth-btn:hover {
  background: linear-gradient(180deg, #00ffcc 0%, #00aacc 100%);
  box-shadow: 0 0 20px #00ffcc88;
}

.auth-switch {
  text-align: center;
  margin-top: 1.2rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: #0088aa;
}

.auth-switch a {
  color: #00ffcc;
  text-decoration: none;
  cursor: pointer;
}

.auth-switch a:hover {
  text-shadow: 0 0 8px #00ffcc;
}

/* ============================================================
   Space HUD (Elite-style cockpit — drawn on Phaser canvas)
   ============================================================ */

/* ---- Loading screen ---- */
.loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loading-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: #00ffcc;
  letter-spacing: 0.3em;
  animation: blink 1s step-end infinite;
}

.loading-bar-wrap {
  width: 300px;
  height: 4px;
  background: rgba(0,255,204,0.1);
  border: 1px solid #00ffcc44;
  margin-top: 1.5rem;
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #00ffcc, #00aaff);
  width: 0%;
  transition: width 0.3s;
  box-shadow: 0 0 10px #00ffcc;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---- Scan lines overlay ---- */
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}
