/* ============================================
   SNAKELY - MOBILE FIRST CSS
   Modern, Clean, Touch-Optimized
   ============================================ */

/* ============================================
   CSS VARIABLES & TOKENS
   ============================================ */
:root {
  /* Colors - Light Theme */
  --bg-primary: #e8ecf7;
  --bg-secondary: #dde3f3;
  --bg-gradient-start: #dbe4ff;
  --bg-gradient-end: #f2e8ff;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  
  --surface-glass: rgba(245, 247, 255, 0.7);
  --surface-border: rgba(148, 163, 184, 0.35);
  --bottom-nav-bg: linear-gradient(180deg, rgba(99, 102, 241, 0.16) 0%, rgba(79, 70, 229, 0.12) 100%);

  /* Brand Colors */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Premium/Admin Colors */
  --premium-gold-start: #fbbf24;
  --premium-gold-mid: #f59e0b;
  --premium-gold-end: #d97706;
  --premium-gold-shadow: rgba(251, 191, 36, 0.4);
  
  /* Level Colors */
  --level-a1: #3b82f6;
  --level-a2: #22c55e;
  --level-b1: #f59e0b;
  --level-b2: #8b5cf6;
  --level-c1: #ef4444;
  
  /* Word Types */
  --type-noun: #3b82f6;
  --type-verb: #ef4444;
  --type-adj: #8b5cf6;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Safe Areas (iOS Notch) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  
  /* Layout */
  --bottom-nav-item-height: 46px;
  --bottom-nav-height: calc(var(--bottom-nav-item-height) + 18px);
  --nav-level-size: clamp(var(--bottom-nav-item-height), 15vw, calc(var(--bottom-nav-item-height) + 10px));
  --page-padding: 1rem;
  --max-width: 600px;
  
  /* 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: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-gradient-start: #1e293b;
  --bg-gradient-end: #0f172a;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  
  --surface-glass: rgba(30, 41, 59, 0.7);
  --surface-border: rgba(255, 255, 255, 0.1);
  --bottom-nav-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.88) 100%);
}

/* ============================================
   RESET & BASE
   ============================================ */

/* Disable pull-to-refresh but preserve normal scrolling */
html, body {
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
}

/* Prevent pull-to-refresh and zoom on touch devices */
body {
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  -ms-text-size-adjust: none;
  text-size-adjust: none;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Prevent text size adjustment on orientation change */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--bg-primary);
  
  /* Smooth scrolling */
  scroll-behavior: smooth;
  
  /* Use modern viewport units that account for dynamic toolbars */
  height: 100%;
  height: 100dvh;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
    'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  background-color: var(--bg-primary);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Prevent overscroll bounce */
  overscroll-behavior: none;
  
  /* Full height - FIXED for PWA */
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden;
  
  /* Disable user select except in inputs */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  
  /* Disable tap highlight */
  -webkit-tap-highlight-color: transparent;
  
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   LAYOUT
   ============================================ */

/* ============================================
   TOP NAVIGATION
   ============================================ */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 1000;
  overflow: hidden;
}

@media (min-width: 768px) {
  .top-nav {
    right: auto;
  }
}

.top-nav-content {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .top-nav {
    max-width: var(--max-width) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    width: var(--max-width) !important;
  }
  
  .top-nav-content {
    margin: 0 !important;
    max-width: none !important;
    padding: 0 1.5rem !important;
  }
}

.nav-left {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
}

.top-nav-logo {
  width: clamp(36px, 6vh, 40px);
  height: clamp(36px, 6vh, 40px);
  border-radius: var(--radius-full);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  background: white;
  padding: 0.25rem;
}

.app-name {
  font-size: clamp(1.25rem, 3vh, 1.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
}

.mode-toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: white;
  font-size: clamp(0.75rem, 2vh, 0.875rem);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.15);
  white-space: nowrap;
}

/* Premium/Admin mode toggle button */
.mode-toggle-btn.premium-style {
  background: linear-gradient(135deg, var(--premium-gold-start), var(--premium-gold-end));
  border-color: rgba(253, 224, 71, 0.6);
  box-shadow: 0 2px 12px var(--premium-gold-shadow), 0 0 20px rgba(251, 191, 36, 0.2), 0 0 0 1px rgba(55, 20, 0, 0.2);
  animation: goldGlow 2s ease-in-out infinite;
}

@keyframes goldGlow {
  0%, 100% {
    box-shadow: 0 2px 12px var(--premium-gold-shadow), 0 0 20px rgba(251, 191, 36, 0.2);
  }
  50% {
    box-shadow: 0 4px 16px var(--premium-gold-shadow), 0 0 30px rgba(251, 191, 36, 0.3);
  }
}

.mode-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.mode-toggle-btn:active {
  transform: translateY(0);
}

.nav-action-btn {
  width: clamp(36px, 6vh, 40px);
  height: clamp(36px, 6vh, 40px);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 2px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  overflow: hidden;
}

.nav-action-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.nav-action-btn:hover .nav-icon {
  color: white;
}

.nav-action-btn .nav-icon {
  width: clamp(18px, 3vh, 20px);
  height: clamp(18px, 3vh, 20px);
  stroke-width: 2;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.app-container {
  position: fixed;
  top: calc(60px + var(--safe-top));
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-height);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  width: 100%;
  isolation: isolate; /* Create stacking context for pages */
}

@media (min-width: 768px) {
  .app-container {
    max-width: var(--max-width);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* Fullpage Modal Styles */
body:has(.fullpage-modal.active) .top-nav,
body:has(.fullpage-modal.active) .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: all 0.3s ease;
}

body:has(.fullpage-modal.active) .bottom-nav {
  transform: translateY(100%);
}

body:has(.fullpage-modal.active) .app-container {
  top: 0;
  bottom: 0;
}

.fullpage-modal {
  background: var(--bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.fullpage-modal .known-levels,
.fullpage-modal .account-container {
  background: var(--bg-primary);
}

.fullpage-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--safe-top));
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) var(--page-padding) 0 var(--page-padding);
  z-index: 100;
  flex-shrink: 0;
}

