/* ==========================================
   QUANTUM TETRO - PREMIUM DESIGN SYSTEM
   ========================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Color Palette - Neon Cyberpunk Theme */
  --color-primary: #00f0ff;
  --color-primary-dark: #00a8b3;
  --color-primary-glow: rgba(0, 240, 255, 0.5);
  --color-secondary: #ff00ff;
  --color-secondary-dark: #b300b3;
  --color-secondary-glow: rgba(255, 0, 255, 0.5);
  --color-accent: #ffff00;
  --color-success: #00ff88;
  --color-warning: #ffaa00;
  --color-danger: #ff0066;

  /* Neutral Colors */
  --color-bg-darkest: #0a0a12;
  --color-bg-dark: #131320;
  --color-bg-medium: #1a1a2e;
  --color-bg-light: #252540;
  --color-surface: rgba(255, 255, 255, 0.05);
  --color-surface-hover: rgba(255, 255, 255, 0.1);
  --color-border: rgba(0, 240, 255, 0.2);

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-tertiary: rgba(255, 255, 255, 0.5);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Orbitron', 'Inter', sans-serif;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 20px var(--color-primary-glow), 0 0 40px var(--color-primary-glow);
  --glow-secondary: 0 0 20px var(--color-secondary-glow), 0 0 40px var(--color-secondary-glow);
  --glow-success: 0 0 20px rgba(0, 255, 136, 0.5);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index layers */
  --z-base: 1;
  --z-dropdown: 100;
  --z-modal: 1000;
  --z-notification: 2000;
  --z-debug: 9999;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-darkest);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  zoom: 0.8;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  touch-action: manipulation;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   MOBILE OPTIMIZATIONS
   ========================================== */

/* Portrait mode enforcement for mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  body::before {
    content: '⟲ Please rotate your device to portrait mode for the best experience';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-darkest);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
    z-index: 10000;
    font-size: 20px;
    font-weight: 600;
  }
}

/* Enhanced touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  button,
  .menu-btn,
  .icon-btn,
  .piece {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 240, 255, 0.2);
  }

  /* Larger touch areas for game pieces */
  .piece {
    padding: var(--spacing-sm);
    margin: var(--spacing-xs);
  }

  /* Prevent zoom on double-tap */
  * {
    touch-action: manipulation;
  }
}

/* Mobile-specific font scaling */
@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .game-logo {
    font-size: clamp(28px, 10vw, 48px);
  }

  .tagline {
    font-size: clamp(10px, 2.5vw, 14px);
  }
}

/* ==========================================
   SCREEN MANAGEMENT
   ========================================== */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

.screen-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--color-bg-darkest) 0%,
    var(--color-bg-dark) 50%,
    var(--color-bg-medium) 100%
  );
  z-index: 0;
  overflow: hidden;
}

/* Aurora Gradient Layer - Aceternity Inspired */
.screen-background::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 30%, rgba(0, 240, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(255, 0, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(0, 255, 136, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse 70% 40% at 70% 20%, rgba(255, 170, 0, 0.06) 0%, transparent 45%);
  animation: auroraFloat 25s ease-in-out infinite;
  filter: blur(40px);
}

/* Floating Orbs Layer */
.screen-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.3) 0%, transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 255, 0.25) 0%, transparent 25%),
    radial-gradient(circle at 50% 10%, rgba(0, 255, 136, 0.2) 0%, transparent 20%),
    radial-gradient(circle at 30% 90%, rgba(255, 0, 102, 0.15) 0%, transparent 22%),
    radial-gradient(circle at 70% 40%, rgba(255, 255, 0, 0.1) 0%, transparent 18%);
  animation: orbsFloat 30s ease-in-out infinite alternate;
  filter: blur(60px);
  opacity: 0.6;
}

/* Aurora Animation */
@keyframes auroraFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.8;
  }
  25% {
    transform: translate(5%, 3%) rotate(2deg);
    opacity: 1;
  }
  50% {
    transform: translate(-3%, 5%) rotate(-1deg);
    opacity: 0.9;
  }
  75% {
    transform: translate(-5%, -3%) rotate(1deg);
    opacity: 1;
  }
}

/* Floating Orbs Animation */
@keyframes orbsFloat {
  0% {
    transform: translate(0, 0) scale(1);
    filter: blur(60px);
  }
  50% {
    transform: translate(-3%, 2%) scale(1.05);
    filter: blur(70px);
  }
  100% {
    transform: translate(3%, -2%) scale(0.95);
    filter: blur(55px);
  }
}

@keyframes backgroundPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.5;
  }
}

.screen-content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
}

/* ==========================================
   LOADING SCREEN
   ========================================== */

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--spacing-xl);
  color: var(--color-text-secondary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ==========================================
   LOGO & BRANDING
   ========================================== */

.logo-image {
  width: clamp(50px, 12vw, 80px);
  height: auto;
  display: block;
  margin: 0 auto var(--spacing-sm);
  filter: drop-shadow(0 0 20px var(--color-primary-glow));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.logo-container {
  text-align: center;
}

.game-logo {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    #00d8ff 25%,
    #ff00cc 50%,
    #ff00ff 75%,
    var(--color-secondary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: logoGradientShift 8s ease infinite;
  margin: 0;
  filter: drop-shadow(0 0 30px var(--color-primary-glow))
    drop-shadow(0 0 50px var(--color-secondary-glow));
  position: relative;
}

@keyframes logoGradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.logo-highlight {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-secondary), #ff66ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.2em;
  margin-top: var(--spacing-sm);
}

/* ==========================================
   HOME SCREEN
   ========================================== */

.home-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.player-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
  backdrop-filter: blur(10px);
}

.player-level {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.level-badge {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.xp-bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.currency-display {
  display: flex;
  gap: var(--spacing-md);
}

.currency {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  font-size: 16px;
}

.currency.shards {
  color: var(--color-primary);
}

.currency.crystals {
  color: var(--color-secondary);
}

.currency-icon {
  font-size: 20px;
}

/* Daily Streak */
.daily-streak {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 100, 0, 0.2);
  border: 1px solid rgba(255, 100, 0, 0.4);
  border-radius: var(--radius-md);
}

.streak-icon {
  font-size: 18px;
  animation: flameFlicker 0.5s ease-in-out infinite alternate;
}

@keyframes flameFlicker {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.streak-count {
  font-weight: 700;
  color: #ff6600;
  font-size: 14px;
}

/* Quick Mute Button */
.quick-mute-btn {
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.quick-mute-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
}

.quick-mute-btn.muted {
  background: rgba(255, 0, 102, 0.2);
  border-color: var(--color-danger);
}

.mute-icon {
  font-size: 18px;
}

/* High Scores Banner */
.high-scores-banner {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(255, 0, 255, 0.1));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

.high-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hs-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}

.hs-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-primary-glow);
}

/* Loading Tip */
.loading-tip {
  margin-top: var(--spacing-xl);
  font-size: 14px;
  color: var(--color-text-tertiary);
  animation: tipFade 4s ease-in-out infinite;
  text-align: center;
  max-width: 300px;
}

@keyframes tipFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Score Counter Animation */
.score-rolling {
  animation: scoreRoll 0.3s ease-out;
}

@keyframes scoreRoll {
  0% { transform: translateY(10px); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================
   BUTTONS
   ========================================== */

.menu-btn {
  width: 100%;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-primary);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.menu-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(255, 0, 255, 0.4));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.menu-btn:hover::before {
  left: 100%;
}

.menu-btn:hover::after {
  opacity: 1;
}

.menu-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.4), 0 0 50px rgba(0, 240, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.menu-btn:active {
  transform: translateY(-2px) scale(1.01);
}

.menu-btn.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  box-shadow: var(--glow-primary);
}

.menu-btn.primary:hover {
  box-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
}

.menu-btn.secondary {
  background: var(--color-bg-light);
  border-color: var(--color-text-tertiary);
}

.menu-btn.zen {
  border-color: var(--color-success);
}

.menu-btn.zen:hover {
  border-color: var(--color-success);
  box-shadow: var(--glow-success);
}

.menu-btn.time-attack {
  border-color: var(--color-warning);
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.1), rgba(255, 170, 0, 0.05));
}

