/* ==========================================================================
   RICOCHET BLITZ - CORE STYLING & DESIGN SYSTEM
   Mobile-First High-Performance Sport Arcade Aesthetic
   ========================================================================== */

:root {
  --primary-orange: #FF5500;
  --primary-orange-bright: #FF6A1A;
  --primary-orange-glow: rgba(255, 85, 0, 0.4);
  --accent-cyan: #00E5FF;
  --accent-cyan-glow: rgba(0, 229, 255, 0.4);
  --accent-gold: #FFD200;
  --accent-gold-glow: rgba(255, 210, 0, 0.45);
  --accent-lime: #00FF88;
  --accent-purple: #B026FF;
  --accent-red: #FF2A55;

  --bg-dark: #0A0D14;
  --bg-surface: rgba(18, 24, 38, 0.75);
  --bg-surface-elevated: rgba(25, 34, 52, 0.88);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 85, 0, 0.6);

  --text-main: #FFFFFF;
  --text-muted: #8E9BAE;
  --text-dim: #546075;

  --font-heading: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px var(--primary-orange-glow);
  --shadow-cyan: 0 0 18px var(--accent-cyan-glow);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html {
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background: url('bg.jpg') center/cover no-repeat fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-body);
  color: var(--text-main);
  overflow-x: hidden;
}

/* App Viewport Container (Centered & Mobile constrained max-width 480px) */
.app-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.65) 0%, rgba(10, 13, 20, 0.82) 100%), url('bg.jpg') center/cover no-repeat;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Ambient Lighting Overlays */
.ambient-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 1;
}

.glow-top {
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--primary-orange-glow) 0%, transparent 70%);
}

.glow-bottom {
  bottom: -60px;
  left: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
}

/* Glassmorphic Panel Styles */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Screen Management & Transitions */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none !important;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  z-index: 5;
  opacity: 0;
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.65) 0%, rgba(10, 13, 20, 0.8) 100%), url('bg.jpg') center/cover no-repeat;
  pointer-events: none !important;
}

.screen.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 10 !important;
}

.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ==========================================================================
   UNIVERSAL TOP NAVIGATION BAR
   ========================================================================== */
.top-nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 14, 23, 0.88);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 58px;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.nav-btn:active {
  transform: scale(0.92);
  background: var(--primary-orange);
  border-color: var(--primary-orange);
}

.nav-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-main);
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 210, 0, 0.35);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  box-shadow: 0 0 10px rgba(255, 210, 0, 0.15);
}

.currency-icon {
  font-size: 1rem;
  color: var(--accent-gold);
}

.currency-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ==========================================================================
   BUTTONS & TYPOGRAPHY
   ========================================================================== */
button,
.btn-primary,
.btn-secondary,
.btn-ghost,
.menu-action-btn,
.nav-btn,
.hud-icon-btn,
.tier-tab,
.level-card,
.skin-card,
.ach-action-btn,
.btn-claim-coins {
  font-family: var(--font-heading);
  font-weight: 700;
  border: none;
  cursor: pointer;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 85, 0, 0.3);
  position: relative;
  z-index: 25;
  user-select: none;
  -webkit-user-select: none;
}

button *,
.btn-primary *,
.btn-secondary *,
.btn-ghost *,
.menu-action-btn *,
.nav-btn *,
.hud-icon-btn * {
  pointer-events: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange-bright) 0%, var(--primary-orange) 100%);
  color: #FFFFFF;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px var(--primary-orange-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
  pointer-events: none;
}

.btn-primary:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

.pulse-btn {
  animation: buttonPulse 2.4s infinite ease-in-out;
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 0 6px 20px var(--primary-orange-glow);
  }
  50% {
    box-shadow: 0 8px 30px rgba(255, 85, 0, 0.7);
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn-secondary:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.btn-ghost:active {
  color: var(--text-main);
}

/* ==========================================================================
   SCREEN 1: WELCOME SCREEN
   ========================================================================== */
#screen-welcome {
  justify-content: flex-start;
  padding: 24px 20px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  z-index: 10;
  pointer-events: auto !important;
}