[data-theme="dark"] .fullpage-navbar {
  background: rgba(17, 24, 39, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.fullpage-title {
  font-size: clamp(1.125rem, 3vh, 1.5rem);
  font-weight: 800;
  color: #6366f1;
  text-align: center;
  flex: 1;
}

.navbar-spacer {
  width: 44px;
  flex-shrink: 0;
}

.fullpage-navbar .btn-back {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fullpage-navbar .btn-back:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .fullpage-navbar .btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-back-red {
  background: linear-gradient(135deg, #f87171, #ef4444) !important;
  color: white !important;
}

.btn-back-red:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.btn-back-red i {
  color: white;
}

/* ============================================
   PAGES
   ============================================ */
.page {
  display: none;
  flex-direction: column;
  gap: clamp(0.25rem, 1vh, 0.75rem);
  padding: clamp(0.25rem, 1vw, 0.5rem);
  padding-top: clamp(0.5rem, 1.5vh, 0.75rem);
  padding-bottom: clamp(0.75rem, 2vh, 1.25rem);
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s 0.2s;
}

.page.active {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0s 0s;
  z-index: 1;
}

#levelSelectPage {
  padding-top: clamp(0.75rem, 2vh, 1.5rem);
  padding-bottom: clamp(1rem, 2.5vh, 1.75rem);
  justify-content: center;
}

#levelSelectPage .level-grid {
  height: 100%;
  min-height: 0;
  gap: clamp(0.75rem, 2vh, 1.25rem);
}

/* PWA specific fixes - minimal approach */
@media (display-mode: standalone) {
  html, body {
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    height: 100vh !important;
    height: 100svh !important; /* Small viewport height for PWA */
    position: fixed;
    overflow: hidden;
    width: 100%;
  }
  
  .bottom-nav {
    bottom: 0 !important;
    position: fixed !important;
  }
  
  .app-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .page {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* iOS PWA - Prevent page stacking */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .page {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      transform: none !important;
    }
    
    .page:not(.active) {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    
    .page.active {
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      pointer-events: auto !important;
    }
  }
}

/* Android Mobile PWA - Very Light Fixes */
@media (display-mode: standalone) and (max-width: 767px) and (-webkit-min-device-pixel-ratio: 1) {
  /* Only apply to Android devices */
  .level-grid {
    min-height: 50vh;
    display: grid !important;
    grid-template-columns: 1fr !important;
    position: relative;
    z-index: 1;
  }
  
  .level-card {
    min-height: clamp(70px, 10vh, 100px);
    position: relative;
    z-index: 2;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  #levelSelectPage {
    display: flex !important;
  }
  
  #levelSelectPage.active {
    display: flex !important;
  }
}

/* Android Tablet Fixes */
@media (min-width: 768px) and (max-width: 1023px) {
  .level-grid {
    overflow: visible !important;
    min-height: auto !important;
    max-height: none !important;
  }
  
  .level-card {
    min-height: clamp(100px, 15vh, 140px) !important;
    max-height: none !important;
  }
  
  #levelSelectPage {
    overflow-y: auto !important;
  }
}

/* Allow scrolling only on pages that need it */
#knownPage,
#accountPage,
#levelDetailPage {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-header {
  text-align: center;
  padding: clamp(0.5rem, 1.5vh, 1rem) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.5rem, 1.5vh, 1rem);
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.page-header:has(.page-title) {
  align-items: center;
}

.page-header:has(.btn-back) {
  align-items: flex-start;
}

.page-header:has(.btn-back) .page-title {
  align-self: center;
}

.page-title {
  font-size: clamp(1.5rem, 4vh, 2.25rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: clamp(0.25rem, 1vh, 0.5rem);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-back {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--error);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
  /* Minimum touch target */
  min-height: 44px;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn-back:active {
  transform: scale(0.95);
}

/* ============================================
   LEVEL SELECT
   ============================================ */
.level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.25rem, 0.75vh, 0.5rem);
  padding: 0;
  margin: 0;
  flex: 1;
  overflow: visible;
}

.level-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(0.625rem, 1.75vh, 1.375rem);
  color: white;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--transition-base);
  /* Minimum touch target */
  min-height: clamp(80px, 12vh, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.125rem, 0.5vh, 0.25rem);
  overflow: hidden;
  
  /* Modern gradient with mesh effect */
  background: 
    linear-gradient(135deg, var(--level-color-start) 0%, var(--level-color-mid) 50%, var(--level-color-end) 100%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  background-blend-mode: normal, overlay, overlay;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Level progress badge (top-right) */
.level-progress-ring {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: conic-gradient(
    var(--progress-color, var(--accent-primary)) calc(var(--progress, 0) * 1%),
    rgba(255, 255, 255, 0.35) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.level-progress-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-full);
}

.level-progress-ring span {
  position: relative;
  z-index: 1;
}

/* Dynamic colors for ring (no animations for performance) */
.level-progress-ring.progress-low { /* 0-29% */
  --progress-color: #ef4444; /* red-500 */
}

.level-progress-ring.progress-mid { /* 30-69% */
  --progress-color: #f59e0b; /* amber-500 */
}

.level-progress-ring.progress-high { /* 70-100% */
  --progress-color: #22c55e; /* green-500 */
}

.level-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 15px 50px rgba(0, 0, 0, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.level-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.level-card:hover::before {
  opacity: 1;
}

.level-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 6s infinite;
  z-index: 1;
  pointer-events: none;
}

/* Disable shimmer on Android mobile for better performance */
@media (max-width: 767px) {
  .level-card::after {
    display: none;
  }
}

.level-card[data-anim="enter"]:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px) scale(0.95);
  transition-delay: 0ms;
}

/* Force visibility on Android mobile */
@media (max-width: 767px) {
  .level-card {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
  
  .level-card[data-anim="enter"] {
    opacity: 1 !important;
    transform: none !important;
  }
}

.level-card .level-count {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(4px);
}

.level-card .level-count.revealed {
  opacity: 1;
  transform: translateY(0);
}

.level-card[data-loading="true"] .level-count {
  position: relative;
  opacity: 0.65;
  letter-spacing: 0.05em;
}

.level-card[data-loading="true"] .level-count::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 1.4s linear infinite;
}

.level-card.is-busy {
  pointer-events: none;
  filter: brightness(0.94) saturate(0.95);
}

.level-card.is-busy .level-count::after {
  animation-duration: 0.9s;
}

.level-card:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.5);
}

.level-card.is-pressed {
  transform: translateY(2px) scale(0.985);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.25),
    0 6px 18px rgba(0, 0, 0, 0.18);
}

.level-transition-overlay {
  --level-overlay-start: #6366f1;
  --level-overlay-end: #4338ca;
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(135deg, var(--level-overlay-start), var(--level-overlay-end));
  animation: levelTransitionSweep 820ms cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.level-transition-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25), transparent 65%);
  opacity: 0;
  animation: levelTransitionPulse 820ms 80ms ease forwards;
}

.level-transition-content {
  text-align: center;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateY(10px);
  opacity: 0;
  animation: levelTransitionContent 640ms 120ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.level-transition-label {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 900;
  text-shadow:
    0 6px 24px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.25);
}

.level-transition-subtitle {
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.3em;
}

@keyframes levelTransitionSweep {
  0% {
    opacity: 0;
    transform: scale(0.96);
    clip-path: circle(12% at center);
    filter: blur(10px);
  }
  42% {
    opacity: 1;
    clip-path: circle(75% at center);
    filter: blur(2px);
    transform: scale(1);
  }
  78% {
    opacity: 1;
    clip-path: circle(120% at center);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
    clip-path: circle(145% at center);
    filter: blur(12px);
  }
}

