/* AGENT OVERDRIVE: Rogue Interceptor - High-Definition Stylesheet */

:root {
  --bg-dark: #050811;
  --bg-card: rgba(10, 16, 30, 0.88);
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff0055;
  --accent-amber: #ffea00;
  --accent-emerald: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-glow: rgba(0, 240, 255, 0.45);
  --border-pink: rgba(255, 0, 85, 0.45);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ambient Cyber Grid Background */
.ambient-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Site Navigation Header */
.game-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(5, 8, 17, 0.95);
  border-bottom: 1px solid var(--border-glow);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-magenta), var(--accent-cyan));
  color: #fff;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Volume Control Widget */
.volume-control-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glow);
  padding: 6px 12px;
  border-radius: 8px;
}

.vol-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .vol-text {
    display: none;
  }
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: transform 0.15s ease;
}

.vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.vol-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 32px;
}

/* Game Main Stage Container */
.game-stage-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.canvas-container {
  position: relative;
  width: 800px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  background: #020408;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.25), 0 25px 50px rgba(0, 0, 0, 0.9);
  border: 2px solid var(--border-glow);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* High-Definition CRT Scanlines Overlay */
.crt-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.28) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.55;
}

/* Game Overlays (Glassmorphic Modals) */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 17, 0.93);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px;
  text-align: center;
  z-index: 10;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.game-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 20px var(--accent-cyan);
  margin-bottom: 8px;
}

.overlay-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent-magenta);
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.menu-btn-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 330px;
}

/* Polished Glowing Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 13px 24px;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #040814;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.8);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-magenta), #b91c1c);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 0, 85, 0.45);
}

.btn-sm {
  padding: 7px 15px;
  font-size: 0.85rem;
}

/* Mission & Garage Cards Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 690px;
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 20px;
}

.mission-card, .skin-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.mission-card:hover, .skin-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.mission-card.locked {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.1);
}

.mission-header {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.mission-num {
  color: var(--accent-cyan);
  font-weight: 700;
}

.mission-reward {
  color: var(--accent-amber);
  font-weight: 700;
}

.skin-card.equipped {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.4);
}

/* Mobile Touch Controls */
.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  display: none;
}

@media (max-width: 900px), (pointer: coarse) {
  .touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px;
  }
}

.touch-dpad, .touch-action-pad {
  display: grid;
  pointer-events: auto;
  gap: 8px;
}

.touch-dpad {
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
}

.touch-btn {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid var(--border-glow);
  color: #fff;
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.touch-btn:active {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

.touch-action-pad {
  grid-template-columns: repeat(2, 64px);
  gap: 12px;
}

.touch-btn-action {
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Stats Callouts */
.stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 14px 22px;
  margin: 12px 0;
  display: flex;
  gap: 26px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--accent-cyan);
}
