/* ==========================================================================
   ONE MORE TRY! - NEON ARCADE HYPER RUNNER STYLESHEET
   Cyberpunk aesthetic, responsive layout, glassmorphic UI, glowing animations
   ========================================================================== */

:root {
  --bg-dark: #070712;
  --bg-panel: rgba(14, 15, 30, 0.88);
  --bg-card: rgba(22, 24, 48, 0.75);
  --border-neon: rgba(0, 243, 255, 0.35);
  
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff007f;
  --neon-yellow: #ffe600;
  --neon-green: #00ff88;
  --neon-purple: #a855f7;
  --neon-orange: #ff7700;
  --neon-red: #ff2255;
  
  --text-primary: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --glow-cyan: 0 0 15px rgba(0, 243, 255, 0.5), 0 0 30px rgba(0, 243, 255, 0.25);
  --glow-magenta: 0 0 15px rgba(255, 0, 127, 0.5), 0 0 30px rgba(255, 0, 127, 0.25);
  --glow-yellow: 0 0 15px rgba(255, 230, 0, 0.5), 0 0 30px rgba(255, 230, 0, 0.25);
  --glow-green: 0 0 15px rgba(0, 255, 136, 0.5), 0 0 30px rgba(0, 255, 136, 0.25);

  --font-logo: 'Orbitron', 'Chakra Petch', sans-serif;
  --font-heading: 'Chakra Petch', sans-serif;
  --font-ui: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  touch-action: manipulation;
}

/* ==========================================================================
   GAME WRAPPER & CANVAS CONTAINER
   ========================================================================== */
#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #11122a 0%, #060710 100%);
  overflow: hidden;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Utility visibility classes */
.hidden {
  display: none !important;
}

/* ==========================================================================
   FRIEND CHALLENGE TOP BANNER
   ========================================================================== */
#challenge-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 12, 38, 0.92);
  border: 1px solid var(--neon-magenta);
  box-shadow: var(--glow-magenta);
  padding: 8px 18px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  animation: slideDown 0.4s ease-out;
  max-width: 90vw;
}

.challenge-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.challenge-badge {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

#challenge-banner-text strong {
  color: var(--neon-cyan);
}

/* ==========================================================================
   HUD LAYER (Heads-Up Display)
   ========================================================================== */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px;
}

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

.hud-stat {
  display: flex;
  flex-direction: column;
  background: rgba(10, 11, 26, 0.7);
  border: 1px solid rgba(0, 243, 255, 0.2);
  padding: 6px 14px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  min-width: 80px;
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.hud-value {
  font-family: var(--font-logo);
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.hud-value-sub {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-yellow);
}

.hud-value-coins {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}

.neon-glow {
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
}

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

.btn-icon {
  background: rgba(20, 22, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.btn-icon:hover {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

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

/* Active Powerups Bar */
.hud-powerups-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  pointer-events: none;
}

.hud-powerup-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 17, 36, 0.85);
  border: 1px solid var(--neon-cyan);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  animation: pulsePill 1.5s infinite alternate;
}

.hud-powerup-bar-fill {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.hud-powerup-bar-inner {
  height: 100%;
  background: var(--neon-cyan);
  width: 100%;
  transition: width 0.1s linear;
}

/* Rival Ghost Tracker in HUD */
.hud-ghost-tracker {
  align-self: center;
  background: rgba(18, 10, 36, 0.8);
  border: 1px solid var(--neon-magenta);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 8px;
  backdrop-filter: blur(6px);
  animation: floatSubtle 2s infinite ease-in-out;
}

.hud-ghost-tracker strong {
  color: var(--neon-magenta);
}

/* Mobile Controls Layer */
.mobile-controls-layer {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 24px;
  pointer-events: none;
}

.mobile-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.mobile-dash-btn {
  pointer-events: auto;
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 127, 0.3) 0%, rgba(20, 10, 40, 0.85) 100%);
  border: 2px solid var(--neon-magenta);
  box-shadow: var(--glow-magenta);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
}

.mobile-dash-btn:active {
  transform: scale(0.92);
  background: rgba(255, 0, 127, 0.4);
}

