/* ==========================================================================
   TYPE//TANK - AAA Game Interface Architecture
   Futuristic Tactical Command-Deck & Cyber-Military Telemetry
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Controlled Semantic Multi-Color Accents (25% Accent / 75% Neutral) */
  --accent-cyan: #22d3ee;
  --accent-cyan-dark: #06b6d4;
  --accent-cyan-glow: rgba(34, 211, 238, 0.18);
  --accent-cyan-bg: rgba(34, 211, 238, 0.08);

  --accent-purple: #a855f7;
  --accent-purple-dark: #8b5cf6;
  --accent-purple-glow: rgba(168, 85, 247, 0.18);
  --accent-purple-bg: rgba(168, 85, 247, 0.08);

  --accent-emerald: #10b981;
  --accent-emerald-dark: #059669;
  --accent-emerald-glow: rgba(16, 185, 129, 0.18);
  --accent-emerald-bg: rgba(16, 185, 129, 0.08);

  --accent-amber: #f59e0b;
  --accent-amber-dark: #d97706;
  --accent-amber-glow: rgba(245, 158, 11, 0.18);
  --accent-amber-bg: rgba(245, 158, 11, 0.08);

  --accent-coral: #f43f5e;
  --accent-coral-dark: #e11d48;
  --accent-coral-glow: rgba(244, 63, 94, 0.2);
  --accent-coral-bg: rgba(244, 63, 94, 0.08);

  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
  --accent-blue-bg: rgba(59, 130, 246, 0.08);

  /* Typography Scale */
  --font-hero: 'Orbitron', 'Rajdhani', sans-serif;
  --font-heading: 'Rajdhani', sans-serif;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Engineered Corner Radii (4px - 8px) */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Fast Snappy Game Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. THEMES: DARK CYBER-MILITARY (DEFAULT) & SILVER COMMAND DECK
   -------------------------------------------------------------------------- */
body.theme-dark {
  --bg-void: #070a0f;
  --bg-cabinet: #0a0f17;
  --bg-header: rgba(11, 16, 24, 0.94);
  --bg-panel: #0d131c;
  --bg-panel-sub: #111923;
  --bg-panel-hover: #151e2a;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(34, 211, 238, 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.25);

  --btn-bg: #111822;
  --btn-border: rgba(255, 255, 255, 0.10);
  --btn-text: #e2e8f0;
  --btn-hover-bg: #16202c;

  --canvas-bg: #070b12;
}

body.theme-light {
  --bg-void: #e2e8f0;
  --bg-cabinet: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-panel: #ffffff;
  --bg-panel-sub: #f8fafc;
  --bg-panel-hover: #f1f5f9;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.14);
  --border-focus: rgba(6, 182, 212, 0.5);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-panel: 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-subtle: 0 2px 8px rgba(15, 23, 42, 0.04);

  --btn-bg: #f8fafc;
  --btn-border: #cbd5e1;
  --btn-text: #1e293b;
  --btn-hover-bg: #ffffff;

  --canvas-bg: #f8fafc;
}

/* --------------------------------------------------------------------------
   3. RESET & BASELINE
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-void);
  font-family: var(--font-ui);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.arcade-body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-void);
}

/* --------------------------------------------------------------------------
   4. LAYOUT & ARCADE CABINET (ASPECT RATIOS)
   -------------------------------------------------------------------------- */
.arcade-cabinet {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-cabinet);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  transition: width var(--transition-normal), height var(--transition-normal), max-width var(--transition-normal);
}

/* Fluid Screen Fit */
.arcade-cabinet.aspect-auto {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
}

/* 16:9 Widescreen */
.arcade-cabinet.aspect-16-9 {
  width: 100vw;
  height: calc(100vw * 9 / 16);
  max-width: calc(100vh * 16 / 9);
  max-height: 100vh;
  margin: auto;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px 1px var(--border-subtle);
}

/* 4:3 Classic Arcade Ratio */
.arcade-cabinet.aspect-4-3 {
  width: 100vw;
  height: calc(100vw * 3 / 4);
  max-width: calc(100vh * 4 / 3);
  max-height: 100vh;
  margin: auto;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px 1px var(--border-subtle);
}

/* CRT Scanline Overlay completely clean / disabled */
.crt-overlay {
  display: none !important;
  pointer-events: none;
}

