/* ==========================================================================
   Sky Rush - Premium Futuristic Mobile Runner Stylesheet
   ========================================================================== */

:root {
  --primary-gold: #fbbf24;
  --primary-gold-dark: #d97706;
  --accent-emerald: #10b981;
  --accent-emerald-dark: #059669;
  --neon-cyan: #06b6d4;
  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --dark-bg: #031412;
  --card-bg: rgba(6, 28, 25, 0.72);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-border-gold: rgba(251, 191, 36, 0.35);
  --glass-gloss: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Rajdhani', sans-serif;
  --shadow-glow-gold: 0 0 25px rgba(251, 191, 36, 0.35);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  background-color: var(--dark-bg);
  background: url('bg.jpg') center/cover no-repeat fixed;
  font-family: var(--font-main);
  color: #f8fafc;
  font-size: 16px;
}

/* Background Vignette & Ambient Layer */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(3, 20, 18, 0.4) 0%, rgba(2, 10, 9, 0.88) 100%);
  pointer-events: none;
  z-index: 0;
}

/* App Main Viewport: Centered Mobile Frame */
.app-viewport {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  background: linear-gradient(180deg, rgba(3, 20, 18, 0.4) 0%, rgba(2, 10, 9, 0.75) 100%), url('bg.jpg') center/cover no-repeat;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.2);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Screen Transitions & Display State */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)) 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  background: linear-gradient(180deg, rgba(3, 20, 18, 0.42) 0%, rgba(2, 12, 10, 0.7) 100%), url('bg.jpg') center/cover no-repeat;
  background-size: cover;
  background-position: center;
}