.menu-btn.time-attack:hover {
  border-color: var(--color-warning);
  box-shadow: 0 0 30px rgba(255, 170, 0, 0.4), 0 0 60px rgba(255, 170, 0, 0.2);
}

.menu-btn.watch-ad {
  background: var(--color-warning);
  color: var(--color-bg-darkest);
  border-color: var(--color-warning);
}

.btn-icon {
  display: inline-block;
  margin-right: var(--spacing-sm);
  font-size: 24px;
}

.btn-text {
  vertical-align: middle;
}

/* Pulse Animation for Primary Button */
.menu-btn.pulse {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%,
  100% {
    box-shadow: 0 0 20px var(--color-primary-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--color-primary-glow), 0 0 80px var(--color-primary-glow);
  }
}

/* ==========================================
   MAIN MENU
   ========================================== */

.main-menu {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* ==========================================
   BOTTOM NAVIGATION
   ========================================== */

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: var(--spacing-sm);
  margin-top: auto;
  margin-bottom: var(--spacing-lg); /* Prevent cutoff */
  padding-bottom: var(--spacing-md); /* Extra spacing */
  max-width: 800px; /* Wider to fit all 7 buttons */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

@media (max-width: 480px) {
  .bottom-nav {
    grid-template-columns: repeat(4, 1fr); /* Top row: 4 items */
    gap: 4px;
    padding: 4px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    margin-top: 8px;
  }

  /* Make the last 3 items span to center them in the second row */
  .bottom-nav .icon-btn:nth-child(n + 5) {
    grid-column: span 1; /* Keep them as single columns */
  }

  /* Special handling to center the bottom row of 3 items */
  /* We'll use a different grid strategy for the last 3 items if we want them perfectly centered, 
     but a simple 4-col grid with the last 3 filling 3 slots is often cleaner. 
     Let's try a flex wrap approach for better centering control or just stick to grid.
     
     Actually, the user asked to "stack different". 
     Let's use flexbox for the container to allow wrapping and centering.
  */
  .bottom-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .bottom-nav .icon-btn {
    width: calc(25% - 6px); /* 4 items per row approx */
    flex-grow: 1;
    padding: 16px 8px;
    min-height: 90px;
  }

  /* Make the bottom row items slightly wider to fill space or keep uniform? 
     Let's keep them uniform but maybe stretch the last row items to fill width?
     "width: calc(33.33% - 6px)" for the last 3 would center them nicely.
  */
  .bottom-nav .icon-btn:nth-child(n + 5) {
    width: calc(33.33% - 6px);
  }

  .icon-btn .label {
    font-size: 16px;
    display: block;
    font-weight: 700;
    margin-top: 8px;
  }

  .icon-btn .icon {
    font-size: 42px;
    display: block;
  }
}

.icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.icon-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.game-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--spacing-md) var(--spacing-md) 0;
  gap: var(--spacing-sm);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

@media (max-height: 900px) {
  .game-container {
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }
}

@media (max-height: 700px) {
  .game-container {
    gap: 4px;
    padding: 8px;
  }
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 30px rgba(0, 240, 255, 0.1);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .game-hud {
    padding: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
}

@media (max-height: 700px) {
  .game-hud {
    padding: 8px;
  }
}

.hud-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-base);
}

.hud-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
}

.hud-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.mode-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.score-display {
  text-align: center;
}

.score-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.score-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 20px var(--color-primary-glow);
}

/* ==========================================
   GAME MAIN AREA
   ========================================== */

.game-main {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: var(--spacing-md);
  min-height: 0;
  overflow: visible;
}

@media (min-height: 901px) {
  .game-main {
    max-height: calc(100vh - 100px - 115px - 32px);
  }
}

@media (max-height: 900px) {
  .game-main {
    max-height: calc(100vh - 90px - 105px - 24px);
  }
}

@media (max-height: 700px) {
  .game-main {
    max-height: calc(100vh - 75px - 95px - 20px);
  }
}

@media (max-width: 1200px) {
  .game-main {
    grid-template-columns: 120px 1fr 120px;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 768px) {
  .game-main {
    grid-template-columns: 80px 1fr 80px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .game-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .game-sidebar {
    flex-direction: row !important;
    justify-content: center;
  }

  .game-sidebar.right {
    order: 3;
  }

  .power-ups {
    flex-direction: row !important;
    gap: var(--spacing-sm);
  }

  .game-center {
    border: 2px solid transparent;
    padding: 2px;
  }

  .game-center::before {
    inset: -2px;
    padding: 2px;
  }

  .game-container {
    padding: 8px 8px 0;
    gap: 6px;
  }

  .game-hud {
    padding: 8px;
  }
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  overflow: visible;
}

.stat-card {
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: blur(15px);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  padding: 2px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.5), rgba(255, 0, 255, 0.5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.game-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 10, 18, 0.95), rgba(26, 26, 46, 0.95));
  border: 3px solid transparent;
  border-radius: var(--radius-lg);
  overflow: visible;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.3), 0 0 120px rgba(255, 0, 255, 0.2),
    inset 0 0 60px rgba(0, 240, 255, 0.05), 0 20px 60px rgba(0, 0, 0, 0.6);
  background-clip: padding-box;
  transform-style: preserve-3d;
  animation: boardPulse 4s ease-in-out infinite, boardFloat 6s ease-in-out infinite;
}

.game-center::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-lg);
  padding: 3px;
  background: linear-gradient(45deg, #00f0ff, #ff00ff, #00ff88, #ffaa00, #ff0066, #00f0ff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 4s linear infinite;
  z-index: -1;
}

.game-center::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  animation: holographicShift 8s ease-in-out infinite;
  z-index: 1;
}

#game-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  position: relative;
  z-index: 2;
  filter: contrast(1.05) brightness(1.05);
  animation: canvasGlow 3s ease-in-out infinite alternate;
}

#game-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 240, 255, 0.03) 0px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  animation: scanLines 8s linear infinite;
}

#particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Power-ups */
.power-ups {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  overflow: visible;
}

.power-btn {
  position: relative;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: visible;
}

.power-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(255, 0, 255, 0.4));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.power-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.power-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.power-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.power-btn:hover:not(:disabled)::after {
  left: 100%;
}

.power-btn:active:not(:disabled) {
  transform: scale(1.02);
}

.power-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.power-icon {
  display: block;
  font-size: 32px;
  margin-bottom: var(--spacing-xs);
}

.power-count {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ==========================================
   PIECE TRAY
   ========================================== */

.piece-tray {
  padding: 20px var(--spacing-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  backdrop-filter: blur(15px);
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  height: 240px;
  max-height: 240px;
  min-height: 220px;
  overflow: visible;
  margin-bottom: 12px;
}

@media (max-height: 900px) {
  .piece-tray {
    height: 240px;
    max-height: 240px;
    padding: 20px var(--spacing-sm);
  }
}

@media (max-height: 700px) {
  .piece-tray {
    height: 220px;
    max-height: 220px;
    padding: 18px var(--spacing-sm);
  }
}

@media (max-height: 600px) {
  .piece-tray {
    height: 200px;
    max-height: 200px;
    padding: 16px var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .piece-tray {
    height: 220px;
    max-height: 220px;
    padding: 24px 16px;
    margin-bottom: 0;
    margin-top: 0;
    border: 2px solid rgba(0, 240, 255, 0.3);
  }

  .pieces-container {
    min-height: 160px;
    gap: var(--spacing-md);
    align-items: center;
  }

.piece.selected {
  transform: scale(1.1);
  filter: brightness(1.2);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 30px var(--color-primary-glow);
  animation: pieceSelectPulse 1s ease-in-out infinite;
}

@keyframes pieceSelectPulse {
  0% { transform: scale(1.1); box-shadow: 0 0 30px var(--color-primary-glow); }
  50% { transform: scale(1.15); box-shadow: 0 0 50px var(--color-primary-glow); }
  100% { transform: scale(1.1); box-shadow: 0 0 30px var(--color-primary-glow); }
}

  .tray-label {
    margin-bottom: 16px;
  }
}

.piece-tray::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    rgba(0, 240, 255, 0.3),
    rgba(255, 0, 255, 0.3),
    rgba(0, 240, 255, 0.3)
  );
  background-size: 200% 100%;
  animation: trayBorderFlow 3s linear infinite;
  z-index: -1;
  opacity: 0.6;
}

@keyframes trayBorderFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* ==========================================
   MOBILE STATS BAR
   ========================================== */

.mobile-stats-bar {
  display: none;
  padding: 16px 12px;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .mobile-stats-bar {
    display: flex;
    justify-content: space-around;
  }
}

.mobile-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(0, 240, 255, 0.05);
  border-radius: var(--radius-sm);
}

