/* Space Bites - Design System V2.0 */

:root {
  --bg-dark-violet: #07000d;
  --bg-panel: rgba(17, 3, 31, 0.75);
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff007f;
  --neon-yellow: #ffea00;
  --neon-green: #39ff14;
  --neon-red: #ff073a;
  --neon-white: #ffffff;
  --glow-cyan: none;
  --glow-magenta: none;
  --glow-yellow: none;
  --glow-green: none;
  --glow-red: none;
  --glow-white: none;
  
  --font-retro: 'Press Start 2P', monospace;
  --font-ui: 'Orbitron', 'Inter', sans-serif;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

body {
  background-color: var(--bg-dark-violet);
  color: #ffffff;
  font-family: var(--font-ui);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* CRT SCANLINE AND CRT SYSTEM EFFECT OVERLAYS - DISABLED FOR MODERN LOOK */
.crt-scanlines {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.3) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
}

.crt-flicker {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 16, 16, 0.03);
  opacity: 0.95;
  z-index: 9998;
  pointer-events: none;
  animation: flicker-animation 0.15s infinite;
}

.crt-vignette {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(0,0,0,0) 55%, rgba(0,0,0,0.85) 120%);
  z-index: 10000;
  pointer-events: none;
}

@keyframes flicker-animation {
  0% { opacity: 0.98; }
  50% { opacity: 1.0; }
  100% { opacity: 0.98; }
}

/* Scrollfield background canvas */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: #05000a;
}

/* Typography & Neon Glows */
h1, h2, h3, h4 {
  font-family: var(--font-retro);
  letter-spacing: 2px;
}

.text-glow-cyan { text-shadow: var(--glow-cyan); color: var(--neon-cyan); }
.text-glow-magenta { text-shadow: var(--glow-magenta); color: var(--neon-magenta); }
.text-glow-yellow { text-shadow: var(--glow-yellow); color: var(--neon-yellow); }
.text-glow-green { text-shadow: var(--glow-green); color: var(--neon-green); }
.text-glow-red { text-shadow: var(--glow-red); color: var(--neon-red); }
.text-glow-white { text-shadow: var(--glow-white); color: var(--neon-white); }

.text-center { text-align: center; }
.w-100 { width: 100%; }

/* Buttons Style */
.retro-btn {
  background: rgba(10, 0, 20, 0.6);
  border: 2px solid #5a189a;
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-retro);
  font-size: 14px;
  padding: 12px 24px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(90, 24, 154, 0.5);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.retro-btn:hover {
  transform: scale(1.05);
  box-shadow: none;
}

.retro-btn:active {
  transform: scale(0.95);
  background: rgba(90, 24, 154, 0.4);
}

