/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

:root {
  --bg-deep: #06060f;
  --bg-surface: #0e0e1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(79, 195, 247, 0.3);

  --accent-cyan: #4fc3f7;
  --accent-cyan-dim: rgba(79, 195, 247, 0.15);
  --accent-gold: #ffd54f;
  --accent-gold-dim: rgba(255, 213, 79, 0.15);
  --accent-purple: #b388ff;
  --accent-purple-dim: rgba(179, 136, 255, 0.15);
  --accent-green: #66bb6a;
  --accent-green-dim: rgba(102, 187, 106, 0.2);
  --accent-red: #ef5350;
  --accent-red-dim: rgba(239, 83, 80, 0.2);
  --accent-orange: #ffab40;

  --text-primary: #e8e8f0;
  --text-secondary: #9e9eb8;
  --text-muted: #6a6a80;
  --text-sesowi: #4fc3f7;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow: 0 0 40px rgba(79, 195, 247, 0.08);
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.3);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ===== VIEWS ===== */
.view {
  display: none;
  min-height: 100dvh;
}
.view.active {
  display: flex;
  flex-direction: column;
}

/* ===== HOME VIEW ===== */
.home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg-deep) 60%, transparent);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.logo {
  margin-bottom: 1.5rem;
}

.logo-icon {
  font-size: 2rem;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 0.25rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
  50% { text-shadow: 0 0 25px rgba(79, 195, 247, 0.6); }
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-gold);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== UNIT MAP ===== */
.unit-map {
  flex: 1;
  padding: 0 1rem 3rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.unit-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.unit-card-header {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.unit-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.unit-number.locked {
  background: var(--bg-glass);
  color: var(--text-muted);
  border: 2px solid var(--border-subtle);
}

.unit-number.available {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 2px solid rgba(79, 195, 247, 0.3);
}

.unit-number.completed {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border: 2px solid rgba(102, 187, 106, 0.3);
}

.unit-info {
  flex: 1;
  min-width: 0;
}

.unit-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-goal {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.unit-chevron {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.unit-card.expanded .unit-chevron {
  transform: rotate(90deg);
}

.unit-progress-mini {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.unit-progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: width var(--transition-slow);
}

.unit-lessons {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.unit-card.expanded .unit-lessons {
  max-height: 2000px;
}

.lesson-item {
  padding: 0.9rem 1.5rem 0.9rem 4.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border-top: 1px solid rgba(255,255,255,0.03);
  transition: background var(--transition-fast);
}

.lesson-item:hover {
  background: rgba(79, 195, 247, 0.05);
}

.lesson-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.lesson-dot.locked {
  background: var(--text-muted);
  opacity: 0.3;
}

.lesson-dot.available {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

.lesson-dot.completed {
  background: var(--accent-green);
}

.lesson-name {
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
}

.lesson-atoms-preview {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-sesowi);
  opacity: 0.7;
}

/* ===== LESSON VIEW ===== */
.lesson-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-deep);
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.header-nav {
  position: absolute;
  top: 1.5rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.lesson-title-bar {
  text-align: center;
  padding: 0 5rem;
}

.lesson-unit-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.15rem;
}

.lesson-title-text {
  font-size: 0.95rem;
  font-weight: 600;
}

.lesson-progress-bar,
.exercise-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.lesson-progress-fill,
.exercise-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: width var(--transition-slow);
  width: 0%;
}

.lesson-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 6rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  animation: fadeSlideIn 0.3s ease;
}

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

.lesson-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem 1.5rem;
  background: linear-gradient(0deg, var(--bg-deep) 70%, transparent);
  display: flex;
  justify-content: center;
  z-index: 5;
}

.lesson-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

/* ===== SLIDE TYPES ===== */

/* Atom slide */
.slide-atom {
  text-align: center;
  width: 100%;
}

.slide-atom .atom-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.slide-atom .atom-word {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(79, 195, 247, 0.2);
  animation: atomReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.slide-atom .atom-meaning {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.slide-atom .atom-mnemonic {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 0.75rem 1.25rem;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: inline-block;
}

/* Compound slide */
.slide-compound {
  text-align: center;
  width: 100%;
}

.compound-breakdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.compound-part {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(79, 195, 247, 0.25);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  animation: partSlideIn 0.4s ease backwards;
}

.compound-part:nth-child(2) { animation-delay: 0.1s; }
.compound-part:nth-child(3) { animation-delay: 0.15s; }
.compound-part:nth-child(4) { animation-delay: 0.2s; }

@keyframes partSlideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.compound-part .part-atom {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

.compound-part .part-meaning {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.compound-plus {
  font-size: 1.3rem;
  color: var(--text-muted);
  font-weight: 300;
}

.compound-equals {
  font-size: 1.3rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.compound-result {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.compound-meaning {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-primary);
}

.compound-gloss {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Compound Quiz slide */
.slide-compound-quiz {
  text-align: center;
  width: 100%;
}

.cq-context {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: 999px;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.cq-context-atom {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.cq-context-meaning {
  color: var(--text-secondary);
  font-weight: 400;
}

.cq-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.slide-compound-quiz .compound-breakdown {
  margin: 1rem 0;
}

.slide-compound-quiz .compound-result {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.slide-compound-quiz .compound-gloss {
  margin-bottom: 1.25rem;
}

.cq-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  max-width: 460px;
  margin: 0 auto;
}

.cq-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.3;
}

.cq-option:hover:not(.disabled) {
  border-color: var(--accent-cyan);
  background: rgba(79, 195, 247, 0.08);
  transform: translateY(-1px);
}

.cq-option.correct {
  border-color: var(--accent-green);
  background: var(--accent-green-dim);
  color: var(--accent-green);
  font-weight: 600;
}

.cq-option.incorrect {
  border-color: var(--accent-red);
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

.cq-option.disabled {
  cursor: default;
  opacity: 0.7;
}

.cq-option.disabled:not(.correct):not(.incorrect) {
  opacity: 0.4;
}

.cq-result {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  animation: fadeSlideIn 0.3s ease;
}

.cq-result.hidden {
  display: none;
}

.cq-result-icon {
  font-size: 1.4rem;
  font-weight: 800;
}

.cq-result-icon.right {
  color: var(--accent-green);
}

.cq-result-icon.wrong {
  color: var(--accent-red);
}

.cq-result-meaning {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .cq-options {
    grid-template-columns: 1fr;
  }
}

/* Grammar slide */
.slide-grammar {
  width: 100%;
}

.grammar-title {
  font-size: 0.7rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.grammar-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.grammar-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.grammar-pattern {
  background: var(--accent-purple-dim);
  border: 1px solid rgba(179, 136, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.grammar-pattern .pattern-sesowi {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-sesowi);
  margin-bottom: 0.5rem;
}

.grammar-pattern .pattern-english {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Example slide */
.slide-example {
  width: 100%;
  text-align: center;
}

.example-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.example-sesowi {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-sesowi);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.example-sesowi .word {
  cursor: pointer;
  padding: 0.1rem 0.1rem;
  border-radius: 4px;
  transition: background var(--transition-fast);
  display: inline-block;
}

.example-sesowi .word:hover {
  background: var(--accent-cyan-dim);
}

.example-english {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ===== EXERCISE STYLES ===== */
.exercise-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 7rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.exercise-type-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.exercise-prompt {
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.exercise-prompt .sesowi-text {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
}

.exercise-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.exercise-option {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: left;
  transition: all var(--transition-fast);
  font-family: inherit;
  line-height: 1.4;
}

.exercise-option:hover {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

.exercise-option.selected {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

.exercise-option.correct {
  border-color: var(--accent-green) !important;
  background: var(--accent-green-dim) !important;
  animation: correctPulse 0.4s ease;
}

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

.exercise-option.wrong {
  border-color: var(--accent-red) !important;
  background: var(--accent-red-dim) !important;
  animation: shake 0.4s ease;
}

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

.exercise-option.dimmed {
  opacity: 0.4;
  pointer-events: none;
}

/* Word builder */
.word-builder {
  width: 100%;
}

.word-builder-target {
  min-height: 60px;
  background: var(--bg-glass);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  transition: border-color var(--transition-fast);
}

.word-builder-target.has-items {
  border-style: solid;
  border-color: var(--accent-cyan);
}

.word-builder-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.atom-tile {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(79, 195, 247, 0.3);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.atom-tile:hover {
  background: rgba(79, 195, 247, 0.25);
  transform: translateY(-2px);
}

.atom-tile.placed {
  opacity: 0.3;
  pointer-events: none;
}

.atom-tile.in-target {
  background: var(--accent-gold-dim);
  border-color: rgba(255, 213, 79, 0.3);
  color: var(--accent-gold);
}

.combined-pill {
  display: flex;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.combined-atom {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.6rem 0;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.combined-atom:first-child {
  padding-left: 1rem;
}

.combined-atom:last-child {
  padding-right: 1rem;
}

.combined-atom:hover {
  opacity: 0.7;
}

.combined-atom.color-0 { color: var(--accent-cyan); }
.combined-atom.color-1 { color: var(--accent-gold); }
.combined-atom.color-2 { color: var(--accent-purple); }
.combined-atom.color-3 { color: var(--accent-green); }

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  z-index: 9999;
  animation: fall linear forwards;
}

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

/* Feedback bar */
.feedback-bar {
  position: fixed;
  bottom: 70px;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 6;
  animation: slideUp 0.3s ease;
}

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

.feedback-bar.correct {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-top: 2px solid var(--accent-green);
}

.feedback-bar.wrong {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-top: 2px solid var(--accent-red);
}

.feedback-bar .correct-answer {
  font-weight: 400;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  opacity: 0.85;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #29b6f6);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 3rem;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  min-width: 200px;
  text-align: center;
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  min-width: 120px;
  text-align: center;
}

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

.btn-secondary:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.btn-large {
  padding: 1rem 4rem;
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

/* ===== SUMMARY VIEW ===== */
.summary-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  animation: fadeSlideIn 0.5s ease;
}

.summary-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.summary-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.summary-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.summary-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  max-width: 400px;
}

.summary-chip {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.summary-chip.compound {
  color: var(--accent-gold);
  border-color: rgba(255, 213, 79, 0.2);
}

/* ===== WORD TOOLTIP ===== */
.word-tooltip {
  position: fixed;
  background: #1a1a2e;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: tooltipIn 0.15s ease;
}

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

.tooltip-word {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.tooltip-meaning {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .home-header { padding: 3rem 2rem 2rem; }
  .unit-map { padding: 0 2rem 4rem; }
  .slide-atom .atom-word { font-size: 5rem; }
  .compound-result { font-size: 3rem; }
}

@media (max-width: 380px) {
  .slide-atom .atom-word { font-size: 3rem; }
  .compound-result { font-size: 2rem; }
  .example-sesowi { font-size: 1.2rem; }
}

/* ===== GOOGLE SIGN IN & USER PROFILE ===== */
.login-container {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

/* Google Button Style */
.google-btn {
  display: flex;
  align-items: center;
  background-color: #131314;
  border: 1px solid #8e918f;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
}

.google-btn:hover {
  background-color: #202124;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.google-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
}

.google-icon {
  width: 18px;
  height: 18px;
}

.google-btn .btn-text {
  color: #e3e3e3;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
}

/* User profile Chip */
.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.user-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

.user-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-chip::after {
  content: '▾';
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  background: #0e0e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  min-width: 120px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: dropdownIn 0.2s ease;
  z-index: 200;
}

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

.dropdown-item {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all var(--transition-fast);
  text-align: left;
}

.dropdown-item:hover {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .login-container {
    position: static;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
  }
  .home-header {
    padding-top: 1rem;
  }
  .lesson-content {
    justify-content: flex-start;
    padding-top: 12vh;
    padding-bottom: 8rem;
  }
}

/* Bold syntax for emphasis in grammar / examples */
.grammar-text strong,
.pattern-sesowi strong,
.pattern-english strong {
  font-weight: 800;
  color: var(--accent-gold);
}

.example-sesowi .word.bold {
  font-weight: 800;
  color: var(--accent-gold);
}

.example-english strong {
  font-weight: 800;
  color: var(--accent-gold);
}

.grammar-patterns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ===== TTS Speakable Elements ===== */
.speakable {
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, color 0.15s ease;
  position: relative;
}

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

.speakable:active {
  transform: scale(0.97);
}

.speak-icon {
  font-size: 0.4em;
  opacity: 0.4;
  vertical-align: middle;
  margin-left: 0.3em;
  transition: opacity 0.15s ease;
}

.speakable:hover .speak-icon {
  opacity: 0.8;
}

.speakable.speaking {
  animation: speakPulse 0.6s ease;
}

@keyframes speakPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.08); }
  50% { transform: scale(1); }
  75% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Also make words in examples show they're clickable */
.example-sesowi .word {
  cursor: pointer;
  transition: color 0.15s ease;
}

.example-sesowi .word:hover {
  color: var(--accent-cyan);
}
