@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=Press+Start+2P&display=swap');

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0d1117;
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* CRT scanline and subtle vignette overlay */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.45) 100%);
}

/* HUD Overlay */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px;
}

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

.hud-pill {
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 6px 10px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.5);
  transition: opacity 0.2s ease;
}

.hud-pill:hover {
  opacity: 0.8;
}

.lives-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.life-ball {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff7676, #d90429, #700010);
  box-shadow: 0 0 10px rgba(255, 40, 70, 0.7), inset 0 2px 3px rgba(255, 255, 255, 0.6);
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.life-ball.lost {
  opacity: 0.25;
  transform: scale(0.65);
  box-shadow: none;
  filter: grayscale(1);
}

.hud-label {
  display: none !important;
}

.hud-value {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.rings-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ring-icon-hud {
  width: 22px;
  height: 22px;
  border: 3px solid #ffcc00;
  border-radius: 50%;
  box-shadow: 0 0 12px #ffcc00, inset 0 0 6px #ffa500;
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.level-badge {
  text-align: center;
}

.level-badge .level-number {
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.level-badge .biome-name {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.combo-text {
  font-size: 12px;
  font-weight: 900;
  color: #ff007f;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.8);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.combo-text.active {
  opacity: 1;
  transform: translateY(0);
}

.ball-status-indicator {
  position: absolute;
  top: 80px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(13, 17, 23, 0.9);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ball-status-indicator.giant {
  border-color: #ff3366;
  color: #ff3366;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.ball-status-indicator.mini {
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

/* Floating notification popup (e.g., "ALL HOOPS COLLECTED! EXIT UNLOCKED") */
#notification-banner {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  text-shadow: 0 3px 6px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.8);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffd700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  width: 90%;
  max-width: 400px;
}

#notification-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Mobile & Touch Onscreen Controls */
#touch-controls {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 0;
  width: 100%;
  padding: 0 calc(24px + env(safe-area-inset-right, 0px)) 0 calc(24px + env(safe-area-inset-left, 0px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
  touch-action: none;
  -webkit-touch-callout: none;
}

.touch-group {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  pointer-events: auto;
}

.touch-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s, background-color 0.08s, border-color 0.08s, box-shadow 0.08s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  position: relative; /* For expanded hitbox */
}

/* Swordigo-style generous invisible touch hitbox (40px larger than visual button) */
.touch-btn::after {
  content: "";
  position: absolute;
  top: -20px;
  bottom: -20px;
  left: -20px;
  right: -20px;
  border-radius: 50%;
}

.touch-btn:active, .touch-btn.active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.4);
}

.touch-btn.jump-btn {
  width: 82px;
  height: 82px;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
  font-size: 30px;
}

.touch-btn.jump-btn:active, .touch-btn.jump-btn.active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.6);
}

/* Modals & Menus (Start, Game Over, Victory, Locker) */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 20, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: rgba(18, 24, 36, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 30px 36px;
  max-width: 560px;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 242, 254, 0.15);
  animation: modal-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overscroll-behavior: contain;
}

/* Custom Sleek Scrollbar */
.modal-content::-webkit-scrollbar,
.stages-grid::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track,
.stages-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb,
.stages-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.4);
  border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover,
.stages-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.8);
}

@keyframes modal-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.game-title {
  font-family: 'Outfit', sans-serif;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 45%, #ffcc00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 15px rgba(255, 75, 43, 0.4));
}

.game-subtitle {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #94a3b8;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 28px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 75, 43, 0.45);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 14px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 75, 43, 0.6);
  filter: brightness(1.08);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.controls-hint {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  color: #94a3b8;
}

.key-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

/* Customization Locker Grid */
.skins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.skin-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.skin-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.skin-card.selected {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.1);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.skin-preview-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.skin-name {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

/* Star Rating for Level Clear */
.stars-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 24px;
}

.star-icon {
  font-size: 36px;
  color: #334155;
  transition: color 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-icon.earned {
  color: #ffd700;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
  transform: scale(1.15) rotate(5deg);
}

.pause-controls-guide {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 14px 0;
  text-align: left;
}

.controls-guide-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #00f2fe;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #cbd5e1;
}

.ctrl-key {
  font-family: monospace;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
}

/* Stats Row in Game Over / Victory */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.stat-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px 14px;
}