.retro-btn.neon-cyan { border-color: var(--neon-cyan); text-shadow: none; box-shadow: none; }
.retro-btn.neon-cyan:hover { background: var(--neon-cyan); color: #000000; }

.retro-btn.neon-magenta { border-color: var(--neon-magenta); text-shadow: none; box-shadow: none; }
.retro-btn.neon-magenta:hover { background: var(--neon-magenta); color: #000000; }

.retro-btn.neon-yellow { border-color: var(--neon-yellow); text-shadow: none; box-shadow: none; }
.retro-btn.neon-yellow:hover { background: var(--neon-yellow); color: #000000; }

.retro-btn.neon-green { border-color: var(--neon-green); text-shadow: none; box-shadow: none; }
.retro-btn.neon-green:hover { background: var(--neon-green); color: #000000; }

.retro-btn.neon-red { border-color: var(--neon-red); text-shadow: none; box-shadow: none; }
.retro-btn.neon-red:hover { background: var(--neon-red); color: #ffffff; }

.retro-btn.neon-white { border-color: var(--neon-white); text-shadow: none; box-shadow: none; }
.retro-btn.neon-white:hover { background: var(--neon-white); color: #000000; }

.retro-btn.disabled, .retro-btn:disabled {
  border-color: #444444;
  color: #666666;
  text-shadow: none;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.retro-btn.disabled:hover, .retro-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Global Header styling */
#global-header {
  height: 55px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 0, 127, 0.25);
  background-color: rgba(5, 0, 15, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 100;
  position: relative;
}

.header-logo {
  font-family: var(--font-retro);
  font-size: 18px;
  text-shadow: var(--glow-cyan);
  color: var(--neon-cyan);
}

#account-indicator {
  padding: 8px 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* App Main Container (SPA Screen Host) */
#app-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - 55px);
  height: calc(100dvh - 55px);
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 15px 20px;
  overflow-y: auto;
}

.screen.active {
  display: flex;
}

/* 1. TITLE SCREEN */
#title-screen {
  justify-content: center;
  align-items: center;
  gap: 15px;
  overflow: hidden;
}

.logo-container {
  text-align: center;
}

.game-logo-glow {
  font-size: 32px;
  font-family: var(--font-retro);
  color: #ffffff;
  text-shadow: none;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.game-subtitle {
  font-size: 10px;
  letter-spacing: 6px;
  color: var(--neon-cyan);
  text-shadow: none;
  font-family: var(--font-retro);
}

/* Ship Hangar Preview Display */
.hangar-preview-container {
  width: 280px;
  background: var(--bg-panel);
  border: 2px solid var(--neon-magenta);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  box-shadow: none;
}

.preview-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
  pointer-events: none;
}

.preview-label {
  font-family: var(--font-retro);
  font-size: 8px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.ship-preview-box {
  width: 140px;
  height: 140px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.ship-name-badge {
  font-family: var(--font-retro);
  font-size: 9px;
  color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--neon-yellow);
}

/* Menu navigation buttons */
.title-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}

.menu-btn {
  font-size: 14px;
  width: 100%;
  letter-spacing: 2px;
}

/* Screen Headers */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.back-btn {
  font-size: 10px;
  padding: 8px 16px;
}

.screen-title {
  font-size: 24px;
}

.spacer {
  width: 100px;
}

/* 2. STAGE SELECT SCREEN */
.stage-list-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  position: relative;
  padding: 20px 0;
}

.scroll-arrow {
  height: 60px;
  width: 50px;
  font-size: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 0, 25, 0.8);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.stage-cards-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  height: 100%;
  align-items: center;
  padding: 10px 50px;
  scrollbar-width: none; /* Firefox */
}

.stage-cards-container::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

/* Stage Card design */
.stage-card {
  flex: 0 0 140px;
  height: 200px;
  background: var(--bg-panel);
  border: 2px solid #5a189a;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.stage-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-cyan);
  box-shadow: 0 6px 12px rgba(0, 240, 255, 0.15);
}

.stage-card.selected {
  border-color: var(--neon-yellow);
  border-width: 3px;
  box-shadow: 0 0 10px rgba(255, 234, 0, 0.4);
  transform: translateY(-5px) scale(1.02);
}

.stage-card-num {
  font-family: var(--font-retro);
  font-size: 10px;
  color: #ffffff;
}

.stage-card-icon {
  font-size: 30px;
}

.stage-card-score-box {
  text-align: center;
}

.stage-card-score-lbl {
  font-size: 8px;
  color: #888888;
  margin-bottom: 4px;
}

.stage-card-score {
  font-family: var(--font-retro);
  font-size: 8px;
  color: var(--neon-cyan);
}

/* Locked card overlay */
.stage-card.locked {
  filter: grayscale(1);
  opacity: 0.5;
  cursor: not-allowed;
}

.stage-card.locked:hover {
  transform: none;
  border-color: #5a189a;
  box-shadow: none;
}

.stage-card-lock-icon {
  font-size: 32px;
  color: #777777;
}

/* Stage Select Footer */
.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: rgba(10, 0, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: 15px;
}

.selected-stage-info {
  font-family: var(--font-retro);
  font-size: 12px;
}

.info-label {
  color: #888888;
  margin-right: 10px;
}

.launch-btn {
  font-size: 16px;
  padding: 15px 40px;
}

/* Launch Transition Overlay & Animation */
#launch-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#launch-transition-overlay.hidden {
  display: none;
  opacity: 0;
}

.booster-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.launch-ship {
  font-size: 100px;
  transform: rotate(-45deg);
  animation: ship-shake 0.1s infinite alternate;
}

.thruster-fire {
  width: 25px;
  height: 60px;
  background: linear-gradient(to bottom, #ffea00, #ff007f);
  filter: blur(2px);
  border-radius: 50% 50% 0 0;
  transform: rotate(180deg);
  animation: thruster-pulse 0.05s infinite alternate;
  margin-top: -15px;
}

.hyperdrive-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 20%, #000000 80%), 
              repeating-linear-gradient(rgba(0, 240, 255, 0.1) 0px, rgba(0, 240, 255, 0.1) 2px, transparent 2px, transparent 10px);
  z-index: -1;
  animation: hyperdrive-flow 0.5s linear infinite;
}

@keyframes ship-shake {
  0% { transform: translate(1px, 1px) rotate(-45deg); }
  100% { transform: translate(-1px, -1px) rotate(-45deg); }
}

@keyframes thruster-pulse {
  0% { height: 50px; opacity: 0.8; }
  100% { height: 75px; opacity: 1; }
}

@keyframes hyperdrive-flow {
  0% { background-position: 0 0; }
  100% { background-position: 0 400px; }
}

/* 3. HANGAR SCREEN */
.hangar-layout {
  display: flex;
  gap: 30px;
  flex: 1;
  height: calc(100% - 60px);
  overflow: hidden;
}

.hangar-preview-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-panel);
  border: 2px solid rgba(255, 0, 127, 0.3);
  border-radius: 8px;
  padding: 20px;
  box-shadow: inset 0 0 15px rgba(255, 0, 127, 0.15);
}

