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

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
}

body {
  background: #0a0a1a;
  display: flex;
  justify-content: center;
  align-items: center;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.3); border-radius: 4px; }

/* ─── App wrapper ─────────────────────────── */
.app-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
}

/* Phone frame on desktop, full screen on mobile */
.game-frame {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 430px;
  max-height: 932px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 1s ease;
}

@media (min-width: 500px) {
  .game-frame {
    border-radius: 32px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  }
}

/* ─── Tier Backgrounds ─────────────────────── */
.bg-tier-0 { background: linear-gradient(180deg, #2d2418 0%, #3d3022 40%, #1a1510 100%); }
.bg-tier-1 { background: linear-gradient(180deg, #1a2332 0%, #243447 40%, #0f1924 100%); }
.bg-tier-2 { background: linear-gradient(180deg, #2a1040 0%, #3d1860 40%, #1a0a2e 100%); }
.bg-tier-3 { background: linear-gradient(180deg, #0a1628 0%, #102040 30%, #1a0a30 70%, #0d0d1a 100%); }
.bg-tier-4 { background: linear-gradient(180deg, #050510 0%, #0a0a20 30%, #0d0520 60%, #050510 100%); }

/* ─── HUD Buttons ─────────────────────────── */
.hud-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hud-btn:active { transform: scale(0.88); }

.hud-btn-lg {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  font-size: 18px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hud-btn-lg:active { transform: scale(0.88); }

/* ─── Coin Counter ─────────────────────────── */
.coin-counter {
  font-size: 2rem;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255,215,0,0.4), 0 2px 4px rgba(0,0,0,0.5);
  font-family: 'Nunito', sans-serif;
  transition: transform 0.2s;
  line-height: 1.2;
}

@media (min-width: 400px) {
  .coin-counter {
    font-size: 2.5rem;
  }
}

/* ─── Scroll Area ──────────────────────────── */
.scroll-area {
  min-height: 200px;
}

.scroll-wheel {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.08) 0%, rgba(255,215,0,0.02) 50%, transparent 70%);
  border: 3px solid rgba(255,215,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 40px rgba(255,215,0,0.05), inset 0 0 30px rgba(255,215,0,0.03);
  transition: transform 0.2s;
}

@media (min-width: 400px) {
  .scroll-wheel {
    width: 160px;
    height: 160px;
  }
}

.scroll-wheel-emoji {
  font-size: 44px;
  opacity: 0.6;
}

@media (min-width: 400px) {
  .scroll-wheel-emoji {
    font-size: 50px;
  }
}

.scroll-wheel-ring {
  position: absolute;
  border-radius: 50%;
}

.scroll-wheel-ring-1 {
  width: 105px;
  height: 105px;
  border: 1px solid rgba(255,215,0,0.1);
}

.scroll-wheel-ring-2 {
  width: 70px;
  height: 70px;
  border: 1px dashed rgba(255,215,0,0.08);
}

@media (min-width: 400px) {
  .scroll-wheel-ring-1 { width: 120px; height: 120px; }
  .scroll-wheel-ring-2 { width: 80px; height: 80px; }
}

/* ─── Tier Badge ───────────────────────────── */
.tier-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(255,215,0,0.1);
  color: rgba(255,215,0,0.6);
  border: 1px solid rgba(255,215,0,0.15);
  white-space: nowrap;
}

/* ─── Funny Message ────────────────────────── */
.funny-msg {
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 110;
  text-align: center;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Glass Effects ────────────────────────── */
.glass {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
}

.glass-dark {
  background: rgba(10,10,30,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ─── Shop Drawer ──────────────────────────── */
.shop-drawer {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.upgrade-card {
  transition: all 0.2s ease;
}

.upgrade-card:active {
  transform: scale(0.97);
}

.buy-btn-pulse {
  animation: glow 1.5s ease-in-out infinite;
}

/* ─── Animations ───────────────────────────── */
@keyframes coinPop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.coin-counter-pop {
  animation: coinPop 0.2s ease-out;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-120px) scale(0.6); opacity: 0; }
}

.float-text {
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
  position: absolute;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 100;
  white-space: nowrap;
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

.particle {
  animation: particleBurst 0.8s ease-out forwards;
  pointer-events: none;
  position: absolute;
  z-index: 99;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 20px rgba(255,215,0,0.8); }
}

@keyframes bannerSlide {
  0% { transform: translateY(-100%); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  85% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

.achievement-banner {
  animation: bannerSlide 3s ease-in-out forwards;
}

@keyframes ripple {
  0% { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}

.ripple-effect {
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, transparent 70%);
  z-index: 50;
}

@keyframes idlePulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.8; }
}

.idle-pulse {
  animation: idlePulse 2s ease-in-out infinite;
}

@keyframes comboFire {
  0%, 100% { text-shadow: 0 0 10px #ff6600, 0 0 20px #ff3300; }
  50% { text-shadow: 0 0 20px #ff6600, 0 0 40px #ff3300, 0 0 60px #ff0000; }
}

.combo-fire {
  animation: comboFire 0.5s ease-in-out infinite;
}

@keyframes prestigeWipe {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; border-radius: 50%; }
  100% { transform: translate(-50%, -50%) scale(50); opacity: 0; border-radius: 50%; }
}

.prestige-wipe {
  animation: prestigeWipe 1.5s ease-in-out forwards;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #FFD700, #4A0E8F, #00D4FF);
  z-index: 9999;
  pointer-events: none;
}

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