@keyframes levelTransitionPulse {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  45% {
    opacity: 0.55;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes levelTransitionContent {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-transition-overlay {
    animation-duration: 360ms;
    clip-path: none !important;
    filter: none !important;
  }

  .level-transition-overlay::after {
    animation: none;
    opacity: 0.35;
  }

  .level-transition-content {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.level-card.A1 { 
  --level-color-start: #3b82f6; 
  --level-color-mid: #60a5fa;
  --level-color-end: #93c5fd;
}
.level-card.A2 { 
  --level-color-start: #22c55e; 
  --level-color-mid: #4ade80;
  --level-color-end: #86efac;
}
.level-card.B1 { 
  --level-color-start: #f59e0b; 
  --level-color-mid: #fbbf24;
  --level-color-end: #fcd34d;
}
.level-card.B2 { 
  --level-color-start: #8b5cf6; 
  --level-color-mid: #a78bfa;
  --level-color-end: #c4b5fd;
}
.level-card.C1 { 
  --level-color-start: #ef4444; 
  --level-color-mid: #f87171;
  --level-color-end: #fca5a5;
}

.level-name {
  font-size: clamp(1.125rem, 2.75vh, 1.625rem);
  font-weight: 900;
  letter-spacing: 0.05em;
}

.level-count {
  font-size: clamp(0.5625rem, 1.125vh, 0.6875rem);
  font-weight: 600;
  opacity: 0.9;
}

/* ============================================
   FLASHCARD (Serbest Gezinim)
   ============================================ */
.flashcard-container {
  perspective: 1000px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: clamp(0.25rem, 1vh, 0.5rem);
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  padding-top: clamp(0.5rem, 3vh, 1.5rem);
}

.flashcard {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 45vh;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.flashcard.passing {
  animation: cardSlideOut 0.4s ease-in-out forwards;
}

@keyframes cardSlideOut {
  0% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-120%) rotate(-15deg);
    opacity: 0;
  }
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
  overflow: hidden;
  
  /* Modern gradient card */
  background: 
    linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%),
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
  background-blend-mode: normal, overlay, overlay;
  
  color: white;
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-face::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: shimmer 7s infinite;
  pointer-events: none;
}

.card-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.25), transparent 60%),
    rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .card-badge {
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 60%),
    rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

.card-snake-icon {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: clamp(30px, 5.5vh, 38px);
  height: clamp(30px, 5.5vh, 38px);
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.25), transparent 60%),
    rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: 50%;
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(12px, 2vh, 16px);
  line-height: 1;
}

[data-theme="dark"] .card-snake-icon {
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 60%),
    rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

.card-word {
  font-size: clamp(0.9375rem, 2.75vh, 1.875rem);
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

/* ============================================
   QUIZ (Kelime Öğrenimi)
   ============================================ */
.quiz-container {
  position: relative;
  background: 
    linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.12) 50%, rgba(168, 85, 247, 0.08) 100%),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: clamp(0.4375rem, 1.25vh, 0.875rem);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: clamp(0.4375rem, 1.25vh, 0.875rem);
  overflow: hidden;
  flex: 1;
  transition: all 0.3s ease;
}

[data-theme="dark"] .quiz-container {
  background: 
    linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.2) 50%, rgba(168, 85, 247, 0.15) 100%),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
}


.quiz-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 10s infinite;
  pointer-events: none;
  z-index: 0;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--surface-border);
}

.quiz-badge {
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.quiz-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.quiz-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.stat-item {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.15);
  overflow: hidden;
}

[data-theme="dark"] .stat-item {
  background: rgba(30, 41, 59, 0.5);
}

.stat-item.stat-highlight {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  border: 2px solid rgba(255, 215, 0, 0.5);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
}

.quiz-question {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(3.25rem, 6vh, 4.25rem);
  font-size: clamp(1.125rem, 2.8vh, 1.5rem);
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  padding: clamp(0.875rem, 2.25vh, 1.25rem) clamp(1.25rem, 3vw, 1.75rem);
  background: 
    linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.12)),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 60%);
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .quiz-question {
  background: 
    linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.2)),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08), transparent 60%);
  border-color: rgba(99, 102, 241, 0.3);
}

.quiz-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.choice-btn {
  position: relative;
  overflow: hidden;
  padding: clamp(0.6875rem, 1.375vh, 1.125rem);
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.9) 100%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-lg);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  /* Minimum touch target */
  min-height: clamp(44px, 7vh, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

.choice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-color: rgba(139, 92, 246, 0.25);
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(249, 250, 251, 0.95) 100%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
}

[data-theme="dark"] .choice-btn {
  background: 
    linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(17, 24, 39, 0.9) 100%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.choice-btn.correct {
  border: 3px solid #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  background: rgba(255, 255, 255, 0.8) !important;
}

.choice-btn.correct:hover {
  border: 3px solid #22c55e !important;
  background: rgba(255, 255, 255, 0.8) !important;
}

.choice-btn.incorrect {
  border: 3px solid #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
  background: rgba(255, 255, 255, 0.8) !important;
}

.choice-btn.incorrect:hover {
  border: 3px solid #ef4444 !important;
  background: rgba(255, 255, 255, 0.8) !important;
}

.choice-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: shimmer 5s infinite;
  pointer-events: none;
}