.hangar-preview-window {
  flex: 1;
  min-height: 200px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hangar-grid-lines {
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: grid-scroll 10s linear infinite;
}

@keyframes grid-scroll {
  0% { transform: translate(-50px, -50px); }
  100% { transform: translate(0, 0); }
}

.ship-stats-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 15px;
}

.panel-subtitle {
  font-size: 10px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 12px;
}

.stat-row {
  margin-bottom: 8px;
}

.stat-name {
  font-size: 9px;
  color: #bbbbbb;
  display: block;
  margin-bottom: 4px;
}

.stat-bar {
  height: 10px;
  background: #222;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #444;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  transition: width 0.3s ease;
}

/* Upgrades Pane side */
.hangar-upgrade-side {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.hangar-tabs {
  display: flex;
  gap: 10px;
}

.hangar-tab {
  flex: 1;
  font-size: 11px;
  padding: 10px;
  border-color: rgba(255,255,255,0.1);
}

.hangar-tab.active {
  border-color: var(--neon-magenta);
  text-shadow: var(--glow-magenta);
  box-shadow: var(--glow-magenta), inset 0 0 10px rgba(255, 0, 127, 0.2);
  background: rgba(255, 0, 127, 0.1);
}

.hangar-tab-panes {
  flex: 1;
  background: var(--bg-panel);
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Custom Scrollbar for Hangar Upgrades & Tables */
.hangar-tab-panes::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.options-body::-webkit-scrollbar {
  width: 8px;
}
.hangar-tab-panes::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.options-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.hangar-tab-panes::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.options-body::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 4px;
  box-shadow: var(--glow-cyan);
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.tab-pane.active {
  display: flex;
}

/* Hangar upgrade/skin/weapon item cards */
.hangar-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.hangar-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(10, 0, 25, 0.6);
}

.card-info-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-title {
  font-family: var(--font-retro);
  font-size: 10px;
  color: #ffffff;
}

.card-description {
  font-size: 11px;
  color: #888888;
}

.card-level-dots {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  border: 1px solid #555;
}

.level-dot.filled {
  background: var(--neon-green);
  box-shadow: var(--glow-green);
  border-color: var(--neon-green);
}

.card-action-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.card-cost {
  font-family: var(--font-retro);
  font-size: 9px;
  color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
}

.buy-equip-btn {
  font-size: 9px;
  padding: 8px 16px;
}

/* 4. ACTIVE GAME SCREEN */
#game-container {
  padding: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: #000000;
  overflow: hidden;
}

