* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 50%, #0d0d3d 100%);
  color: #fff;
  height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Background particles */
#bg-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: bgFloat linear infinite;
}

@keyframes bgFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

#game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Top bar */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,0.5);
  border-bottom: 2px solid rgba(255,215,0,0.3);
  z-index: 10;
}

#coin-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

#coin-icon { width: 26px; height: 26px; display: inline-flex; }
#coin-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(255,215,0,0.6)); }

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

#level-display {
  background: linear-gradient(135deg, #ff6b35, #ff4500);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255,69,0,0.4);
}

/* XP bar */
#xp-bar {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(0,0,0,0.5);
  overflow: hidden;
  flex-shrink: 0;
}

#xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6c5ce7, #a855f7, #ec4899);
  transition: width 0.3s ease;
}

#xp-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* CTA Banner */
#cta-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(255,107,0,0.2), rgba(255,0,80,0.2), rgba(168,85,247,0.2));
  border-bottom: 1px solid rgba(255,107,0,0.3);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#cta-banner:active {
  background: linear-gradient(90deg, rgba(255,107,0,0.4), rgba(255,0,80,0.4), rgba(168,85,247,0.4));
  transform: scale(0.98);
}

.cta-pulse {
  width: 8px; height: 8px;
  background: #ff6b00;
  border-radius: 50%;
  animation: ctaPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,0,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,0,0); }
}

.cta-text {
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffd700, #ff6b00, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ctaShimmer 3s linear infinite;
}

@keyframes ctaShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.cta-arrow {
  font-size: 18px;
  color: #ffd700;
  animation: ctaBounce 1s ease-in-out infinite;
}

@keyframes ctaBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* Main click area */
#click-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 8px;
  overflow: hidden;
  padding: 6px 0;
}

/* Stats row */
#stats-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.12);
  border-radius: 12px;
  padding: 6px 16px;
  min-width: 85px;
}

.stat-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #ffd700;
}

/* Combo */
#combo-display {
  font-size: 22px;
  font-weight: 800;
  color: #ff6b00;
  text-shadow: 0 0 15px rgba(255,107,0,0.6);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  min-height: 30px;
}

/* Button wrapper with ring */
#btn-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
}

#btn-ring {
  position: absolute;
  top: -10px; left: -10px;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 2px solid rgba(255,215,0,0.15);
  animation: ringRotate 10s linear infinite;
}

#btn-ring::before {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  width: 8px; height: 8px;
  background: #ffd700;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px #ffd700;
}

@keyframes ringRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

#click-btn {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 5px solid #ffd700;
  background: radial-gradient(circle at 30% 30%, #2a2a6e, #0a0a2e);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255,215,0,0.3), 0 0 80px rgba(255,215,0,0.15), inset 0 0 30px rgba(255,215,0,0.1);
  transition: transform 0.08s ease, box-shadow 0.4s ease, border-color 0.5s ease, background 0.6s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 5;
}

#click-btn:active {
  transform: scale(0.88);
  box-shadow: 0 0 60px rgba(255,215,0,0.6), 0 0 100px rgba(255,215,0,0.3);
}

#click-btn.shake {
  animation: btnShake 0.15s ease;
}

@keyframes btnShake {
  0%, 100% { transform: scale(0.88) rotate(0deg); }
  25% { transform: scale(0.88) rotate(-2deg); }
  75% { transform: scale(0.88) rotate(2deg); }
}

#ronaldo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(255,215,0,0.4));
  transition: opacity 0.4s, transform 0.4s, filter 0.5s;
}

#click-particles {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

.float-text {
  position: absolute;
  font-size: 24px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255,215,0,0.7), 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  white-space: nowrap;
  z-index: 20;
}

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

/* Click ripple effect */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(255,215,0,0.5);
  pointer-events: none;
  animation: rippleExpand 0.6s ease-out forwards;
}

@keyframes rippleExpand {
  0% { width: 0; height: 0; opacity: 1; }
  100% { width: 200px; height: 200px; opacity: 0; margin: -100px; }
}

/* Explosion */
.explosion-particle {
  position: absolute;
  pointer-events: none;
  z-index: 30;
}

@keyframes explode {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

.explosion-flash {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.9) 0%, rgba(255,100,0,0.5) 40%, transparent 70%);
  animation: flashBurst 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 25;
}

@keyframes flashBurst {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%,-50%) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%,-50%) scale(3); opacity: 0; }
}

/* Era effects */
.era-glow-gold {
  box-shadow: 0 0 30px rgba(255,215,0,0.3), 0 0 60px rgba(255,215,0,0.15);
}

.era-glow-white {
  animation: glowWhite 2s ease-in-out infinite;
}
@keyframes glowWhite {
  0%, 100% { box-shadow: 0 0 25px rgba(255,255,255,0.4), 0 0 50px rgba(255,255,255,0.2), inset 0 0 20px rgba(255,255,255,0.05); }
  50% { box-shadow: 0 0 40px rgba(255,255,255,0.7), 0 0 80px rgba(255,255,255,0.35), inset 0 0 30px rgba(255,255,255,0.1); }
}