.choice-btn.is-pressed {
  transform: scale(0.97);
  box-shadow: 
    0 8px 24px rgba(79, 70, 229, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.choice-btn.correct {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.choice-btn.wrong {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.quiz-typing {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quiz-input {
  padding: var(--space-lg);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: white;
  outline: none;
  transition: border-color var(--transition-fast);
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .quiz-input {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

.quiz-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Keep quiz input normal color during series mode */
body.series-active .quiz-input {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

body[data-theme="dark"].series-active .quiz-input {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #f8fafc !important;
}

body.series-active .quiz-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Series Timer Badge - Same size as hint button */
.series-timer-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.625rem, 1.25vh, 0.875rem) clamp(0.875rem, 1.75vh, 1.125rem);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: none;
  border-radius: var(--radius-lg);
  color: #7c2d12;
  font-weight: 700;
  font-size: clamp(0.75rem, 1.5vh, 0.875rem);
  box-shadow: 
    0 2px 8px rgba(251, 191, 36, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: timerPulse 1s ease-in-out infinite;
  min-height: clamp(40px, 7vh, 48px);
  flex: 1;
  justify-content: center;
}

.series-timer-badge.urgent {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(239, 68, 68, 0.6);
  color: white;
  animation: timerPulseUrgent 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(251, 191, 36, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 
      0 6px 16px rgba(251, 191, 36, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

@keyframes timerPulseUrgent {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(239, 68, 68, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 
      0 8px 20px rgba(239, 68, 68, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

.quiz-hints {
  display: flex;
  gap: clamp(0.25rem, 1vh, 0.5rem);
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  /* Minimum touch target */
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: 
    linear-gradient(135deg, #a5b4fc, #8b5cf6),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  color: white;
  box-shadow: 
    0 4px 12px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: 
    linear-gradient(135deg, #8b5cf6, #7c3aed),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 
    0 2px 6px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
  color: white;
}

.btn-danger {
  background: 
    linear-gradient(135deg, #ff6b6b, #ee5a52),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  color: white;
  border: 2px solid rgba(238, 90, 82, 0.3);
  box-shadow: 
    0 4px 12px rgba(238, 90, 82, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-danger:hover {
  background: 
    linear-gradient(135deg, #ff5252, #e63946),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.25), transparent 50%);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(238, 90, 82, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(238, 90, 82, 0.5);
}

.btn-danger:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 
    0 2px 6px rgba(238, 90, 82, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #15803d 0%, #165e3c 45%, #062e1a 100%);
  color: #f8fafc;
  box-shadow:
    0 8px 20px rgba(21, 128, 61, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-success:hover {
  background: linear-gradient(135deg, #1f9a4f 0%, #13703c 45%, #16834c 100%);
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(15, 81, 50, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(6, 46, 26, 0.65);
}

.btn-success:active {
  background: linear-gradient(135deg, #147c3a 0%, #0c4c2c 60%, #06281a 100%);
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 4px 10px rgba(6, 46, 26, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-pass {
  background: 
    linear-gradient(135deg, #f87171, #ef4444),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  color: white;
  box-shadow: 
    0 4px 12px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

.btn-pass:hover {
  background: 
    linear-gradient(135deg, #ef4444, #dc2626),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(239, 68, 68, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-pass:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 
    0 2px 6px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-hint {
  padding: clamp(0.625rem, 1.25vh, 0.875rem) clamp(0.875rem, 1.75vh, 1.125rem);
  background: 
    linear-gradient(135deg, #fcd34d, #f59e0b),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  color: #7c2d12;
  font-size: clamp(0.75rem, 1.5vh, 0.875rem);
  min-height: clamp(40px, 7vh, 48px);
  flex: 1;
  box-shadow: 
    0 4px 12px rgba(245, 158, 11, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 700;
  transition: all 0.2s;
}

.btn-hint:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-hint:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 
    0 2px 6px rgba(245, 158, 11, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-hint:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hint button when showing clue text */
.btn-hint.showing-clue {
  font-size: clamp(0.80rem, 1.75vh, 0.90rem);
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
  word-spacing: 0.25rem;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.375rem, 1.5vh, 0.75rem);
  max-width: 320px;
  margin: 0 auto;
  width: 80%;
  padding: clamp(0.375rem, 1.5vh, 0.75rem);
  padding-top: clamp(0.25rem, 1vh, 0.5rem);
  flex-shrink: 0;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: clamp(0.25rem, 1vw, 0.4rem) clamp(0.65rem, 2.5vw, 1.2rem);
  padding-bottom: clamp(1.1rem, 2.7vw, 1.70rem);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: var(--nav-level-size) minmax(0, 0.9fr) repeat(3, auto);
  align-items: center;
  gap: clamp(0.3rem, 1.2vw, 0.6rem);
  background: var(--bottom-nav-bg);
  border-top: 1px solid var(--surface-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.1);
  z-index: 1000;
  overflow: visible;
}

.bottom-nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--safe-bottom));
  height: var(--safe-bottom);
  background: var(--bottom-nav-bg);
  pointer-events: none;
  z-index: -1;
}

@media (min-width: 768px) {
  .bottom-nav {
    right: auto !important;
    max-width: var(--max-width) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    width: var(--max-width) !important;
  }
}

.nav-btn {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.2rem, 0.8vw, 0.45rem);
  padding: clamp(0.28rem, 0.85vw, 0.45rem) clamp(0.45rem, 1.2vw, 0.65rem);
  min-height: var(--bottom-nav-item-height);
  color: var(--text-secondary);
  border-radius: clamp(12px, 4vw, 16px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 16px -12px rgba(15, 23, 42, 0.22);
  transition: transform var(--transition-fast), color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-btn:hover,
.nav-btn:focus-visible {
  transform: translateY(-1px);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.32);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 10px 20px -12px rgba(99, 102, 241, 0.24);
}

.nav-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 5px 14px -12px rgba(15, 23, 42, 0.2);
}

.nav-btn.active {
  color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.16));
  border-color: rgba(99, 102, 241, 0.42);
  box-shadow: 0 14px 24px -12px rgba(99, 102, 241, 0.26);
}

/* Premium/Admin account button */
.nav-btn.premium-style {
  color: var(--premium-gold-start);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(217, 119, 6, 0.25));
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 14px 24px -12px var(--premium-gold-shadow), 0 0 15px rgba(251, 191, 36, 0.2);
  animation: goldGlow 2s ease-in-out infinite;
}

.nav-btn.premium-style:hover,
.nav-btn.premium-style:focus-visible {
  color: var(--premium-gold-start);
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(217, 119, 6, 0.3));
  box-shadow: 0 16px 28px -12px var(--premium-gold-shadow), 0 0 20px rgba(251, 191, 36, 0.25);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.nav-btn-level {
  flex: 0 0 auto;
  width: var(--nav-level-size);
  min-width: var(--nav-level-size);
  max-width: var(--nav-level-size);
  height: var(--nav-level-size);
  max-height: var(--nav-level-size);
  min-height: var(--bottom-nav-item-height);
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  background: none;
  color: #ffffff;
  box-shadow: none;
  gap: 0;
}

.nav-btn-level:hover,
.nav-btn-level:focus-visible {
  transform: translateY(-1px);
  color: #ffffff;
}

.nav-btn-level:active {
  transform: translateY(0) scale(0.98);
}

.nav-btn-level.active::after {
  display: none;
}

.nav-level-card {
  --level-start: #cbd5f5;
  --level-mid: #e2e8f0;
  --level-end: #94a3b8;
  --level-shadow: rgba(15, 23, 42, 0.2);
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: clamp(10px, 4vw, 14px);
  background: linear-gradient(135deg, var(--level-start) 0%, var(--level-mid) 45%, var(--level-end) 100%);
  box-shadow:
    0 10px 20px -10px var(--level-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 8px rgba(15, 23, 42, 0.2);
  font-weight: 900;
  font-size: clamp(0.75rem, 2.4vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  overflow: hidden;
}

.nav-level-card::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
  mix-blend-mode: screen;
  opacity: 0.65;
  pointer-events: none;
}

.nav-level-card.is-empty {
  --level-start: rgba(241, 245, 249, 0.7);
  --level-mid: rgba(248, 250, 252, 0.9);
  --level-end: rgba(226, 232, 240, 0.75);
  --level-shadow: rgba(15, 23, 42, 0.1);
  color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(15, 23, 42, 0.12);
}

.nav-level-card.is-empty::before {
  opacity: 0.18;
}

.nav-btn-level:not(.is-empty):hover {
  box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.3);
}

.nav-level-text {
  position: relative;
  z-index: 1;
}

.nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-icon-chest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  stroke-width: 0;
}

/* Lives Display */
.nav-lives {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.3rem, 0.8vw, 0.5rem);
  padding: clamp(0.25rem, 0.7vw, 0.45rem) clamp(0.55rem, 1.4vw, 0.85rem);
  color: #ef4444;
  position: relative;
  min-height: var(--bottom-nav-item-height);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
  border-radius: clamp(12px, 4vw, 16px);
  box-shadow: 0 8px 18px -14px rgba(239, 68, 68, 0.26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  max-width: 170px;
  justify-self: center;
}

/* Premium/Admin lives display */
.nav-lives.premium-style {
  color: var(--premium-gold-start);
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(217, 119, 6, 0.2));
  box-shadow: 0 8px 18px -14px var(--premium-gold-shadow), 0 0 15px rgba(251, 191, 36, 0.15);
  animation: goldGlow 2s ease-in-out infinite;
}

.nav-lives.empty {
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.3);
  background: rgba(156, 163, 175, 0.12);
  box-shadow: 0 6px 16px -14px rgba(156, 163, 175, 0.2);
}

.lives-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  fill: currentColor;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.nav-lives.empty .lives-icon {
  fill: none;
  animation: none;
}

.leaderboard-wrapper {
  padding: clamp(0.75rem, 2vw, 1.5rem);
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.leaderboard-meta {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1vw, 0.75rem);
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: clamp(0.5rem, 1.4vw, 0.8rem) clamp(0.75rem, 2vw, 1.2rem);
  border-radius: clamp(0.75rem, 2vw, 1rem);
  backdrop-filter: blur(8px);
}

.leaderboard-meta-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.5rem, 1.6vw, 0.9rem);
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.5rem, 1.4vw, 0.8rem);
  padding: clamp(0.65rem, 1.8vw, 1rem) clamp(0.85rem, 2.2vw, 1.2rem);
  border-radius: clamp(0.75rem, 2vw, 1rem);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.22);
  position: relative;
  overflow: hidden;
}

.leaderboard-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 0;
}

.leaderboard-entry:hover::before {
  opacity: 1;
}

.leaderboard-entry-content {
  position: relative;
  display: grid;
  gap: clamp(0.15rem, 0.6vw, 0.25rem);
  z-index: 1;
}

.leaderboard-rank {
  width: clamp(2rem, 4vw, 2.4rem);
  height: clamp(2rem, 4vw, 2.4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.2rem);
  background: rgba(99, 102, 241, 0.16);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.22);
  position: relative;
  z-index: 1;
}

.leaderboard-rank--top1 {
  width: clamp(2.5rem, 5vw, 3rem);
  height: clamp(2.5rem, 5vw, 3rem);
  font-size: clamp(1.2rem, 3.5vw, 1.4rem);
  background: linear-gradient(135deg, #fbbf24 0%, #facc15 100%);
  color: #1e293b;
  border: 3px solid #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.3), 0 4px 8px rgba(250, 204, 21, 0.4);
  font-weight: 800;
}

.leaderboard-rank--top2 {
  width: clamp(2.3rem, 4.5vw, 2.8rem);
  height: clamp(2.3rem, 4.5vw, 2.8rem);
  font-size: clamp(1.1rem, 3.2vw, 1.3rem);
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  color: #1e293b;
  border: 2.5px solid #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3), 0 3px 6px rgba(148, 163, 184, 0.3);
  font-weight: 800;
}

.leaderboard-rank--top3 {
  width: clamp(2.3rem, 4.5vw, 2.8rem);
  height: clamp(2.3rem, 4.5vw, 2.8rem);
  font-size: clamp(1.1rem, 3.2vw, 1.3rem);
  background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
  color: #1e293b;
  border: 2.5px solid #fb923c;
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.3), 0 3px 6px rgba(251, 146, 60, 0.3);
  font-weight: 800;
}

.leaderboard-name {
  font-weight: 600;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-primary);
  word-break: break-word;
}

.leaderboard-score {
  font-weight: 600;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--accent-primary);
  position: relative;
  z-index: 1;
}

.leaderboard-score--top1 {
  font-weight: 800;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  color: #facc15;
  text-shadow: 
    0 0 8px rgba(250, 204, 21, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.leaderboard-score--top2 {
  font-weight: 800;
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
  color: #94a3b8;
  text-shadow: 
    0 0 6px rgba(148, 163, 184, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.15);
}

.leaderboard-score--top3 {
  font-weight: 800;
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
  color: #fb923c;
  text-shadow: 
    0 0 6px rgba(251, 146, 60, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.15);
}

.leaderboard-subtitle {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--text-muted);
}

.leaderboard-entry--top1 {
  border: 4px solid #facc15;
  box-shadow: 
    0 0 0 2px rgba(250, 204, 21, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(250, 204, 21, 0.05) 100%);
}

.leaderboard-entry--top1::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(217, 119, 6, 0.18));
  pointer-events: none;
  z-index: 0;
}

.leaderboard-entry--top2 {
  border: 3px solid #94a3b8;
  box-shadow: 
    0 0 0 2px rgba(148, 163, 184, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(148, 163, 184, 0.05) 100%);
}

.leaderboard-entry--top2::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.14), rgba(99, 102, 241, 0.1));
  pointer-events: none;
  z-index: 0;
}

.leaderboard-entry--top3 {
  border: 3px solid #fb923c;
  box-shadow: 
    0 0 0 2px rgba(251, 146, 60, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(251, 146, 60, 0.05) 100%);
}

.leaderboard-entry--top3::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.14), rgba(251, 191, 36, 0.14));
  pointer-events: none;
  z-index: 0;
}

.leaderboard-empty {
  text-align: center;
  padding: clamp(1.5rem, 5vw, 2.2rem);
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: clamp(0.75rem, 2vw, 1rem);
  display: grid;
  justify-items: center;
  gap: clamp(0.75rem, 2.4vw, 1.2rem);
  color: var(--text-muted);
}

.leaderboard-empty-icon {
  width: 42px;
  height: 42px;
  stroke-width: 1.6;
}

.leaderboard-empty[hidden] {
  display: none;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(1.1);
  }
  20%, 40% {
    transform: scale(1);
  }
}

.lives-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.lives-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: currentColor;
}

.lives-timer {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 1rem);
  left: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: white;
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--accent-primary);
  animation: toastSlideIn 0.3s ease;
  pointer-events: auto;
  font-weight: 600;
  overflow: hidden;
}

[data-theme="dark"] .toast {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--error); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================
   SERIES MODAL
   ============================================ */
.series-modal {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(252, 165, 165, 0.95), rgba(248, 113, 113, 0.95), rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.series-modal.active {
  display: flex;
}

.series-modal-content {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 400px;
}

.series-icon-wrapper {
  margin-bottom: 1.5rem;
  animation: pulse 1s ease-in-out infinite;
}

.series-icon {
  width: 80px;
  height: 80px;
  color: #fbbf24;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
}

.series-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 900;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.05em;
}

.series-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  font-weight: 500;
}

.series-countdown {
  font-size: 4rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 4px 20px rgba(251, 191, 36, 0.8);
  animation: scaleIn 0.3s ease-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes scaleIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Series Mode - Active State */
body.series-active,
body.series-active * {
  --bg-primary: #dc2626;
  --bg-secondary: #b91c1c;
  --bg-gradient-start: #fca5a5;
  --bg-gradient-end: #dc2626;
}

body.series-active {
  background: linear-gradient(135deg, #fca5a5 0%, #f87171 25%, #ef4444 50%, #dc2626 75%, #b91c1c 100%) !important;
}

body.series-active .app-container,
body.series-active .page,
body.series-active #testPage {
  background: transparent !important;
}

body.series-active .top-nav,
body.series-active .bottom-nav {
  opacity: 0;
  pointer-events: none;
}

body.series-active .quiz-hints .btn-hint {
  display: none !important;
}

body.series-active .series-timer-badge {
  display: flex !important;
}

/* Series Timer - Red glow on container */
.quiz-container.series-timer {
  border: 3px solid #dc2626;
  box-shadow: 
    0 0 40px rgba(220, 38, 38, 0.8),
    0 0 80px rgba(220, 38, 38, 0.6),
    inset 0 2px 8px rgba(220, 38, 38, 0.3);
  animation: pulseRedGlow 1s ease-in-out infinite;
}

@keyframes pulseRedGlow {
  0%, 100% {
    box-shadow: 
      0 0 40px rgba(220, 38, 38, 0.8),
      0 0 80px rgba(220, 38, 38, 0.6),
      inset 0 2px 8px rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 
      0 0 60px rgba(220, 38, 38, 1),
      0 0 120px rgba(220, 38, 38, 0.8),
      inset 0 2px 8px rgba(220, 38, 38, 0.5);
  }
}

/* Series End Modal */
.series-end-modal {
  text-align: center;
  max-width: 400px;
}

.series-end-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.series-end-icon {
  width: 64px;
  height: 64px;
  color: #f59e0b;
}

.series-end-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.series-end-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.btn.is-pressed {
  transform: translateY(1px) scale(0.97);
  box-shadow: var(--shadow-sm);
}

.series-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.08));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.series-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.series-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
}