#game-container.active {
  display: flex;
}

.game-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 40px;
  background: rgba(10, 5, 20, 0.85);
  border: 2px solid var(--neon-cyan);
  box-shadow: none;
  border-radius: 6px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-family: var(--font-retro);
  font-size: 8px;
  color: #777777;
  margin-bottom: 3px;
  text-align: center;
}

.hud-value {
  font-family: var(--font-retro);
  font-size: 11px;
}

.hud-hearts {
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--neon-red);
  text-shadow: var(--glow-red);
}

.hud-chips-wrapper {
  font-family: var(--font-retro);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-pause-btn {
  position: absolute;
  right: -45px;
  top: 0;
  height: 40px;
  width: 38px;
  font-size: 14px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: var(--neon-cyan);
  box-shadow: none;
}

.game-canvas-wrapper {
  position: relative;
  width: 100%;
  height: calc(100% - 60px);
  max-width: 430px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background-color: #020005;
  box-shadow: none;
  margin: 50px auto 0 auto;
}

#game-canvas {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
}

/* In-game overlay announcements */
#game-stage-announcement {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 9;
  pointer-events: none;
  font-family: var(--font-retro);
}

#game-stage-announcement h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

#game-stage-announcement h3 {
  font-size: 40px;
}

.hidden-fade {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.visible-fade {
  opacity: 1;
  pointer-events: auto;
}

/* Overlays / Modal Overlays inside Game Screen */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
}

