/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a1a;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f0f0ff;
  --dim: rgba(240, 240, 255, 0.5);
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --gold: #ffbe0b;
  --red: #ff006e;
  --blue: #3a86ff;
  --green: #06d6a0;
  --orange: #fb5607;
  --purple: #8338ec;
  --safe-top: env(safe-area-inset-top, 8px);
  --safe-bot: env(safe-area-inset-bottom, 8px);
}

.hidden {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: #080816;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lang-toggle-container {
  position: absolute;
  top: calc(var(--safe-top) + 6px);
  right: 12px;
  z-index: 50;
}
.lang-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.lang-btn:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* SCREENS */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity 0.4s ease;
  transition: opacity 0.4s ease;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--safe-bot) + 20px);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== START SCREEN ===== */
#start-screen {
  background: radial-gradient(ellipse at 50% 0%, #12082a 0%, #080816 50%, #060612 100%);
  justify-content: center;
  gap: 0;
}

/* Floating particles */
.start-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.start-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.4);
  -webkit-animation: particleFloat linear infinite;
  animation: particleFloat linear infinite;
}
@-webkit-keyframes particleFloat {
  0% {
    -webkit-transform: translateY(100vh) scale(0);
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    -webkit-transform: translateY(-10vh) scale(1);
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}
@keyframes particleFloat {
  0% {
    -webkit-transform: translateY(100vh) scale(0);
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    -webkit-transform: translateY(-10vh) scale(1);
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Decorative orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  -webkit-filter: blur(60px);
  filter: blur(60px);
}
.orb-1 {
  width: 280px;
  height: 280px;
  background: rgba(168, 85, 247, 0.12);
  top: -60px;
  left: -80px;
  -webkit-animation: orbDrift1 8s ease-in-out infinite;
  animation: orbDrift1 8s ease-in-out infinite;
}
.orb-2 {
  width: 200px;
  height: 200px;
  background: rgba(255, 0, 110, 0.08);
  bottom: 10%;
  right: -40px;
  -webkit-animation: orbDrift2 10s ease-in-out infinite;
  animation: orbDrift2 10s ease-in-out infinite;
}
.orb-3 {
  width: 160px;
  height: 160px;
  background: rgba(59, 130, 246, 0.08);
  bottom: 40%;
  left: -30px;
  -webkit-animation: orbDrift3 12s ease-in-out infinite;
  animation: orbDrift3 12s ease-in-out infinite;
}
.orb-4 {
  width: 300px;
  height: 300px;
  background: rgba(255, 190, 11, 0.04);
  top: 30%;
  right: -100px;
  -webkit-animation: orbDrift4 15s ease-in-out infinite;
  animation: orbDrift4 15s ease-in-out infinite;
}
@-webkit-keyframes orbDrift1 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(40px, 30px); transform: translate(40px, 30px); }
}
@keyframes orbDrift1 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(40px, 30px); transform: translate(40px, 30px); }
}
@-webkit-keyframes orbDrift2 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(-20px, -40px); transform: translate(-20px, -40px); }
}
@keyframes orbDrift2 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(-20px, -40px); transform: translate(-20px, -40px); }
}
@-webkit-keyframes orbDrift3 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(20px, -20px); transform: translate(20px, -20px); }
}
@keyframes orbDrift3 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(20px, -20px); transform: translate(20px, -20px); }
}
@-webkit-keyframes orbDrift4 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(-30px, 20px); transform: translate(-30px, 20px); }
}
@keyframes orbDrift4 {
  0%, 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  50% { -webkit-transform: translate(-30px, 20px); transform: translate(-30px, 20px); }
}

