/* ===================================
   LERN³ - Master Stylesheet v2.0
   ALL CORRECTIONS APPLIED
   =================================== */

:root {
  --primary-cyan: #2DD4BF;
  --primary-dark: #1a1d3d;
  --primary-darker: #0f1127;
  --accent-blue: #0EA5E9;
  
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --bg-card: #252850;
  --bg-input: #1e2139;
  --border-color: #2d3254;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.3);
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--primary-darker);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* =========================
   Screen Management
   ========================= */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--primary-darker);
  display: none;
  opacity: 0;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 0;
}

.screen.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 300ms ease;
}

.screen:not(.active) {
  pointer-events: none !important;
}

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

/* =========================
   Loading Screen
   ========================= */
#loading-screen {
  z-index: 9999;
  background: var(--primary-darker);
}

.loading-content {
  text-align: center;
  padding: 24px;
  max-width: 400px;
}

.logo-container {
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.loading-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  margin: 20px auto;
  border: 4px solid rgba(45, 212, 191, 0.2);
  border-top-color: var(--primary-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 12px;
  font-weight: 500;
}

.loading-progress-container {
  width: 200px;
  height: 4px;
  background: rgba(45, 212, 191, 0.2);
  border-radius: 999px;
  margin: 20px auto 0;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-blue));
  border-radius: 999px;
  transition: width 300ms ease;
}

/* =========================
   Home Screen
   ========================= */
#home-screen {
  background: 
    radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.15), transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.15), transparent 50%),
    linear-gradient(135deg, #0c0e1a 0%, #070818 100%);
}

.home-content {
  width: min(460px, calc(100% - 40px));
  padding: 20px 0;
  max-height: 100vh;
  overflow-y: auto;
}

.hero-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-mini {
  margin: 0 auto 16px;
  animation: float 3s ease-in-out infinite;
}

.home-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
}

.home-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Stats Row */
.stats-row {
  display: flex;
  justify-content: space-around;
  gap: 24px;
  margin: 32px 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-cyan);
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* How It Works Section */
.how-it-works-section {
  margin: 32px 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(45, 212, 191, 0.4);
  transform: translateX(4px);
}

.step-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  color: var(--primary-darker);
  font-weight: 900;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Progress Card */
.progress-card {
  margin: 24px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

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

.progress-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-value {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary-cyan);
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-blue));
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Buttons */
.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  color: var(--primary-darker);
  box-shadow: var(--shadow-glow);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-cyan);
  background: rgba(45, 212, 191, 0.1);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* Built on Base Badge */
.built-on-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.base-logo {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 6px;
  color: var(--primary-cyan);
  font-weight: 700;
}

/* =========================
   Tutorial Screen
   ========================= */
.tutorial-content {
  width: min(460px, calc(100% - 40px));
  padding: 20px;
}

.tutorial-title {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.tutorial-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-lg);
}

.tutorial-number {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  color: var(--primary-darker);
  font-weight: 900;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-text h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tutorial-text p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tutorial-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tutorial-tip p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tutorial-tip strong {
  color: var(--text-primary);
}

/* =========================
   Game Screen
   ========================= */
#game-screen {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary-dark);
  border-bottom: 2px solid var(--border-color);
  z-index: 10;
  flex-shrink: 0;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-back:active {
  transform: scale(0.95);
}

.level-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.level-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.level-number {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--primary-cyan);
  line-height: 1;
}

.progress-info {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}

/* Difficulty Badge */
.difficulty {
  min-width: 80px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid;
  transition: all var(--transition-fast);
}

.difficulty.easy {
  background: rgba(148, 163, 184, 0.15);
  color: #CBD5E1;
  border-color: rgba(148, 163, 184, 0.3);
}

.difficulty.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.4);
  animation: pulse-medium 2s ease-in-out infinite;
}

.difficulty.hard {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.4);
  animation: pulse-hard 2s ease-in-out infinite;
}

@keyframes pulse-medium {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

@keyframes pulse-hard {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  flex: 1;
  align-content: center;
  opacity: 0;
  animation: fadeInGrid 400ms ease forwards;
  animation-delay: 100ms;
}

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

.image-card {
  aspect-ratio: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-color);
  position: relative;
  opacity: 0;
  animation: fadeInImage 400ms ease forwards;
}

.image-card:nth-child(1) {
  animation-delay: 150ms;
}

.image-card:nth-child(2) {
  animation-delay: 200ms;
}

.image-card:nth-child(3) {
  animation-delay: 250ms;
}