/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-padding);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  animation: modalSlideUp 0.3s ease;
  overflow: hidden;
}

[data-theme="dark"] .modal-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.feedback-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.feedback-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.feedback-icon {
  width: 64px;
  height: 64px;
  stroke-width: 2;
}

.feedback-icon[data-lucide="check-circle"] {
  color: var(--success);
}

.feedback-icon[data-lucide="x-circle"] {
  color: var(--error);
}

.feedback-icon[data-lucide="alert-circle"] {
  color: var(--warning);
}

.feedback-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
}

.feedback-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feedback-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: left;
}

.feedback-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.feedback-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   KNOWN WORDS (Sandık)
   ============================================ */
.known-levels {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 2vh, 1rem);
  flex: 1;
  overflow-y: auto;
}

.known-level-item {
  position: relative;
  overflow: hidden;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.98) 100%),
    radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  /* Minimum touch target */
  min-height: 80px;
}

.known-level-item:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(99, 102, 241, 0.2);
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 1) 100%),
    radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 50%);
}

[data-theme="dark"] .known-level-item {
  background: 
    linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(17, 24, 39, 0.98) 100%),
    radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
  border-color: rgba(255, 255, 255, 0.1);
}

.known-level-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 8s infinite;
  pointer-events: none;
}

