/* ==========================================================================
   CONTROL GUYS COUNT - Game Stylesheet (Master Upgrade)
   Website: controlguyscount.com
   Mobile-first, responsive, hypercasual arcade aesthetic with full animation
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700;800&family=Outfit:wght@600;800;900&display=swap');

:root {
  --primary: #00d2ff;
  --primary-dark: #0099cc;
  --accent-good: #00e676;
  --accent-good-glow: rgba(0, 230, 118, 0.45);
  --accent-bad: #ff3366;
  --accent-bad-glow: rgba(255, 51, 102, 0.45);
  --accent-gold: #ffc107;
  --accent-purple: #9c27b0;
  --bg-dark: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.18);
  --text-light: #ffffff;
  --text-muted: #94a3b8;
  --font-main: 'Fredoka', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Fredoka', sans-serif;
  --shadow-popup: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 210, 255, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-light);
  position: fixed;
}

/* ==========================================================================
   PRELOADER / LOADING SCREEN
   ========================================================================== */
#preloader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 35%, #0284c7 0%, #0f172a 100%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  width: 100%;
  max-width: 340px;
  margin-bottom: 24px;
  filter: drop-shadow(0 8px 24px rgba(0, 210, 255, 0.5));
  animation: logoFloat 2.5s ease-in-out infinite alternate;
}

@keyframes logoFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.02); }
}

.preloader-bar-wrap {
  width: 100%;
  max-width: 280px;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00d2ff, #00e676, #ffd700);
  border-radius: 20px;
  transition: width 0.2s linear;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.8);
}

.preloader-status {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   GAME CANVAS CONTAINER
   ========================================================================== */
#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(circle at 50% 30%, #38bdf8 0%, #0284c7 35%, #0f172a 100%);
}

#canvas3d {
  width: 100%;
  height: 100%;
  display: block;
}

/* 3D Crowd Counter Label in Screen Coordinates */
#world-counter-container {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

.floating-counter {
  position: absolute;
  transform: translate(-50%, -100%);
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 150, 255, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  border: 2px solid #ffffff;
  letter-spacing: 0.5px;
  transition: transform 0.08s ease-out;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Squash & Stretch Elastic Animation for Counter Changes */
.floating-counter.pop-good {
  animation: counterElasticGood 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-counter.pop-bad {
  animation: counterElasticBad 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes counterElasticGood {
  0% { transform: translate(-50%, -100%) scale(1, 1); }
  35% { transform: translate(-50%, -100%) scale(1.3, 0.8); background: #00e676; }
  70% { transform: translate(-50%, -100%) scale(0.9, 1.15); }
  100% { transform: translate(-50%, -100%) scale(1, 1); }
}

@keyframes counterElasticBad {
  0% { transform: translate(-50%, -100%) scale(1, 1); }
  35% { transform: translate(-50%, -100%) scale(1.3, 0.8); background: #ff3366; }
  70% { transform: translate(-50%, -100%) scale(0.9, 1.15); }
  100% { transform: translate(-50%, -100%) scale(1, 1); }
}

/* Floating +/-/x text popups */
.float-popup {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  pointer-events: none;
  z-index: 15;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 15px currentColor;
  animation: floatUpParabolic 0.85s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
}

.float-popup.good {
  color: #00ff88;
}

.float-popup.bad {
  color: #ff3366;
}

.float-popup.gold {
  color: #ffd700;
}

@keyframes floatUpParabolic {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -30px) scale(1.35);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -70px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -105px) scale(0.85);
  }
}

/* ==========================================================================
   IN-GAME HUD
   ========================================================================== */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 16px) 16px env(safe-area-inset-bottom, 16px) 16px;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#hud-overlay.active {
  opacity: 1;
  pointer-events: none;
}

/* Top bar */
.hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
}

.hud-btn {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.15s ease;
  padding: 8px;
}

.hud-btn:hover {
  transform: scale(1.08);
  background: rgba(30, 41, 59, 0.95);
}

.hud-btn:active {
  transform: scale(0.92);
}

.icon-btn-img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Progress Bar with Continuous Glowing Shimmer Sweep */
.hud-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hud-level-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-level-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #e2e8f0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hud-world-tag {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(0, 210, 255, 0.2);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.hud-progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
}

.hud-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d2ff, #00e676, #ffc107);
  border-radius: 10px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
  position: relative;
}