.dash-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.dash-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dash-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  transform-origin: bottom;
  transform: scaleY(0);
  pointer-events: none;
  transition: transform 0.05s linear;
}

/* ==========================================================================
   FULLSCREEN OVERLAYS (Start, Game Over, Modals)
   ========================================================================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  background: rgba(6, 7, 16, 0.78);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

/* ==========================================================================
   START / MAIN MENU SCREEN
   ========================================================================== */
.menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  width: 100%;
  animation: fadeInScale 0.4s ease-out;
}

.brand-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
  margin-bottom: 12px;
}

.game-logo {
  font-family: var(--font-logo);
  font-size: clamp(2.5rem, 8vw, 4.4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 
    0 0 10px var(--neon-cyan),
    0 0 30px rgba(0, 243, 255, 0.6),
    0 0 60px rgba(255, 0, 127, 0.4);
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip: rect(0, 0, 0, 0);
}

.glitch::before {
  left: -2px;
  text-shadow: 2px 0 var(--neon-magenta);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
  left: 2px;
  text-shadow: -2px 0 var(--neon-cyan);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(20px, 9999px, 44px, 0); transform: skew(0.3deg); }
  20% { clip: rect(60px, 9999px, 80px, 0); transform: skew(-0.2deg); }
  40% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.5deg); }
  60% { clip: rect(80px, 9999px, 98px, 0); transform: skew(-0.4deg); }
  80% { clip: rect(35px, 9999px, 50px, 0); transform: skew(0.1deg); }
  100% { clip: rect(0px, 0px, 0px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(45px, 9999px, 60px, 0); transform: skew(-0.3deg); }
  25% { clip: rect(12px, 9999px, 32px, 0); transform: skew(0.4deg); }
  50% { clip: rect(70px, 9999px, 90px, 0); transform: skew(-0.1deg); }
  75% { clip: rect(25px, 9999px, 40px, 0); transform: skew(0.3deg); }
  100% { clip: rect(0px, 0px, 0px, 0); }
}

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
}

/* Mode Selection Tabs */
.mode-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 440px;
}

.mode-tab {
  flex: 1;
  background: rgba(22, 24, 48, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: all 0.25s ease;
}

.mode-tab:hover {
  background: rgba(30, 34, 68, 0.8);
  color: #fff;
}

.mode-tab.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
}

.badge-new {
  font-size: 0.65rem;
  background: var(--neon-magenta);
  color: #fff;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
}

/* Daily Challenge Card */
.daily-card {
  background: rgba(20, 18, 44, 0.85);
  border: 1px solid var(--neon-magenta);
  box-shadow: var(--glow-magenta);
  border-radius: 14px;
  padding: 14px 20px;
  width: 100%;
  max-width: 440px;
  margin-bottom: 20px;
  text-align: left;
  backdrop-filter: blur(8px);
}

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

.daily-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-yellow);
  letter-spacing: 1px;
}

.daily-timer {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.daily-modifier {
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.daily-modifier strong {
  color: var(--neon-magenta);
}

.daily-best {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.daily-best .highlight {
  color: var(--neon-green);
  font-weight: 700;
}

/* Play Action Area */
.play-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #00f3ff 0%, #0099ff 100%);
  color: #060714;
  font-family: var(--font-logo);
  font-size: 1.4rem;
  font-weight: 900;
  padding: 16px 48px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 1.5px;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.6), 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.9), 0 8px 25px rgba(0, 0, 0, 0.5);
}

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

.pulse-glow {
  animation: pulseGlow 2s infinite;
}

.quick-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quick-tip kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--neon-cyan);
  font-family: monospace;
}

/* Controls Legend */
.controls-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 22, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.key-badge {
  color: var(--neon-yellow);
  font-weight: 700;
  font-size: 0.75rem;
}

.control-desc {
  color: var(--text-muted);
}

/* Secondary Menu Bar */
.menu-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  width: 100%;
}