.known-level-item:active {
  transform: scale(0.98);
}

.known-level-ring {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: conic-gradient(
    var(--accent-primary) calc(var(--progress, 0) * 1%),
    rgba(0, 0, 0, 0.15) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.125rem;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.known-level-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: white;
  border-radius: var(--radius-full);
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .known-level-ring::before {
  background: #1e293b;
}

.known-level-ring span {
  position: relative;
  z-index: 2;
}

.known-level-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.known-level-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: #1f2937;
}

[data-theme="dark"] .known-level-name {
  color: #f3f4f6;
}

.known-level-stats {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

[data-theme="dark"] .known-level-stats {
  color: #9ca3af;
}

/* ============================================
   LEVEL DETAIL PAGE
   ============================================ */
.level-detail-container {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vh, 1rem);
  flex: 1;
  overflow-y: auto;
  padding: var(--page-padding);
}

/* Search and Filter Controls */
.level-detail-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg) var(--space-md) 2.75rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.filter-container {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-btn {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.level-detail-words {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Dark theme adjustments */
[data-theme="dark"] .search-input {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .search-input:focus {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--primary-color);
}

[data-theme="dark"] .filter-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .filter-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(139, 92, 246, 0.3);
}

.level-detail-word {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.98) 100%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  transition: all 0.2s;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.level-detail-word:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .level-detail-word {
  background: 
    linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(17, 24, 39, 0.95) 100%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 50%);
  border-color: rgba(255, 255, 255, 0.08);
}

.word-english {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .word-english {
  color: #f3f4f6;
}

.word-turkish {
  font-size: 0.9375rem;
  color: #6b7280;
  font-weight: 500;
}

[data-theme="dark"] .word-turkish {
  color: #9ca3af;
}

.word-stats {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-top: 0.375rem;
  font-weight: 500;
}

[data-theme="dark"] .word-stats {
  color: #6b7280;
}

/* ============================================
   ACCOUNT PAGE
   ============================================ */
.account-container {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vh, 1.5rem);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xs);
  max-height: 100vh; /* Fullpage modal için tam ekran */
  max-height: 100dvh;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100%;
  padding: var(--space-lg) 0;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: 
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%),
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.05), transparent 50%);
  border: 2px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .auth-card {
  background: 
    linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%),
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1), transparent 50%);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-header {
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .auth-header {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.auth-mascot {
  width: 48px;
  height: 48px;
  background: 
    linear-gradient(135deg, #6366f1, #8b5cf6),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  margin-bottom: var(--space-sm);
}

.auth-mascot img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
}

.auth-title {
  margin: 0;
  font-size: clamp(1.125rem, 3vh, 1.5rem);
  font-weight: 800;
  color: #6366f1;
  text-align: center;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 var(--space-lg);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  gap: var(--space-xs);
}

[data-theme="dark"] .auth-tabs {
  background: rgba(255, 255, 255, 0.03);
}

.auth-tab {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: clamp(0.875rem, 2vh, 1rem);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
  color: var(--text-secondary);
  background: transparent;
}

.auth-tab:hover {
  color: var(--accent-primary);
}

.auth-tab.active {
  color: white;
}

/* Sliding background for active tab */
.auth-tabs::before {
  content: '';
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  width: calc(50% - var(--space-xs) / 2);
  height: calc(100% - var(--space-xs) * 2);
  background: 
    linear-gradient(135deg, var(--accent-primary), #7c3aed);
  border-radius: var(--radius-md);
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  z-index: 1;
}

.auth-tabs[data-active-tab="register"]::before {
  transform: translateX(100%);
}

.auth-form {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.input-group label {
  font-weight: 600;
  font-size: clamp(0.875rem, 2vh, 1rem);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.auth-input {
  padding: var(--space-lg);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: white;
  width: 100%;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .auth-input {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 4px 12px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

[data-theme="dark"] .auth-input:focus {
  box-shadow: 
    0 0 0 3px rgba(99, 102, 241, 0.2),
    0 4px 12px rgba(99, 102, 241, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .auth-input {
  padding-right: calc(var(--space-lg) + 2.5rem);
}

.password-toggle-btn {
  position: absolute;
  right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--accent-primary);
}

.password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
  border-radius: 999px;
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .password-toggle-btn {
  color: var(--text-secondary);
}

[data-theme="dark"] .password-toggle-btn:hover {
  color: var(--accent-primary);
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  margin-top: var(--space-md);
  min-height: 52px;
  background: 
    linear-gradient(135deg, var(--accent-primary), #7c3aed),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2), transparent 50%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  box-shadow: 
    0 6px 16px rgba(99, 102, 241, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all var(--transition-fast);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(99, 102, 241, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-color: rgba(99, 102, 241, 0.5);
}

.auth-submit:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-footer {
  padding: var(--space-lg);
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .auth-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.auth-footer p {
  margin: 0;
  font-size: clamp(0.75rem, 2vh, 0.875rem);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Loading animation for auth buttons */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.profile-card {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 60px - 80px - 2rem); /* viewport - navs - padding */
  max-height: calc(100dvh - 60px - 80px - 2rem);
}

/* Custom scrollbar for profile card */
.profile-card::-webkit-scrollbar {
  width: 8px;
}

.profile-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-full);
}

.profile-card::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.profile-card::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

[data-theme="dark"] .profile-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.profile-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 9s infinite;
  pointer-events: none;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--surface-border);
  flex-wrap: wrap;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  word-break: break-word;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.profile-stat {
  text-align: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
}

.profile-stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.profile-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Profile Details Section */
.profile-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

[data-theme="dark"] .profile-details {
  background: rgba(255, 255, 255, 0.02);
}

.profile-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.profile-detail-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  min-width: fit-content;
}

.profile-detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: normal;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Account details - improved layout for labels and values */
.profile-details .profile-detail-row {
  align-items: flex-start;
  gap: var(--space-sm);
}

.profile-details .profile-detail-label {
  flex: 0 0 140px; /* stable label column */
}

.profile-details .profile-detail-value {
  white-space: normal;       /* allow wrapping for full visibility */
  overflow: visible;         /* no scrollbars */
  text-align: left;          /* align left for readability */
  line-height: 1.4;
}

@media (max-width: 420px) {
  .profile-details .profile-detail-label {
    flex-basis: 120px;
  }
}

/* New stacked detail layout (icon + stacked label/value) */
.profile-details .detail-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: var(--space-sm);
}

.profile-details .detail-icon i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.profile-details .detail-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-details .detail-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-details .detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* Account Type Badge */
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.account-badge.free {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  color: white;
}

.account-badge.premium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
}

.account-badge.admin {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
}

.account-badge i {
  width: 14px;
  height: 14px;
}

/* Profile Settings Section */
.profile-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

[data-theme="dark"] .profile-settings {
  background: rgba(255, 255, 255, 0.02);
}

.profile-settings-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.profile-settings-title i {
  width: 20px;
  height: 20px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}

.setting-row:not(:last-child) {
  border-bottom: 1px solid var(--surface-border);
}

.setting-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
  min-width: fit-content;
}

.setting-label i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

[data-theme="dark"] .toggle-switch {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.05);
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: var(--accent-primary);
}

.toggle-switch.active::before {
  left: 26px;
}

/* Profile Edit Form */
.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

[data-theme="dark"] .profile-edit-form {
  background: rgba(255, 255, 255, 0.02);
}

.profile-edit-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.profile-edit-title i {
  width: 20px;
  height: 20px;
}

.profile-edit-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.profile-edit-actions .btn {
  flex: 1;
}

/* Admin Panel Styles */
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(217, 119, 6, 0.12));
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

[data-theme="dark"] .admin-panel {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(217, 119, 6, 0.2));
}

.admin-panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--premium-gold-end);
}