/* Mascot section */
.mascot-section {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: calc(var(--safe-top) + 20px);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.mascot-frame {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(255, 0, 110, 0.15));
  border: 2px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.15), inset 0 0 30px rgba(168, 85, 247, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  -webkit-animation: mascotFloat 4s ease-in-out infinite;
  animation: mascotFloat 4s ease-in-out infinite;
  position: relative;
}
@-webkit-keyframes mascotFloat {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
  50% { -webkit-transform: translateY(-8px); transform: translateY(-8px); }
}
@keyframes mascotFloat {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
  50% { -webkit-transform: translateY(-8px); transform: translateY(-8px); }
}
.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  -webkit-filter: drop-shadow(0 4px 20px rgba(168, 85, 247, 0.4)) brightness(1.1) contrast(1.1);
  filter: drop-shadow(0 4px 20px rgba(168, 85, 247, 0.4)) brightness(1.1) contrast(1.1);
}
.sparkle-ring {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.08);
  -webkit-animation: ringSpin 8s linear infinite;
  animation: ringSpin 8s linear infinite;
  pointer-events: none;
}
.sparkle-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
@-webkit-keyframes ringSpin {
  0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes ringSpin {
  0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

/* Title section */
.title-section {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
  font-family: 'Black Ops One', 'Fredoka', 'Outfit', sans-serif;
}
.title-line {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #e8e0ff 0%, #c084fc 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3));
  filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3));
  -webkit-animation: titleGlow 3s ease-in-out infinite;
  animation: titleGlow 3s ease-in-out infinite;
}
.title-line.accent {
  font-size: 2.7rem;
  font-weight: 400;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffbe0b 0%, #ff006e 50%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3));
  filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3));
  -webkit-animation: titleGlowAccent 3s ease-in-out infinite;
  animation: titleGlowAccent 3s ease-in-out infinite;
}
@-webkit-keyframes titleGlow {
  0%, 100% { -webkit-filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3)); filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3)); }
  50% { -webkit-filter: drop-shadow(0 2px 35px rgba(168, 85, 247, 0.5)); filter: drop-shadow(0 2px 35px rgba(168, 85, 247, 0.5)); }
}
@keyframes titleGlow {
  0%, 100% { -webkit-filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3)); filter: drop-shadow(0 2px 20px rgba(168, 85, 247, 0.3)); }
  50% { -webkit-filter: drop-shadow(0 2px 35px rgba(168, 85, 247, 0.5)); filter: drop-shadow(0 2px 35px rgba(168, 85, 247, 0.5)); }
}
@-webkit-keyframes titleGlowAccent {
  0%, 100% { -webkit-filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3)); filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3)); }
  50% { -webkit-filter: drop-shadow(0 2px 50px rgba(255, 0, 110, 0.5)); filter: drop-shadow(0 2px 50px rgba(255, 0, 110, 0.5)); }
}
@keyframes titleGlowAccent {
  0%, 100% { -webkit-filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3)); filter: drop-shadow(0 2px 30px rgba(255, 0, 110, 0.3)); }
  50% { -webkit-filter: drop-shadow(0 2px 50px rgba(255, 0, 110, 0.5)); filter: drop-shadow(0 2px 50px rgba(255, 0, 110, 0.5)); }
}
.subtitle {
  font-size: 0.9rem;
  color: rgba(240, 240, 255, 0.35);
  margin-top: 6px;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 5;
  margin-bottom: 16px;
  flex-shrink: 0;
  padding: 0 16px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 100px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.stat-icon {
  font-size: 0.8rem;
  line-height: 1;
}
.stat-label {
  font-size: 0.6rem;
  color: var(--dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}
.coins-pill .stat-value {
  color: var(--gold);
}

/* Player name row */
.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 5;
  margin-bottom: 22px;
  flex-shrink: 0;
  padding: 0 24px;
}
.name-icon {
  font-size: 1.2rem;
}
.name-mascot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(168,85,247,0.4));
  background: rgba(168,85,247,0.1);
  padding: 2px;
  flex-shrink: 0;
}
.name-input {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(168, 85, 247, 0.15);
  border-radius: 100px;
  padding: 9px 18px;
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  width: 260px;
  max-width: 70%;
  text-align: center;
  outline: none;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.name-input::placeholder {
  color: rgba(240, 240, 255, 0.25);
  font-weight: 400;
  font-size: 0.9rem;
}
.name-input:focus {
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}
.name-input.error {
  border-color: var(--red);
  background: rgba(255, 0, 110, 0.08);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.15);
}
.name-error {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--red);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.name-error.hidden {
  display: none;
}

/* Action buttons */
.action-buttons {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 24px;
  flex-shrink: 0;
}

