@font-face{font-family:'Roboto';src:url('assets/Roboto-Regular.ttf')}
@font-face{font-family:'Roboto';src:url('assets/Roboto-Bold.ttf');font-weight:700}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:#f8fafc;color:#0f172a;font-family:'Roboto',sans-serif;height:100%;width:100%;overflow-x:hidden}
button{font:inherit;white-space:nowrap;cursor:pointer}
h1,h2,h3{margin:0;text-wrap:balance}
p{margin:0;text-wrap:pretty}

#lesson{
  width:100%;
  max-width:440px;
  height:100%;
  position:relative;
  background:#ffffff;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}

.scene{
  width:100%;
  min-height:100%;
  display:none;
  flex-direction:column;
  padding:14px 14px 12px;
  box-sizing:border-box;
  opacity:0;
  visibility:hidden;
  --accent:#2563eb;
  --tint:#eff6ff;
  --tint-border:#bfdbfe;
}
.scene.verb{--accent:#ea580c;--tint:#fff7ed;--tint-border:#fed7aa}
.scene.noun{--accent:#2563eb;--tint:#eff6ff;--tint-border:#bfdbfe}
.scene.adj{--accent:#7c3aed;--tint:#faf5ff;--tint-border:#e9d5ff}
.scene.adv{--accent:#16a34a;--tint:#f0fdf4;--tint-border:#bbf7d0}
.scene.intro,.scene:first-of-type{display:flex;opacity:1;visibility:visible}

/* Header */
.lesson-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  margin-bottom:10px;
}
.lesson-header strong{font-size:15px;font-weight:900;letter-spacing:-0.3px;color:#1e293b}
.header-badge{font-size:11px;font-weight:800;color:var(--accent);background:var(--tint);border:1px solid var(--tint-border);padding:4px 10px;border-radius:10px;letter-spacing:0.5px}

/* Learn Scene Elements */
.chapter{color:var(--accent);font-size:12px;font-weight:800;letter-spacing:1px;margin-bottom:2px;white-space:nowrap}
.heading{font-size:21px;font-weight:900;letter-spacing:-0.5px;line-height:1.25;margin-bottom:10px;color:#0f172a;text-wrap:balance}
.illustration{width:100%;height:165px;border-radius:18px;object-fit:cover;pointer-events:none;margin-bottom:6px;box-shadow:0 4px 14px rgba(0,0,0,0.06)}
.image-caption{text-align:center;font-size:13.5px;font-weight:600;color:#475569;margin-bottom:10px;text-wrap:pretty}
.image-caption strong{color:var(--accent);font-weight:900}

/* Morph Stage */
.morph-stage{
  width:100%;
  height:94px;
  background:var(--tint);
  border:1.5px solid var(--tint-border);
  border-radius:16px;
  position:relative;
  overflow:hidden;
  margin-bottom:10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.morph-label{position:absolute;left:10px;top:6px;color:var(--accent);font-size:10.5px;font-weight:800;letter-spacing:0.5px;white-space:nowrap}
.morph-stage svg{width:90%;height:68px;max-width:340px;margin-top:12px;filter:drop-shadow(0 2px 0 #ffffffb0) drop-shadow(0 4px 8px rgba(0,0,0,0.08))}
.morph-note{position:absolute;right:10px;top:6px;font-size:10.5px;color:var(--accent);font-weight:800;white-space:nowrap}

/* Form Tabs Navigation */
.form-nav{display:flex;gap:6px;width:100%;margin-bottom:10px}
.form-nav button{border:1.5px solid #e2e8f0;background:#fff;border-radius:12px;flex:1 1 0;min-width:0;height:38px;color:#334155;font-size:13px;font-weight:800;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all .15s ease}
.form-nav .selected{color:#fff;background:var(--accent);border-color:var(--accent);box-shadow:0 3px 8px rgba(0,0,0,0.12)}

/* Learn Cards Container */
.learn-cards-container{display:grid;gap:8px;width:100%;margin-bottom:10px}
.learn-info-card{background:#ffffff;border:1.5px solid #e2e8f0;border-radius:16px;box-shadow:0 2px 8px rgba(0,0,0,0.03)}
.grammar-card{padding:10px 14px;display:flex;align-items:center;justify-content:space-between}
.card-label{font-size:10.5px;font-weight:800;color:var(--accent);letter-spacing:0.5px;display:block;margin-bottom:2px;white-space:nowrap}
.card-title{font-size:16px;font-weight:900;color:#0f172a;white-space:nowrap}
.card-sub-label{font-size:10.5px;font-weight:800;color:#64748b;letter-spacing:0.5px;display:block;margin-bottom:4px;white-space:nowrap}
.example-card{padding:12px 14px}
.example-text{font-size:15px;font-weight:900;color:#0f172a;margin-bottom:4px;line-height:1.35;text-wrap:pretty}
.translation-text{font-size:13px;color:#475569;font-weight:600;line-height:1.35;text-wrap:pretty}

/* Subtitle */
.subtitle{
  background:#f8fafc;
  border:1.5px solid #e2e8f0;
  border-radius:14px;
  padding:8px 12px;
  width:100%;
  margin-bottom:8px;
  min-height:48px;
  position:relative;
}
.subtitle-label{color:var(--accent);font-size:10px;letter-spacing:0.5px;margin-bottom:2px;font-weight:800;white-space:nowrap}
.subtitle-text{font-size:13px;font-weight:700;line-height:1.35;color:#1e293b;opacity:0;visibility:hidden;text-wrap:pretty}

/* Swipe Hint Bar */
.swipe-hint-bar{
  width:100%;
  height:36px;
  background:#f5f3ff;
  border:1.5px solid #ddd6fe;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  color:#7c3aed;
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
  animation:pulseHint 2s infinite ease-in-out;
  white-space:nowrap;
}
.swipe-hint-bar .swipe-icon{font-size:14px;font-weight:900}
@keyframes pulseHint{0%,100%{transform:translateY(0)}50%{transform:translateY(3px)}}

.lesson-progress{width:100%;height:4px;background:#e2e8f0;border-radius:2px;overflow:hidden;margin-bottom:6px}
.lesson-progress-fill{height:100%;width:100%;background:var(--accent);transform-origin:0 0}
.footer-line{display:flex;justify-content:space-between;font-size:11px;font-weight:700;color:#64748b;margin-bottom:4px;white-space:nowrap}

/* Confetti & Summary */
.confetti{position:absolute;left:50%;top:50%;width:10px;height:14px;opacity:0;pointer-events:none}
.summary-box{
  background:linear-gradient(180deg,#faf5ff,#ffffff);
  border:2px solid #d8b4fe;
  border-radius:22px;
  padding:24px 18px;
  text-align:center;
  box-shadow:0 8px 24px rgba(124,58,237,0.08);
  width:100%;
  margin:auto 0;
}
.summary-icon{font-size:48px;margin-bottom:8px}
.summary-title{color:#6b21a8;font-size:22px;font-weight:900;margin-bottom:6px;text-wrap:balance}
.summary-desc{margin-bottom:16px;font-size:13.5px;font-weight:600;color:#334155;text-wrap:pretty}
.summary-words{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:18px}
.summary-words span{border:1.5px solid #e9d5ff;background:#fff;color:#7e22ce;font-size:13.5px;font-weight:800;padding:8px 10px;border-radius:12px;text-align:center;white-space:nowrap}
.cta-box{background:#ffffff;border:2px dashed #7c3aed;border-radius:16px;padding:16px;margin-bottom:10px;box-shadow:0 4px 14px rgba(124,58,237,0.06)}
.cta-subtitle{font-size:11px;font-weight:800;color:#6b21a8;letter-spacing:0.5px;margin-bottom:4px;white-space:nowrap;display:block}
.cta-link{font-size:20px;font-weight:900;color:#1e293b;display:block;margin-bottom:4px;white-space:nowrap}
.cta-sub{font-size:11.5px;color:#64748b;font-weight:600;white-space:nowrap}

/* Intro Cover Screen (Scene 0) */
.intro-screen{display:flex;flex-direction:column;align-items:center;width:100%;text-align:center;flex:1 1 auto;justify-content:space-between}
.intro-tag{font-size:11px;font-weight:800;letter-spacing:1px;color:#6d28d9;margin-bottom:6px;background:#f5f3ff;padding:4px 14px;border-radius:20px;border:1px solid #ddd6fe;white-space:nowrap}
.intro-title{font-size:23px;font-weight:900;letter-spacing:-0.5px;color:#0f172a;margin-bottom:2px;line-height:1.2;text-wrap:balance}
.intro-subtitle{font-size:11.5px;font-weight:700;color:#64748b;margin-bottom:12px;white-space:nowrap}

/* Adaptive Intro Grids */
.intro-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;width:100%;margin-bottom:12px}
.intro-grid.count-5 .intro-card:last-child{grid-column:1/-1}

.intro-card{background:#fff;border:1.5px solid #e2e8f0;border-radius:16px;padding:10px 12px;text-align:left;box-shadow:0 4px 12px rgba(0,0,0,0.03)}
.intro-card.adj{border-color:#e9d5ff;background:linear-gradient(180deg,#fff,#faf5ff)}
.intro-card.verb{border-color:#fed7aa;background:linear-gradient(180deg,#fff,#fff7ed)}
.intro-card.adv{border-color:#bbf7d0;background:linear-gradient(180deg,#fff,#f0fdf4)}
.intro-card.noun{border-color:#bfdbfe;background:linear-gradient(180deg,#fff,#eff6ff)}
.intro-card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.intro-badge{font-size:10.5px;font-weight:800;padding:2px 8px;border-radius:8px;background:#f1f5f9;color:#475569;white-space:nowrap}
.intro-card.adj .intro-badge{background:#f3e8ff;color:#7e22ce}
.intro-card.verb .intro-badge{background:#ffedd5;color:#c2410c}
.intro-card.adv .intro-badge{background:#dcfce7;color:#15803d}
.intro-card.noun .intro-badge{background:#dbeafe;color:#1d4ed8}
.intro-pos{font-size:11.5px;font-weight:900;color:#64748b;white-space:nowrap}
.intro-word{font-size:20px;font-weight:900;letter-spacing:-0.3px;margin:0 0 2px;color:#0f172a;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.intro-meaning{font-size:12px;color:#334155;line-height:1.3;margin:0 0 4px;font-weight:600;text-wrap:pretty}
.intro-equation{font-size:10px;color:#64748b;background:#f8fafc;padding:3px 6px;border-radius:6px;margin:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.intro-cta{width:100%;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;padding:12px 16px;border-radius:16px;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 14px rgba(109,40,217,0.25);cursor:pointer;white-space:nowrap}
.intro-cta-pulse{background:#ffffff33;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-size:12px}

/* Story Practice */
.story-illustration{height:165px;border-radius:18px;margin-bottom:8px}
.story-box{background:#ffffff;border:1.5px solid #e2e8f0;border-radius:18px;padding:12px 14px;box-shadow:0 4px 14px rgba(0,0,0,0.03);width:100%;margin-bottom:10px}
.story-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.story-badge{font-size:10.5px;font-weight:800;color:#7c3aed;background:#f3e8ff;padding:3px 8px;border-radius:8px;white-space:nowrap}
.story-timer-box{display:flex;align-items:center;gap:4px;font-size:11.5px;font-weight:900;color:#d97706;background:#fef3c7;padding:3px 8px;border-radius:8px;white-space:nowrap}
.story-text{font-size:15px;font-weight:700;line-height:1.6;margin-bottom:8px;text-wrap:pretty}
.story-translation{font-size:12.5px;font-weight:600;color:#475569;margin-bottom:10px;padding-top:8px;border-top:1px dashed #e2e8f0;line-height:1.4;text-wrap:pretty}
.story-blank-slot{display:inline-flex;vertical-align:middle;margin:0 3px;text-align:center;cursor:pointer}
.blank-holder{display:inline-flex;align-items:center;justify-content:center;border:1.5px dashed #94a3b8;background:#f8fafc;color:#64748b;font-size:12px;font-weight:900;padding:2px 8px;border-radius:8px;letter-spacing:0.5px;min-width:64px;height:28px;transition:all .15s ease;user-select:none;white-space:nowrap}
.story-blank-slot:hover .blank-holder{border-color:#7c3aed;background:#f5f3ff;color:#7c3aed}
.filled-tag{display:none;align-items:center;justify-content:center;font-size:13.5px;font-weight:900;padding:2px 10px;border-radius:8px;box-shadow:0 2px 0 rgba(0,0,0,0.1);border:1.5px solid transparent;white-space:nowrap;height:28px;user-select:none;transition:transform .15s ease}
.filled-tag.noun{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}
.filled-tag.verb{background:#ffedd5;color:#c2410c;border-color:#fdba74}
.filled-tag.adj{background:#f3e8ff;color:#7e22ce;border-color:#d8b4fe}
.filled-tag.adv{background:#dcfce7;color:#15803d;border-color:#86efac}
.story-chips-bank{display:flex;gap:6px;justify-content:center;align-items:center;margin-top:8px;flex-wrap:wrap}
.fly-chip{font-size:14px;font-weight:900;padding:7px 12px;border-radius:12px;border:1.5px solid #cbd5e1;border-bottom:3.5px solid #94a3b8;background:#ffffff;display:flex;align-items:center;gap:6px;cursor:pointer;transition:transform .15s ease,opacity .2s ease;user-select:none;white-space:nowrap}
.fly-chip:active{transform:translateY(2px);border-bottom-width:1.5px}
.fly-chip.adj{border-color:#e9d5ff;border-bottom-color:#a855f7;color:#6b21a8;background:#faf5ff}
.fly-chip.verb{border-color:#fed7aa;border-bottom-color:#f97316;color:#9a3412;background:#fffaf5}
.fly-chip.adv{border-color:#bbf7d0;border-bottom-color:#22c55e;color:#166534;background:#f6fdf9}
.fly-chip.noun{border-color:#bfdbfe;border-bottom-color:#3b82f6;color:#1e40af;background:#f6faff}
.fly-chip .chip-pos{font-size:10px;font-weight:900;padding:2px 5px;border-radius:6px;background:#ffffffcc}