.mobile-stat-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.mobile-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 15px var(--color-primary-glow), 0 0 30px var(--color-primary-glow);
}

/* ==========================================
   MOBILE ACTION BAR
   ========================================== */

.mobile-action-bar {
  display: none;
  padding: 8px;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: var(--radius-md);
  margin-top: 6px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .mobile-action-bar {
    display: flex;
    justify-content: space-between;
  }
}

.mobile-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mobile-action-btn:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
  border-color: rgba(0, 240, 255, 0.6);
}

.mobile-action-btn .action-icon {
  font-size: 28px;
  display: block;
}

.mobile-action-btn .action-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ==========================================
   TOOLTIPS & ENHANCEMENTS
   ========================================== */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 46, 0.95));
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 10000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%) rotate(90deg);
  border: 6px solid transparent;
  border-top-color: rgba(0, 240, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: 10000;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Top-positioned tooltip for specific elements */
[data-tooltip-pos='top']::before {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 46, 0.95));
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 10000;
}

[data-tooltip-pos='top']::after {
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%) rotate(90deg);
  border: 6px solid transparent;
  border-top-color: rgba(0, 240, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: 10000;
}

[data-tooltip-pos='top']:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos='top']:hover::after {
  opacity: 1;
}

/* Animated Score Display */
.score-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 20px var(--color-primary-glow);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.score-value.score-increase {
  animation: scorePopAnimation 0.4s ease-out;
}

@keyframes scorePopAnimation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
    color: #ffff00;
    text-shadow: 0 0 30px rgba(255, 255, 0, 0.8);
  }
  100% {
    transform: scale(1);
  }
}

/* Stat Card Pulse on Update */
.stat-value.updated {
  animation: statPulse 0.5s ease-out;
}

@keyframes statPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    color: #ffff00;
  }
}

/* Enhanced Loading Spinner */
.loading-spinner {
  animation: spinnerRotate 1s linear infinite, spinnerPulse 2s ease-in-out infinite;
}

@keyframes spinnerPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.tray-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  text-align: center;
}

.pieces-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 160px;
  flex-wrap: wrap;
  padding: 4px;
}

@media (max-width: 768px) {
  .pieces-container {
    gap: var(--spacing-sm);
  }
}

@media (max-height: 700px) {
  .pieces-container {
    min-height: 50px;
    gap: 8px;
  }
}

.piece {
  padding: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--transition-base);
  user-select: none;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

@media (max-height: 700px) {
  .piece {
    padding: 4px;
  }
}

.piece::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(255, 0, 255, 0.4));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.piece:hover {
  transform: scale(1.1) translateY(-4px) rotate(2deg);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.4), 0 0 50px rgba(0, 240, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.piece:hover::before {
  opacity: 1;
}

.piece:active {
  cursor: grabbing;
  transform: scale(1.05) rotate(5deg);
}

.piece.dragging {
  opacity: 0.7;
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 20px 60px rgba(0, 240, 255, 0.6);
}

.piece.used {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.8);
}

/* ==========================================
   RESULTS SCREEN
   ========================================== */

.results-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding: var(--spacing-sm) 0;
}

.results-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.result-stat {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  backdrop-filter: blur(10px);
}

.result-stat.highlight {
  grid-column: 1 / -1;
  border-color: var(--color-primary);
  box-shadow: var(--glow-primary);
}

.result-stat .stat-label {
  font-size: 10px;
  margin-bottom: 4px;
}

.result-stat .stat-value {
  font-size: 28px;
  margin-top: 0;
}

.rewards-section {
  padding: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  backdrop-filter: blur(10px);
}

.rewards-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  text-align: center;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-secondary);
}

.rewards-list {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
}

.reward-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 20px;
  font-weight: 700;
}

.reward-icon {
  font-size: 24px;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* ==========================================
   SHOP SCREEN
   ========================================== */

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
}

.screen-header h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-currency {
  display: flex;
  gap: var(--spacing-md);
}

.shop-tabs {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.tab-btn {
  flex: 1;
  padding: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-base);
}

.tab-btn:hover {
  background: var(--color-surface-hover);
}

.tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg-darkest);
}

.shop-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.shop-item {
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.shop-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.shop-item.locked {
  opacity: 0.5;
}

.shop-item.owned {
  border-color: var(--color-success);
}

.item-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--spacing-xs);
}

.powerup-preview {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.powerup-icon {
  font-size: 48px;
}

.premium-item {
  border: 2px solid rgba(255, 215, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 255, 255, 0.02));
}

.premium-preview {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3)) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  position: relative;
}

.premium-icon {
  font-size: 48px;
}

.premium-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 215, 0, 0.9);
  color: #000;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 14px;
}

.premium-contents {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.premium-btn {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: #000 !important;
  border: none;
  font-weight: 900;
}

.premium-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* ==========================================
   SETTINGS SCREEN
   ========================================== */

.settings-content {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.settings-section {
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  backdrop-filter: blur(10px);
}

.settings-section h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-surface);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item label {
  font-weight: 600;
}

.setting-item input[type='range'] {
  width: 150px;
  margin: 0 var(--spacing-md);
}

.value-display {
  min-width: 50px;
  text-align: right;
  font-family: var(--font-display);
  color: var(--color-primary);
}

.toggle-switch {
  width: 50px;
  height: 26px;
  appearance: none;
  background: var(--color-bg-light);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-text-tertiary);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle-switch:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.toggle-switch:checked::before {
  left: 26px;
  background: var(--color-bg-darkest);
}

.theme-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--spacing-md);
}

.theme-option {
  aspect-ratio: 1;
  border: 3px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

.theme-option:hover {
  transform: scale(1.05);
}

.theme-option.active {
  border-color: var(--color-primary);
  box-shadow: var(--glow-primary);
}

/* ==========================================
   MODAL
   ========================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 500px;
  width: 90%;
  padding: var(--spacing-2xl);
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(255, 0, 102, 0.5);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 36px;
  margin-bottom: var(--spacing-xl);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* ==========================================
   DEBUG PANEL
   ========================================== */

.debug-panel {
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--color-warning);
  border-radius: var(--radius-md);
  z-index: var(--z-debug);
  min-width: 200px;
  display: none;
}

.debug-panel.visible {
  display: block;
}

.debug-panel h4 {
  color: var(--color-warning);
  margin-bottom: var(--spacing-md);
  font-family: var(--font-display);
}

.debug-controls {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.debug-controls button {
  padding: var(--spacing-sm);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all var(--transition-base);
}

.debug-controls button:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-warning);
}

/* ==========================================
   UTILITIES
   ========================================== */

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
  .game-main.game-sidebar {
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  z-index: 5;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-sidebar.right {
  align-items: flex-end;
}
  .game-main {
    grid-template-columns: 80px 1fr 80px;
  }

  .stat-card {
    padding: var(--spacing-sm);
  }

  .stat-value {
    font-size: 20px;
  }

  .power-btn {
    padding: var(--spacing-md);
  }

  .power-icon {
    font-size: 24px;
  }

  .power-count {
    font-size: 14px;
  }

  .results-stats {
    grid-template-columns: 1fr;
  }

  .shop-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .player-info-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .currency-display {
    justify-content: center;
  }

  .game-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .game-sidebar.left,
  .game-sidebar.right {
    display: none !important;
  }

  .stat-card,
  .power-btn {
    min-width: 100px;
  }
}

/* ==========================================
   JOURNEY MAP - Exceptional Design
   ========================================== */

.journey-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
}

.progress-label {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

#journey-progress-text {
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
}