.image-card:nth-child(4) {
  animation-delay: 300ms;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.puzzle-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.image-card:hover .puzzle-image {
  transform: scale(1.05);
}

/* Answer Section */
.answer-container {
  padding: 0 16px;
  margin: 16px 0;
  flex-shrink: 0;
}

.answer-slots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.answer-slot {
  width: 48px;
  height: 60px;
  background: var(--bg-input);
  border: 3px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  color: transparent;
  transition: all var(--transition-normal);
  position: relative;
}

.answer-slot::after {
  content: '';
  position: absolute;
  bottom: 8px;
  width: 24px;
  height: 3px;
  background: var(--border-color);
  border-radius: 999px;
  transition: all var(--transition-normal);
}

.answer-slot.filled {
  background: var(--bg-card);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  transform: scale(1.05);
}

.answer-slot.filled::after {
  opacity: 0;
}

.answer-slot.correct {
  background: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
  animation: correctPulse 500ms ease;
}

@keyframes correctPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.answer-slot.wrong {
  background: var(--error);
  border-color: var(--error);
  color: #FFFFFF;
  animation: shake 500ms ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Letters Section */
.letters-container {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.letter-tiles {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 120px;
}

.letter-tile {
  width: 52px;
  height: 60px;
  background: linear-gradient(135deg, #FFFFFF, #F1F5F9);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--primary-darker);
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
  position: relative;
}

.letter-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), transparent);
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.letter-tile:hover::before {
  opacity: 1;
}

.letter-tile:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.letter-tile.used {
  opacity: 0.3;
  pointer-events: none;
  transform: scale(0.9);
}

.letter-tile.shuffle-animate {
  animation: shuffleTile 400ms ease;
}

@keyframes shuffleTile {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

/* Controls Row */
.controls-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.btn-clear,
.btn-shuffle,
.btn-hint {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex: 1;
  justify-content: center;
  max-width: 120px;
}

.btn-clear:hover,
.btn-shuffle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-clear:active,
.btn-shuffle:active {
  transform: scale(0.95);
}

.btn-hint {
  background: linear-gradient(135deg, #8B5CF6, #6366F1);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-hint:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
  border-color: transparent;
}

.btn-hint:active {
  transform: scale(0.95);
}

.btn-hint:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, #64748B, #475569);
}

/* Submit Button */
.btn-submit {
  margin: 0 16px 16px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  color: var(--primary-darker);
  font-weight: 900;
  font-size: 1.125rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.4);
}

.btn-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: linear-gradient(135deg, #94A3B8, #64748B);
}

/* =========================
   Explanation Screen
   ========================= */
.explanation-content {
  width: min(460px, calc(100% - 40px));
  text-align: center;
  padding: 20px;
}

.explanation-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  animation: scaleIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.explanation-word {
  font-size: 2.75rem;
  font-weight: 900;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 600ms ease;
  animation-delay: 200ms;
  animation-fill-mode: both;
}

.explanation-text {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  animation: fadeIn 600ms ease;
  animation-delay: 400ms;
  animation-fill-mode: both;
}

/* =========================
   Completion Screen
   ========================= */
.completion-content {
  width: min(460px, calc(100% - 40px));
  text-align: center;
  padding: 20px;
}

.completion-badge {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  animation: scaleIn 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.completion-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.completion-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Stats Card */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9375rem;
}

.stat-value {
  font-weight: 900;
  color: var(--primary-cyan);
  font-size: 1.25rem;
}

/* Concepts Section */
.concepts-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.concepts-section h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 700;
}

.concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.concept-tag {
  background: var(--bg-input);
  border: 2px solid var(--primary-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--primary-cyan);
  font-weight: 800;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.concept-tag:hover {
  background: rgba(45, 212, 191, 0.1);
  transform: translateY(-2px);
}

/* Email Section */
.email-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.email-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.email-prompt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#email-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  font-family: inherit;
}

#email-input:focus {
  outline: none;
  border-color: var(--primary-cyan);
  background: rgba(45, 212, 191, 0.05);
}

#email-input::placeholder {
  color: var(--text-muted);
}

#email-submit-btn {
  margin-top: 0;
}

/* Completion Actions */
.completion-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================
   Confetti Canvas
   ========================= */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

#confetti-canvas.hidden {
  display: none;
}

/* =========================
   Toast Notifications
   ========================= */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  padding: 16px 20px;
  background: rgba(45, 212, 191, 0.95);
  color: var(--primary-darker);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(100px);
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  max-width: 300px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.toast.info {
  background: rgba(14, 165, 233, 0.95);
  color: white;
}

/* =========================
   Responsive Design
   ========================= */
@media (max-width: 480px) {
  .home-title {
    font-size: 3rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .steps-grid {
    gap: 10px;
  }
  
  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .answer-slot {
    width: 44px;
    height: 56px;
    font-size: 1.5rem;
  }
  
  .letter-tile {
    width: 48px;
    height: 56px;
    font-size: 1.5rem;
  }
  
  .completion-title {
    font-size: 2rem;
  }

  .btn-clear,
  .btn-shuffle,
  .btn-hint {
    padding: 10px 12px;
    font-size: 0.8125rem;
    gap: 4px;
  }

  .btn-clear span,
  .btn-shuffle span,
  .btn-hint span {
    display: none;
  }

  .controls-row {
    gap: 6px;
  }
}

@media (max-height: 700px) {
  .image-grid {
    gap: 8px;
    padding: 12px;
  }
  
  .answer-container {
    margin: 12px 0;
  }
  
  .letters-container {
    padding: 0 12px 12px;
  }

  .letter-tiles {
    min-height: 100px;
  }
}

@media (max-height: 650px) {
  .letter-tiles {
    min-height: 80px;
  }

  .letter-tile {
    width: 48px;
    height: 56px;
    font-size: 1.5rem;
  }
}

/* =========================
   Accessibility
   ========================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible {
  outline: 3px solid var(--primary-cyan);
  outline-offset: 2px;
}

input:focus-visible {
  outline: 3px solid var(--primary-cyan);
  outline-offset: 2px;
}

/* Hide scrollbar but keep functionality */
.screen::-webkit-scrollbar {
  width: 0px;
}

.screen {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* =========================
   Utility Classes
   ========================= */
.hidden {
  display: none !important;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.loading-spinner {
  display: none !important;
}