/* -------------------------------------------------------------
   PRIME SCORE - Golden Aesthetic Design System
   Glassmorphism + Vibrant Golden Gradients
------------------------------------------------------------- */

:root {
  --primary-gold: #FFD700;
  --gold-glow: #FFAA00;
  --gold-light: #FFF275;
  --gold-dark: #B8860B;
  --accent-blue: #0F2042;
  --deep-bg: #090D16;
  --glass-bg: rgba(18, 26, 44, 0.72);
  --glass-border: rgba(255, 215, 0, 0.28);
  --glass-border-strong: rgba(255, 215, 0, 0.65);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --text-primary: #FFFFFF;
  --text-secondary: #D4AF37;
  --text-muted: #A0B2C6;
  --danger-color: #FF4757;
  --success-color: #2ED573;
  --font-main: 'Outfit', sans-serif;
  --font-heading: 'Rajdhani', sans-serif;
  --app-max-width: 480px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--deep-bg);
  background-image: url('bg.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* App container */
.app-container {
  width: 100%;
  max-width: var(--app-max-width);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(9, 13, 22, 0.75);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.15);
  border-left: 1px solid rgba(255, 215, 0, 0.15);
  border-right: 1px solid rgba(255, 215, 0, 0.15);
  overflow: hidden;
}

/* Header */
.app-header {
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 24, 40, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.logo-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.app-title-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #FFF, var(--primary-gold), #FF9F1A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
}

.golden-badge {
  color: var(--primary-gold);
}

.coin-badge {
  color: #FFDA79;
  border-color: rgba(255, 218, 121, 0.4);
}

/* Screen Viewport */
.screens-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 70px;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.screen-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Glassmorphism components */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 1px var(--glass-highlight);
  position: relative;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #FFE600 0%, #FFA800 100%);
  color: #0A0E17;
  box-shadow: 0 4px 16px rgba(255, 170, 0, 0.35);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(255, 170, 0, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(30deg);
  animation: btnGlowSweep 3s infinite;
}

@keyframes btnGlowSweep {
  0% { transform: translateX(-100%) rotate(30deg); }
  20%, 100% { transform: translateX(100%) rotate(30deg); }
}

.btn-large {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.25rem;
}

/* Typography styles */
.glow-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #FFFFFF 10%, #FFD700 60%, #FF9F1A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  margin-bottom: 4px;
}

.glow-gold {
  color: var(--primary-gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.red-gold {
  color: var(--danger-color);
  text-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
}

.gold-text {
  color: var(--primary-gold);
}

/* 1. WELCOME SCREEN */
.welcome-layout {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
}

.welcome-hero {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-trophy-glow {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

.hero-trophy-img {
  width: 110px;
  height: 110px;
  border-radius: 20px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cards-carousel {
  width: 100%;
  min-height: 160px;
  position: relative;
  margin: 20px 0;
}

.welcome-step {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.welcome-step.active {
  display: flex;
}

.step-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.welcome-step h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary-gold);
  margin-bottom: 6px;
}

.welcome-step p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.carousel-dots .dot.active {
  width: 24px;
  background: var(--primary-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.welcome-actions {
  width: 100%;
}

.welcome-actions .btn {
  width: 100%;
}

/* 2. HOME SCREEN */
.home-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(25, 38, 64, 0.85) 0%, rgba(12, 19, 33, 0.85) 100%);
  border-color: var(--glass-border-strong);
}

.avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 2px solid var(--primary-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.banner-info {
  flex: 1;
}

.player-rank {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-gold);
  letter-spacing: 1px;
}

.banner-info h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA800);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  text-align: center;
}

.tile-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.tile-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-gold);
}

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

/* Campaign level grid */
.level-select-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #FFF;
}

.level-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--glass-border);
  color: var(--primary-gold);
  border-radius: 10px;
}

.levels-scroll-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.levels-scroll-grid::-webkit-scrollbar {
  width: 4px;
}

.levels-scroll-grid::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.level-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.level-btn.unlocked {
  background: rgba(255, 215, 0, 0.12);
  border-color: var(--glass-border);
  color: #FFF;
}

.level-btn.current {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(255, 168, 0, 0.35));
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.level-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-stars-mini {
  font-size: 0.55rem;
  margin-top: -2px;
  color: var(--primary-gold);
}

/* 3. GAME SCREEN */
#gameScreen {
  padding-bottom: 0;
  display: none;
  flex-direction: column;
}

#gameScreen.active {
  display: flex;
}

.game-hud {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 19, 33, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 50;
}

.hud-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.hud-center {
  text-align: center;
}

.level-indicator {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-gold);
  letter-spacing: 1px;
}

.hud-target-score {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hud-ball-count {
  display: flex;
  gap: 3px;
}

.ball-dot {
  font-size: 0.9rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ball-dot.spent {
  opacity: 0.2;
  filter: grayscale(1);
}

.game-canvas-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(17, 30, 56, 0.6) 0%, rgba(5, 8, 15, 0.9) 100%);
  touch-action: none;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aim-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary-gold);
  pointer-events: none;
  animation: floatHint 2s infinite ease-in-out;
}

@keyframes floatHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

.combo-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.2);
  background: linear-gradient(135deg, #FFD700, #FF6B6B);
  color: #0A0E17;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  padding: 8px 20px;
  border-radius: 30px;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
  pointer-events: none;
  animation: popBanner 0.8s ease forwards;
}

@keyframes popBanner {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.9); }
}

/* Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.modal-trophy-icon {
  font-size: 3rem;
  margin-top: 4px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

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

.stars-awarded {
  display: flex;
  gap: 6px;
  font-size: 1.8rem;
}

.stars-awarded .star {
  filter: grayscale(1);
  opacity: 0.3;
  transition: all 0.3s ease;
}

.stars-awarded .star.active {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.15);
  animation: starPop 0.4s ease forwards;
}

@keyframes starPop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1.15); }
}

.modal-stats-list {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.modal-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.modal-buttons .btn {
  width: 100%;
}

/* 4. ACHIEVEMENTS SCREEN */
.section-title-box {
  text-align: center;
  margin-bottom: 8px;
}

.section-title-box h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-gold);
  letter-spacing: 1.5px;
}

.section-title-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.achievement-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.achievement-card.completed .achievement-icon {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 168, 0, 0.4));
  border-color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.achievement-details {
  flex: 1;
}

.achievement-details h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.achievement-details p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.achievement-reward {
  text-align: right;
}

.reward-coins {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-gold);
}

.status-check {
  font-size: 1.1rem;
  color: var(--success-color);
  margin-top: 4px;
}

/* 5. SHOP SCREEN */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shop-card.equipped {
  border-color: var(--primary-gold);
  background: rgba(255, 215, 0, 0.12);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

.skin-preview-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  position: relative;
}

.skin-info h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 2px;
}

.skin-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shop-card .btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Bottom Navigation */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(12, 19, 33, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 12px;
}

.nav-item .nav-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.nav-item .nav-text {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-item.active {
  color: var(--primary-gold);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Helpers */
.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