.journey-map-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 180px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
}

.map-background-layers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background-repeat: repeat;
  animation: mapScroll 60s linear infinite;
}

.map-layer.layer-1 {
  background-image: radial-gradient(circle at 20% 30%, rgba(0, 240, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.03) 0%, transparent 50%);
  animation-duration: 80s;
}

.map-layer.layer-2 {
  background-image: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.02) 0%, transparent 50%);
  animation-duration: 100s;
  animation-direction: reverse;
}

.map-layer.layer-3 {
  background: linear-gradient(90deg, transparent 0%, rgba(0, 240, 255, 0.05) 50%, transparent 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(0, 240, 255, 0.03) 50px,
      rgba(0, 240, 255, 0.03) 51px
    );
  animation-duration: 120s;
}

@keyframes mapScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100px);
  }
}

.journey-map-container {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 3rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
}

/* Custom Scrollbar */
.journey-map-container::-webkit-scrollbar {
  width: 8px;
}

.journey-map-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.journey-map-container::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.map-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.map-connections line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
  stroke-dasharray: 10 5;
  opacity: 0.4;
  transition: all 0.5s ease;
}

.map-connections line.unlocked {
  stroke: var(--color-primary);
  stroke-width: 4;
  stroke-dasharray: none;
  opacity: 1;
  filter: drop-shadow(0 0 8px var(--color-primary));
  animation: lineGlow 2s ease-in-out infinite;
}

@keyframes lineGlow {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-node:hover {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 10;
}

.node-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(26, 26, 46, 0.9));
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.node-icon::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, var(--color-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: nodeRotate 3s linear infinite;
}

@keyframes nodeRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.map-node.current .node-icon {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.05));
  box-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow),
    inset 0 0 20px rgba(0, 240, 255, 0.2);
  animation: currentPulse 2s ease-in-out infinite;
}

.map-node.current .node-icon::before {
  opacity: 1;
}

@keyframes currentPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow),
      inset 0 0 20px rgba(0, 240, 255, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--color-primary-glow), 0 0 80px var(--color-primary-glow),
      inset 0 0 30px rgba(0, 240, 255, 0.3);
  }
}

.map-node.completed .node-icon {
  border-color: var(--color-success);
  color: var(--color-success);
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.map-node.completed .node-icon::after {
  content: '✓';
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 28px;
  height: 28px;
  background: var(--color-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-bg-darkest);
  box-shadow: 0 2px 10px rgba(0, 255, 136, 0.6);
}

.map-node.locked {
  cursor: not-allowed;
  opacity: 0.4;
  filter: grayscale(1);
}

.map-node.locked .node-icon {
  color: rgba(255, 255, 255, 0.2);
}

.map-node.locked:hover {
  transform: translate(-50%, -50%);
}

.node-info {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 46, 0.95));
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 240, 255, 0.3);
  margin-top: 15px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.map-node:hover .node-info {
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
}

.node-name {
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.node-score {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.node-stars {
  font-size: 0.75rem;
  margin-top: 4px;
  letter-spacing: 2px;
}

/* Boss Levels */
.map-node.boss .node-icon {
  width: 70px;
  height: 70px;
  font-size: 28px;
  background: linear-gradient(135deg, var(--color-warning), #ff6600);
  border: 3px solid var(--color-warning);
  box-shadow: 0 0 30px rgba(255, 170, 0, 0.6);
}

.map-node.boss.current .node-icon {
  animation: bossPulse 1.5s ease-in-out infinite;
}

@keyframes bossPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 170, 0, 0.6); }
  50% { box-shadow: 0 0 50px rgba(255, 170, 0, 0.9), 0 0 80px rgba(255, 170, 0, 0.4); }
}

/* Checkpoint Levels */
.map-node.checkpoint .node-icon {
  border: 3px solid var(--color-secondary);
}

/* Journey Page Navigation */
.journey-page-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  z-index: 500;
}

.page-nav-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-nav-btn:hover:not(:disabled) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg-darkest);
}

.page-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-indicator {
  text-align: center;
  min-width: 150px;
}

.world-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.page-range {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}


/* Journey Level Details Modal */
.journey-modal {
  max-width: 600px;
  background: linear-gradient(135deg, rgba(10, 10, 18, 0.98), rgba(26, 26, 46, 0.98));
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 60px var(--color-primary-glow);
}

.level-detail-content {
  padding: 1rem;
}

.level-description {
  color: var(--color-text-secondary);
  margin: 1rem 0 2rem;
  line-height: 1.6;
  text-align: center;
}

.level-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.level-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.level-best-score {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
}

.level-best-score[style*='display: none'] {
  display: none !important;
}

.best-score-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.best-score-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-success);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  margin-bottom: 0.75rem;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.star-rating .star {
  font-size: 1.5rem;
  filter: grayscale(1) brightness(0.3);
  transition: all 0.3s ease;
}

.star-rating .star.active {
  filter: grayscale(0) brightness(1) drop-shadow(0 0 10px #ffaa00);
  animation: starPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes starPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.map-node:hover .node-info {
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
}

.node-name {
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--color-text);
  margin-bottom: 2px;
}

.node-score {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* Missions Screen */
.missions-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.mission-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-base);
}

.mission-item.completed {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--color-secondary);
}

.mission-info {
  flex: 1;
}

.mission-title {
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.mission-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--spacing-xs);
  width: 100%;
  max-width: 200px;
}

.mission-progress-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.mission-reward {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-primary);
  font-weight: 700;
  margin-right: var(--spacing-md);
}

.mission-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-base);
}

.mission-btn.claim {
  background: var(--color-secondary);
  color: white;
  box-shadow: var(--glow-secondary);
}

.mission-btn.claim:hover {
  transform: scale(1.05);
}

.mission-btn:disabled {
  background: var(--color-surface);
  color: var(--color-text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================
   EXCEPTIONAL FEATURES - Combo, Popups, Notifications
   ========================================== */

.combo-visualizer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
}

.combo-display {
  text-align: center;
  opacity: 0;
  transform: scale(0.5) translateY(50px);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.combo-display.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.combo-text {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  margin-bottom: 1rem;
  animation: comboTextPulse 0.5s ease-out;
}

.combo-display.super .combo-text {
  font-size: 5rem;
  color: var(--color-secondary);
  text-shadow: 0 0 30px var(--color-secondary-glow), 0 0 60px var(--color-secondary-glow);
}

.combo-display.mega .combo-text {
  font-size: 6rem;
  background: linear-gradient(
    45deg,
    var(--color-primary),
    var(--color-secondary),
    var(--color-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: comboTextPulse 0.5s ease-out, rainbowShift 2s linear infinite;
}

@keyframes comboTextPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes rainbowShift {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

.combo-number,
.combo-score {
  font-family: var(--font-display);
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.combo-number {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.5rem;
}
.combo-score {
  font-size: 1.5rem;
  color: var(--color-success);
}

.score-popup-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.score-popup {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-success);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
  opacity: 0;
}

.score-popup.animate {
  animation: scorePopupFloat 2s ease-out forwards;
}

@keyframes scorePopupFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-30px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(0.8);
  }
}

.performance-grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--spacing-md);
  animation: gradeReveal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes gradeReveal {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.grade-letter {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  margin-bottom: 0.25rem;
  animation: gradePopIn 0.5s ease-out;
}

@keyframes gradePopIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.grade-label {
  font-size: 14px;
  margin-bottom: 0;
}

.grade-letter.rank-s {
  color: #ffd700;
  text-shadow: 0 0 30px #ffd700, 0 0 60px #ffa500, 0 0 90px #ffd700;
  animation: gradePopIn 0.5s ease-out, rankSPulse 2s infinite;
}
.grade-letter.rank-a {
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-secondary);
}
.grade-letter.rank-b {
  color: var(--color-success);
  text-shadow: 0 0 30px rgba(0, 255, 100, 0.6);
}
.grade-letter.rank-c {
  color: var(--color-accent);
  text-shadow: 0 0 30px rgba(255, 200, 0, 0.6);
}
.grade-letter.rank-d {
  color: var(--color-danger);
  text-shadow: 0 0 30px rgba(255, 0, 102, 0.6);
}

@keyframes rankSPulse {
  0%,
  100% {
    text-shadow: 0 0 30px #ffd700, 0 0 60px #ffa500;
  }
  50% {
    text-shadow: 0 0 50px #ffd700, 0 0 90px #ffa500, 0 0 120px #ffd700;
  }
}
}

.grade-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.notification-container,
.achievement-toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
}

