/* Exo 2 font-faces with complete Polish (Latin Extended) characters */
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/exo2-latinext-600.woff2?v=7') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/exo2-latin-600.woff2?v=7') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/exo2-latinext-600.woff2?v=7') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/exo2-latin-600.woff2?v=7') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/exo2-latinext-800.woff2?v=7') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/exo2-latin-800.woff2?v=7') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/exo2-latinext-800.woff2?v=7') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Exo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/exo2-latin-800.woff2?v=7') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-dark: #070b19;
  --panel-bg: rgba(13, 20, 42, 0.88);
  --cyan-neon: #00f0ff;
  --pink-neon: #ff2a6d;
  --gold-neon: #fbbf24;
  --purple-neon: #c084fc;
  --green-neon: #10b981;
  --font-display: 'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ui: 'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: #ffffff;
  font-family: var(--font-ui);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: min(800px, 98vw, calc((100dvh - 12px) * 800 / 900));
  height: min(900px, calc(98vw * 900 / 800), calc(100dvh - 12px));
  aspect-ratio: 800 / 900;
  max-height: calc(100dvh - 12px);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.2), 0 0 100px rgba(255, 42, 109, 0.1);
  border: 2px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  overflow: hidden;
  background: #060913;
  margin: auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #060913;
}

/* ==========================================================================
   HUD (Heads-Up Display)
   ========================================================================== */

#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(6px, 1.5vh, 14px);
  z-index: 10;
}

#hud.hidden {
  display: none !important;
}

.hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 16, 35, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 10px 18px;
  pointer-events: auto;
}

.hud-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
  font-family: var(--font-display);
}

.hud-value {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-display);
  color: #ffffff;
}

.credits-color {
  color: var(--gold-neon);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.combo-color {
  color: var(--green-neon);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.hud-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-music-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding-right: 8px;
}

.hud-vol-slider {
  width: 55px;
  height: 5px;
  accent-color: var(--cyan-neon);
  cursor: pointer;
}

.btn-icon {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  pointer-events: auto;
}

.btn-icon:hover {
  background: var(--cyan-neon);
  color: #000000;
  box-shadow: 0 0 10px var(--cyan-neon);
}

.btn-icon.off {
  opacity: 0.55;
  filter: grayscale(1);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Panel ustawień audio w menu pauzy */
.pause-audio-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0 6px 0;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.audio-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.audio-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}

.audio-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-audio-toggle {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.18);
  color: var(--cyan-neon);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-audio-toggle:hover {
  background: var(--cyan-neon);
  color: #000;
}

.btn-audio-toggle.off {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.btn-audio-toggle.off:hover {
  background: #ef4444;
  color: #fff;
}

.slider-vol {
  width: 90px;
  height: 6px;
  accent-color: var(--cyan-neon);
  cursor: pointer;
}

.vol-val-badge {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  width: 34px;
  text-align: right;
}

/* Boss Health Bar */
#hud-boss-container {
  align-self: center;
  width: 70%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 42, 109, 0.5);
  border-radius: 6px;
  padding: 6px 14px;
  box-shadow: 0 0 16px rgba(255, 42, 109, 0.3);
  text-align: center;
  transition: all 0.3s;
}

#hud-boss-container.hidden {
  display: none !important;
}

.hud-boss-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 4px;
}

.boss-bar-track {
  width: 100%;
  height: 10px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boss-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--pink-neon);
  box-shadow: 0 0 10px currentColor;
  transition: width 0.15s ease-out;
}

/* Bottom HUD (Dual Ammo & Player Status) */
.hud-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-player-bars {
  display: flex;
  gap: 16px;
  background: rgba(10, 16, 35, 0.7);
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-bar-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 11px;
}

.bar-track {
  flex: 1;
  height: 9px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill-shield {
  height: 100%;
  width: 100%;
  background: var(--cyan-neon);
  box-shadow: 0 0 8px var(--cyan-neon);
  transition: width 0.2s;
}

.bar-fill-hp {
  height: 100%;
  width: 100%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  transition: width 0.2s;
}

/* Dual Ammo Dock */
.hud-ammo-dock {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  gap: 12px;
  align-items: center;
}

.ammo-card {
  background: rgba(13, 20, 42, 0.88);
  border: 2px solid;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
}

.ammo-card.active-firing {
  box-shadow: 0 0 25px currentColor;
  transform: translateY(-3px) scale(1.02);
  background: rgba(20, 32, 65, 0.95);
}

.ammo-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ammo-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.ammo-hint {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ammo-rule-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Bomb Box in Center */
.hud-bomb-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--pink-neon);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.3);
}

