/* Functional styles for multi-level lessons (levels 2–5, age tracks). Plain on purpose:
   the UI redesign can restyle these classes freely. Added 2026-10-18. */

/* 3D illustrations used instead of emoji */
.pic-img { display: block; width: 96px; height: 96px; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .12)); user-select: none; }
.pic-img.xl, .pic-img.pic-xl { width: clamp(120px, 22vw, 200px); height: clamp(120px, 22vw, 200px); }
.word .pic-img { width: 72px; height: 72px; }
.word.big .pic-img { width: clamp(120px, 20vw, 180px); height: clamp(120px, 20vw, 180px); }

/* Level tabs on the path screen */
.level-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.level-tab span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line, #eadbc6); background: #fff; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.level-tab.on span { border-color: var(--maroon, #6e191e); background: var(--maroon, #6e191e); color: #fff; }
.level-tab.done span { border-color: var(--mint, #1f7a5c); }
.level-tab.open span { border-style: dashed; }
.level-tab.locked span { opacity: .55; }

/* Levels have 6 to 36 lessons: let the lesson circles wrap in rows instead of one squeezed line */
.screen.path .trail { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 10px; }
.screen.path .trail .node { transform: none; padding: 8px 0; }
.screen.path .trail .node-btn { width: clamp(78px, 9vw, 104px); }

/* Start choice at setup */
.start-choice .chip span { text-align: left; padding: 8px 14px; line-height: 1.3; }
.start-choice .chip small { display: block; font-weight: 500; }

/* Uyirmei: how a letter is made */
.formula { display: inline-flex; align-items: center; gap: .35em; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; color: var(--ink, #2b1a17); margin: 6px 0; }
.formula span { padding: 0 .2em; border-radius: 10px; background: var(--gold-soft, #fff1d2); }
.formula.big { font-size: clamp(2.2rem, 7vw, 4rem); }
.build-cue { padding: 18px 28px; }
.rule-card { width: min(100%, 980px); text-align: center; }
.rule-title { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 4px; }
.rule-title small { display: block; font-size: 1rem; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 10px; }
.rule-tile { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: 20px; border: 2px solid var(--line, #eadbc6); background: #fff; cursor: pointer; overflow: hidden; }
.rule-tile .formula { font-size: 1.1rem; margin: 0; }
.rule-tile b { font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.15; color: var(--maroon, #6e191e); }
.rule-tile.on { border-color: var(--gold, #c98b1e); box-shadow: 0 0 0 4px rgba(201, 139, 30, .25); transform: scale(1.04); }
.rule-note { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--gold-soft, #fff1d2); font-weight: 600; }

/* Words */
.word-card { justify-items: center; text-align: center; }
.word.big { display: grid; justify-items: center; gap: 6px; padding: 18px 28px; min-width: min(100%, 320px); }
.word.big .word-ta { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.session .choices.words { width: min(100%, 640px); max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.words .choice { aspect-ratio: auto; min-height: 84px; font-size: clamp(1.4rem, 3.4vw, 2.2rem); padding: 10px 12px; }
.choices.words .choice [data-fit] { white-space: nowrap; }

/* Kural */
.kural-card { text-align: center; gap: 10px; }
.kural-no { margin: 0; font-weight: 700; color: var(--muted, #6f5e57); }
.kural-lines { display: grid; gap: 6px; background: none; border: 0; padding: 6px; cursor: pointer; font-size: clamp(1.25rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.5; color: var(--ink, #2b1a17); }
.kural-lines span { display: block; }
.kural-child { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--mint-soft, #e1f3ea); font-size: 1.1rem; line-height: 1.6; }
.kural-en { margin: 0; color: var(--muted, #6f5e57); }
.kural-cue { width: min(100%, 860px); text-align: center; }
.kural-cue .kural-lines { cursor: default; }

/* Beginning guide (js/tour.js): dim the screen, ring the part being explained, bubble with the words */
.tour { position: fixed; inset: 0; z-index: 50; }
.tour-ring { position: fixed; border-radius: 22px; box-shadow: 0 0 0 9999px rgba(20, 12, 10, .62), 0 0 0 4px var(--gold, #c98b1e), 0 0 24px 6px rgba(255, 210, 120, .55); transition: all .35s ease; pointer-events: none; }
.tour-bubble { position: fixed; background: var(--paper, #fffdf9); border-radius: 22px; padding: 16px 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); animation: tour-pop .3s ease; }
@keyframes tour-pop { from { transform: scale(.92); opacity: 0; } }
.tour-ta { margin: 0 0 4px; font-size: 1.2rem; font-weight: 700; line-height: 1.45; color: var(--maroon, #6e191e); }
.tour-en { margin: 0 0 12px; color: var(--muted, #6f5e57); font-size: .95rem; }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-foot .spacer { flex: 1; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line, #eadbc6); }
.tour-dots i.on { background: var(--maroon, #6e191e); }
.help-btn, .voice-toggle { font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-bubble { transition: none; animation: none; } }

/* "Who is using?" start screen and the parent account screens */
.start-screen .logo, .account-screen .logo { width: clamp(90px, 14vw, 150px); height: auto; margin: 0 auto 6px; display: block; }
.start-screen h1, .account-screen h1 { text-align: center; }
.who-en { display: block; font-size: .55em; font-weight: 500; color: var(--muted, #6f5e57); margin-top: 4px; }
.who-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: min(100%, 760px); margin: 14px auto; }
.who-card { display: grid; justify-items: center; gap: 6px; padding: 22px 12px; cursor: pointer; border: 3px solid transparent; font: inherit; }
.who-card:hover, .who-card:focus-visible { border-color: var(--gold, #c98b1e); }
.who-card b { font-size: clamp(1.3rem, 3vw, 1.8rem); color: var(--maroon, #6e191e); }
.who-card .who-en { font-size: 1rem; margin: 0; }
.who-icon { font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1; }
.who-note { text-align: center; max-width: 520px; margin: 8px auto; }
.who-note .btn { margin-top: 10px; }
.account-form { width: min(100%, 460px); margin: 10px auto; }
.account-links { text-align: center; font-size: .95rem; }
.account-links a { color: var(--maroon, #6e191e); text-decoration: underline; }
@media (orientation: landscape) and (max-height: 520px) {
  .start-screen { min-height: 0; padding-top: 8px; }
  .start-screen .logo { width: 70px; }
  .who-card { padding: 12px 8px; }
}

/* Warning before leaving an unfinished lesson */
.leave-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(20, 12, 10, .55); }
.leave-card { width: min(100%, 460px); text-align: center; display: grid; gap: 8px; animation: tour-pop .25s ease; }
.leave-icon { font-size: 3rem; line-height: 1; }
.leave-card h2 { margin: 0; color: var(--maroon, #6e191e); }
.leave-card p { margin: 0; line-height: 1.5; }
.leave-en { color: var(--muted, #6f5e57); font-size: .95rem; }
.leave-actions { display: grid; gap: 10px; margin-top: 10px; }
@media (orientation: landscape) and (max-height: 520px) {
  .leave-card { gap: 4px; padding: 14px 18px; }
  .leave-icon { font-size: 2rem; }
  .leave-actions { grid-template-columns: 1fr auto; align-items: center; }
  .leave-actions .btn.big { min-height: 52px; font-size: 1.05rem; }
}

/* Parent area: word and kural chips are wider than letters */
.ls.wide { width: auto; padding: 0 10px; font-size: 1rem; }

/* Explorer without tracing (words, kural): one centred column */
.learn-grid.single { grid-template-columns: minmax(0, 720px); justify-content: center; }