.header-logo-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Hide scrollbars smoothly */
.screen::-webkit-scrollbar {
  display: none;
}
.screen {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   Glassmorphism UI Components
   ========================================================================== */

.glass-panel {
  background: var(--card-bg);
  background-image: var(--glass-gloss);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}

.glass-sub-panel {
  background: rgba(8, 36, 32, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Buttons */
button {
  font-family: var(--font-main);
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:active {
  transform: scale(0.96);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: #1e1102;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.primary-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.55);
}

.secondary-btn {
  background: rgba(16, 52, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.secondary-btn:hover {
  background: rgba(22, 68, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-hero {
  width: 100%;
  padding: 18px 28px;
  font-size: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

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

.btn-glow {
  animation: pulseGlow 2.5s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35); }
  100% { box-shadow: 0 8px 30px rgba(245, 158, 11, 0.7); }
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(12, 44, 38, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-bubble {
  background: rgba(8, 38, 33, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fef08a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.stat-bubble.stars-bubble {
  color: #fde047;
}

/* ==========================================================================
   Screen 1: Welcome Screen
   ========================================================================== */

#welcome-screen {
  justify-content: center;
  align-items: center;
}

.welcome-card {
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 32px;
  padding: 8px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(251, 191, 36, 0.1) 70%, transparent 100%);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.badge-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.glow-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-gold) 65%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
  line-height: 1.05;
}

.tagline {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 6px;
}

.feature-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.pill-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 52, 45, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

/* ==========================================================================
   Screen 2: Home Screen
   ========================================================================== */

.home-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.home-hero-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  text-align: center;
  gap: 16px;
}

.hero-character-preview {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.floating-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 28px;
  animation: floatAvatar 4s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

@keyframes floatAvatar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

.ring-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(251, 191, 36, 0.15) 50%, transparent 80%);
  filter: blur(10px);
  pointer-events: none;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-gold) 60%, var(--primary-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.player-rank {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: -8px;
}

/* Progress Section */
.milestone-box {
  width: 100%;
  background: rgba(12, 42, 37, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.milestone-label-row, .score-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

.score-summary-row strong {
  color: var(--primary-gold);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(2, 20, 18, 0.8);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--primary-gold) 100%);
  border-radius: 6px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Hub Action Grid */
.hub-action-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-grid-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.btn-card {
  position: relative;
  flex-direction: column;
  padding: 12px 8px;
  gap: 4px;
}

.btn-card-icon {
  font-size: 1.4rem;
}

.btn-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
}

.badge-tag {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--accent-emerald);
  color: #02201b;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   Screen 3: Game Screen
   ========================================================================== */

#game-screen {
  padding: 10px 12px;
  justify-content: space-between;
  overflow: hidden;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  z-index: 10;
}

.hud-item {
  background: rgba(6, 28, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  backdrop-filter: blur(8px);
}

.hud-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
}

.hud-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.hud-item.hud-score .hud-val {
  color: var(--primary-gold);
}

.hud-item.hud-coins {
  flex-direction: row;
  gap: 6px;
}

.hud-coins .hud-icon {
  font-size: 1.1rem;
}

.hud-coins .hud-val {
  color: #fef08a;
}

.hud-pause {
  width: 38px;
  height: 38px;
}

/* Stage Goal Meter */
.stage-goal-container {
  width: 100%;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}

.stage-goal-bar {
  width: 100%;
  height: 6px;
  background: rgba(4, 20, 18, 0.85);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stage-goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--accent-emerald) 60%, var(--primary-gold) 100%);
  border-radius: 4px;
  transition: width 0.15s linear;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.7);
}

.stage-goal-subtext {
  display: flex;
  justify-content: flex-end;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a5f3fc;
  letter-spacing: 0.5px;
}

/* Buffs Indicator */
.active-buffs-bar {
  display: flex;
  gap: 8px;
  height: 24px;
  margin-top: 2px;
  z-index: 10;
}

.buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(14, 116, 144, 0.5);
  border: 1px solid var(--neon-cyan);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  animation: pulseBuff 1s infinite alternate;
}

@keyframes pulseBuff {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* Canvas Area */
.canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  margin: 6px 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 8px 30px rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, rgba(3, 20, 18, 0.3) 0%, rgba(2, 12, 10, 0.65) 100%), url('bg.jpg') center/cover no-repeat;
  background-size: cover;
  background-position: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Touch Controls */
.game-touch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  height: 70px;
  z-index: 10;
}

.touch-control-btn {
  background: rgba(10, 42, 36, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.touch-control-btn:active {
  background: rgba(16, 185, 129, 0.4);
  border-color: var(--accent-emerald);
  transform: scale(0.94);
}

.touch-control-btn.btn-boost {
  background: rgba(217, 119, 6, 0.25);
  border-color: var(--primary-gold);
}

.touch-control-btn.btn-boost:active {
  background: rgba(245, 158, 11, 0.5);
}

.arrow-sym {
  font-size: 1.4rem;
  line-height: 1;
}

.ctrl-sub {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 14, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
}

.modal-sub {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-top: -8px;
}

.modal-button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.modal-metrics {
  background: rgba(4, 24, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #94a3b8;
}

.metric-row strong {
  color: #f8fafc;
  font-weight: 800;
}

/* Victory / Game Over Specials */
.victory-ribbon {
  background: linear-gradient(90deg, var(--accent-emerald), var(--primary-gold));
  color: #03201b;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
  align-self: center;
}

.victory-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
}

.star-icon.empty {
  opacity: 0.25;
  filter: grayscale(1);
}

.crash-alert {
  color: var(--neon-pink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.4);
  padding: 4px 12px;
  border-radius: 12px;
  align-self: center;
}

/* ==========================================================================
   Screens 4, 5, 6: Subscreens (Levels, Shop, Achievements)
   ========================================================================== */

.sub-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sub-screen-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #f8fafc;
}

.back-btn {
  font-size: 1.1rem;
}

/* Levels Grid (30 Items) */
.levels-grid-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  padding-bottom: 24px;
}

.level-card {
  aspect-ratio: 1;
  background: rgba(10, 42, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.level-card:not(.locked):hover {
  transform: translateY(-2px);
  border-color: var(--primary-gold);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.25);
}

.level-card:not(.locked):active {
  transform: scale(0.92);
}

.level-card.current {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(251, 191, 36, 0.3));
  border-color: var(--primary-gold);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.level-card.locked {
  background: rgba(6, 20, 18, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  opacity: 0.5;
}

.level-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.level-card.locked .level-number {
  display: none;
}

.level-lock-icon {
  display: none;
  font-size: 1.1rem;
}

.level-card.locked .level-lock-icon {
  display: block;
}

.level-stars-mini {
  display: flex;
  gap: 1px;
  font-size: 0.55rem;
  margin-top: 3px;
}

.level-stars-mini span {
  color: var(--primary-gold);
}

.level-stars-mini span.empty {
  opacity: 0.25;
}

/* Shop Skins List */
.shop-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding-bottom: 24px;
}

.shop-card {
  background: rgba(8, 36, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
}

.shop-card.equipped {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.3);
}

.shop-skin-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(3, 20, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.shop-skin-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skin-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.skin-perk {
  font-size: 0.78rem;
  color: #94a3b8;
}

.skin-price-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-gold);
}

.skin-action-btn {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.skin-action-btn.equipped-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
  cursor: default;
}

/* Achievements List */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding-bottom: 24px;
}