.notification {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 46, 0.95));
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateX(450px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}
.notification.success {
  border-left-color: var(--color-success);
}
.notification.error {
  border-left-color: var(--color-danger);
}
.notification.warning {
  border-left-color: var(--color-warning);
}
.notification.achievement {
  border-left-color: #ffd700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
}

.notification-icon {
  font-size: 1.5rem;
}
.notification.achievement .notification-icon {
  animation: achievementBounce 0.6s ease-out;
}

@keyframes achievementBounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3) rotate(15deg);
  }
}

.notification-message {
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
}

/* ==========================================
   ACHIEVEMENTS SCREEN
   ========================================== */

.achievement-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.progress-bar-slim {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.5s ease;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.achievement-card {
  position: relative;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(26, 26, 46, 0.5));
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.achievement-card.unlocked {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(26, 26, 46, 0.6));
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.achievement-card.unlocked::before {
  content: '?';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  color: var(--color-success);
  animation: achievementUnlock 0.5s ease;
}

@keyframes achievementUnlock {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.achievement-card.locked .achievement-icon {
  filter: grayscale(1) opacity(0.3);
}

.achievement-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.achievement-description {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* ==========================================
   LEADERBOARD SCREEN
   ========================================== */

.leaderboard-modes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.mode-tab {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: var(--color-primary);
  color: white;
  box-shadow: var(--glow-primary);
}

.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 2rem 0;
}

.podium-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(26, 26, 46, 0.5));
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  position: relative;
}

.podium-rank.rank-1 {
  order: 2;
  transform: scale(1.15);
  border: 3px solid #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(26, 26, 46, 0.7));
}

.podium-rank.rank-2 {
  order: 1;
  border: 3px solid #c0c0c0;
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}

.podium-rank.rank-3 {
  order: 3;
  border: 3px solid #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.podium-avatar {
  font-size: 3rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.podium-name {
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.podium-score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.rank-1 .podium-score {
  color: #ffd700;
}
.rank-2 .podium-score {
  color: #c0c0c0;
}
.rank-3 .podium-score {
  color: #cd7f32;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.leaderboard-entry:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.leaderboard-entry.player {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(26, 26, 46, 0.5));
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.entry-rank {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-text-secondary);
  min-width: 40px;
  text-align: center;
}

.entry-avatar {
  font-size: 2rem;
}

.entry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.entry-name {
  font-weight: 700;
  color: var(--color-text-primary);
}

.entry-badge {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.entry-score {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.player-rank-card {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(26, 26, 46, 0.9));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(10px);
}

.rank-position {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-primary);
  min-width: 60px;
  text-align: center;
}

.rank-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rank-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

.rank-badge {
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: 600;
}

.rank-score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

/* ==========================================
   STATISTICS SCREEN
   ========================================== */

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-big-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(26, 26, 46, 0.5));
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.stat-big-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

.stat-big-icon {
  font-size: 3rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.stat-big-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
}

.stat-big-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.stats-detailed {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-section {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
}

.stat-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.stat-label {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

/* ==========================================
   VISUAL ENHANCEMENTS - Hover, Shadows, Effects
   ========================================== */

/* Grid cell hover glow effect */
.grid-cell:hover {
  background: rgba(0, 240, 255, 0.15) !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
}

/* Piece shadow (ghost piece preview) */
.piece-shadow {
  opacity: 0.3;
  filter: brightness(0.5);
  border: 2px dashed rgba(0, 240, 255, 0.4) !important;
}

/* Piece drag trail effect */
.piece-trail {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: trailFade 0.6s ease-out;
}

@keyframes trailFade {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Grid glow effect when hovering */
.game-grid:hover {
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3), 0 0 80px rgba(0, 240, 255, 0.1);
}

/* Piece placement flash */
@keyframes placementFlash {
  0%,
  100% {
    background: inherit;
  }
  50% {
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
  }
}

.grid-cell.placed {
  animation: placementFlash 0.4s ease-out;
}

/* Piece hover elevation */
.piece-preview:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Button glow on hover */
.game-btn:hover,
.menu-btn:hover {
  box-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  transform: translateY(-2px);
}

/* Piece rotation animation */
@keyframes pieceRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(90deg);
  }
}

.piece-rotating {
  animation: pieceRotate 0.15s ease-out;
}

/* Line clear effect */
@keyframes lineClear {
  0% {
    opacity: 1;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.8);
  }
  100% {
    opacity: 0;
    transform: scaleX(0);
  }
}

.line-clearing {
  animation: lineClear 0.5s ease-out forwards;
}

/* Particle burst effect */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  pointer-events: none;
  animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Score popup enhancement */
@keyframes scorePopupFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-30px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(0.8);
  }
}

/* Combo glow pulse */
@keyframes comboPulse {
  0%,
  100% {
    box-shadow: 0 0 20px var(--color-secondary-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--color-secondary-glow), 0 0 60px var(--color-secondary-glow);
  }
}

.combo-active {
  animation: comboPulse 1s ease-in-out infinite;
}

/* ==========================================
   TIME ATTACK MODE SPECIFIC
   ========================================== */

#time-attack-timer {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-success);
  text-shadow: 0 0 20px currentColor;
  transition: color 0.3s ease;
}

.timer-warning {
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#speed-bonus-display {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  text-shadow: 0 0 15px var(--color-accent);
}

.speed-bonus-popup {
  animation: speedBonusFloat 1.5s ease-out forwards;
}

@keyframes speedBonusFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100px) scale(0.8);
  }
}

.time-bonus-popup {
  animation: timeBonusFloat 2s ease-out forwards;
}

@keyframes timeBonusFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120px) scale(0.8) rotate(-5deg);
  }
}

.time-attack-hud {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(26, 26, 46, 0.7));
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.time-attack-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.time-attack-stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.time-attack-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

/* ==========================================
   DAILY REWARDS MODAL
   ========================================== */

.daily-rewards-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.daily-rewards-modal.active {
  opacity: 1;
  pointer-events: all;
}

.daily-rewards-content {
  background: linear-gradient(135deg, rgba(10, 10, 18, 0.95), rgba(26, 26, 46, 0.95));
  border: 3px solid var(--color-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.4);
  animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
  0% {
    transform: translateY(-100px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.daily-rewards-header {
  text-align: center;
  margin-bottom: 2rem;
}

.daily-rewards-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.daily-rewards-streak {
  font-size: 1.2rem;
  color: var(--color-success);
  font-weight: 700;
}

.daily-rewards-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.reward-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  position: relative;
}

.reward-day.claimed {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--color-success);
}

.reward-day.today {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
  border-color: var(--color-primary);
  border-width: 3px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  animation: rewardPulse 2s ease-in-out infinite;
}

@keyframes rewardPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.reward-day.claimed::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  color: var(--color-success);
  font-weight: 900;
  font-size: 1.2rem;
}

.reward-day-number {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.reward-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.reward-amount {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.daily-rewards-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.claim-reward-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color-success), #00cc66);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.claim-reward-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 10px 20px rgba(0, 0, 0, 0.3);
}

.claim-reward-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.close-rewards-btn {
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-rewards-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   GAME BOARD ANIMATIONS
   ========================================== */

@keyframes boardPulse {
  0%,
  100% {
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.3), 0 0 120px rgba(255, 0, 255, 0.2),
      inset 0 0 60px rgba(0, 240, 255, 0.05), 0 20px 60px rgba(0, 0, 0, 0.6);
  }
  50% {
    box-shadow: 0 0 80px rgba(0, 240, 255, 0.5), 0 0 140px rgba(255, 0, 255, 0.3),
      inset 0 0 80px rgba(0, 240, 255, 0.1), 0 25px 70px rgba(0, 0, 0, 0.7);
  }
}

