:root {
  --bg-darkest: #0d0d10;
  --bg-card: #1a1a2e;
  --bg-card-hover: #252542;
  --accent-cyan: #00FFFF;
  --accent-magenta: #FF00FF;
  --accent-lime: #00FF00;
  --accent-pink: #FF69B4;
  --accent-gold: #FFD700;
  --text-light: #e0e0e0;
  --text-muted: #a0a0ff;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-darkest);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 255, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav-container {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(13, 13, 16, 0.8);
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  padding: 0.75rem 1rem;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-light);
}

.nav-tab.active {
  color: var(--accent-cyan);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* Home */
.home-container {
  animation: fadeIn 0.5s ease;
}

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

.hero-section {
  text-align: center;
  padding: 3rem 1rem;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.word-learn {
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.word-fun {
  color: var(--accent-magenta);
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-magenta), var(--accent-pink));
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(255, 0, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 0, 255, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border: 2px solid var(--accent-cyan);
  padding: 0.875rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 255, 255, 0.15);
}

.feature-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--accent-cyan);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Section Titles */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Workspace */
.workspace-container {
  animation: fadeIn 0.5s ease;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.color-picker {
  display: flex;
  gap: 0.5rem;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: white;
  box-shadow: 0 0 10px currentColor;
}

.brush-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.brush-size input[type="range"] {
  width: 80px;
  accent-color: var(--accent-cyan);
}

.tools {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

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

.tool-btn.active {
  background: rgba(0, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

.tool-btn.danger:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff4444;
}

.drawing-canvas {
  width: 100%;
  height: 400px;
  background: var(--bg-darkest);
  border: 2px solid var(--bg-card);
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
}

/* Practice */
.practice-container {
  animation: fadeIn 0.5s ease;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--text-light);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

.category-icon {
  font-size: 2.5rem;
}

.difficulty-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.difficulty-btn {
  padding: 1rem 2.5rem;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.difficulty-btn.easy {
  background: linear-gradient(135deg, #00FF00, #00CC00);
  color: #003300;
}

.difficulty-btn.medium {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #4a3000;
}

.difficulty-btn.hard {
  background: linear-gradient(135deg, #FF4444, #CC0000);
  color: white;
}

.difficulty-btn:hover {
  transform: scale(1.05);
}

.back-btn {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.back-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.high-score {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: var(--accent-gold);
}

/* Quiz */
.quiz-container {
  animation: fadeIn 0.3s ease;
  max-width: 600px;
  margin: 0 auto;
}

.quiz-header {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  transition: width 0.3s ease;
}

.quiz-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.streak {
  color: var(--accent-gold);
}

.quiz-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
}

.question-text {
  font-size: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-lime);
  margin-bottom: 2rem;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  padding: 1rem;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(0, 255, 255, 0.1);
}

.option-btn.correct {
  background: rgba(0, 255, 0, 0.2);
  border-color: var(--accent-lime);
  animation: pulse-green 0.5s ease;
}

.option-btn.wrong {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff4444;
  animation: shake 0.5s ease;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 0, 0); }
  50% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.5); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.next-btn {
  margin-top: 1rem;
}

.score-display {
  margin-top: 1.5rem;
  font-size: 1.25rem;
  color: var(--accent-cyan);
}

/* Results */
.result-container {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeIn 0.5s ease;
  position: relative;
}

.result-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.result-score {
  font-size: 4rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.result-message {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.result-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Shapes */
.shapes-container {
  animation: fadeIn 0.5s ease;
  text-align: center;
}

.shapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.shape-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.shape-card:hover {
  transform: translateY(-3px);
  border-color: var(--shape-color);
  box-shadow: 0 0 30px color-mix(in srgb, var(--shape-color) 30%, transparent);
}

.shape-preview {
  width: 60px;
  height: 60px;
}

.shape-preview svg {
  width: 100%;
  height: 100%;
}

.shape-name {
  color: var(--text-light);
  font-weight: 500;
}

/* Shape Detail */
.shape-detail {
  animation: fadeIn 0.5s ease;
  max-width: 600px;
  margin: 0 auto;
}

.shape-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0;
  text-shadow: 0 0 20px currentColor;
}

.shape-canvas {
  width: 100%;
  max-width: 300px;
  height: 300px;
  margin: 0 auto 1.5rem;
  display: block;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
}

.shape-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.shape-controls input[type="range"] {
  width: 150px;
  accent-color: var(--accent-magenta);
}

.randomize-btn {
  background: linear-gradient(135deg, var(--accent-gold), #FFA500);
  color: #333;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.randomize-btn:hover {
  transform: scale(1.05);
}

.shape-properties {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.property {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.property:last-child {
  border-bottom: none;
}

.property .value {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-lime);
}

.property .formula {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.property.calculated {
  background: rgba(0, 255, 255, 0.05);
  margin: 0 -1.5rem;
  padding: 0.75rem 1.5rem;
}

.fun-fact {
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1));
  border-radius: 16px;
  padding: 1.5rem;
  text-align: left;
}

.fun-fact span {
  color: var(--accent-gold);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.fun-fact p {
  color: var(--text-light);
  line-height: 1.5;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent-magenta);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer a:hover {
  text-shadow: 0 0 10px var(--accent-magenta);
}

/* Easter Egg */
body.easter-egg .shape-card,
body.easter-egg .feature-card,
body.easter-egg .category-card {
  animation: dance 0.5s ease infinite alternate;
}

@keyframes dance {
  0% { transform: rotate(-5deg) scale(0.95); }
  100% { transform: rotate(5deg) scale(1.05); }
}

body.easter-egg .logo {
  animation: rainbow 1s linear infinite;
}

@keyframes rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .nav-content {
    justify-content: center;
  }
  
  .nav-tabs {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .hero-section {
    padding: 2rem 0.5rem;
  }
  
  .toolbar {
    justify-content: center;
  }
  
  .tools {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  
  .drawing-canvas {
    height: 300px;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .shapes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .question-text {
    font-size: 1.25rem;
  }
  
  .result-score {
    font-size: 3rem;
  }
}