.btn-play {
  position: relative;
  width: 100%;
  max-width: 280px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  padding: 0;
  -webkit-transition: transform 0.15s, box-shadow 0.15s;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.btn-play:active {
  -webkit-transform: scale(0.96);
  transform: scale(0.96);
}
.btn-play-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 40%, #ff006e 100%);
  border-radius: 18px;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
}
.btn-play::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.btn-play-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  z-index: 1;
}
.btn-play-icon {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
}
.btn-play-text {
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Play button glow pulse */
.btn-play {
  box-shadow:
    0 4px 30px rgba(168, 85, 247, 0.35),
    0 0 60px rgba(168, 85, 247, 0.1);
  -webkit-animation: playPulse 2.5s ease-in-out infinite;
  animation: playPulse 2.5s ease-in-out infinite;
}
@-webkit-keyframes playPulse {
  0%, 100% {
    box-shadow:
      0 4px 30px rgba(168, 85, 247, 0.35),
      0 0 60px rgba(168, 85, 247, 0.1);
  }
  50% {
    box-shadow:
      0 4px 50px rgba(168, 85, 247, 0.5),
      0 0 80px rgba(255, 0, 110, 0.15);
  }
}
@keyframes playPulse {
  0%, 100% {
    box-shadow:
      0 4px 30px rgba(168, 85, 247, 0.35),
      0 0 60px rgba(168, 85, 247, 0.1);
  }
  50% {
    box-shadow:
      0 4px 50px rgba(168, 85, 247, 0.5),
      0 0 80px rgba(255, 0, 110, 0.15);
  }
}

.secondary-btns {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 4px;
}
.btn-secondary-glass {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  color: rgba(240, 240, 255, 0.6);
  font-family: "Outfit", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  -webkit-transition: all 0.15s;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: relative;
}
.btn-secondary-glass:active {
  -webkit-transform: scale(0.94);
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(168, 85, 247, 0.2);
}
/* Leaderboard status dot */
.lb-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  -webkit-transition: background 0.3s;
  transition: background 0.3s;
}
.lb-dot.online {
  background: #06d6a0;
  box-shadow: 0 0 6px rgba(6, 214, 160, 0.6);
}
.lb-dot.offline {
  background: rgba(255, 255, 255, 0.15);
}
.btn-glass-icon {
  font-size: 0.95rem;
}
.btn-glass-label {
  line-height: 1;
}



.footer-actions .btn-secondary-glass {
  flex: none;
  padding: 10px 18px;
}

.coffee-modal-content {
  text-align: center;
  padding: 30px 24px;
}
.coffee-modal-text {
  font-size: 1rem;
  color: var(--dim);
  line-height: 1.5;
  margin: 14px 0 6px;
}
.coffee-modal-mp {
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.coffee-alias-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 14px;
  padding: 14px 24px;
  margin: 4px 0 18px;
  cursor: pointer;
  -webkit-transition: background 0.15s;
  transition: background 0.15s;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.coffee-alias-box:active {
  background: rgba(168, 85, 247, 0.15);
}
.coffee-alias-label {
  font-size: 0.85rem;
  color: var(--dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.coffee-alias {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
  user-select: all;
  letter-spacing: 0.5px;
}
.coffee-copy-hint {
  font-size: 1.1rem;
  opacity: 0.6;
}
.btn-mp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  padding: 18px 28px;
  background: linear-gradient(135deg, #009ee3 0%, #0077b6 100%);
  border: none;
  border-radius: 16px;
  color: #fff;
  font-family: -apple-system, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 32px rgba(0,158,227,0.4);
  -webkit-transition: all 0.15s;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.btn-mp:active {
  -webkit-transform: scale(0.94);
  transform: scale(0.94);
}
.mp-logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.creator-signature {
  font-size: 0.7rem;
  color: rgba(240, 240, 255, 0.2);
  letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
}
.creator-signature span {
  color: rgba(168, 85, 247, 0.5);
  font-weight: 800;
}



.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 8px;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}
.footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.creator-signature span {
  color: rgba(168, 85, 247, 0.5);
  font-weight: 800;
}

/* Keep only the btn-menu style for modals */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.35);
  -webkit-transition: all 0.15s ease;
  transition: all 0.15s ease;
  width: 100%;
  max-width: 260px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-primary:active {
  -webkit-transform: translateY(3px);
  transform: translateY(3px);
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.3);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-transition: all 0.1s;
  transition: all 0.1s;
  width: 100%;
  max-width: 280px;
}
.btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
  -webkit-transform: scale(0.97);
  transform: scale(0.97);
}
.btn-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: linear-gradient(135deg, #ffd33d, #ff9500);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(255, 149, 0, 0.35);
  -webkit-transition: all 0.15s ease;
  transition: all 0.15s ease;
  width: 100%;
  max-width: 260px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-menu:active {
  -webkit-transform: translateY(3px);
  transform: translateY(3px);
  box-shadow: 0 2px 12px rgba(255, 149, 0, 0.3);
}

/* ===== GAME SCREEN ===== */
#game-screen {
  justify-content: flex-start;
  padding-top: calc(var(--safe-top) + 40px);
}