.bomb-hint {
  font-family: var(--font-display);
  font-size: 10px;
  color: #cbd5e1;
}

.bombs-icons-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 16px;
}

.bomb-icon.empty {
  opacity: 0.25;
  filter: grayscale(1);
}

/* Powerup Badge (Auto-Shoot) */
.hud-powerup-badge {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 182, 212, 0.25);
  border: 1px solid #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  color: #00f0ff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.2s ease;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Modal Overlays & Screens (Menu, Shop, Level Select, Victory, Game Over)
   ========================================================================== */

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 19, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 50;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none !important;
}

.menu-box {
  width: 100%;
  max-width: 650px;
  max-height: 90%;
  overflow-y: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

/* Custom Scrollbar */
.menu-box::-webkit-scrollbar {
  width: 6px;
}
.menu-box::-webkit-scrollbar-thumb {
  background: var(--cyan-neon);
  border-radius: 3px;
}

.menu-banner-container {
  width: 100%;
  max-width: 500px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35), 0 0 50px rgba(255, 42, 109, 0.2);
  margin-bottom: 12px;
}

.menu-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.game-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-shadow: 0 0 15px var(--cyan-neon), 0 0 35px var(--cyan-neon);
  margin-bottom: 4px;
}

.game-subtitle {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--pink-neon);
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-shadow: 0 0 10px var(--pink-neon);
}

.menu-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 280px;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 240, 255, 0.05));
  border: 2px solid var(--cyan-neon);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--cyan-neon);
  color: #000000;
  box-shadow: 0 0 25px var(--cyan-neon);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

/* ==========================================================================
   Level Select Screen
   ========================================================================== */

.levels-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 580px;
  margin: 20px 0;
}

.level-card {
  background: var(--panel-bg);
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-card:hover:not(.locked) {
  border-color: var(--cyan-neon);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  transform: translateX(4px);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.level-card-info h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 4px;
}

.level-card-info p {
  font-size: 13px;
  color: #94a3b8;
}

.level-status {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--green-neon);
}

.level-status.status-locked {
  color: #f43f5e;
}

/* ==========================================================================
   Difficulty Selector UI
   ========================================================================== */

.difficulty-selector-container {
  width: 100%;
  max-width: 580px;
  margin: 12px 0 16px 0;
  background: rgba(13, 20, 42, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diff-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan-neon);
  letter-spacing: 1px;
}

.diff-buttons-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

button.btn-diff {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.18s ease;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

button.btn-diff:hover {
  border-color: #ffffff;
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
}

button.btn-diff.active {
  border-width: 2px;
  font-weight: 900;
  transform: scale(1.04);
  background: rgba(15, 23, 42, 0.98);
}

button.btn-diff[data-diff="kadet"].active {
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
}
button.btn-diff[data-diff="pilot"].active {
  border-color: #fbbf24;
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
}
button.btn-diff[data-diff="weteran"].active {
  border-color: #f97316;
  color: #f97316;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.6);
}
button.btn-diff[data-diff="as"].active {
  border-color: #ff2a6d;
  color: #ff2a6d;
  box-shadow: 0 0 18px rgba(255, 42, 109, 0.7);
}

.diff-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.diff-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
  pointer-events: none;
}

/* ==========================================================================
   Shop / Hangar Screen
   ========================================================================== */

.shop-top-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.shop-credits-box {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold-neon);
  font-weight: 800;
}

.shop-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--cyan-neon);
  margin: 14px 0 10px 0;
  text-align: left;
  width: 100%;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.shop-item-card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shop-item-card.equipped {
  border-color: var(--cyan-neon);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.ship-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ship-card-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
}

.badge-equipped {
  font-size: 10px;
  background: var(--cyan-neon);
  color: #000000;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.ship-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
  line-height: 1.3;
}

.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #cbd5e1;
}

.stat-track {
  width: 90px;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
  align-self: center;
}

.stat-fill {
  height: 100%;
  background: var(--cyan-neon);
}

.btn-action {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.btn-buy:hover {
  background: #fbbf24;
  box-shadow: 0 0 10px var(--gold-neon);
}

.btn-disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
}