/* Continuous Shimmer Sweep across the progress bar */
.hud-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmerSweep 2.2s infinite;
}

@keyframes shimmerSweep {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Coin badge */
.hud-coin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 193, 7, 0.45);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-weight: 800;
  font-size: 16px;
  color: #ffc107;
}

.icon-coin-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
}

/* Center Crowd Display & Odometer */
.hud-center-counter {
  text-align: center;
  margin-top: 10px;
}

.hud-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  padding: 8px 26px;
  border-radius: 32px;
  border: 2px solid #00d2ff;
  box-shadow: 0 8px 25px rgba(0, 210, 255, 0.35);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease;
}

.hud-counter-badge.pop-good {
  animation: counterElasticGood 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hud-counter-badge.pop-bad {
  animation: counterElasticBad 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hud-counter-icon {
  font-size: 26px;
}

.hud-counter-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

/* Combo badge */
.hud-combo-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff5722, #ff9800);
  color: #ffffff;
  padding: 4px 16px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.5);
  margin-top: 6px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}

.hud-combo-badge.active {
  opacity: 1;
  transform: scale(1);
  animation: pulseCombo 0.6s infinite alternate;
}

@keyframes pulseCombo {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Boss Health Bar HUD */
#boss-hud {
  width: 100%;
  max-width: 460px;
  margin: 12px auto 0;
  background: rgba(15, 23, 42, 0.92);
  padding: 12px 18px;
  border-radius: 20px;
  border: 2px solid #ff3366;
  box-shadow: 0 0 25px rgba(255, 51, 102, 0.4);
  display: none;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  animation: slideDown 0.35s ease-out;
}

#boss-hud.active {
  display: flex;
}

@keyframes slideDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.boss-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: #ff3366;
  letter-spacing: 1px;
}

.boss-hp-bg {
  width: 100%;
  height: 18px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 51, 102, 0.4);
  position: relative;
}

.boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff0055, #ff5500);
  border-radius: 9px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.8);
}

/* Steering Tutorial Hint */
.hud-steer-hint {
  align-self: center;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.75);
  padding: 10px 22px;
  border-radius: 25px;
  border: 1px solid var(--border-glass);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInOut 2.5s infinite alternate;
  pointer-events: none;
}

@keyframes fadeInOut {
  from { opacity: 0.4; }
  to { opacity: 0.95; }
}

/* ==========================================================================
   SCREENS & MODALS (OVERLAYS) WITH SMOOTH 300ms TRANSITIONS
   ========================================================================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(0.95) translateY(10px);
}

.screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.modal-card {
  background: linear-gradient(165deg, rgba(26, 38, 64, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 32px 28px;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow-popup);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00d2ff, #00e676, #ffc107, #ff3366);
}

/* ==========================================================================
   MAIN MENU WITH AI LOGO & ART
   ========================================================================== */
#screen-main-menu {
  background: url('assets/art/menu_hero_bg.webp') center/cover no-outset, rgba(10, 15, 30, 0.85);
}

#screen-main-menu .modal-card {
  max-width: 460px;
  padding: 30px 24px 26px;
}

.game-logo-wrap {
  margin-bottom: 20px;
}

.game-logo-img {
  width: 100%;
  max-width: 380px;
  border-radius: 18px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 210, 255, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-logo-img:hover {
  transform: scale(1.03);
}

/* Play Button with Micro-interactions & Idle Glow */
.btn-play-primary {
  width: 100%;
  padding: 16px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffffff;
  background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 230, 118, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  animation: playPulse 2.4s infinite;
}

.icon-play {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

@keyframes playPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(0, 230, 118, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 12px 35px rgba(0, 230, 118, 0.65); }
}

.btn-play-primary:hover {
  transform: scale(1.04);
}

.btn-play-primary:active {
  transform: scale(0.95);
}

/* Menu Actions Row */
.menu-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.btn-menu-secondary {
  padding: 12px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--border-glass);
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-menu-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.btn-menu-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.btn-menu-secondary:active {
  transform: scale(0.94);
}

.menu-footer-coins {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 800;
  color: #ffd700;
}

/* ==========================================================================
   SCROLLABLE WINDING LEVEL MAP
   ========================================================================== */
#screen-level-select .modal-card {
  max-width: 480px;
  height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  transition: background 0.15s, transform 0.15s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.btn-close:active {
  transform: scale(0.92);
}

/* Level Map Scroll Area */
.level-map-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 20px 10px 40px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
}

