/* 🎨 RETRO CYBERCADE BRAND SYSTEM STYLESHEET */

:root {
  /* HSL Brand Theme Coordinate Tokens */
  --bg-dark: hsl(220, 28%, 6%);
  --bg-card: hsla(218, 29%, 12%, 0.85);
  --border-glow: hsla(0, 0%, 100%, 0.08);
  
  --primary-indigo: hsl(244, 75%, 59%);
  --secondary-cyan: hsl(188, 93%, 43%);
  --accent-pink: hsl(328, 86%, 56%);
  
  --success-emerald: hsl(158, 82%, 40%);
  --error-crimson: hsl(0, 84%, 60%);
  
  --text-primary: hsl(210, 38%, 95%);
  --text-secondary: hsl(218, 11%, 65%);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* 📺 CRT Scanlines & Visual Raster Shaders */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.75) 100%);
  z-index: 9999;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.06), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.06)
  );
  background-size: 100% 4px, 6px 100%;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.85;
}

/* 🔮 Glassmorphism Cards & Tactile Orbits */
.premium-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
}

.sphere-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-indigo) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  left: -100px;
}

.sphere-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--secondary-cyan) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  right: -100px;
}

/* 🚥 Central Layout Structure */
.arcade-container {
  width: 95vw;
  height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1600px;
}

/* Telemetry Header */
.arcade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  height: 80px;
}

.header-logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  letter-spacing: 2px;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

.accent-text {
  color: var(--secondary-cyan);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.sub-logo {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
}

.telemetry-panel {
  display: flex;
  gap: 24px;
  align-items: center;
}

.telemetry-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-label {
  color: var(--text-secondary);
}

.telemetry-val {
  font-weight: bold;
}

.val-green { color: var(--success-emerald); text-shadow: 0 0 8px rgba(16, 185, 129, 0.3); }
.val-cyan { color: var(--secondary-cyan); text-shadow: 0 0 8px rgba(6, 182, 212, 0.3); }

/* Main Grid Viewport split */
.main-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0; /* Ensures container can shrink properly */
}

/* Sidebar Selector */
.games-sidebar {
  width: 320px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.sidebar-title h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.divider-line {
  height: 2px;
  background: linear-gradient(90deg, var(--secondary-cyan), rgba(0,0,0,0));
  margin-bottom: 12px;
}

.games-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(6, 182, 212, 0.2);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.08);
}

.nav-item.active {
  background: rgba(79, 70, 229, 0.1);
  border-color: var(--primary-indigo);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

.sector-num {
  font-weight: 800;
  color: var(--accent-pink);
}

.nav-item.active .sector-num {
  text-shadow: 0 0 8px var(--accent-pink);
}

.sector-name {
  letter-spacing: 1px;
}

/* Core Main Screen Viewport */
.arcade-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  position: relative;
  min-width: 0;
  border: 1px solid rgba(6, 182, 212, 0.15);
  box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.05);
}

.game-viewport-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Welcome Splash View */
.welcome-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-glitch h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--text-primary);
  text-shadow: 2px 2px var(--accent-pink), -2px -2px var(--secondary-cyan);
  position: relative;
  animation: glitch 3s infinite;
}

.welcome-tagline {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 3px;
}

.system-specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 14px 20px;
  width: 280px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  margin-top: 10px;
}

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

.spec-row span:nth-child(1) {
  color: var(--text-secondary);
}

.spec-row span:nth-child(2) {
  color: var(--secondary-cyan);
}

/* Interactive Controls styles */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-indigo), var(--secondary-cyan));
  color: var(--text-primary);
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary-cyan);
}

.mute-toggle {
  color: var(--accent-pink);
  border-color: rgba(236, 72, 153, 0.3);
}

.mute-toggle.muted {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Console Logs footer */
.arcade-console {
  height: 120px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
}

.console-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-pink);
  margin-bottom: 6px;
}

.console-logs {
  flex: 1;
  overflow-y: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.log-entry {
  margin-bottom: 2px;
}

/* 👾 Glitch Keyframes */
@keyframes glitch {
  0% { transform: translate(0); }
  2% { transform: translate(-2px, 2px); }
  4% { transform: translate(2px, -2px); }
  6% { transform: translate(0); }
  98% { transform: translate(0); }
  99% { transform: translate(-1px, -1px); }
  100% { transform: translate(0); }
}

/* Game Interface Containers */
.game-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  color: var(--secondary-cyan);
  margin-bottom: 12px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.game-panel {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.canvas-viewport {
  border: 1px solid var(--border-glow);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  max-width: 100%;
  max-height: 100%;
}

.game-info-card {
  width: 240px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'Share Tech Mono', monospace;
  flex-shrink: 0;
}

.info-label {
  color: var(--text-secondary);
  font-size: 11px;
}

.info-val {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.info-divider {
  height: 1px;
  background: var(--border-glow);
}

/* 🏆 High Score Initials Submission Overlay */
.highscore-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 14, 20, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  font-family: 'Share Tech Mono', monospace;
  border-radius: 12px;
}

.highscore-overlay h3 {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent-pink);
  font-size: 24px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
  margin-bottom: 8px;
}

.highscore-overlay p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

.initials-input {
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--secondary-cyan);
  color: var(--text-primary);
  font-size: 36px;
  width: 130px;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
  outline: none;
  margin: 16px 0;
  font-family: 'Orbitron', sans-serif;
}

/* 📊 Home Screen Grid Leaderboard */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
  max-height: 230px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border-glow);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 15px;
}

.leaderboard-game-card {
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.leaderboard-game-card h5 {
  font-size: 11px;
  color: var(--secondary-cyan);
  margin-bottom: 6px;
  font-family: 'Orbitron', sans-serif;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  padding-bottom: 4px;
  letter-spacing: 0.5px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 2px;
}

.leaderboard-row.gold { color: #ffd700; }
.leaderboard-row.silver { color: #c0c0c0; }
.leaderboard-row.bronze { color: #cd7f32; }