.btn-quit {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.btn-quit:active {
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

/* Particles and floating scores moved from inline styles */
.particles-container,
.floating-scores {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.particles-container {
  z-index: 99;
}
.floating-scores {
  z-index: 100;
}

.game-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  gap: 4px;
}
.header-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 6px;
  border-radius: 10px;
  flex: 1;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  min-width: 0;
}
.header-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.5px;
}
.header-value {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}
.moves-value {
  color: var(--gold);
}
.moves-critical {
  color: var(--red) !important;
  -webkit-animation: blink 0.6s ease-in-out infinite;
  animation: blink 0.6s ease-in-out infinite;
}
.coins-value {
  color: var(--gold);
}
.coins-item {
  cursor: pointer;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.coins-item:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
}

@-webkit-keyframes blink {
  50% {
    opacity: 0.3;
  }
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* PROGRESS */
.progress-container {
  width: 100%;
  padding: 4px 12px 6px;
}
.progress-bar {
  width: 100%;
  height: 9px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--purple), var(--red), var(--gold));
  -webkit-transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px var(--accent-glow);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--dim);
  margin-top: 3px;
  font-weight: 600;
}

/* OBJECTIVES */
.objectives-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 12px;
}
.objectives-panel.hidden {
  display: none;
}
.obj-icon {
  font-size: 1rem;
}
.obj-text {
  font-size: 0.75rem;
  color: var(--dim);
  flex: 1;
}
.obj-progress {
  font-size: 0.8rem;
  font-weight: 700;
}
.obj-reward {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 190, 11, 0.12);
  padding: 2px 8px;
  border-radius: 100px;
}

/* GRID */
.game-grid {
  position: relative;
  width: calc(100% - 16px);
  max-width: 400px;
  margin: 4px auto;
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* BLOCKS */
.block {
  position: absolute;
  border-radius: 8px;
  cursor: pointer;
  -webkit-transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
  will-change: transform, opacity;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}
.block::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28) 0%,
    transparent 50%
  );
  pointer-events: none;
}
.block:active {
  -webkit-transform: scale(0.88) !important;
  transform: scale(0.88) !important;
}