.stat-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* Floating HUD Controls */
.hud-btn-icon {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(13, 17, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Stage Select Grid */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 4px;
  margin: 18px 0;
}

.stage-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stage-card:not(.locked):hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: #00f2fe;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.25);
}

.stage-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

.stage-num {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.stage-biome {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stage-stars {
  font-size: 14px;
  display: flex;
  gap: 4px;
}

.star-gold {
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.7);
}

.star-dim {
  color: #475569;
}

.lock-icon {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #64748b;
}

/* Exit Compass Pill */
.compass-pill {
  background: rgba(0, 242, 254, 0.18);
  border: 1px solid #00f2fe;
  color: #00f2fe;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 14px;
  animation: pulseCompass 1s ease-in-out infinite alternate;
}

@keyframes pulseCompass {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.06); opacity: 1; }
}

/* Timer Pill */
.timer-pill {
  min-width: 105px;
}

.timer-val {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #00f2fe;
  letter-spacing: 0.5px;
}

/* Dash Pill & Energy Meter */
.dash-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-bar-outer {
  width: 55px;
  height: 9px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dash-bar-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffea00, #ff7700);
  box-shadow: 0 0 8px rgba(255, 200, 0, 0.8);
  border-radius: 4px;
  transition: width 0.05s linear;
}

/* Magnet Pill */
.magnet-pill {
  background: rgba(255, 0, 128, 0.2);
  border: 1px solid #ff0080;
  color: #ff0080;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  animation: pulseMagnet 0.8s infinite alternate;
}

@keyframes pulseMagnet {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* Mobile Dash Touch Button */
.dash-touch-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dash-touch-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.4);
}

.stage-pb {
  font-size: 9px;
  font-weight: 700;
  color: #00f2fe;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Orientation Recommendation Modal for Mobile */
.orientation-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 22, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.orientation-card {
  background: rgba(18, 24, 38, 0.98);
  border: 2px solid #00f2fe;
  border-radius: 24px;
  padding: 32px 26px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 242, 254, 0.35);
}

.orientation-icon {
  font-size: 46px;
  margin-bottom: 12px;
  animation: rotatePhone 2.2s ease-in-out infinite alternate;
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-90deg); }
  100% { transform: rotate(-90deg); }
}

.orientation-title {
  font-size: 17px;
  font-weight: 900;
  color: #00f2fe;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.orientation-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Responsive Rules for Small Screens & Mobile */
@media (max-width: 860px) {
  .desktop-only {
    display: none !important;
  }
  .hud-top-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px;
    top: 8px;
  }
  .hud-pill {
    padding: 4px 8px;
    font-size: 10px;
  }
  .hud-value {
    font-size: 13px;
  }
  .hud-btn-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 10px;
  }
  .touch-btn {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }
  .touch-btn.jump-btn {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }
  .dash-touch-btn {
    width: 56px;
    height: 56px;
    font-size: 10px;
  }
  .modal-content {
    padding: 24px 20px;
    max-width: 92vw;
  }
  .game-title {
    font-size: 32px;
  }
  .stages-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: 250px;
  }
}

