/* ==========================================================================
   Cyber Snek: Overdrive - Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.85);
  --border-color: rgba(0, 242, 254, 0.2);
  --primary-cyan: #00f2fe;
  --primary-teal: #00ffcc;
  --accent-pink: #ff007f;
  --accent-gold: #ffe600;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Decor */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-1 {
  position: absolute;
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(60px);
}

.ambient-glow-2 {
  position: absolute;
  bottom: -10%;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 0, 127, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
}

/* Header Navbar */
.game-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-pink));
  color: #090d16;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
}

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

/* Music Player Bar Header Component */
.music-player-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.music-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-cyan);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-vol-slider {
  width: 70px;
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

.music-vol-lbl {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan), #00b4d8);
  color: #090d16;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.7);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
}

.btn-icon-only {
  padding: 8px;
  border-radius: 8px;
}

/* Main Container Layout */
.game-container {
  position: relative;
  z-index: 5;
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* HUD Panel */
.hud-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-cyan);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.stat-value.highlight {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
}

/* Canvas Display Wrap */
.canvas-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas#gameCanvas {
  background: #090d16;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 0 32px rgba(0, 242, 254, 0.15), inset 0 0 32px rgba(0, 0, 0, 0.8);
  max-width: 100%;
}

/* Overlay Menus (Start, GameOver, Pause) */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.game-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.overlay-subtitle {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.overlay-detail {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.mode-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: all 0.2s ease;
}

.mode-btn.active, .mode-btn:hover {
  background: var(--primary-cyan);
  color: #090d16;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

/* Virtual D-Pad for Touch Devices */
.virtual-dpad {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 6px;
  margin-top: 16px;
}

.dpad-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--primary-cyan);
  font-size: 1.2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

.dpad-btn:active {
  background: var(--primary-cyan);
  color: #090d16;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }
.dpad-nitro { grid-column: 2; grid-row: 2; background: rgba(255, 0, 127, 0.2); color: var(--accent-pink); }

/* Controls Legend */
.controls-legend {
  width: 100%;
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.key-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-cyan);
}

/* Customizer Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: #fff;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.skin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skin-card.selected {
  border-color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.12);
}

.skin-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.skin-req {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