.confetti-canvas {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
}

/* --------------------------------------------------------------------------
   5. TELEMETRY HEADER & TACTICAL HUD
   -------------------------------------------------------------------------- */
.marquee-hud {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
  flex-shrink: 0;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-logo-icon {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.hud-logo {
  font-family: var(--font-hero);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.hud-logo-slash {
  color: var(--accent-cyan);
}

.hud-version-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  letter-spacing: 0.5px;
}

.hud-callsign-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  background: var(--bg-panel);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.callsign-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.hud-callsign-box strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Combat Telemetry HUD Bar (Active in sortie) */
.combat-hud-bar {
  display: none;
  align-items: center;
  gap: 10px;
}

.marquee-hud.hud-combat-mode .combat-hud-bar {
  display: flex;
}

.hud-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  background: var(--bg-panel);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.hud-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.combo-high {
  color: var(--accent-amber) !important;
  text-shadow: 0 0 8px var(--accent-amber-glow);
}

/* Engineered Hull Integrity Meter */
.hull-chip {
  min-width: 165px;
}

.hull-meter {
  width: 75px;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

body.theme-light .hull-meter {
  background: #e2e8f0;
}

.hull-fill {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-xs);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.hull-fill.status-green {
  background: var(--accent-emerald);
}

.hull-fill.status-amber {
  background: var(--accent-amber);
}

.hull-fill.status-red {
  background: var(--accent-coral);
}

.hull-val-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.btn-abort {
  color: var(--accent-coral) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  font-weight: 700 !important;
}

.btn-abort:hover {
  background: var(--accent-coral-bg) !important;
  border-color: var(--accent-coral) !important;
}

/* Header Control Buttons */
.hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
  outline: none;
}

.hud-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.hud-btn.active {
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.4);
  background: var(--accent-cyan-bg);
}

.hud-btn.btn-theme {
  border-color: var(--border-medium);
}

/* --------------------------------------------------------------------------
   6. VIEWPORT & TACTICAL CARD CONTAINERS
   -------------------------------------------------------------------------- */
.arcade-viewport {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-screen-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  padding: clamp(10px, 2.5vh, 24px);
  box-sizing: border-box;
}

.screen-hidden {
  display: none !important;
}

.screen-active {
  display: flex !important;
}

/* Engineered Panel Box (4px-8px corners, layered dark surfaces, 1px borders) */
.terminal-box {
  width: 100%;
  max-width: 900px;
  margin: auto 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Tactical Corner Brackets */
.terminal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--accent-cyan);
  border-left: 2px solid var(--accent-cyan);
  pointer-events: none;
  z-index: 5;
}

.terminal-box::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
  pointer-events: none;
  z-index: 5;
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-panel-sub);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-cyan { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan-glow); }
.dot-purple { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple-glow); }
.dot-gold { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber-glow); }
.dot-coral { background: var(--accent-coral); box-shadow: 0 0 6px var(--accent-coral-glow); }
.dot-emerald { background: var(--accent-emerald); box-shadow: 0 0 6px var(--accent-emerald-glow); }

.header-title {
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}

.header-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  letter-spacing: 0.5px;
}

.box-body {
  padding: clamp(14px, 2.2vh, 22px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 16px);
}

/* --------------------------------------------------------------------------
   7. ENGINEERED TACTILE BUTTONS
   -------------------------------------------------------------------------- */