.modal-content {
  background: var(--bg-panel);
  border-radius: 8px;
  padding: 30px;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.neon-border-cyan { border: 2px solid var(--neon-cyan); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.neon-border-magenta { border: 2px solid var(--neon-magenta); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.neon-border-yellow { border: 2px solid var(--neon-yellow); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.neon-border-green { border: 2px solid var(--neon-green); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.neon-border-red { border: 2px solid var(--neon-red); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.neon-border-white { border: 2px solid var(--neon-white); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}

.modal-header h3 {
  font-size: 16px;
}

.close-btn {
  font-size: 24px;
  padding: 0 8px;
  line-height: 1;
  border: none;
  background: transparent;
  color: #999;
  box-shadow: none;
}
.close-btn:hover {
  transform: none;
  color: #fff;
  box-shadow: none;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.result-details {
  background: rgba(0,0,0,0.5);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 20px;
  margin-top: 20px;
  font-family: var(--font-retro);
  font-size: 12px;
  line-height: 2;
}

.result-row {
  display: flex;
  justify-content: space-between;
}

/* Form Styling in Accounts modal */
.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  font-size: 10px;
  padding: 8px;
}

.auth-tab.active {
  border-color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 10px;
  color: #888888;
  font-family: var(--font-retro);
}

.retro-input {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #5a189a;
  border-radius: 4px;
  color: #ffffff;
  padding: 10px;
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
  transition: all 0.2s;
}

.retro-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.auth-divider {
  text-align: center;
  font-size: 9px;
  color: #666;
  margin: 15px 0;
  font-family: var(--font-retro);
}

.auth-status-box {
  background: rgba(255, 7, 58, 0.15);
  border: 1px solid var(--neon-red);
  color: #ff9999;
  border-radius: 4px;
  padding: 10px;
  margin-top: 15px;
  font-size: 11px;
  text-align: center;
}

.auth-status-box.success {
  background: rgba(57, 255, 20, 0.15);
  border-color: var(--neon-green);
  color: #99ffaa;
}

.auth-status-box.hidden {
  display: none;
}

/* Options settings styling */
.options-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 5px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 15px;
  border-radius: 4px;
  border-left: 3px solid var(--neon-cyan);
}

.option-label {
  font-family: var(--font-retro);
  font-size: 9px;
  color: #dddddd;
}

.retro-select {
  background: rgba(0,0,0,0.8);
  border: 1.5px solid var(--neon-cyan);
  color: #fff;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  box-shadow: var(--glow-cyan);
}

.retro-select:focus {
  background: #000;
}

/* Sound Switch/Checkbox custom styling */
.sound-toggle-wrapper {
  position: relative;
}

.retro-checkbox-input {
  display: none;
}

.retro-checkbox-label {
  display: block;
  width: 70px;
  height: 28px;
  background: rgba(255, 7, 58, 0.2);
  border: 1.5px solid var(--neon-red);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  font-family: var(--font-retro);
  font-size: 8px;
  transition: all 0.2s ease;
}

.retro-checkbox-label span {
  position: absolute;
  line-height: 25px;
  width: 50%;
  text-align: center;
  top: 0;
  transition: opacity 0.2s ease;
}

.retro-checkbox-label .checked-txt {
  left: 0;
  color: var(--neon-green);
  opacity: 0;
}

.retro-checkbox-label .unchecked-txt {
  right: 0;
  color: var(--neon-red);
  opacity: 1;
}

.retro-checkbox-input:checked + .retro-checkbox-label {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
}

.retro-checkbox-input:checked + .retro-checkbox-label .checked-txt {
  opacity: 1;
}

.retro-checkbox-input:checked + .retro-checkbox-label .unchecked-txt {
  opacity: 0;
}

/* Remapping key UI */
.option-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 15px;
}

.section-subtitle {
  font-size: 10px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 5px;
}

.key-remap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: 4px;
}

.key-action {
  font-size: 11px;
  color: #bbb;
}

.key-capture-btn {
  font-size: 9px;
  padding: 6px 12px;
  min-width: 100px;
  border-color: rgba(255,255,255,0.2);
}

.key-capture-btn:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.modal-footer {
  margin-top: 20px;
}

/* Credits auto scroller style */
.credits-speed-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 11px;
  color: #bbb;
}

.retro-slider {
  -webkit-appearance: none;
  width: 150px;
  height: 6px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  outline: none;
}

.retro-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  border-radius: 50%;
  cursor: pointer;
}

.credits-scroller-container {
  height: 240px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  padding: 10px 0;
}

.credits-scroller-content {
  text-align: center;
  font-size: 9px;
  line-height: 1.8;
  position: absolute;
  width: 100%;
  top: 100%; /* controlled dynamically in JS */
}

.credits-scroller-content .role {
  color: #888;
  font-size: 8px;
  margin-bottom: 2px;
}

.credits-scroller-content .name {
  font-family: var(--font-retro);
  margin-bottom: 10px;
}

/* Leaderboard modal styling */
.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.leaderboard-tab {
  flex: 1;
  font-size: 10px;
  padding: 8px;
}

.leaderboard-tab.active {
  border-color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
  background: rgba(255, 234, 0, 0.1);
}

.leaderboard-body {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  max-height: 40vh;
  overflow-y: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 12px;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 12px;
  text-align: left;
}

.leaderboard-table th {
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 2px solid #5a189a;
  font-family: var(--font-retro);
  font-size: 8px;
  color: var(--neon-yellow);
}

.leaderboard-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table tr:hover {
  background: rgba(255, 234, 0, 0.05);
}

.leaderboard-rank-gold {
  color: #ffd700;
  text-shadow: 0 0 5px #ffd700;
  font-weight: bold;
}
.leaderboard-rank-silver {
  color: #c0c0c0;
  text-shadow: 0 0 5px #c0c0c0;
  font-weight: bold;
}
.leaderboard-rank-bronze {
  color: #cd7f32;
  text-shadow: 0 0 5px #cd7f32;
  font-weight: bold;
}

/* Key Capture remap prompt */
.key-capture-content {
  width: 320px;
}

.key-capture-animation {
  margin-top: 20px;
  padding: 20px;
  border: 1px dashed rgba(0, 240, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
}

.pulsing-text {
  font-family: var(--font-retro);
  font-size: 10px;
  animation: pulse-op 1s infinite alternate;
}

@keyframes pulse-op {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.animate-pulse {
  animation: pulse 1.5s infinite alternate ease-in-out;
}

@keyframes flicker {
  0% { opacity: 0.8; }
  5% { opacity: 0.5; }
  10% { opacity: 0.9; }
  15% { opacity: 0.3; }
  20% { opacity: 0.8; }
  100% { opacity: 1; }
}

.animate-flicker {
  animation: flicker 2s infinite;
}

/* Responsiveness adjustments */
@media (max-width: 768px) {
  #global-header {
    height: 48px;
    padding: 0 12px;
  }
  .header-logo {
    font-size: 14px;
  }
  #account-indicator {
    padding: 6px 12px;
    font-size: 8px;
  }
  #app-container {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
  }
  .screen {
    padding: 10px;
  }
  
  /* 1. Title Screen Slimming */
  #title-screen {
    gap: 8px;
    justify-content: flex-start;
    padding-top: 15px;
  }
  .game-logo-glow {
    font-size: 26px;
    letter-spacing: 2px;
    margin-bottom: 4px;
  }
  .game-subtitle {
    font-size: 8px;
    letter-spacing: 4px;
  }
  .hangar-preview-container {
    width: 240px;
    padding: 8px;
    gap: 8px;
  }
  .ship-preview-box {
    width: 100px;
    height: 100px;
  }
  .ship-name-badge {
    font-size: 8px;
    padding: 4px 8px;
  }
  .title-menu {
    width: 240px;
    gap: 8px;
  }
  .menu-btn {
    font-size: 11px;
    padding: 8px 16px;
  }

  /* 2. Stage Select Slimming */
  .stage-list-wrapper {
    padding: 10px 0;
  }
  .stage-card {
    flex: 0 0 120px;
    height: 170px;
    padding: 8px;
  }
  .stage-card-num {
    font-size: 8px;
  }
  .stage-card-icon, .stage-card-lock-icon {
    font-size: 24px;
  }
  .stage-card-score-lbl {
    font-size: 7px;
  }
  .stage-footer {
    padding: 10px 15px;
    margin-top: 8px;
  }
  .selected-stage-info {
    font-size: 9px;
  }
  .launch-btn {
    font-size: 12px;
    padding: 10px 20px;
  }

  /* 3. Hangar Screen Slimming */
  .hangar-layout {
    flex-direction: column;
    overflow-y: auto;
    gap: 15px;
    height: 100%;
  }
  .hangar-preview-side {
    padding: 12px;
    gap: 10px;
    flex: none;
    height: auto;
  }
  .hangar-preview-window {
    height: 140px;
    min-height: 120px;
  }
  .ship-stats-panel {
    padding: 8px;
  }
  .stat-row {
    margin-bottom: 4px;
  }
  .stat-name {
    font-size: 8px;
  }
  .stat-bar {
    height: 8px;
  }
  .hangar-upgrade-side {
    flex: none;
    height: auto;
  }
  .hangar-tab-panes {
    padding: 12px;
  }
  .hangar-card {
    padding: 10px;
  }
  .card-title {
    font-size: 9px;
  }
  .card-description {
    font-size: 9px;
  }
  
  /* 4. Active Game Screen Canvas Setup */
  .game-hud {
    width: 90vw;
    max-width: 360px;
    height: 35px;
    padding: 0 10px;
  }
  .hud-label {
    font-size: 7px;
    margin-bottom: 1px;
  }
  .hud-value, .hud-chips-wrapper {
    font-size: 9px;
  }
  .hud-hearts {
    font-size: 12px;
  }
  .hud-pause-btn {
    right: -40px;
    height: 35px;
    width: 35px;
    font-size: 12px;
  }
  .game-canvas-wrapper {
    width: 100%;
    height: calc(100% - 45px);
    max-width: 360px;
    margin: 40px auto 0 auto;
  }
  
  .modal-content {
    width: 95%;
    padding: 15px;
  }
}