.era-glow-white-gold {
  animation: glowWhiteGold 1.5s ease-in-out infinite;
}
@keyframes glowWhiteGold {
  0%, 100% { box-shadow: 0 0 35px rgba(255,255,255,0.5), 0 0 70px rgba(255,215,0,0.3), inset 0 0 25px rgba(255,215,0,0.08); border-color: #febe10; }
  50% { box-shadow: 0 0 60px rgba(255,255,255,0.8), 0 0 120px rgba(255,215,0,0.5), 0 0 200px rgba(255,180,0,0.2), inset 0 0 40px rgba(255,215,0,0.15); border-color: #ffe44d; }
}

#click-btn.era-glow-white-gold #ronaldo-img,
#click-btn.era-glow-white #ronaldo-img {
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.5));
}

/* Era notification */
.era-notification {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.5);
  background: rgba(0,0,0,0.95);
  border: 3px solid #ffd700;
  border-radius: 20px;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 60px rgba(255,215,0,0.5);
}
.era-notification.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.era-notif-icon { font-size: 48px; }
.era-notif-title { font-size: 24px; font-weight: 800; color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,0.5); }
.era-notif-sub { font-size: 16px; color: #fff; margin-top: 4px; }

/* Bottom nav */
#bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 8px 16px 12px;
  background: rgba(0,0,0,0.6);
  border-top: 2px solid rgba(255,215,0,0.2);
  z-index: 10;
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  height: 56px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  transition: color 0.2s;
}

.nav-btn.active { border-color: #ffd700; background: rgba(255,215,0,0.15); box-shadow: 0 0 12px rgba(255,215,0,0.3); }
.nav-btn.active .nav-label { color: #ffd700; }
.nav-btn:active { transform: scale(0.93); }

/* Panels */
.panel {
  position: absolute;
  bottom: 80px; left: 0; right: 0;
  background: rgba(10,10,46,0.97);
  border-top: 2px solid rgba(255,215,0,0.3);
  padding: 14px;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 20;
  animation: slideUp 0.25s ease;
}
.panel.hidden { display: none; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.panel h2 { font-size: 16px; margin-bottom: 10px; color: #ffd700; text-align: center; }

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 0 4px;
  margin-top: 6px;
  border-bottom: 1px solid rgba(168,85,247,0.3);
}

/* Upgrade cards */
.upgrade-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 12px;
  transition: all 0.2s;
}
.upgrade-card.owned { border-color: rgba(0,255,100,0.3); background: rgba(0,255,100,0.05); }
.upgrade-icon { width: 36px; height: 36px; flex-shrink: 0; }
.upgrade-icon svg { width: 100%; height: 100%; }
.upgrade-info { flex: 1; min-width: 0; }
.upgrade-name { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.upgrade-desc { font-size: 11px; color: #888; }
.upgrade-cost { font-size: 12px; color: #ffd700; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.coin-inline { width: 16px; height: 16px; display: inline-flex; vertical-align: middle; }
.coin-inline svg { width: 100%; height: 100%; }
.upgrade-btn {
  padding: 7px 14px;
  border: none; border-radius: 8px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000; font-weight: 700; font-size: 12px;
  cursor: pointer; flex-shrink: 0; transition: all 0.2s;
}
.upgrade-btn:disabled { background: #444; color: #888; cursor: not-allowed; }
.upgrade-btn:active:not(:disabled) { transform: scale(0.95); }

/* Task cards */
.task-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}
.task-card.completed { border-color: rgba(0,255,100,0.3); background: rgba(0,255,100,0.08); }
.task-icon { width: 28px; height: 28px; flex-shrink: 0; }
.task-icon svg { width: 100%; height: 100%; }
.task-info { flex: 1; min-width: 0; }
.task-name { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.task-progress-bar { width: 100%; height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.task-progress-fill { height: 100%; background: linear-gradient(90deg, #ffd700, #ffaa00); border-radius: 3px; transition: width 0.3s ease; }
.task-reward { font-size: 12px; font-weight: 700; color: #ffd700; flex-shrink: 0; display: flex; align-items: center; gap: 3px; }
.task-claim-btn {
  padding: 5px 10px;
  border: none; border-radius: 8px;
  background: linear-gradient(135deg, #00cc66, #00aa55);
  color: #fff; font-weight: 700; font-size: 11px;
  cursor: pointer; flex-shrink: 0;
}
.task-claim-btn:disabled { background: #444; color: #888; cursor: not-allowed; }

@keyframes coinBounce { 0% { transform: scale(1); } 30% { transform: scale(1.4); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
.coin-bounce { animation: coinBounce 0.4s ease; }

/* Level up flash */
.levelup-flash {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255,215,0,0.3), transparent);
  pointer-events: none;
  z-index: 999;
  animation: levelFlash 0.8s ease-out forwards;
}

@keyframes levelFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

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