/* Block colors */
.color-0 {
  background: linear-gradient(145deg, #ff2d87, #cc0058);
}
.color-1 {
  background: linear-gradient(145deg, #5a9dff, #1a6eff);
}
.color-2 {
  background: linear-gradient(145deg, #2eeab8, #04b885);
}
.color-3 {
  background: linear-gradient(145deg, #ffcf3a, #e6a800);
}
.color-4 {
  background: linear-gradient(145deg, #9d5cf5, #6b1fd4);
}
.color-5 {
  background: linear-gradient(145deg, #ff7733, #e04000);
}

/* Special blocks */
.special-bomb::before {
  content: "💥";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 2;
  pointer-events: none;
}
.special-bomb {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    0 0 12px rgba(255, 100, 0, 0.5);
  -webkit-animation: bombPulse 1.5s ease-in-out infinite;
  animation: bombPulse 1.5s ease-in-out infinite;
}
@-webkit-keyframes bombPulse {
  0%,
  100% {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.25),
      0 0 8px rgba(255, 100, 0, 0.4);
  }
  50% {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.25),
      0 0 20px rgba(255, 100, 0, 0.7);
  }
}
@keyframes bombPulse {
  0%,
  100% {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.25),
      0 0 8px rgba(255, 100, 0, 0.4);
  }
  50% {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.25),
      0 0 20px rgba(255, 100, 0, 0.7);
  }
}

.special-rainbow::before {
  content: "✨";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 2;
  pointer-events: none;
}
.special-rainbow {
  -webkit-animation: rainbowShift 2s linear infinite;
  animation: rainbowShift 2s linear infinite;
}
@-webkit-keyframes rainbowShift {
  0% {
    -webkit-filter: hue-rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    -webkit-filter: hue-rotate(360deg);
    filter: hue-rotate(360deg);
  }
}
@keyframes rainbowShift {
  0% {
    -webkit-filter: hue-rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    -webkit-filter: hue-rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

.frozen-block::after {
  background: linear-gradient(
    135deg,
    rgba(180, 230, 255, 0.6) 0%,
    rgba(100, 180, 255, 0.2) 50%
  ) !important;
}
.frozen-block {
  box-shadow:
    inset 0 2px 8px rgba(150, 220, 255, 0.5),
    inset 0 -2px 4px rgba(0, 80, 150, 0.3),
    0 0 12px rgba(100, 180, 255, 0.3);
}
.frozen-block::before {
  content: "❄️";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 2;
  pointer-events: none;
}
.cracked-ice::before {
  content: "🧊";
}

/* Block animations */
.block.popping {
  -webkit-animation: popBlock 0.28s ease-out forwards;
  animation: popBlock 0.28s ease-out forwards;
  pointer-events: none;
}
@-webkit-keyframes popBlock {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
  50% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
    opacity: 0.8;
  }
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }
}
@keyframes popBlock {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
  50% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
    opacity: 0.8;
  }
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }
}
.block.dropping {
  -webkit-transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.block.appearing {
  -webkit-animation: appearBlock 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation: appearBlock 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Mobile adjustments to keep start-screen UI visible */
@media (max-width: 420px) {
  .mascot-frame {
    width: 100px;
    height: 100px;
  }
  .sparkle-ring {
    width: 135px;
    height: 135px;
  }
  .title-line {
    font-size: 2.2rem;
  }
  .title-line.accent {
    font-size: 2.7rem;
  }
  .subtitle {
    font-size: 0.8rem;
    letter-spacing: 4px;
  }
  .stats-bar {
    gap: 5px;
  }
  .stat-pill {
    padding: 4px 10px;
  }
  .stat-value {
    font-size: 0.8rem;
  }
  .action-buttons {
    padding: 0 20px;
  }
  .btn-play-content {
    padding: 14px 20px;
  }
  .btn-play-text {
    font-size: 1rem;
  }
  .btn-secondary-glass {
    padding: 8px 8px;
    font-size: 0.65rem;
  }
  .btn-glass-icon {
    font-size: 0.8rem;
  }
  .name-input {
    font-size: 0.95rem;
    padding: 7px 14px;
    max-width: 65%;
  }
  .creator-signature {
    font-size: 0.62rem;
  }
  .name-mascot {
    width: 26px;
    height: 26px;
  }
  .footer-row {
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
  }

  .mascot-section {
    margin-top: calc(var(--safe-top) + 12px);
  }
}
@-webkit-keyframes appearBlock {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes appearBlock {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.block.highlight {
  -webkit-animation: blockGlow 0.35s ease-in-out infinite alternate;
  animation: blockGlow 0.35s ease-in-out infinite alternate;
  z-index: 2;
}
@-webkit-keyframes blockGlow {
  to {
    -webkit-filter: brightness(1.4);
    filter: brightness(1.4);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
  }
}
@keyframes blockGlow {
  to {
    -webkit-filter: brightness(1.4);
    filter: brightness(1.4);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
  }
}

/* POWERUPS */
.powerups-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  padding-bottom: calc(var(--safe-bot) + 6px);
}
.powerup-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  flex: 1;
  max-width: 90px;
}
.powerup-btn:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
}
.powerup-btn.active-pu {
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.2);
  box-shadow: 0 0 16px var(--accent-glow);
}
.powerup-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.pu-icon {
  font-size: 1.3rem;
}
.pu-label {
  font-size: 0.55rem;
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.pu-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 7px;
  border-radius: 100px;
}