.shop-upgrade-card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.upgrade-info h4 {
  font-family: var(--font-display);
  font-size: 14px;
  color: #ffffff;
}

.upgrade-info p {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 4px 0;
}

.level-dots {
  font-size: 11px;
  color: var(--cyan-neon);
  font-weight: 700;
}

/* ==========================================================================
   Guide / How to play
   ========================================================================== */

.guide-content {
  text-align: left;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 20px;
}

.guide-content h3 {
  font-family: var(--font-display);
  color: var(--cyan-neon);
  margin: 14px 0 6px 0;
}

.guide-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.guide-content strong {
  color: #ffffff;
}

/* ==========================================================================
   Victory & Game Over Screens
   ========================================================================== */

.summary-stats-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  max-width: 380px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 14px;
}

.summary-stat-row span:last-child {
  font-weight: 800;
  color: var(--cyan-neon);
}

/* ==========================================================================
   Mobile Touch Controls (ukryte na ekranach desktopowych)
   ========================================================================== */

.touch-controls-bar {
  display: none;
  pointer-events: auto;
  gap: 8px;
  margin-top: 6px;
}

.touch-btn {
  flex: 1;
  padding: 12px 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid;
  border-radius: 6px;
  color: #ffffff;
}

.touch-btn-bomb {
  border-color: var(--pink-neon) !important;
  color: var(--pink-neon);
}

@media (max-width: 820px) {
  .touch-controls-bar {
    display: flex;
  }
}

/* ==========================================================================
   Bonus Comet Interception Stage
   ========================================================================== */

.bonus-comet-box {
  max-width: 680px;
  background: radial-gradient(circle at center, rgba(30, 20, 60, 0.95), rgba(7, 11, 25, 0.96));
  border: 2px solid var(--gold-neon);
  box-shadow: 0 0 35px rgba(251, 191, 36, 0.35), 0 0 70px rgba(255, 42, 109, 0.15);
  border-radius: 12px;
  padding: 20px 24px;
}

.comet-header-badge {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  color: #000000;
  background: var(--gold-neon);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 900;
  margin-bottom: 8px;
  box-shadow: 0 0 12px var(--gold-neon);
}

.comet-subtitle {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.comet-stage-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.comet-round-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--cyan-neon);
  letter-spacing: 1px;
}

.comet-timer-display {
  font-size: 14px;
  color: #94a3b8;
}

.timer-countdown {
  font-size: 20px;
  font-weight: 900;
  color: var(--gold-neon);
  margin-left: 6px;
}

.timer-countdown.danger {
  color: #ff2a6d !important;
  text-shadow: 0 0 10px #ff2a6d;
  animation: timerBlink 0.3s infinite alternate;
}

@keyframes timerBlink {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.7; transform: scale(1.08); }
}

.comet-timer-track {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.comet-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24, #ff2a6d);
  transition: width 0.05s linear;
}

/* Comet Visual & Floating Math Expression */
.comet-stage-visual {
  width: 100%;
  min-height: 130px;
  background: rgba(10, 16, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.comet-meteor {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: cometHover 2s infinite ease-in-out alternate;
}

@keyframes cometHover {
  0% { transform: translateY(-4px) scale(0.98); }
  100% { transform: translateY(4px) scale(1.02); }
}

.comet-core {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--gold-neon);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5), inset 0 0 15px rgba(251, 191, 36, 0.2);
  border-radius: 12px;
  padding: 12px 24px;
}

.comet-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px #f59e0b);
}

.comet-math-expression {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* 3 Big Glowing Action Buttons */
.comet-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.btn-comet-sign {
  background: var(--panel-bg);
  border: 2px solid;
  border-radius: 10px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-comet-sign:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 25px currentColor;
}

.btn-comet-sign:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comet-sign-symbol {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
}

.comet-sign-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.comet-sign-hotkey {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Button variants */
.btn-comet-positive {
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
}
.btn-comet-positive:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.18);
}

.btn-comet-zero {
  border-color: var(--gold-neon);
  color: var(--gold-neon);
}
.btn-comet-zero:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.18);
}

.btn-comet-negative {
  border-color: var(--pink-neon);
  color: var(--pink-neon);
}
.btn-comet-negative:hover:not(:disabled) {
  background: rgba(255, 42, 109, 0.18);
}