.welcome-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
  z-index: 15;
  pointer-events: auto !important;
}

.brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 16px;
}

.logo-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-full);
  filter: drop-shadow(0 10px 25px rgba(255, 85, 0, 0.5));
  animation: orbFloat 4s ease-in-out infinite;
}

.logo-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary-orange);
  opacity: 0.6;
  animation: ringExpand 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes orbFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}

@keyframes ringExpand {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.game-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  color: #FFFFFF;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.title-accent {
  color: var(--primary-orange);
  margin-left: 6px;
  text-shadow: 0 0 18px var(--primary-orange-glow);
}

.game-tagline {
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}

.welcome-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.feature-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.feature-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 30;
  pointer-events: auto !important;
}

/* ==========================================================================
   SCREEN 2: HOME SCREEN
   ========================================================================== */
#screen-home {
  padding-top: 58px; /* Offset for top nav */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.home-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

/* Player Banner */
.player-banner {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.15) 0%, rgba(18, 24, 38, 0.85) 100%);
  border-color: rgba(255, 85, 0, 0.35);
}

.player-avatar-box {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange-glow);
  flex-shrink: 0;
}

.avatar-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF 0%, var(--primary-orange) 50%, #992200 100%);
  box-shadow: inset -2px -2px 6px rgba(0,0,0,0.6);
}

.avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--primary-orange);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.player-meta {
  flex: 1;
}

.player-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.player-username {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.player-level-pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

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

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--primary-orange));
  border-radius: 4px;
  transition: width 0.3s ease;
}

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

/* Stats 2x2 Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.stat-icon {
  font-size: 0.95rem;
}

.stat-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
}

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

/* Home Menu Actions */
.home-menu-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  text-align: left;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.menu-action-btn.primary-action {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.95) 0%, rgba(220, 60, 0, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px var(--primary-orange-glow);
}

.action-btn-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at right, rgba(255, 255, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.action-btn-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
}

.action-icon-circle.accent-blue {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
}

.action-icon-circle.accent-gold {
  background: rgba(255, 210, 0, 0.15);
  color: var(--accent-gold);
}

.action-icon-circle.accent-green {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-lime);
}

.action-text-box {
  display: flex;
  flex-direction: column;
}

.action-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  line-height: 1.2;
}

.action-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.badge-pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.chevron-right {
  color: rgba(255, 255, 255, 0.6);
}

/* Bonus Box */
.bonus-box {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-color: rgba(255, 210, 0, 0.3);
  background: linear-gradient(90deg, rgba(255, 210, 0, 0.08) 0%, rgba(18, 24, 38, 0.9) 100%);
}

.bonus-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.bonus-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-claim-coins {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold);
  color: #000;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 0 10px var(--accent-gold-glow);
  transition: transform 0.15s ease;
}

.btn-claim-coins:active {
  transform: scale(0.93);
}

/* ==========================================================================
   SCREEN 3: GAME SCREEN & CANVAS ARENA
   ========================================================================== */
#screen-game {
  background: linear-gradient(180deg, rgba(6, 9, 16, 0.65) 0%, rgba(6, 9, 16, 0.8) 100%), url('bg.jpg') center/cover no-repeat;
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden !important;
}

#screen-game.active {
  display: flex !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  z-index: 20 !important;
}

/* Top In-Game HUD */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(10, 14, 23, 0.92);
  border-bottom: 1px solid var(--border-glass);
  z-index: 10;
  min-height: 54px;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hud-icon-btn:active {
  transform: scale(0.9);
  background: var(--primary-orange);
}

.level-indicator {
  display: flex;
  flex-direction: column;
}

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

.lvl-num {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-orange);
  line-height: 1;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.targets-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.hud-icon-target {
  font-size: 0.95rem;
}