@keyframes boardFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes borderRotate {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes holographicShift {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(0, 0);
  }
  25% {
    opacity: 0.5;
    transform: translate(10px, 10px);
  }
  50% {
    opacity: 0.3;
    transform: translate(-10px, 10px);
  }
  75% {
    opacity: 0.5;
    transform: translate(10px, -10px);
  }
}

@keyframes canvasGlow {
  0% {
    filter: contrast(1.05) brightness(1.05) drop-shadow(0 0 10px rgba(0, 240, 255, 0.2));
  }
  100% {
    filter: contrast(1.08) brightness(1.08) drop-shadow(0 0 20px rgba(0, 240, 255, 0.4));
  }
}

@keyframes scanLines {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(4px);
  }
}

/* ==========================================
   RESPONSIVE OPTIMIZATIONS
   ========================================== */

/* Responsive Typography */
@media (max-width: 1200px) {
  :root {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }

  .game-logo {
    font-size: 48px !important;
  }

  .score-value {
    font-size: 24px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 13px;
  }

  .game-logo {
    font-size: 36px !important;
  }
}

/* Grid Pulse Effect */
.game-center.pulse {
  animation: gridPulse 0.3s ease-out;
}

@keyframes gridPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 0 80px rgba(0, 240, 255, 0.5), 0 0 150px rgba(255, 0, 255, 0.4),
      inset 0 0 80px rgba(0, 240, 255, 0.2), 0 25px 70px rgba(0, 0, 0, 0.7);
  }
  100% {
    transform: scale(1);
  }
}

/* Button Press Effect */
.menu-btn.pressed {
  animation: buttonPress 0.2s ease-out;
}

@keyframes buttonPress {
  0% {
    transform: translateY(-4px) scale(1.02);
  }
  50% {
    transform: translateY(0) scale(0.98);
  }
  100% {
    transform: translateY(-4px) scale(1.02);
  }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .game-center {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  canvas {
    image-rendering: pixelated;
  }
}

/* ==========================================
   AD WATCH MODAL & DOUBLE REWARDS
   ========================================== */

.ad-modal {
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.ad-content {
  background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.1);
  max-width: 400px;
  width: 90%;
  padding: var(--spacing-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ad-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
  animation: scanline 2s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(400px);
    opacity: 0;
  }
}

.ad-header {
  margin-bottom: var(--spacing-lg);
}

.satellite-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

.ad-header h2 {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 20px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.ad-status-text {
  font-family: 'Courier New', monospace;
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
  letter-spacing: 0.05em;
}

.ad-progress-container {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  width: 0%;
  box-shadow: 0 0 10px var(--color-primary-glow);
  transition: width 0.1s linear;
}

.ad-timer {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-text-primary);
}

/* Double Rewards Button Special Styling */
#double-rewards-btn {
  background: linear-gradient(135deg, #ffaa00 0%, #ff6600 100%);
  border-color: #ffaa00;
  color: #000;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

#double-rewards-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 0 30px rgba(255, 170, 0, 0.6);
}

#double-rewards-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  20% {
    transform: translateX(100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

#double-rewards-btn:disabled {
  background: var(--color-bg-light);
  border-color: var(--color-text-tertiary);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  animation: none;
}

#double-rewards-btn:disabled::after {
  display: none;
}

/* ==========================================
   ACETERNITY-INSPIRED PARTICLE EFFECTS
   ========================================== */

/* Particle Container */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Grid Pattern Overlay */
.grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle, rgba(0, 240, 255, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* Shooting Star Base */
.shooting-star {
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px var(--color-primary));
  opacity: 0;
  animation: shootingStar 4s ease-in-out infinite;
  transform-origin: left center;
}

.shooting-star::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary), 0 0 40px var(--color-primary);
}

/* Multiple shooting stars with different timings */
.shooting-star:nth-child(1) {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
  animation-duration: 3s;
}

.shooting-star:nth-child(2) {
  top: 25%;
  left: 60%;
  animation-delay: 1.5s;
  animation-duration: 4s;
  background: linear-gradient(90deg, var(--color-secondary), transparent);
  filter: drop-shadow(0 0 6px var(--color-secondary));
}

.shooting-star:nth-child(3) {
  top: 50%;
  left: -5%;
  animation-delay: 3s;
  animation-duration: 3.5s;
}

.shooting-star:nth-child(4) {
  top: 70%;
  left: 40%;
  animation-delay: 2s;
  animation-duration: 4.5s;
  background: linear-gradient(90deg, var(--color-success), transparent);
  filter: drop-shadow(0 0 6px var(--color-success));
}

.shooting-star:nth-child(5) {
  top: 85%;
  left: 80%;
  animation-delay: 0.5s;
  animation-duration: 3.2s;
}

@keyframes shootingStar {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(-35deg);
  }
  5% {
    opacity: 1;
  }
  20% {
    opacity: 1;
  }
  25% {
    opacity: 0;
    transform: translateX(300px) translateY(180px) rotate(-35deg);
  }
  100% {
    opacity: 0;
    transform: translateX(300px) translateY(180px) rotate(-35deg);
  }
}

/* Sparkle Particles */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 3s ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: inherit;
}

.sparkle::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: -50%;
  transform: translateY(-50%);
  width: 200%;
}

.sparkle::after {
  height: 100%;
  width: 2px;
  left: 50%;
  top: -50%;
  transform: translateX(-50%);
  height: 200%;
}

/* Generate multiple sparkles with different positions and timings */
.sparkle:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 25%; left: 85%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { top: 40%; left: 30%; animation-delay: 1s; }
.sparkle:nth-child(4) { top: 55%; left: 70%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { top: 70%; left: 15%; animation-delay: 2s; }
.sparkle:nth-child(6) { top: 80%; left: 50%; animation-delay: 2.5s; }
.sparkle:nth-child(7) { top: 20%; left: 55%; animation-delay: 0.3s; }
.sparkle:nth-child(8) { top: 65%; left: 90%; animation-delay: 1.8s; }
.sparkle:nth-child(9) { top: 35%; left: 5%; animation-delay: 2.2s; }
.sparkle:nth-child(10) { top: 90%; left: 35%; animation-delay: 0.8s; }

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary);
  }
}

/* Floating Dust Particles */
.dust-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: floatDust 15s ease-in-out infinite;
  opacity: 0.4;
}

.dust-particle:nth-child(1) { left: 5%; animation-duration: 18s; animation-delay: 0s; }
.dust-particle:nth-child(2) { left: 15%; animation-duration: 22s; animation-delay: 2s; }
.dust-particle:nth-child(3) { left: 25%; animation-duration: 16s; animation-delay: 4s; }
.dust-particle:nth-child(4) { left: 35%; animation-duration: 20s; animation-delay: 1s; }
.dust-particle:nth-child(5) { left: 45%; animation-duration: 24s; animation-delay: 3s; }
.dust-particle:nth-child(6) { left: 55%; animation-duration: 17s; animation-delay: 5s; }
.dust-particle:nth-child(7) { left: 65%; animation-duration: 21s; animation-delay: 2.5s; }
.dust-particle:nth-child(8) { left: 75%; animation-duration: 19s; animation-delay: 4.5s; }
.dust-particle:nth-child(9) { left: 85%; animation-duration: 23s; animation-delay: 1.5s; }
.dust-particle:nth-child(10) { left: 95%; animation-duration: 15s; animation-delay: 3.5s; }

@keyframes floatDust {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-20vh) translateX(30px);
    opacity: 0;
  }
}

/* Glowing Beam Effect */
.glow-beam {
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 240, 255, 0.3) 20%,
    rgba(0, 240, 255, 0.8) 50%,
    rgba(0, 240, 255, 0.3) 80%,
    transparent 100%
  );
  opacity: 0;
  animation: beamSweep 8s ease-in-out infinite;
  filter: blur(2px);
}

.glow-beam:nth-child(1) { left: 20%; animation-delay: 0s; }
.glow-beam:nth-child(2) { left: 50%; animation-delay: 2.5s; background: linear-gradient(to bottom, transparent, rgba(255, 0, 255, 0.3), rgba(255, 0, 255, 0.8), rgba(255, 0, 255, 0.3), transparent); }
.glow-beam:nth-child(3) { left: 80%; animation-delay: 5s; background: linear-gradient(to bottom, transparent, rgba(0, 255, 136, 0.3), rgba(0, 255, 136, 0.8), rgba(0, 255, 136, 0.3), transparent); }