/* COMBO */
.combo-display {
  position: absolute;
  top: 40%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 200;
  pointer-events: none;
}
.combo-display.hidden {
  display: none;
}
.combo-display span {
  font-size: 3rem;
  font-weight: 900;
  display: block;
  text-align: center;
  background: linear-gradient(180deg, #fff, #ffbe0b, #ff006e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-filter: drop-shadow(0 4px 10px rgba(255, 0, 110, 0.8))
    drop-shadow(0 0 20px rgba(255, 190, 11, 0.6));
  filter: drop-shadow(0 4px 10px rgba(255, 0, 110, 0.8))
    drop-shadow(0 0 20px rgba(255, 190, 11, 0.6));
  -webkit-animation: comboPop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation: comboPop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@-webkit-keyframes comboPop {
  0% {
    opacity: 0;
    -webkit-transform: scale(0.2) translateY(50px) rotate(-10deg);
    transform: scale(0.2) translateY(50px) rotate(-10deg);
  }
  20% {
    opacity: 1;
    -webkit-transform: scale(1.4) translateY(-10px) rotate(5deg);
    transform: scale(1.4) translateY(-10px) rotate(5deg);
  }
  40% {
    -webkit-transform: scale(1) translateY(0) rotate(0deg);
    transform: scale(1) translateY(0) rotate(0deg);
  }
  80% {
    opacity: 1;
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    -webkit-transform: scale(1.2) translateY(-40px);
    transform: scale(1.2) translateY(-40px);
  }
}
@keyframes comboPop {
  0% {
    opacity: 0;
    -webkit-transform: scale(0.2) translateY(50px) rotate(-10deg);
    transform: scale(0.2) translateY(50px) rotate(-10deg);
  }
  20% {
    opacity: 1;
    -webkit-transform: scale(1.4) translateY(-10px) rotate(5deg);
    transform: scale(1.4) translateY(-10px) rotate(5deg);
  }
  40% {
    -webkit-transform: scale(1) translateY(0) rotate(0deg);
    transform: scale(1) translateY(0) rotate(0deg);
  }
  80% {
    opacity: 1;
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    -webkit-transform: scale(1.2) translateY(-40px);
    transform: scale(1.2) translateY(-40px);
  }
}
.combo-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  box-shadow: 0 0 10px currentColor;
  -webkit-animation: comboParticleBurst 0.8s ease-out forwards;
  animation: comboParticleBurst 0.8s ease-out forwards;
}
@-webkit-keyframes comboParticleBurst {
  0% {
    -webkit-transform: translate(-50%, -50%) scale(1);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      scale(0);
    opacity: 0;
  }
}
@keyframes comboParticleBurst {
  0% {
    -webkit-transform: translate(-50%, -50%) scale(1);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      scale(0);
    opacity: 0;
  }
}

/* ===== COUNTDOWN ===== */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 250;
}
.countdown-overlay.hidden {
  display: none;
}
.countdown-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 40px var(--accent-glow),
    inset 0 0 40px rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.1);
}
.countdown-number {
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px var(--accent-glow);
  -webkit-animation: countdownPop 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: countdownPop 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.countdown-number.go-text {
  font-size: 3rem;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255, 190, 11, 0.5);
}
@-webkit-keyframes countdownPop {
  0% {
    -webkit-transform: scale(2);
    transform: scale(2);
    opacity: 0;
  }
  60% {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes countdownPop {
  0% {
    -webkit-transform: scale(2);
    transform: scale(2);
    opacity: 0;
  }
  60% {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.countdown-label {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--dim);
  letter-spacing: 3px;
  font-weight: 600;
}

/* ===== MODALS ===== */
.modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 200;
  -webkit-animation: fadeIn 0.3s ease;
  animation: fadeIn 0.3s ease;
}
.modal.hidden {
  display: none;
}
@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-content {
  position: relative;
  background: linear-gradient(
    160deg,
    rgba(30, 20, 60, 0.95),
    rgba(15, 10, 35, 0.98)
  );
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 22px;
  padding: 28px 26px;
  text-align: center;
  width: 88%;
  max-width: 340px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(168, 85, 247, 0.12);
  -webkit-animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@-webkit-keyframes modalSlide {
  from {
    -webkit-transform: scale(0.8) translateY(40px);
    transform: scale(0.8) translateY(40px);
    opacity: 0;
  }
  to {
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
@keyframes modalSlide {
  from {
    -webkit-transform: scale(0.8) translateY(40px);
    transform: scale(0.8) translateY(40px);
    opacity: 0;
  }
  to {
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.gameover-title {
  color: var(--red);
}
.gameover-sub {
  color: var(--dim);
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.stars-display {
  font-size: 2.4rem;
  margin-bottom: 16px;
  -webkit-filter: drop-shadow(0 0 10px rgba(255, 190, 11, 0.5));
  filter: drop-shadow(0 0 10px rgba(255, 190, 11, 0.5));
}
.modal-stats {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
}
.stat-row span:first-child {
  color: var(--dim);
}
.stat-row span:last-child {
  font-weight: 700;
}
.coins-earned {
  color: var(--gold);
  font-weight: 800;
}
.modal-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 5px;
}
.modal-btns .btn-primary {
  width: 100%;
  max-width: 100%;
}
.modal-btns-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.modal-btns-row button {
  flex: 1;
  padding: 14px 10px;
  font-size: 0.9rem;
  margin: 0;
}
.confetti-container {
  position: absolute;
  top: 0;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  border-radius: 22px;
}
.confetti-piece {
  position: absolute;
  width: 9px;
  height: 9px;
  top: -10px;
  border-radius: 2px;
  -webkit-animation: confettiFall 1.5s ease-in forwards;
  animation: confettiFall 1.5s ease-in forwards;
}
@-webkit-keyframes confettiFall {
  0% {
    opacity: 1;
    -webkit-transform: translateY(0) rotate(0);
    transform: translateY(0) rotate(0);
  }
  100% {
    opacity: 0;
    -webkit-transform: translateY(400px) rotate(720deg);
    transform: translateY(400px) rotate(720deg);
  }
}
@keyframes confettiFall {
  0% {
    opacity: 1;
    -webkit-transform: translateY(0) rotate(0);
    transform: translateY(0) rotate(0);
  }
  100% {
    opacity: 0;
    -webkit-transform: translateY(400px) rotate(720deg);
    transform: translateY(400px) rotate(720deg);
  }
}

/* ===== SHOP ===== */
.shop-content {
  padding: 22px 20px;
  max-height: 85vh;
  overflow-y: auto;
}
.shop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.shop-title {
  font-size: 1.3rem;
  font-weight: 800;
  flex: 1;
  text-align: left;
}
.shop-coins-bal {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 190, 11, 0.12);
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255, 190, 11, 0.3);
}
.btn-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.btn-close:active {
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
}
.shop-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.shop-item-icon {
  font-size: 2rem;
  width: 44px;
  text-align: center;
}
.shop-item-info {
  flex: 1;
}
.shop-item-name {
  font-size: 1rem;
  font-weight: 700;
}
.shop-item-desc {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 2px;
}
.shop-item-owned {
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 3px;
  font-weight: 600;
}
.btn-buy {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-buy:active {
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
}
.btn-buy:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-buy.cant-afford {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}
.shop-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--dim);
  margin: 4px 0;
  letter-spacing: 2px;
  font-weight: 600;
}

/* OBJ TOAST */
.obj-toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(255, 190, 11, 0.2),
    rgba(255, 190, 11, 0.1)
  );
  border: 1px solid rgba(255, 190, 11, 0.4);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 150;
  -webkit-animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.obj-toast.hidden {
  display: none;
}
@-webkit-keyframes toastIn {
  from {
    opacity: 0;
    -webkit-transform: translateX(-50%) translateY(20px);
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateX(-50%) translateY(0);
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    -webkit-transform: translateX(-50%) translateY(20px);
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateX(-50%) translateY(0);
    transform: translateX(-50%) translateY(0);
  }
}

/* PARTICLES & FLOATING */
.particles-container,
.floating-scores {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 99;
}
.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  -webkit-animation: particleFly 0.7s ease-out forwards;
  animation: particleFly 0.7s ease-out forwards;
}
@-webkit-keyframes particleFly {
  0% {
    opacity: 1;
    -webkit-transform: translate(0, 0) scale(1);
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    -webkit-transform: translate(var(--px), var(--py)) scale(0);
    transform: translate(var(--px), var(--py)) scale(0);
  }
}
@keyframes particleFly {
  0% {
    opacity: 1;
    -webkit-transform: translate(0, 0) scale(1);
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    -webkit-transform: translate(var(--px), var(--py)) scale(0);
    transform: translate(var(--px), var(--py)) scale(0);
  }
}
.floating-score {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 190, 11, 0.6);
  -webkit-animation: floatUp 1s ease-out forwards;
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
}
@-webkit-keyframes floatUp {
  0% {
    opacity: 1;
    -webkit-transform: translate(-50%, -50%) translateY(0) scale(1);
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    -webkit-transform: translate(-50%, -50%) translateY(-60px) scale(0.5);
    transform: translate(-50%, -50%) translateY(-60px) scale(0.5);
  }
}
@keyframes floatUp {
  0% {
    opacity: 1;
    -webkit-transform: translate(-50%, -50%) translateY(0) scale(1);
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    -webkit-transform: translate(-50%, -50%) translateY(-60px) scale(0.5);
    transform: translate(-50%, -50%) translateY(-60px) scale(0.5);
  }
}

/* SHAKE */
.shake {
  -webkit-animation: shakeAnim 0.3s ease-in-out;
  animation: shakeAnim 0.3s ease-in-out;
}
@-webkit-keyframes shakeAnim {
  0%,
  100% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
  25% {
    -webkit-transform: translateX(-5px);
    transform: translateX(-5px);
  }
  75% {
    -webkit-transform: translateX(5px);
    transform: translateX(5px);
  }
}
@keyframes shakeAnim {
  0%,
  100% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
  25% {
    -webkit-transform: translateX(-5px);
    transform: translateX(-5px);
  }
  75% {
    -webkit-transform: translateX(5px);
    transform: translateX(5px);
  }
}

/* RESPONSIVE */
@media (max-height: 680px) {
  .game-header {
    padding: 5px 10px;
  }
  .header-value {
    font-size: 1.1rem;
  }
  .progress-container {
    padding: 3px 10px 4px;
  }
  .powerups-bar {
    padding: 5px 10px;
  }
  .pu-icon {
    font-size: 1.1rem;
  }
}

/* HELP MODAL */
.help-content {
  text-align: left;
}
.help-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}
.help-body::-webkit-scrollbar {
  width: 4px;
}
.help-body::-webkit-scrollbar-track {
  background: transparent;
}
.help-body::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 4px;
}
.help-section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.help-section p,
.help-section li {
  font-size: 0.95rem;
  color: var(--dim);
  line-height: 1.5;
}
.help-section ul {
  padding-left: 15px;
}