/* World Zone Banner */
.world-zone-banner {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.2), rgba(0, 230, 118, 0.2));
  border: 1px solid rgba(0, 210, 255, 0.4);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #38bdf8;
  margin: 16px auto;
  width: fit-content;
}

/* Winding Level Path Nodes */
.level-path-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  position: relative;
}

.level-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.level-node-wrap:hover:not(.locked) {
  transform: scale(1.1);
}

.level-node-wrap:active:not(.locked) {
  transform: scale(0.95);
}

.level-node-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  border: 3px solid #ffffff;
  box-shadow: 0 6px 18px rgba(0, 150, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  position: relative;
}

.level-node-wrap.boss .level-node-circle {
  background: linear-gradient(135deg, #ff0055, #ff5500);
  border-color: #ffd700;
  box-shadow: 0 6px 20px rgba(255, 0, 85, 0.6);
}

.level-node-wrap.locked .level-node-circle {
  background: #334155;
  border-color: #64748b;
  box-shadow: none;
  opacity: 0.6;
}

.icon-lock {
  width: 24px;
  height: 24px;
}

.icon-boss-skull-small {
  width: 26px;
  height: 26px;
}

.level-node-stars {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

.icon-star-small {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   SKINS / CUSTOMIZATION SCREEN
   ========================================================================== */
#screen-skins .modal-card {
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.skin-preview-wrap {
  width: 100%;
  height: 180px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 210, 255, 0.15) 0%, rgba(15, 23, 42, 0.4) 100%);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

#skin-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.skin-preview-info {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid var(--border-glass);
  white-space: nowrap;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  overflow-y: auto;
  max-height: 38vh;
  padding: 4px 4px 10px;
}

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

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

.skin-card:active {
  transform: scale(0.95);
}

.skin-card.selected {
  border-color: #00e676;
  background: rgba(0, 230, 118, 0.12);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.skin-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  border: 2px solid #ffffff;
}

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

.skin-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.skin-card.selected .skin-status-badge {
  background: #00e676;
  color: #000;
}

.skin-action-btn {
  margin-top: 14px;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.15s;
}

.skin-action-btn:active {
  transform: scale(0.96);
}

.skin-action-btn.buy {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
}

.skin-action-btn.equip {
  background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
  color: #fff;
}

.skin-action-btn.equipped {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: default;
}

/* ==========================================================================
   PAUSE, GAME OVER, & VICTORY SCREENS
   ========================================================================== */
#screen-pause .modal-card,
#screen-game-over .modal-card,
#screen-victory .modal-card {
  max-width: 440px;
}

.modal-btn-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn-modal-action {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-modal-action:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-modal-action:active {
  transform: scale(0.95);
}

.btn-modal-action.primary {
  background: linear-gradient(135deg, #00d2ff 0%, #0077ff 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(0, 150, 255, 0.4);
}

.btn-modal-action.danger {
  background: rgba(255, 51, 102, 0.15);
  border-color: rgba(255, 51, 102, 0.3);
  color: #ff3366;
}

/* Victory Stars */
.victory-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 22px;
}

.star-trophy-img {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-trophy-img.earned {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.8));
}

.victory-banner {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffd700 0%, #ff8f00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 15px rgba(255, 193, 7, 0.5));
}

.victory-summary-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.victory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.victory-row-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

.victory-multiplier-highlight {
  color: #00e676;
  font-size: 22px;
}

.victory-coins-highlight {
  color: #ffc107;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Settings Toggle */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  border-radius: 28px;
  transition: 0.25s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
}

input:checked + .toggle-slider {
  background-color: #00e676;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* ==========================================================================
   DEBUG / PERFORMANCE OVERLAY
   ========================================================================== */
#debug-perf-overlay {
  position: fixed;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.4);
  padding: 6px 12px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
  z-index: 999;
  pointer-events: none;
  display: none;
}

#debug-perf-overlay.active {
  display: block;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 480px) {
  .modal-card {
    padding: 24px 18px;
    border-radius: 22px;
  }
  .hud-counter-num {
    font-size: 28px;
  }
  .hud-counter-badge {
    padding: 6px 20px;
  }
  .skins-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