.btn-menu {
  background: rgba(22, 24, 52, 0.7);
  border: 1px solid rgba(0, 243, 255, 0.25);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.btn-menu:hover {
  background: rgba(0, 243, 255, 0.18);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

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

/* Menu Footer */
.menu-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.menu-footer strong {
  color: var(--neon-cyan);
}

.menu-footer .divider {
  color: var(--text-dim);
}

/* ==========================================================================
   GAME OVER / REPLAY SCREEN
   ========================================================================== */
.game-over-card {
  background: var(--bg-panel);
  border: 2px solid var(--neon-magenta);
  box-shadow: var(--glow-magenta), 0 10px 40px rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(16px);
  animation: shakeDrop 0.4s ease-out;
}

.game-over-banner {
  margin-bottom: 20px;
}

.game-over-badge {
  display: inline-block;
  background: rgba(255, 0, 127, 0.2);
  border: 1px solid var(--neon-magenta);
  color: var(--neon-magenta);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.game-over-title {
  font-family: var(--font-logo);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 1.5px;
  text-shadow: 0 0 15px var(--neon-magenta), 0 0 30px rgba(255, 0, 127, 0.5);
  margin-bottom: 6px;
}

.death-roast {
  font-size: 0.95rem;
  color: var(--neon-yellow);
  font-style: italic;
  min-height: 24px;
}

/* Score Display Grid */
.score-display-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.score-cell {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.score-cell.main-score {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.12), rgba(255, 0, 127, 0.12));
  border-color: rgba(0, 243, 255, 0.4);
}

.cell-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.cell-val {
  font-family: var(--font-logo);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.score-cell.main-score .cell-val {
  font-size: 2.8rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.8);
  line-height: 1.1;
}

.new-best-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
  color: #060710;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 230, 0, 0.8);
  animation: pulsePill 1.2s infinite alternate;
}

/* Percentile Box */
.percentile-box {
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.percentile-box strong {
  color: var(--neon-green);
}

/* Rival Result Box */
.rival-result-box {
  background: rgba(255, 0, 127, 0.12);
  border: 1px solid var(--neon-magenta);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* Replay Actions */
.game-over-actions {
  margin-bottom: 16px;
}

.btn-replay {
  width: 100%;
  background: linear-gradient(135deg, var(--neon-magenta) 0%, #a855f7 100%);
  color: #fff;
  padding: 16px 24px;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.7);
}

.btn-replay:hover {
  box-shadow: 0 0 40px rgba(255, 0, 127, 0.95);
}

.btn-replay-icon {
  font-size: 1.4rem;
}

.btn-replay-text {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.btn-replay-sub {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* Share Actions Row */
.share-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-secondary {
  flex: 1;
  background: rgba(26, 28, 58, 0.8);
  border: 1px solid rgba(0, 243, 255, 0.3);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

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

/* Game Over Navigation */
.game-over-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--neon-cyan);
}

/* ==========================================================================
   MODAL OVERLAYS (Score Card, Challenge, Locker, Leaderboard, Badges)
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: rgba(4, 5, 12, 0.85);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.25s ease-out;
}

.modal-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-neon);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.25), 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: 18px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.25s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: var(--neon-magenta);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 11, 24, 0.6);
}

.sub-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.sub-tab.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.06);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

/* Forms inside Modals */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.form-group input {
  background: rgba(16, 18, 36, 0.9);
  border: 1px solid rgba(0, 243, 255, 0.3);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.challenge-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.challenge-link-box input {
  flex: 1;
  background: rgba(12, 13, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--neon-yellow);
  font-family: monospace;
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
}

.btn-action {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(0, 153, 255, 0.3));
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--neon-cyan);
  color: #060714;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.btn-action.btn-highlight {
  background: linear-gradient(135deg, var(--neon-magenta), #9333ea);
  border-color: var(--neon-magenta);
}

.btn-action.btn-highlight:hover {
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.7);
}

/* Direct Social Share Buttons */
.direct-share-links {
  display: flex;
  gap: 10px;
}

.social-share-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, opacity 0.2s;
}

.social-share-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.social-share-btn.wa { background: #25D366; }
.social-share-btn.tw { background: #000000; border: 1px solid #333; }
.social-share-btn.tg { background: #0088cc; }

/* Score Card Preview Modal */
.card-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#shareCardCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.card-instruction {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Locker Dialog */
.locker-dialog {
  max-width: 620px;
}

.locker-bank {
  background: rgba(255, 230, 0, 0.12);
  border: 1px solid var(--neon-yellow);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--neon-yellow);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.shop-item-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.shop-item-card:hover {
  border-color: rgba(0, 243, 255, 0.5);
  transform: translateY(-3px);
}

.shop-item-card.equipped {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.item-preview {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
}

.item-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.item-status {
  font-size: 0.75rem;
  font-weight: 700;
}

.status-equipped {
  color: var(--neon-cyan);
}

.btn-item-action {
  margin-top: 6px;
  width: 100%;
  padding: 6px 0;
  border-radius: 6px;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy {
  background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
  color: #060714;
}

.btn-equip {
  background: rgba(0, 243, 255, 0.2);
  border: 1px solid var(--neon-cyan);
  color: #fff;
}

.btn-equip:hover {
  background: var(--neon-cyan);
  color: #060714;
}

/* Leaderboard List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 22, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  border-radius: 10px;
}

.leaderboard-row.rank-1 {
  border-color: var(--neon-yellow);
  background: rgba(255, 230, 0, 0.08);
}

.leaderboard-row.rank-2 {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.leaderboard-row.rank-3 {
  border-color: #cd7f32;
  background: rgba(205, 127, 50, 0.08);
}

.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-rank {
  font-family: var(--font-logo);
  font-size: 1.1rem;
  font-weight: 900;
  width: 28px;
  color: var(--text-muted);
}

.rank-1 .row-rank { color: var(--neon-yellow); }
.rank-2 .row-rank { color: #ffffff; }
.rank-3 .row-rank { color: #e59866; }

.row-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.row-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.row-score {
  font-family: var(--font-logo);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--neon-cyan);
}

.row-date {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--neon-red);
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.7;
}

.btn-text-danger:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.5;
  filter: grayscale(80%);
  transition: all 0.3s ease;
}

.badge-card.unlocked {
  opacity: 1;
  filter: grayscale(0%);
  border-color: rgba(0, 243, 255, 0.4);
  background: rgba(18, 22, 48, 0.75);
}

.badge-icon {
  font-size: 2rem;
  min-width: 44px;
  text-align: center;
}

.badge-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.badge-name {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.badge-card.unlocked .badge-name {
  color: var(--neon-yellow);
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pause Dialog */
.pause-dialog {
  max-width: 360px;
  text-align: center;
  padding: 30px 24px;
}

.pause-dialog h2 {
  font-family: var(--font-logo);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 24px;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(14, 16, 36, 0.94);
  border-left: 4px solid var(--neon-cyan);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

.toast.toast-gold {
  border-left-color: var(--neon-yellow);
}

.toast.toast-magenta {
  border-left-color: var(--neon-magenta);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 20px rgba(0, 243, 255, 0.6); }
  50% { box-shadow: 0 0 35px rgba(0, 243, 255, 0.95); }
  100% { box-shadow: 0 0 20px rgba(0, 243, 255, 0.6); }
}

@keyframes pulsePill {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

@keyframes floatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes slideDown {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes shakeDrop {
  0% { transform: scale(1.1) translateY(-20px); opacity: 0; }
  60% { transform: scale(0.98) translateY(2px); opacity: 1; }
  80% { transform: scale(1.02) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}

/* ==========================================================================
   MEDIA QUERIES (Mobile Responsiveness)
   ========================================================================== */
@media (max-width: 640px) {
  .hud-layer {
    padding: 10px 14px;
  }
  
  .hud-stat {
    padding: 4px 8px;
    min-width: auto;
  }
  
  .hud-value {
    font-size: 1.4rem;
  }
  
  .hud-value-sub, .hud-value-coins {
    font-size: 1rem;
  }
  
  .btn-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  
  .game-over-card {
    padding: 20px 16px;
  }
  
  .score-cell.main-score .cell-val {
    font-size: 2.2rem;
  }
  
  .controls-legend {
    display: none; /* Hide on mobile to save space */
  }

  .menu-bar {
    gap: 6px;
  }

  .btn-menu {
    font-size: 0.78rem;
    padding: 7px 10px;
  }
  
  .share-actions-row {
    flex-direction: column;
  }
}