@keyframes beamSweep {
  0%, 100% {
    opacity: 0;
    transform: translateY(-100%);
  }
  10% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  95% {
    opacity: 0;
    transform: translateY(100%);
  }
}

/* ==========================================
   COUNTDOWN ANIMATION
   ========================================== */

#countdown-overlay {
  animation: fadeIn 0.3s ease;
}

#countdown-overlay .countdown-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#countdown-overlay .countdown-number {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 40px var(--color-primary-glow), 0 0 80px var(--color-primary-glow);
  z-index: 1;
}

#countdown-overlay .countdown-number.countdown-animate {
  animation: countdownPop 0.8s ease-out;
}

@keyframes countdownPop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#countdown-overlay .countdown-ring {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: ringPulse 0.8s ease-out infinite;
  box-shadow: 0 0 30px var(--color-primary-glow);
}

@keyframes ringPulse {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

#countdown-overlay.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* ==========================================
   LEVEL UP EFFECT
   ========================================== */

.level-up-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.level-up-content {
  text-align: center;
  animation: levelUpBounce 0.5s ease-out;
}

.level-up-icon {
  font-size: 80px;
  animation: levelUpSpin 1s ease-out;
}

.level-up-text {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--color-primary-glow);
  margin-top: var(--spacing-md);
  animation: levelUpGlow 0.5s ease-out infinite alternate;
}

.level-up-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
  animation: levelUpPulse 1s ease-out infinite;
  pointer-events: none;
}

@keyframes levelUpBounce {
  0% { transform: scale(0.3) translateY(50px); opacity: 0; }
  60% { transform: scale(1.1) translateY(-10px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes levelUpSpin {
  0% { transform: rotate(0deg) scale(0.5); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes levelUpGlow {
  0% { text-shadow: 0 0 30px var(--color-primary-glow); }
  100% { text-shadow: 0 0 60px var(--color-primary-glow), 0 0 100px var(--color-secondary-glow); }
}

@keyframes levelUpPulse {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.level-up-overlay.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* ==========================================
   ACHIEVEMENT UNLOCK POPUP
   ========================================== */

.achievement-unlock-popup {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-xl);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px var(--color-primary-glow);
  z-index: 10000;
  animation: achievementSlideIn 0.5s ease-out;
}

.achievement-unlock-icon {
  font-size: 48px;
  animation: achievementBounce 0.5s ease-out;
}

.achievement-unlock-label {
  font-size: 12px;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.achievement-unlock-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

@keyframes achievementSlideIn {
  0% {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes achievementBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.achievement-unlock-popup.slide-out {
  animation: achievementSlideOut 0.5s ease-in forwards;
}

@keyframes achievementSlideOut {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
  }
}

/* ==========================================
   TUTORIAL OVERLAY
   ========================================== */

.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

.tutorial-spotlight {
  position: absolute;
  border: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 0 30px var(--color-primary-glow);
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.tutorial-spotlight.active {
  opacity: 1;
}

.tutorial-card {
  position: absolute;
  width: 90%;
  max-width: 400px;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(10, 10, 20, 0.98));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px var(--color-primary-glow);
  text-align: center;
  z-index: 9999;
}

.tutorial-card.position-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tutorial-card.position-bottom {
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.tutorial-card.position-top {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.tutorial-card.position-left {
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
}

.tutorial-card.position-right {
  top: 50%;
  right: 10%;
  left: auto;
  transform: translateY(-50%);
}

.tutorial-card.animate-in {
  animation: tutorialCardIn 0.4s ease-out;
}

@keyframes tutorialCardIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.tutorial-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-md);
  animation: tutorialIconBounce 2s ease-in-out infinite;
}

@keyframes tutorialIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.tutorial-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.tutorial-message {
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

.tutorial-progress {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-bg-light);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  transform: scale(1.2);
}

.progress-dot.complete {
  background: var(--color-success);
}

.tutorial-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

.tutorial-btn {
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.tutorial-btn.skip {
  background: transparent;
  border: 1px solid var(--color-text-tertiary);
  color: var(--color-text-tertiary);
}

.tutorial-btn.skip:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.tutorial-btn.next {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-bg-darkest);
  border: none;
}

.tutorial-btn.next:hover {
  box-shadow: 0 0 20px var(--color-primary-glow);
  transform: translateY(-2px);
}

.tutorial-overlay.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* ==========================================
   SHARE MODAL
   ========================================== */

.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.share-modal-content {
  width: 90%;
  max-width: 500px;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-darkest));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  text-align: center;
  position: relative;
}

.share-modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  width: 40px;
  height: 40px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.share-modal-close:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.share-modal-content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--color-primary);
  margin-bottom: var(--spacing-lg);
}

.share-preview {
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.share-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.share-loading {
  padding: var(--spacing-2xl);
  color: var(--color-text-tertiary);
}

.share-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.share-btn.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-bg-darkest);
}

.share-btn.secondary {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

/* ==========================================
   SCREEN SHAKE EFFECTS
   ========================================== */

.shake-light {
  animation: shakeLightAnim 0.3s ease-out;
}

.shake-medium {
  animation: shakeMediumAnim 0.4s ease-out;
}

.shake-heavy {
  animation: shakeHeavyAnim 0.5s ease-out;
}

@keyframes shakeLightAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@keyframes shakeMediumAnim {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5px, -3px); }
  30% { transform: translate(5px, 3px); }
  50% { transform: translate(-4px, 2px); }
  70% { transform: translate(4px, -2px); }
  90% { transform: translate(-2px, 1px); }
}

@keyframes shakeHeavyAnim {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-8px, -5px) rotate(-1deg); }
  20% { transform: translate(8px, 5px) rotate(1deg); }
  30% { transform: translate(-6px, 3px) rotate(-0.5deg); }
  40% { transform: translate(6px, -3px) rotate(0.5deg); }
  50% { transform: translate(-4px, 2px) rotate(-0.3deg); }
  60% { transform: translate(4px, -2px) rotate(0.3deg); }
  70% { transform: translate(-3px, 1px) rotate(-0.2deg); }
  80% { transform: translate(3px, -1px) rotate(0.2deg); }
}

/* ==========================================
   ANIMATIONS UTILITIES
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================
   POWER-UPS UI
   ========================================== */

#powerups-container {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--spacing-sm);
}

.powerup-btn {
  position: relative;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.powerup-btn:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.powerup-btn.active {
  border-color: var(--color-warning);
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
  animation: powerupPulse 0.5s ease-in-out infinite;
}

@keyframes powerupPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.powerup-icon {
  font-size: 24px;
}

.powerup-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  background: var(--color-danger);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Power-up Targeting Mode */
body.powerup-targeting {
  cursor: crosshair !important;
}

body.powerup-targeting * {
  cursor: crosshair !important;
}

/* ==========================================
   KEYBOARD CURSOR
   ========================================== */

.keyboard-cursor {
  position: absolute;
  border: 3px solid var(--color-warning);
  border-radius: 4px;
  pointer-events: none;
  z-index: 100;
  animation: cursorBlink 0.8s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================
   NEXT PIECE PREVIEW
   ========================================== */

.next-pieces-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.next-pieces-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-tertiary);
  text-align: center;
}

.next-piece-preview {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.next-piece-preview:first-of-type {
  opacity: 0.8;
  border: 1px solid var(--color-border);
}

/* ==========================================
   KEYBOARD SHORTCUTS HINT
   ========================================== */

.keyboard-hints {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-tertiary);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.keyboard-hints.visible {
  opacity: 1;
}

.keyboard-hints h4 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 12px;
}

.keyboard-hints ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.keyboard-hints li {
  margin-bottom: 4px;
}

.keyboard-hints kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: monospace;
  font-size: 11px;
  margin-right: 8px;
}

/* ============================================
   EXCEPTIONAL POLISH EFFECTS
   ============================================ */

/* Combo Popup */
.combo-popup {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 2000;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
  --combo-color: var(--color-primary);
}