/* Feedback card */
.comet-feedback-box {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

.comet-feedback-box.correct {
  border-color: var(--green-neon);
  background: rgba(16, 185, 129, 0.15);
}

.comet-feedback-box.wrong {
  border-color: var(--pink-neon);
  background: rgba(255, 42, 109, 0.15);
}

.comet-feedback-box h4 {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 2px;
}

.comet-feedback-box p {
  font-size: 13px;
  color: #cbd5e1;
}

.bonus-gain-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-neon);
  margin-top: 4px;
}

/* Summary Box */
.comet-summary-box {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   Responsive Viewport Height Adaptations (Laptops, Tablets & Small Displays)
   ========================================================================== */

@media (max-height: 860px) {
  #hud {
    padding: 8px 10px;
  }
  .hud-top-bar {
    padding: 6px 12px;
  }
  .hud-label {
    font-size: 9px;
  }
  .hud-value {
    font-size: 15px;
  }
  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .hud-vol-slider {
    width: 42px;
  }
  .hud-music-wrapper {
    gap: 4px;
    padding-right: 4px;
  }
  .hud-player-bars {
    padding: 4px 8px;
    gap: 8px;
  }
  .bar-track {
    height: 7px;
  }
  .hud-bottom-bar {
    gap: 6px;
  }
  .hud-ammo-dock {
    gap: 8px;
    grid-template-columns: 1fr 115px 1fr;
  }
  .ammo-card {
    padding: 6px 10px;
  }
  .ammo-title {
    font-size: 12px;
  }
  .ammo-hint {
    font-size: 9px;
    padding: 1px 4px;
  }
  .ammo-rule-sub {
    font-size: 9px;
  }
  .hud-bomb-box {
    padding: 4px 6px;
  }
  .bombs-icons-row {
    font-size: 13px;
  }
  .menu-banner-container {
    max-width: 360px;
    margin-bottom: 8px;
  }
  .game-title {
    font-size: 28px;
  }
  .game-subtitle {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .level-card {
    padding: 10px 14px;
  }
  .level-card-info h3 {
    font-size: 15px;
  }
  .levels-grid {
    gap: 10px;
    margin: 10px 0;
  }
}

@media (max-height: 720px) {
  #hud {
    padding: 4px 6px;
  }
  .hud-top-bar {
    padding: 4px 8px;
  }
  .hud-bottom-bar {
    gap: 4px;
  }
  .ammo-card {
    padding: 4px 8px;
  }
  .ammo-rule-sub {
    display: none;
  }
  .menu-banner-container {
    max-width: 260px;
    margin-bottom: 6px;
  }
  .game-title {
    font-size: 22px;
  }
  .game-subtitle {
    margin-bottom: 8px;
  }
  .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
  }
  .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
  }
}



/* Special encounters share one full-canvas playfield. */
.encounter-box { max-width: 620px; gap: 18px; }
.encounter-label { color: #7dd3fc; letter-spacing: 3px; font-size: 12px; }
.encounter-title { font-size: clamp(25px, 5vw, 38px); line-height: 1.15; color: #e2f2ff; }
.encounter-copy { color: #c2d2e2; line-height: 1.7; max-width: 510px; }
.encounter-keys { color: #94a3b8; font-size: 13px; line-height: 1.6; }
#encounter-controls { display: none; gap: 10px; width: max-content; position: absolute; bottom: 3%; left: 50%; transform: translateX(-50%); z-index: 20; }
#encounter-controls button { min-height: 48px; font-size: 13px; padding: 10px 25px; }
@media (max-height: 760px) { #screen-menu .menu-banner-container { max-height: 130px; } #screen-menu .menu-buttons-list { gap: 8px; } #screen-menu .menu-buttons-list button { padding-top: 10px; padding-bottom: 10px; } }

#gameCanvas { touch-action: none; }

#game-container.quantum-active #encounter-controls:not([hidden]) { display: flex; }
#encounter-controls[hidden], #encounter-controls.hidden { display: none !important; }
#encounter-controls { max-width: calc(100% - 24px); justify-content: center; }
#encounter-controls button { min-width: 0; }
@media (max-width: 480px) { #encounter-controls button { font-size: 11px; padding: 10px 12px; } }

#hud-powerup-badge[hidden], #hud-powerup-badge.hidden { display: none !important; }