/* ===== COFFEE / DONATION ===== */
/* ===== LEADERBOARD ===== */
.lb-content {
  padding: 22px 20px;
  max-height: 85vh;
  overflow-y: auto;
}
.lb-status {
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
  background: rgba(6, 214, 160, 0.1);
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.lb-body {
  min-height: 100px;
}
.lb-loading, .lb-empty, .lb-disabled {
  text-align: center;
  padding: 30px 10px;
  color: var(--dim);
  font-size: 1rem;
}
.lb-empty-sub {
  font-size: 0.85rem;
  margin-top: 8px;
  opacity: 0.6;
}
.lb-disabled p:first-child {
  font-size: 1rem;
  margin-bottom: 6px;
}
.lb-table {
  margin-top: 8px;
}
.lb-header {
  display: grid;
  grid-template-columns: 36px 1fr 80px 40px;
  gap: 4px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lb-col-rank { text-align: center; }
.lb-col-score { text-align: right; }
.lb-col-level { text-align: center; }
.lb-entries {
  display: flex;
  flex-direction: column;
}
.lb-entry {
  display: grid;
  grid-template-columns: 36px 1fr 80px 40px;
  gap: 4px;
  padding: 10px 12px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: center;
  -webkit-transition: background 0.2s;
  transition: background 0.2s;
}
.lb-entry:last-child {
  border-bottom: none;
}
.lb-entry .lb-rank {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--dim);
}
.lb-entry .lb-rank.gold { color: var(--gold); }
.lb-entry .lb-rank.silver { color: #c0c0c0; }
.lb-entry .lb-rank.bronze { color: #cd7f32; }
.lb-entry .lb-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-entry .lb-score {
  text-align: right;
  font-weight: 800;
  color: var(--accent);
}
.lb-entry .lb-level {
  text-align: center;
  font-size: 0.85rem;
  color: var(--dim);
}
.lb-entry.me {
  background: rgba(168, 85, 247, 0.08);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
}
.lb-entry .lb-medal {
  font-size: 1rem;
}

/* Rank prompt in modals */
.rank-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px 0 8px;
  -webkit-animation: rankPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: rankPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rank-prompt.hidden {
  display: none;
}
@-webkit-keyframes rankPop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes rankPop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.rank-prompt-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.rank-prompt-icon {
  font-size: 1.3rem;
}
.rank-prompt-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.btn-rank {
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px var(--accent-glow);
  -webkit-transition: all 0.15s;
  transition: all 0.15s;
}
.btn-rank:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
}

/* Entry slide-in animation */
.lb-entry {
  -webkit-animation: lbEntry 0.3s ease both;
  animation: lbEntry 0.3s ease both;
}
@-webkit-keyframes lbEntry {
  from {
    opacity: 0;
    -webkit-transform: translateX(-10px);
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
}
@keyframes lbEntry {
  from {
    opacity: 0;
    -webkit-transform: translateX(-10px);
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
}