.combo-popup.active {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 1;
  animation: comboPulse 0.5s ease-in-out infinite alternate;
}

@keyframes comboPulse {
  from { transform: translate(-50%, -50%) scale(1.5); }
  to { transform: translate(-50%, -50%) scale(1.7); filter: brightness(1.2); }
}

.combo-count {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 900;
  color: var(--combo-color);
  text-shadow: 0 0 20px var(--combo-color), 0 0 40px var(--combo-color);
  line-height: 0.8;
  margin-bottom: -1rem;
}

.combo-label {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
  color: #fff;
  text-shadow: 0 0 10px var(--combo-color);
}

/* Score Floater */
.score-floater {
  position: fixed;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  pointer-events: none;
  z-index: 1500;
  opacity: 1;
  transform: translateY(0);
}

.score-floater.float-up {
  transition: transform 1.5s ease-out, opacity 1.5s ease-out;
  transform: translateY(-100px);
  opacity: 0;
}

.score-floater.bonus {
  color: #ff00ff;
  font-size: 2rem;
  text-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

/* Star Burst */
.star-burst-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1vw;
  height: 1vh;
  pointer-events: none;
  z-index: 2100;
}

.star-burst {
  position: absolute;
  font-size: 3rem;
  animation: starBurstOut 1s var(--delay) ease-out forwards;
  opacity: 0;
  pointer-events: none;
}

@keyframes starBurstOut {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  10% { opacity: 1; }
  100% { 
    transform: translate(calc(cos(var(--angle)) * 300px), calc(sin(var(--angle)) * 300px)) scale(2) rotate(360deg); 
    opacity: 0; 
  }
}

/* Perfect Clear Banner */
.perfect-clear-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 2rem 5rem;
  border-radius: 100px;
  border: 4px solid #ffd700;
  box-shadow: 0 0 100px rgba(255, 215, 0, 0.6);
  text-align: center;
  z-index: 3000;
  animation: bannerPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerPop {
  0% { transform: translate(-50%, -50%) scale(0); box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
  60% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.perfect-text {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 20px #ffd700;
  margin-bottom: 0.5rem;
}

.perfect-sub {
  color: #fff;
  letter-spacing: 0.3rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  font-weight: 600;
}

/* Level Up Flash */
.level-up-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.3) 0%, transparent 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
  pointer-events: none;
}

.level-up-content {
  text-align: center;
  animation: levelUpIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes levelUpIn {
  0% { transform: scale(0.5) translateY(100px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.level-up-icon { font-size: 6rem; margin-bottom: 1.5rem; filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5)); }
.level-up-text { font-family: var(--font-display); font-size: 3rem; color: #fff; letter-spacing: 0.5rem; }
.level-up-number { font-family: var(--font-display); font-size: 6rem; color: #00f0ff; text-shadow: 0 0 30px #00f0ff; margin-top: -1rem; }

/* Boss Warning */
.boss-warning {
  position: fixed;
  top: 30%;
  left: 0;
  width: 100%;
  height: 100px;
  background: var(--color-danger);
  color: #fff;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  box-shadow: 0 0 50px var(--color-danger), inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: warningStrip 1.5s ease-in-out;
  overflow: hidden;
}

@keyframes warningStrip {
  0% { transform: scaleY(0) skewX(-20deg); opacity: 0; }
  20% { transform: scaleY(1) skewX(-20deg); opacity: 1; }
  80% { transform: scaleY(1) skewX(-20deg); opacity: 1; }
  100% { transform: scaleY(0) skewX(-20deg); opacity: 0; }
}

.boss-text {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 1rem;
  text-shadow: 0 0 20px #fff;
  animation: warningPulse 0.3s infinite alternate;
}

@keyframes warningPulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Screen Flash */
.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  animation: flashFade 0.4s ease-out forwards;
}

@keyframes flashFade {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

/* Animated Score Counter Adjustment */
.score-rolling {
  display: inline-block;
  animation: scoreBounce 0.3s ease-out;
  color: var(--color-primary);
  text-shadow: 0 0 15px var(--color-primary-glow);
}

@keyframes scoreBounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px) scale(1.2); }
  100% { transform: translateY(0); }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* ============================================
   ENHANCED GAME FEEL / JUICE
   ============================================ */

/* Score increase pulse */
.score-value.score-increase {
  animation: scorePulse 0.4s cubic-bezier(0.2, 0, 0, 1.4);
  color: var(--color-primary, #00f0ff);
}

@keyframes scorePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); text-shadow: 0 0 30px currentColor; }
  100% { transform: scale(1); }
}

/* Stat updated flash */
.stat-value.updated {
  animation: statFlash 0.5s ease-out;
}

@keyframes statFlash {
  0% { transform: scale(1); color: inherit; }
  30% { transform: scale(1.3); color: #00ff88; text-shadow: 0 0 15px #00ff88; }
  100% { transform: scale(1); color: inherit; }
}

/* Score rolling indicator */
.score-value.score-rolling {
  transition: all 0.1s ease;
}

/* Enhanced piece hover in tray */
.piece {
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1.4), box-shadow 0.15s ease;
}

.piece:hover {
  transform: scale(1.15) translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.3);
}

.piece:active {
  transform: scale(0.95);
}

.piece.selected {
  animation: selectedPulse 1s ease-in-out infinite;
}

@keyframes selectedPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); }
  50% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.8), 0 0 50px rgba(0, 240, 255, 0.3); }
}

/* Grid line clear flash */
@keyframes lineClearFlash {
  0% { background: rgba(0, 240, 255, 0.8); }
  50% { background: rgba(255, 255, 255, 0.9); }
  100% { background: transparent; }
}

/* Big combo screen flash */
.screen-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.3;
  animation: flashFade 0.2s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 0.4; }
  100% { opacity: 0; }
}

/* Enhanced countdown styles */
#countdown-overlay .countdown-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 8rem;
  font-weight: 900;
  color: #00f0ff;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.8), 0 0 80px rgba(0, 240, 255, 0.4);
}

.countdown-animate {
  animation: countdownPop 0.8s cubic-bezier(0.2, 0, 0, 1.2);
}

@keyframes countdownPop {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Chain reaction ripple on grid */
.chain-ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.6);
  animation: ripple 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple {
  0% { width: 0; height: 0; opacity: 1; }
  100% { width: 200px; height: 200px; opacity: 0; margin-left: -100px; margin-top: -100px; }
}

/* Highlight pulse for reward doubling */
.highlight-pulse {
  animation: highlightPulse 0.6s ease-out;
}

@keyframes highlightPulse {
  0% { transform: scale(1); color: inherit; }
  50% { transform: scale(1.3); color: #ffd700; text-shadow: 0 0 20px #ffd700; }
  100% { transform: scale(1); color: #00ff88; }
}

/* Time Attack timer warning animation */
.timer-warning {
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); text-shadow: 0 0 20px #ff4444; }
}

/* Speed bonus display */
#speed-card {
  transition: all 0.3s ease;
}

/* fadeInOut for Time Attack popups */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
}

/* Daily modifier badge in menu */
.daily-modifier-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.3);
  margin-top: 4px;
  color: #00f0ff;
  font-family: 'Inter', sans-serif;
}

/* Seasonal event banner */
.seasonal-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 0, 255, 0.15));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seasonal-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.seasonal-banner .event-icon {
  font-size: 2rem;
}

.seasonal-banner .event-info {
  flex: 1;
}

.seasonal-banner .event-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffd700;
}

.seasonal-banner .event-timer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.seasonal-banner .event-description {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 2px 0;
}

/* Challenge card (for async multiplayer) */
.challenge-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.challenge-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
}

.challenge-card .challenge-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #00f0ff;
}

.challenge-card .challenge-mode {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.challenge-card .challenge-actions {
  display: flex;
  gap: 8px;
}

.challenge-card .challenge-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.1);
  color: #00f0ff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.challenge-card .challenge-btn:hover {
  background: rgba(0, 240, 255, 0.25);
}

.challenge-card .challenge-btn.primary {
  background: rgba(0, 240, 255, 0.2);
  border-color: #00f0ff;
}