.admin-panel-title i {
  width: 24px;
  height: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.admin-stat-card {
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.2);
  text-align: center;
}

[data-theme="dark"] .admin-stat-card {
  background: rgba(30, 41, 59, 0.6);
}

.admin-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--premium-gold-end);
  margin-bottom: var(--space-xs);
}

.admin-stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.btn-admin {
  background: linear-gradient(135deg, var(--premium-gold-start), var(--premium-gold-end));
  color: white;
  box-shadow: 0 4px 12px var(--premium-gold-shadow);
}

.btn-admin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--premium-gold-shadow);
}

/* User Management Panel */
.user-management-panel {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 10000;
  overflow-y: auto;
  display: none;
}

.user-management-panel.active {
  display: block;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.user-item {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.user-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--surface-border);
}

.user-item-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-item-role-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-item-role-badge.free {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  color: white;
}

.user-item-role-badge.premium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
}

.user-item-role-badge.banned {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.user-item-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.user-item-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.user-item-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.user-stat-item {
  text-align: center;
  padding: var(--space-sm);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
}

[data-theme="dark"] .user-stat-item {
  background: rgba(255, 255, 255, 0.03);
}

.user-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.user-item-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.btn-user-action {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  min-height: 40px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.pressable {
  touch-action: manipulation;
}

.pressable.is-pressed {
  filter: brightness(0.97);
}

.pressable:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.4);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-auto {
  margin-top: auto;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 639px) {
  #levelSelectPage .level-grid {
    grid-auto-rows: minmax(100px, 1fr);
  }
  
  /* Android Mobile Web (non-PWA) fixes */
  .level-card {
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  
  .level-grid {
    position: relative;
    z-index: 1;
  }
}

/* ============================================
   RESPONSIVE - TABLET & DESKTOP
   ============================================ */
@media (min-width: 640px) {
  :root {
    --page-padding: 1.5rem;
  }
  
  .quiz-choices {
    grid-template-columns: 1fr 1fr;
  }
  
  .level-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  :root {
    --max-width: 700px;
  }
  
  .bottom-nav {
    max-width: var(--max-width) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    bottom: 0 !important;
    width: var(--max-width) !important;
  }
  
  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  :root {
    --max-width: 900px;
  }
  
  .level-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .bottom-nav {
    max-width: var(--max-width) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: var(--max-width) !important;
  }
}

/* ============================================
   DESKTOP NAVBAR ALIGNMENT FIX
   ============================================ */
@media (min-width: 768px) {
  /* Force navbar alignment on desktop */
  .top-nav {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: var(--max-width) !important;
    max-width: var(--max-width) !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
  }
  
  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: var(--max-width) !important;
    max-width: var(--max-width) !important;
    margin: 0 !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
  }
  
  .top-nav-content {
    margin: 0 !important;
    max-width: none !important;
    padding: 0 1.5rem !important;
    width: 100% !important;
  }
}

