/* PUBLIC STYLES - PUCK: CALL OF THE ICE */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --bg-dark: #080c14;
  --bg-card: rgba(14, 22, 38, 0.85);
  --bg-card-border: rgba(0, 229, 255, 0.3);
  --cyan-glow: #00f0ff;
  --magenta-glow: #ff0077;
  --gold-glow: #ffcc00;
  --ice-blue: #a0f0ff;
  --neon-green: #00ff88;
  --purple-glow: #9900ff;
  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Rajdhani', -apple-system, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: #f0f6ff;
  font-family: var(--font-body);
  overflow: hidden;
  position: relative;
}

/* Background Animated Gradient Grid */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(circle at 50% 20%, rgba(0, 240, 255, 0.12), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 119, 0.08), transparent 50%),
    linear-gradient(to bottom, #050811, #0a1122);
  z-index: 0;
}

#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* Game Canvas Container */
#canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1280px;
  max-height: 800px;
  aspect-ratio: 16 / 10;
  background: #000;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.25), 0 0 100px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Overlay Base */
.overlay-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 10, 18, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-out;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Glowing Headers */
h1.title-glow {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, var(--cyan-glow) 50%, var(--magenta-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
  margin-bottom: 8px;
}

h2.subtitle-glow {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ice-blue);
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
  text-shadow: 0 0 12px rgba(160, 240, 255, 0.6);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cyan-glow);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 2px solid var(--bg-card-border);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 24px;
  border: 2px solid var(--cyan-glow);
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover {
  background: var(--cyan-glow);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7);
  transform: translateY(-2px);
}

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

.btn-magenta {
  border-color: var(--magenta-glow);
  background: rgba(255, 0, 119, 0.15);
}

.btn-magenta:hover {
  background: var(--magenta-glow);
  color: #fff;
  box-shadow: 0 0 25px rgba(255, 0, 119, 0.8);
}

.btn-gold {
  border-color: var(--gold-glow);
  background: rgba(255, 204, 0, 0.15);
}

.btn-gold:hover {
  background: var(--gold-glow);
  color: #000;
  box-shadow: 0 0 25px rgba(255, 204, 0, 0.8);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
}

.btn-secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* MAIN MENU SPECIFIC */
.main-menu-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}

.menu-banner {
  text-align: center;
  margin-top: 20px;
}

.menu-center-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 900px;
  align-items: center;
}

.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.menu-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-buttons-list .btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 14px 20px;
  justify-content: flex-start;
}

/* PLAYER & TEAM SELECTION */
.customizer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: calc(100% - 120px);
}

.character-card-option {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.character-card-option:hover, .character-card-option.selected {
  border-color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.color-swatch-picker {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
}

.swatch:hover, .swatch.selected {
  transform: scale(1.2);
  border-color: #fff;
  box-shadow: 0 0 12px currentColor;
}

/* SHOP / HANGAR */
.shop-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: calc(100% - 100px);
}

.shop-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bank-credits-badge {
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid var(--gold-glow);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding-right: 6px;
}

.shop-item-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s;
}

.shop-item-card:hover {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  transform: translateY(-2px);
}

.shop-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.shop-item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
}

.shop-item-level {
  font-size: 0.85rem;
  color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.shop-item-desc {
  font-size: 0.9rem;
  color: #bbb;
  margin-bottom: 12px;
  min-height: 38px;
}

.shop-item-stats {
  font-size: 0.85rem;
  color: var(--neon-green);
  margin-bottom: 12px;
}

.shop-item-actions {
  display: flex;
  gap: 8px;
}

/* SECTOR / MISSION SELECT */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.sector-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sector-card:hover, .sector-card.selected {
  border-color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.sector-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.mission-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.mission-card {
  background: rgba(10, 16, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.mission-card:hover, .mission-card.selected {
  border-color: var(--magenta-glow);
  background: rgba(255, 0, 119, 0.15);
}

.mission-card.locked {
  opacity: 0.3;
  pointer-events: none;
}

/* HUD Overlay during gameplay */
#hud-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 5;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.hud-bars-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.stat-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.75rem;
}

.stat-bar-label {
  width: 60px;
  color: #fff;
  font-weight: 700;
}

.bar-outer {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bar-inner-health {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0055, #ff5500);
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px #ff0055;
}

.bar-inner-shield {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00f0ff, #00aeff);
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px #00f0ff;
}

.hud-center-score {
  text-align: center;
  font-family: var(--font-display);
}

.hud-score-val {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-glow);
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.8);
}

.hud-credits-val {
  font-size: 1.1rem;
  color: var(--ice-blue);
}

.hud-right-stats {
  text-align: right;
  font-family: var(--font-display);
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hud-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.zamboni-bombs-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--magenta-glow);
}

.zamboni-icon {
  width: 28px;
  height: 28px;
  background: var(--magenta-glow);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 10px var(--magenta-glow);
}

/* Boss Banner */
#boss-bar-container {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--magenta-glow);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  display: none;
  animation: bossEntrance 0.5s ease-out;
}

@keyframes bossEntrance {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* MODALS (Settings, Leaderboards, Victory, Defeat) */
.modal-box {
  background: var(--bg-card);
  border: 2px solid var(--cyan-glow);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.95rem;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
  color: var(--cyan-glow);
  font-family: var(--font-display);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: var(--cyan-glow);
  border-radius: 3px;
}