.stars-preview {
  display: flex;
  gap: 3px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.2);
}

.stars-preview .star.active {
  color: var(--accent-gold);
  text-shadow: 0 0 6px var(--accent-gold-glow);
}

.shots-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.shots-icons {
  display: flex;
  gap: 4px;
}

.shot-orb-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-orange);
  box-shadow: 0 0 6px var(--primary-orange-glow);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.shot-orb-icon.used {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  transform: scale(0.7);
}

/* Combo Banner */
.combo-banner {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.9) 0%, rgba(255, 210, 0, 0.9) 100%);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--primary-orange-glow);
  animation: bannerPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
}

@keyframes bannerPop {
  0% { transform: translateX(-50%) scale(0.7); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.combo-multiplier {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.15rem;
  color: #000;
}

.combo-desc {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #000;
}

/* Main Canvas Wrapper */
.canvas-wrapper {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 260px;
  touch-action: none;
  display: block;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}

.aim-instruction {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.75);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  pointer-events: none;
  animation: instructionFade 3s infinite ease-in-out;
  white-space: nowrap;
}

@keyframes instructionFade {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.5; transform: translateX(-50%) translateY(3px); }
}

/* In-Game Bottom Bar */
.game-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 14px;
  background: rgba(10, 14, 23, 0.94);
  border-top: 1px solid var(--border-glass);
  z-index: 10;
  min-height: 48px;
}

.bottom-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-stat .lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bottom-stat .val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.skin-badge {
  color: var(--primary-orange) !important;
}

/* ==========================================================================
   SCREEN 4: LEVELS SCREEN
   ========================================================================== */
#screen-levels {
  padding-top: 58px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.levels-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 36px;
  min-height: 0;
}

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

.tier-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.tier-tab {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.tier-tab.active {
  background: var(--primary-orange);
  color: #FFFFFF;
  box-shadow: 0 0 10px var(--primary-orange-glow);
}

.levels-summary-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-gold);
  background: rgba(255, 210, 0, 0.1);
  border: 1px solid rgba(255, 210, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.levels-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-bottom: 36px;
  min-height: 0;
}

.level-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.level-card:active {
  transform: scale(0.94);
}

.level-card.unlocked {
  border-color: rgba(255, 85, 0, 0.4);
}

.level-card.current {
  border: 2px solid var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange-glow);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(10, 14, 23, 0.6);
}

.level-num-txt {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1;
  margin-bottom: 4px;
}

.level-stars-row {
  display: flex;
  gap: 2px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.2);
}

.level-stars-row .star-filled {
  color: var(--accent-gold);
  text-shadow: 0 0 6px var(--accent-gold-glow);
}

.lock-icon {
  font-size: 1.3rem;
  color: var(--text-dim);
}

/* ==========================================================================
   SCREEN 5: ACHIEVEMENTS SCREEN
   ========================================================================== */
#screen-achievements {
  padding-top: 58px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.achievements-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 36px;
  gap: 12px;
  min-height: 0;
}

.achievements-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trophy-lead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trophy-emoji {
  font-size: 1.6rem;
}

.trophy-lead h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.trophy-lead p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.achievements-count {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-lime);
}

.achievements-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 36px;
  min-height: 0;
}

.achievement-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.achievement-card.completed {
  border-color: rgba(0, 255, 136, 0.4);
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.08) 0%, rgba(18, 24, 38, 0.85) 100%);
}

.achievement-card.claimed {
  opacity: 0.65;
}

.ach-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ach-details {
  flex: 1;
}

.ach-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.ach-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
}

.ach-reward-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.ach-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
  margin-bottom: 6px;
}

.ach-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
}