/* ============================================
   ANDROID PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Android Detection and Optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  /* Android Chrome için performans optimizasyonları */
  
  /* GPU Acceleration */
  .level-card,
  .flashcard,
  .choice-btn,
  .btn,
  .nav-btn,
  .quiz-container,
  .top-nav,
  .bottom-nav {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  
  /* Animasyonları azalt */
  .level-card::after,
  .flashcard-face::after,
  .choice-btn::after,
  .quiz-container::after,
  .known-level-item::after,
  .profile-card::after {
    display: none !important;
  }
  
  /* Blur efektlerini azalt/kaldır */
  .top-nav,
  .bottom-nav,
  .quiz-container,
  .stat-item,
  .choice-btn,
  .modal-card,
  .auth-card,
  .profile-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
  }
  
  [data-theme="dark"] .top-nav,
  [data-theme="dark"] .bottom-nav,
  [data-theme="dark"] .quiz-container,
  [data-theme="dark"] .stat-item,
  [data-theme="dark"] .choice-btn,
  [data-theme="dark"] .modal-card,
  [data-theme="dark"] .auth-card,
  [data-theme="dark"] .profile-card {
    background: rgba(30, 41, 59, 0.95) !important;
  }
  
  /* 3D efektleri ve ağır gölgeleri sadeleştir */
  .level-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }
  
  .level-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
  }
  
  .choice-btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  }
  
  .choice-btn:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
  }
  
  .btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  }
  
  .btn:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
  }
  
  /* Parlamaları azalt */
  .level-card::before {
    opacity: 0.3 !important;
  }
  
  .level-card:hover::before {
    opacity: 0.5 !important;
  }
  
  /* Transition sürelerini azalt */
  :root {
    --transition-fast: 100ms;
    --transition-base: 150ms;
    --transition-slow: 200ms;
  }
  
  /* Complex gradients'i sadeleştir */
  .level-card {
    background: linear-gradient(135deg, var(--level-color-start), var(--level-color-end)) !important;
  }
  
  .flashcard-face {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, #a5b4fc, #8b5cf6) !important;
  }
  
  /* Series modal optimizasyonu */
  .series-modal {
    background: linear-gradient(135deg, rgba(252, 165, 165, 0.95), rgba(248, 113, 113, 0.95), rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.95)) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Modal optimizasyonu */
  .modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Auth card optimizasyonu */
  .auth-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
  }
  
  [data-theme="dark"] .auth-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary)) !important;
  }
  
  /* Profile card optimizasyonu */
  .profile-card {
    background: rgba(255, 255, 255, 0.95) !important;
  }
  
  [data-theme="dark"] .profile-card {
    background: rgba(30, 41, 59, 0.95) !important;
  }
  
  /* Known level item optimizasyonu */
  .known-level-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.98)) !important;
  }
  
  [data-theme="dark"] .known-level-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(17, 24, 39, 0.98)) !important;
  }
  
  /* Level detail word optimizasyonu */
  .level-detail-word {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.98)) !important;
  }
  
  [data-theme="dark"] .level-detail-word {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(17, 24, 39, 0.95)) !important;
  }
  
  /* Search input optimizasyonu */
  .search-input {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  [data-theme="dark"] .search-input {
    background: rgba(30, 41, 59, 0.9) !important;
  }
  
  /* Filter button optimizasyonu */
  .filter-btn {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  [data-theme="dark"] .filter-btn {
    background: rgba(30, 41, 59, 0.8) !important;
  }
  
  /* Auth input optimizasyonu */
  .auth-input {
    background: white !important;
  }
  
  [data-theme="dark"] .auth-input {
    background: var(--bg-primary) !important;
  }
  
  /* Quiz input optimizasyonu - seri modunda normal renk */
  body.series-active .quiz-input {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
  }
  
body[data-theme="dark"].series-active .quiz-input {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #f8fafc !important;
  }
  
  /* Toggle switch optimizasyonu */
  .toggle-switch {
    background: rgba(0, 0, 0, 0.1) !important;
  }
  
  [data-theme="dark"] .toggle-switch {
    background: rgba(255, 255, 255, 0.1) !important;
  }
  
  /* Profile settings optimizasyonu */
  .profile-settings,
  .profile-details,
  .profile-edit-form {
    background: rgba(0, 0, 0, 0.02) !important;
  }
  
  [data-theme="dark"] .profile-settings,
  [data-theme="dark"] .profile-details,
  [data-theme="dark"] .profile-edit-form {
    background: rgba(255, 255, 255, 0.02) !important;
  }
  
  /* Admin panel optimizasyonu */
  .admin-panel {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(217, 119, 6, 0.12)) !important;
  }
  
  [data-theme="dark"] .admin-panel {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(217, 119, 6, 0.2)) !important;
  }
  
  /* Admin stat card optimizasyonu */
  .admin-stat-card {
    background: rgba(255, 255, 255, 0.9) !important;
  }
  
  [data-theme="dark"] .admin-stat-card {
    background: rgba(30, 41, 59, 0.6) !important;
  }
  
  /* User item optimizasyonu */
  .user-item {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  [data-theme="dark"] .user-item {
    background: rgba(30, 41, 59, 0.95) !important;
  }
  
  /* User stat item optimizasyonu */
  .user-stat-item {
    background: rgba(0, 0, 0, 0.03) !important;
  }
  
  [data-theme="dark"] .user-stat-item {
    background: rgba(255, 255, 255, 0.03) !important;
  }
  
  /* Auth tabs optimizasyonu */
  .auth-tabs {
    background: rgba(0, 0, 0, 0.03) !important;
  }
  
  [data-theme="dark"] .auth-tabs {
    background: rgba(255, 255, 255, 0.03) !important;
  }
  
  /* Auth footer optimizasyonu */
  .auth-footer {
    background: rgba(0, 0, 0, 0.02) !important;
  }
  
  [data-theme="dark"] .auth-footer {
    background: rgba(255, 255, 255, 0.02) !important;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes shimmer {
  0% {
    left: -100%;
  }
  20% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ============================================
   REINFORCEMENT SYSTEM STYLES
   ============================================ */

/* Word status in level detail */
.word-status {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  margin-top: 0.5rem;
  display: inline-block;
}

.word-status.learned {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.word-status.reinforcing {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  animation: pulse 2s infinite;
}

.word-status.known {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Navigation badge for known words count */
.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 0.75rem;
  min-width: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 2px solid var(--bg-primary);
}

/* Reinforcement progress indicator */
.reinforcement-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.reinforcement-progress-bar {
  flex: 1;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  overflow: hidden;
}

.reinforcement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 0.25rem;
  transition: width 0.3s ease;
}

/* Known words count in stats */
.known-words-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 0.25rem;
}

.language-option {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.language-option:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.language-option.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .language-option.active {
  background: var(--accent-primary);
  color: white;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .word-status.reinforcing {
    animation: none;
  }
}