.retro-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: all var(--transition-fast);
  outline: none;
  box-shadow: var(--shadow-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.retro-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.retro-btn:active {
  transform: translateY(1px);
}

/* Primary Game Button: Dark surface + Cyan accent border & fill */
.retro-btn.btn-primary {
  background: #09202c;
  color: #ffffff;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25);
}

body.theme-light .retro-btn.btn-primary {
  background: #0e374d;
  color: #ffffff;
  border: 1px solid var(--accent-cyan-dark);
}

.retro-btn.btn-primary:hover {
  background: var(--accent-cyan-dark);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 20px var(--accent-cyan-glow);
}

.pulse-btn {
  animation: tactilePulse 3s infinite ease-in-out;
}

@keyframes tactilePulse {
  0%, 100% { border-color: var(--accent-cyan); }
  50% { border-color: rgba(34, 211, 238, 0.4); }
}

.terminal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.keyboard-hint {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Controlled Accent Text Utilities */
.text-cyan { color: var(--accent-cyan) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-coral { color: var(--accent-coral) !important; }

/* --------------------------------------------------------------------------
   8. INPUTS & TERMINAL FORMS
   -------------------------------------------------------------------------- */
.dos-prompt-container {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dos-prompt {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.dos-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dos-input-line:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.prompt-prefix {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.dos-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex: 1;
}

.blinking-cursor {
  font-weight: bold;
  color: var(--accent-cyan);
  animation: cursorBlink 0.9s infinite step-start;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

.prompt-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. SCREEN 1: LOGIN / AUTHORIZATION
   -------------------------------------------------------------------------- */
.box-login {
  max-width: 640px;
}

.hero-brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 6px 0 10px;
}

.hero-emblem {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.emblem-inner {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-xs);
  background: #ffffff;
  mask: radial-gradient(circle at center, transparent 35%, black 40%);
  -webkit-mask: radial-gradient(circle at center, transparent 35%, black 40%);
}

.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.hero-title .hero-slash {
  color: var(--accent-cyan);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.hero-tag-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-panel-sub);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tag-cyan { border-color: rgba(34, 211, 238, 0.25); color: var(--accent-cyan); }
.tag-purple { border-color: rgba(168, 85, 247, 0.25); color: var(--accent-purple); }
.tag-gold { border-color: rgba(245, 158, 11, 0.25); color: var(--accent-amber); }
.tag-coral { border-color: rgba(244, 63, 94, 0.25); color: var(--accent-coral); }

/* --------------------------------------------------------------------------
   10. SCREEN 2: ARMORY SETTINGS
   -------------------------------------------------------------------------- */
.box-settings {
  max-width: 900px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.sec-accent {
  color: var(--accent-cyan);
  font-size: 10px;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mode-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

/* Subtle Colored Top Border Indicator */
.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.card-alpha::before { background: var(--accent-emerald); }
.card-bravo::before { background: var(--accent-cyan); }
.card-charlie::before { background: var(--accent-purple); }
.card-delta::before { background: var(--accent-coral); }

.mode-card:hover {
  background: var(--bg-panel-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.mode-card.selected {
  background: var(--bg-panel-hover);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 4px 14px var(--accent-cyan-glow), inset 0 0 12px rgba(34, 211, 238, 0.06);
  transform: translateY(-2px);
}

.card-alpha.selected { border-color: var(--accent-emerald); box-shadow: 0 4px 14px var(--accent-emerald-glow), inset 0 0 12px rgba(16, 185, 129, 0.06); }
.card-bravo.selected { border-color: var(--accent-cyan); box-shadow: 0 4px 14px var(--accent-cyan-glow), inset 0 0 12px rgba(34, 211, 238, 0.06); }
.card-charlie.selected { border-color: var(--accent-purple); box-shadow: 0 4px 14px var(--accent-purple-glow), inset 0 0 12px rgba(168, 85, 247, 0.06); }
.card-delta.selected { border-color: var(--accent-coral); box-shadow: 0 4px 14px var(--accent-coral-glow), inset 0 0 12px rgba(244, 63, 94, 0.06); }

.mode-active-indicator {
  display: none;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

.mode-card.selected .mode-active-indicator {
  display: inline-block;
}

.card-alpha .mode-active-indicator { background: var(--accent-emerald); color: #070a0f; }
.card-bravo .mode-active-indicator { background: var(--accent-cyan); color: #070a0f; }
.card-charlie .mode-active-indicator { background: var(--accent-purple); color: #ffffff; }
.card-delta .mode-active-indicator { background: var(--accent-coral); color: #ffffff; }

.mode-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mode-badge {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

.badge-emerald { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.badge-cyan { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.badge-purple { background: var(--accent-purple-bg); color: var(--accent-purple); }
.badge-coral { background: var(--accent-coral-bg); color: var(--accent-coral); }

.mode-diff {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
}

.mode-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.mode-sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.mode-sample-chips .chip {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-panel-sub);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.settings-subgrid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.subgrid-col {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subgrid-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.matrix-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.matrix-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.matrix-label:hover {
  border-color: var(--border-medium);
}

.matrix-label.locked {
  opacity: 0.8;
  cursor: default;
}

.matrix-text {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.matrix-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--bg-panel-sub);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.aspect-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.aspect-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 5px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.aspect-btn:hover {
  border-color: var(--border-medium);
}

.aspect-btn.active {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-bg);
}

.aspect-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.aspect-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.sample-ticker-box {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.ticker-content {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   11. SCREEN 3: COMBAT BRIEFING
   -------------------------------------------------------------------------- */
.box-instructions {
  max-width: 880px;
}

.directive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.directive-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

/* 2px Tactical Accent Strip */
.directive-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.card-cyan::before { background: var(--accent-cyan); }
.card-emerald::before { background: var(--accent-emerald); }
.card-purple::before { background: var(--accent-purple); }
.card-bonus::before { background: var(--accent-coral); }
.card-amber::before { background: var(--accent-amber); }
.card-indigo::before { background: var(--accent-blue); }

.directive-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.directive-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

.num-cyan { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.num-emerald { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.num-purple { background: var(--accent-purple-bg); color: var(--accent-purple); }
.num-coral { background: var(--accent-coral-bg); color: var(--accent-coral); }
.num-amber { background: var(--accent-amber-bg); color: var(--accent-amber); }
.num-indigo { background: var(--accent-blue-bg); color: var(--accent-blue); }

.directive-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.directive-card p {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.directive-card strong {
  color: var(--text-primary);
}

.card-bonus {
  background: var(--accent-coral-bg);
  border-color: rgba(244, 63, 94, 0.2);
}

/* --------------------------------------------------------------------------
   12. SCREEN 4: GAME ARENA & CANVAS HUD
   -------------------------------------------------------------------------- */
.game-wrapper {
  padding: 0 !important;
  overflow: hidden !important;
}

.canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--canvas-bg);
}

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

/* --------------------------------------------------------------------------
   13. SCREEN 5: SORTIE DEBRIEF & RESULTS
   -------------------------------------------------------------------------- */
.box-result {
  max-width: 800px;
}

.record-celebration-banner {
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 8px;
  text-align: center;
  letter-spacing: 1px;
}

.record-celebration-banner.hidden {
  display: none;
}

.debrief-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-panel-sub);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.meta-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 800;
}

.metric-sub {
  font-size: 9px;
  color: var(--text-muted);
}

.pb-comparison-box {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   14. SCREEN 6: FLIGHT LOGS ARCHIVE
   -------------------------------------------------------------------------- */
.box-records {
  max-width: 900px;
}

.lifetime-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.life-stat-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.life-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.life-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
}

.mode-bests-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mode-best-card {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  text-align: center;
}

.quad-title {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.quad-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.quad-wpm {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.log-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.filter-buttons-group {
  display: flex;
  gap: 5px;
}

.log-filter-btn {
  background: var(--bg-panel);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.log-filter-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.log-filter-btn.active {
  background: var(--accent-cyan-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.purge-btn {
  background: transparent;
  color: var(--accent-coral);
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.purge-btn:hover {
  background: var(--accent-coral-bg);
  border-color: var(--accent-coral);
}

.table-scroll-container {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.flight-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
}

.flight-table th {
  background: var(--bg-panel-sub);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

.flight-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.flight-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

body.theme-light .flight-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.badge-mode {
  background: var(--accent-cyan-bg);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
}

.badge-pb {
  color: var(--accent-amber);
  font-weight: 800;
  margin-left: 4px;
}

.log-empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 20px !important;
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE ADAPTATIONS (100% ZOOM FIT)
   -------------------------------------------------------------------------- */
@media (max-height: 740px) {
  .box-body {
    padding: 10px 14px;
    gap: 8px;
  }
  .table-scroll-container {
    max-height: 120px;
  }
  .terminal-box {
    margin: 4px 0;
  }
  .hero-brand-section {
    padding: 2px 0 6px;
  }
  .hero-emblem {
    display: none;
  }
}

@media (max-width: 800px) {
  .mode-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
  .directive-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .lifetime-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mode-bests-quad {
    grid-template-columns: 1fr 1fr;
  }
  .settings-subgrid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   16. ACCESSIBILITY & FOCUS STATES
   -------------------------------------------------------------------------- */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 1px;
}