.ach-progress-fill {
  height: 100%;
  background: var(--accent-lime);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ach-action-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.ach-action-btn.claim {
  background: var(--accent-lime);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.ach-action-btn.claim:active {
  transform: scale(0.92);
}

.ach-action-btn.claimed {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  cursor: default;
}

/* ==========================================================================
   SCREEN 6: SKINS SHOP SCREEN
   ========================================================================== */
#screen-shop {
  padding-top: 58px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.shop-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 12px 16px 40px;
  gap: 14px;
  min-height: 0;
}

.skin-showcase-stage {
  position: relative;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 85, 0, 0.15) 0%, rgba(18, 24, 38, 0.95) 100%);
  border-color: rgba(255, 85, 0, 0.35);
  overflow: hidden;
}

.stage-lighting {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--primary-orange-glow) 0%, transparent 70%);
  pointer-events: none;
}

#skin-preview-canvas {
  width: 140px;
  height: 140px;
  margin-bottom: 8px;
  z-index: 2;
}

.stage-skin-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
}

.stage-skin-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
  margin-top: 4px;
  line-height: 1.3;
}

.skin-specs {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}

.spec-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.stage-action {
  width: 100%;
}

.stage-action button {
  width: 100%;
}

.skins-grid-header {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

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

.skin-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.skin-card:active {
  transform: scale(0.96);
}

.skin-card.selected {
  border-color: var(--primary-orange);
  box-shadow: 0 0 14px var(--primary-orange-glow);
}

.skin-card.equipped::before {
  content: 'EQUIPPED';
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent-lime);
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 3px;
}

.skin-preview-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 8px 0;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.skin-card-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

.skin-card-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-top: 2px;
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 360px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px;
  text-align: center;
  position: relative;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #FFFFFF;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 8px 0 16px;
}

.modal-divider {
  width: 40px;
  height: 3px;
  background: var(--primary-orange);
  border-radius: 2px;
  margin: 10px auto 16px;
}

.modal-stats-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.m-stat {
  display: flex;
  flex-direction: column;
}

.m-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.m-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
}

.modal-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn-stack button {
  width: 100%;
}

/* Victory Modal Specifics */
.victory-card {
  border-color: rgba(255, 210, 0, 0.4);
  background: linear-gradient(180deg, rgba(255, 210, 0, 0.12) 0%, rgba(20, 28, 44, 0.95) 100%);
}

.victory-badge {
  display: inline-block;
  background: var(--accent-gold);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.stars-award-container {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 16px 0 20px;
  font-size: 2.8rem;
  color: rgba(255, 255, 255, 0.15);
}

.award-star.active {
  color: var(--accent-gold);
  text-shadow: 0 0 16px var(--accent-gold-glow);
  animation: starPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes starPop {
  0% { transform: scale(0.3) rotate(-20deg); }
  60% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.victory-stats-grid, .defeat-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.v-stat-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.v-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.v-stat-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
}

.v-stat-val.accent-gold {
  color: var(--accent-gold);
}

/* Defeat Modal Specifics */
.defeat-card {
  border-color: rgba(255, 42, 85, 0.4);
}

.defeat-badge {
  display: inline-block;
  background: var(--accent-red);
  color: #FFF;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* How to Play Modal */
.how-card {
  max-width: 380px;
}

.how-slides {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 20px;
  text-align: left;
}

.how-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-orange);
  color: #FFF;
  font-family: var(--font-heading);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.step-desc h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.step-desc p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Toast Notifications */
.toast-box {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--accent-cyan);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
  z-index: 200;
  animation: toastSlide 0.3s ease;
  pointer-events: none;
}

@keyframes toastSlide {
  0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.toast-icon {
  font-size: 1rem;
}

.toast-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & SCROLL OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 480px) {
  .app-container {
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
}

@media (max-height: 720px) {
  .logo-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
  }
  .game-title {
    font-size: 2.1rem;
  }
  .welcome-card {
    padding: 12px;
    gap: 10px;
    margin: 10px 0;
  }
  .feature-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .player-banner {
    padding: 10px 12px;
  }
  .stat-card {
    padding: 10px;
  }
}