.achievement-card {
  background: rgba(8, 36, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.achievement-card.completed {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(14, 46, 40, 0.8);
}

.achievement-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(3, 18, 16, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achievement-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.achievement-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.achievement-reward {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-gold);
}

.achievement-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.3;
}

.achievement-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(2, 14, 12, 0.8);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--primary-gold));
  border-radius: 4px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: rgba(6, 28, 24, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--primary-gold);
  border-radius: 16px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Mobile Device Adaptations & Media Queries
   ========================================================================== */

/* Compact Width Devices (e.g. iPhone SE, Galaxy S, small screens <= 380px) */
@media (max-width: 380px) {
  .app-viewport {
    padding-left: 6px;
    padding-right: 6px;
  }
  .screen {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px)) 8px;
  }
  .glow-title {
    font-size: 2.3rem;
  }
  .brand-title {
    font-size: 2.1rem;
  }
  .levels-grid-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .level-number {
    font-size: 1.1rem;
  }
  .level-stars-mini {
    font-size: 0.45rem;
    gap: 0px;
  }
  .shop-card {
    padding: 10px 12px;
    gap: 10px;
  }
  .shop-skin-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .skin-name {
    font-size: 0.95rem;
  }
  .hud-item {
    padding: 4px 8px;
    min-width: 52px;
  }
  .hud-val {
    font-size: 1.1rem;
  }
  .game-touch-controls {
    height: 60px;
    gap: 6px;
  }
  .arrow-sym {
    font-size: 1.25rem;
  }
}

/* Compact Height Devices (screen height <= 720px) */
@media (max-height: 720px) {
  .welcome-card {
    padding: 18px 16px;
    gap: 12px;
  }
  .logo-wrapper {
    width: 90px;
    height: 90px;
  }
  .glow-title {
    font-size: 2.2rem;
  }
  .tagline {
    font-size: 0.85rem;
    line-height: 1.35;
  }
  .btn-hero {
    padding: 14px 20px;
    font-size: 1.1rem;
  }
  .home-hero-card {
    padding: 12px 14px;
    gap: 8px;
  }
  .hero-character-preview {
    width: 85px;
    height: 85px;
    margin-top: 0;
  }
  .brand-title {
    font-size: 2rem;
  }
  .player-rank {
    font-size: 0.78rem;
    margin-top: -6px;
  }
  .milestone-box {
    padding: 8px 12px;
    gap: 5px;
  }
  .hub-action-stack {
    gap: 8px;
  }
  .primary-btn.btn-large {
    padding: 12px 18px;
    font-size: 1rem;
  }
  .btn-card {
    padding: 8px 4px;
  }
  .btn-card-icon {
    font-size: 1.2rem;
  }
  .btn-card-label {
    font-size: 0.72rem;
  }
  .game-touch-controls {
    height: 54px;
  }
  .modal-card {
    padding: 18px 16px;
    gap: 10px;
  }
  .modal-logo-badge {
    width: 46px;
    height: 46px;
    margin-bottom: 2px;
  }
  .modal-title {
    font-size: 1.6rem;
  }
}