@media (max-height: 500px) {
  .hud-top-bar {
    top: 6px;
    padding: 0 8px;
  }
  .hud-pill {
    padding: 3px 6px;
    font-size: 9px;
  }
  .hud-label {
    font-size: 8px;
  }
  .hud-value {
    font-size: 11px;
  }
  .hud-btn-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  #touch-controls {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .touch-btn {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .touch-btn.jump-btn {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }
  .dash-touch-btn {
    width: 50px;
    height: 50px;
    font-size: 9px;
  }
  .modal-content {
    padding: 16px 20px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .game-title {
    font-size: 26px;
    margin-bottom: 2px;
  }
  .stages-grid {
    max-height: 170px;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Stage Progress Minimap Track */
.hud-progress-container {
  pointer-events: auto;
  align-self: center;
  margin-top: 10px;
  width: 320px;
  max-width: 80vw;
}

@media (max-width: 860px) {
  .hud-progress-container {
    display: none !important;
  }
}

.hud-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hud-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff0055, #ffd700);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  transition: width 0.1s linear;
}

.hud-progress-marker {
  position: absolute;
  top: -8px;
  left: 0%;
  font-size: 14px;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 0 4px #ff0055);
  transition: left 0.1s linear;
}

.hud-progress-exit-icon {
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 14px;
  pointer-events: none;
  filter: drop-shadow(0 0 4px #ffd700);
}

/* Settings Modal Elements */
.settings-group {
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  text-align: left;
}

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

.settings-val {
  font-weight: 800;
  font-size: 13px;
  color: #00f2fe;
}

.volume-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  accent-color: #00f2fe;
  cursor: pointer;
}

.toggle-buttons-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-toggle {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-toggle.active {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  color: #0a0d14;
  border-color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

.diagnostic-badge {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diagnostic-badge div {
  color: #38bdf8;
}

/* Sticky Modal Header */
.modal-header-sticky {
  position: sticky;
  top: -30px;
  background: rgba(18, 24, 36, 0.98);
  backdrop-filter: blur(12px);
  padding: 12px 0 10px 0;
  margin: -30px -36px 14px -36px;
  padding-left: 36px;
  padding-right: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 30;
}

.modal-close-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-size: 16px;
  font-weight: 900;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-icon-btn:hover {
  background: rgba(255, 51, 102, 0.3);
  border-color: #ff3366;
  color: #ffffff;
  transform: scale(1.08);
}

/* Two-column grid for settings on desktop */
.settings-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 620px) {
  .settings-grid-layout {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

.settings-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* GPU Software Acceleration Alert Banner */
.gpu-software-alert {
  background: linear-gradient(135deg, rgba(255, 51, 68, 0.2), rgba(255, 136, 0, 0.25));
  border: 1px solid #ff4444;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: left;
  animation: pulseThermal 2s infinite alternate;
}

@keyframes pulseThermal {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.02); opacity: 1; }
}

.gpu-alert-title {
  color: #ff4444;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.gpu-alert-desc {
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 8px;
}

.gpu-alert-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.gpu-alert-btn:hover {
  background: #ff2233;
  transform: scale(1.03);
}

.gpu-guide-box {
  background: rgba(0, 0, 0, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 11px;
  color: #f1f5f9;
  line-height: 1.5;
}

.gpu-guide-box ol {
  margin: 4px 0 0 16px;
  padding: 0;
}

/* Enable text selection on informational guides, text, and code */
.modal-content,
.gpu-software-alert,
.gpu-alert-title,
.gpu-alert-desc,
.gpu-guide-box,
.gpu-guide-box ol,
.gpu-guide-box li,
.gpu-guide-box strong,
code,
.stat-val,
.stat-title,
.controls-hint,
.pause-controls-guide,
.ctrl-item {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}

code {
  user-select: all !important;
  -webkit-user-select: all !important;
  cursor: text;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #00f2fe;
}

.btn-copy-chip {
  background: rgba(0, 242, 254, 0.2);
  border: 1px solid #00f2fe;
  color: #00f2fe;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
  user-select: none !important;
  -webkit-user-select: none !important;
  display: inline-block;
  vertical-align: middle;
}

.btn-copy-chip:hover {
  background: #00f2fe;
  color: #0d1117;
  transform: scale(1.04);
}

/* Story chapter badge on HUD & Stages */
.stage-card-story {
  font-size: 9px;
  color: #94a3b8;
  font-style: italic;
  margin-top: 3px;
  line-height: 1.2;
}

/* World Tabs for Stage Select */
.world-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.world-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.world-tab:hover { background: rgba(0, 242, 254, 0.1); color: #e2e8f0; }
.world-tab.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}
.world-tab.locked { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.8); }
.world-progress {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}
.world-progress .progress-stars { color: #ffd700; }
.stage-pb {
  font-size: 9px;
  font-weight: 700;
  color: #00f2fe;
  letter-spacing: 0.5px;
}

.hidden {
  display: none !important;
}
