/* ===================== Course app ===================== */
.app-body { min-height: 100dvh; }
.app-bar { position: sticky; top: 0; z-index: 50; background: rgba(255,246,232,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 2px solid rgba(34,22,15,.1); padding-block: 12px; }
.app-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-bar-right { display: flex; align-items: center; gap: 6px; }
.bar-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; font-weight: 700; text-decoration: none; background: none; border: 0; cursor: pointer; }
.bar-link:hover { background: var(--sand); }
.bar-unlock { min-height: 42px; font-size: 13px; padding: 8px 16px; }
.bar-link, .bar-unlock, .app-bar .wordmark { white-space: nowrap; }
@media (max-width: 820px) { .bar-link span { display: none; } .app-bar .wordmark .wm-sub { display: none; } }
.demo-ribbon { background: var(--sun); border-bottom: 2px solid var(--ink); text-align: center; font-size: 14px; font-weight: 600; padding: 8px var(--gutter); }
.demo-ribbon code { background: rgba(0,0,0,.08); padding: 1px 6px; border-radius: 4px; }
#app { outline: none; padding-bottom: 80px; }
.loading { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 14px; font-weight: 600; color: var(--text-soft); }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hibiscus-deep); margin-bottom: 8px; }
.lead { font-size: 18px; color: var(--text-soft); max-width: 56ch; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; padding: 10px 0; margin-top: 18px; }
.back-link:hover { text-decoration: underline; }
.center { display: flex; justify-content: center; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100dvh - 140px); display: grid; place-items: center; padding-block: 48px; }
.auth-card { width: 100%; max-width: 480px; padding: 40px 28px 28px; text-align: center; position: relative; }
.auth-mascot { width: 96px; margin: -90px auto 6px; display: block; }
.auth-card h1 { font-size: clamp(36px, 7vw, 50px); }
.auth-card h1 .script { color: var(--hibiscus); font-size: 1.1em; }
.auth-lead { color: var(--text-soft); margin: 10px 0 26px; }
.field { text-align: left; margin-bottom: 18px; }
.field label, .field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .tr-in {
  width: 100%; min-height: 52px; padding: 12px 16px; font: inherit; font-size: 17px; color: var(--ink);
  background: var(--cream); border: 2.5px solid var(--ink); border-radius: 12px; outline: none;
  transition: box-shadow var(--t-fast);
}
.field input:focus, .tr-in:focus { box-shadow: 0 0 0 4px rgba(14,107,102,.25); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.help { font-size: 14px; color: var(--text-soft); margin-top: 6px; }
.err { font-size: 14px; color: var(--error); font-weight: 600; margin-top: 4px; min-height: 0; }
.err:empty { display: none; }
.auth-switch { margin-top: 18px; font-weight: 500; }
.auth-switch a { font-weight: 700; color: var(--sea); }

/* ---------- Dashboard ---------- */
.dash { padding-top: 32px; }
.dash-hero { display: grid; gap: 28px; align-items: center; padding: 24px 0 32px; }
@media (min-width: 768px) { .dash-hero { grid-template-columns: 1fr auto; } }
.dash-hero h1 { font-size: clamp(40px, 7vw, 76px); margin-bottom: 10px; }
.dash-hero h1 .script { color: var(--hibiscus); }
.dash-hero .lead { margin-bottom: 22px; }
.dash-ring { position: relative; width: 150px; height: 150px; justify-self: center; }
.dash-ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.dash-ring-label b { font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 400; }
.dash-ring-label span { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.unlock-banner { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 20px 22px; background: var(--mango); margin-bottom: 28px; }
.unlock-banner h2 { font-size: 22px; }
.unlock-banner p { font-weight: 500; }
.unlock-banner .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 720px) { .unlock-banner { grid-template-columns: auto 1fr auto; } .unlock-banner .btn { grid-column: auto; } }
.ub-mascot { width: 64px; }
.note-banner { padding: 16px 20px; margin-bottom: 24px; display: flex; gap: 10px; align-items: center; font-weight: 600; background: var(--sea-light); }
.note-banner.warn { background: #FFE9B8; }
.guest-banner { flex-wrap: wrap; background: var(--white); font-weight: 500; }
.guest-banner span { flex: 1; min-width: 200px; }
.guest-banner .btn { min-height: 42px; font-size: 13px; padding: 8px 16px; }
.paid-guest { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 24px; margin-bottom: 28px; background: var(--palm-light); }
.paid-guest h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 6px; }
.paid-guest h2 .script { color: var(--palm); }
.paid-guest .btn { grid-column: 1 / -1; justify-self: start; }
.pg-mascot { width: 76px; }
@media (min-width: 760px) { .paid-guest { grid-template-columns: auto 1fr auto; } .paid-guest .btn { grid-column: auto; } }
.mod-grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
.mod-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; text-decoration: none;
  background: var(--mc); color: var(--cream); min-height: 250px;
  transition: transform var(--t) var(--ease-back), box-shadow var(--t);
}
.mod-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--shadow-hard-lg); }
.mod-card.locked { background: var(--white); color: var(--ink); }
.mod-card.locked .mc-desc { color: var(--text-soft); }
.mc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mc-num { font-family: var(--font-display); font-size: 15px; background: rgba(0,0,0,.2); padding: 4px 10px; border-radius: 8px; }
.mod-card.locked .mc-num { background: var(--sand); }
.mc-ring { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.mc-ring svg { position: absolute; inset: 0; }
.mc-ring svg circle:first-child { stroke: rgba(255,255,255,.22); }
.mc-ring b { font-size: 11px; font-weight: 700; }
.mc-lock { width: 40px; height: 40px; border-radius: 50%; background: var(--sand); border: 2px solid var(--ink); display: grid; place-items: center; }
.mc-lock svg { width: 18px; height: 18px; }
.mod-card h3 { font-size: 30px; }
.mc-creole { font-size: 24px; color: var(--sun); line-height: 1; }
.mod-card.locked .mc-creole { color: var(--hibiscus); }
.mc-desc { font-size: 15px; opacity: .92; flex: 1; }
.mc-cta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); text-transform: uppercase; font-size: 14px; margin-top: 10px; }

.lakou-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 22px; margin-top: 28px; background: var(--sun); }
.lakou-card h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 6px; }
.lakou-card p:not(.eyebrow) { font-weight: 500; }
.lakou-card .btn { grid-column: 1 / -1; justify-self: start; }
.lk-mascot { width: 72px; }
@media (min-width: 760px) { .lakou-card { grid-template-columns: auto 1fr auto; } .lakou-card .btn { grid-column: auto; } }

.mod-card.coming { background: var(--cream); color: var(--ink); border-style: dashed; box-shadow: none; text-decoration: none; }
.mod-card.coming:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.mod-card.coming .mc-num { background: var(--sun); }
.mod-card.coming .mc-creole { color: var(--hibiscus-deep); }
.mod-card.coming .mc-desc { color: var(--text-soft); }
.mc-plus { width: 40px; height: 40px; border-radius: 50%; border: 2.5px dashed var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.more-note { padding: 16px 20px; background: var(--sun); font-weight: 500; max-width: 520px; }

/* ---------- Unlock ---------- */
.unlock { max-width: 560px; }
.unlock-card { margin-top: 36px; text-align: left; }
.unlock-card h1 { font-size: clamp(34px, 6vw, 48px); }
.unlock-card h1 .script { color: var(--hibiscus-deep); }
.unlock-mascot { position: absolute; right: 18px; top: -46px; width: 86px; }
.unlock-card .plan-tag { right: auto; left: 22px; }
.modal-wrap { position: fixed; inset: 0; z-index: 1200; background: rgba(34,22,15,.55); display: grid; place-items: center; padding: 16px; animation: fadeIn 200ms var(--ease-out); }
.modal { width: 100%; max-width: 460px; padding: 30px 26px 26px; position: relative; display: grid; gap: 14px; animation: popIn 300ms var(--ease-back); }
.modal h2 { font-size: 28px; padding-right: 48px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(10px); } }

/* ---------- Module ---------- */
.mod-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 10px 0 26px; }
.mod-head h1 { font-size: clamp(38px, 6.5vw, 70px); margin-bottom: 10px; }
.mod-head h1 .script { color: var(--mc); font-size: .62em; display: inline-block; transform: rotate(-3deg); vertical-align: middle; }
.mod-head-ring { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.mod-head-ring svg { position: absolute; inset: 0; }
.mod-head-ring b { font-weight: 700; font-size: 16px; }
@media (max-width: 560px) { .mod-head-ring { display: none; } }

.lesson-top { display: grid; gap: 20px; margin-bottom: 28px; }
@media (min-width: 860px) { .lesson-top { grid-template-columns: 1fr 1.2fr; } }
.tip { padding: 24px; background: var(--sun); transform: rotate(-.8deg); }
.tip-tag { display: inline-block; font-family: var(--font-display); text-transform: uppercase; font-size: 12px; background: var(--ink); color: var(--sun); padding: 4px 10px; border-radius: 6px; margin-bottom: 10px; }
.tip h2 { font-family: var(--font-display); text-transform: uppercase; font-size: 22px; margin-bottom: 8px; }
.tip p { font-size: 17px; }
.video-card { overflow: hidden; padding: 0; }
.video-frame { aspect-ratio: 16 / 9; width: 100%; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 12px 16px; border-top: 2.5px solid var(--ink); font-size: 14px; font-weight: 600; color: var(--text-soft); }
.video-meta a { color: var(--ink); }
.video-yt { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; white-space: nowrap; min-height: 32px; }
.video-yt:hover { text-decoration: underline; }
.video-ph { display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 20px; background: linear-gradient(150deg, var(--mc), var(--ink)); color: var(--cream); }
.video-ph b { font-family: var(--font-display); text-transform: uppercase; font-size: 20px; }
.video-ph span:last-child { opacity: .8; font-size: 14px; }
.rp-play { width: 64px; height: 64px; border-radius: 50%; background: var(--cream); color: var(--ink); display: grid; place-items: center; border: 3px solid var(--ink); }
.rp-play svg { width: 26px; height: 26px; margin-left: 4px; }

.act-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin-inline: -2px; scrollbar-width: none; }
.act-tabs::-webkit-scrollbar { display: none; }
.act-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 16px;
  border: 2.5px solid var(--ink); border-radius: 14px; background: var(--white); text-decoration: none; font-weight: 700;
  box-shadow: 0 3px 0 var(--ink); transition: transform var(--t-fast);
}
.act-tab:hover { transform: translateY(-2px); }
.act-tab[aria-current="page"] { background: var(--mc); color: var(--white); }
.done-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--palm); color: var(--white); display: grid; place-items: center; border: 2px solid var(--ink); }
.done-dot svg { width: 12px; height: 12px; }

.stage { padding: clamp(20px, 4vw, 40px); min-height: 420px; box-shadow: var(--shadow-hard-lg); }
.stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.stage-head h2 { font-family: var(--font-display); text-transform: uppercase; font-size: 24px; }
.stage-meta { color: var(--text-soft); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; flex: 1; }
.bar { height: 10px; background: var(--sand); border-radius: 999px; overflow: hidden; border: 2px solid var(--ink); margin-bottom: 28px; }
.bar span { display: block; height: 100%; background: var(--mc); transition: width 400ms var(--ease-out); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); font-weight: 700; font-size: 14px; cursor: pointer; }
.chip:hover { background: var(--sand); }

.flip.big { max-width: 560px; margin: 0 auto; }
.flip.big .flip-inner { aspect-ratio: 5 / 3; }
.flip.big .ff-word { font-size: clamp(30px, 5vw, 50px); }
.card-ctrl { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 26px 0 18px; }
.know-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.know-row .btn.is-on { --btn-bg: var(--palm); --btn-fg: var(--white); }

.q-sub { color: var(--text-soft); font-weight: 600; margin-bottom: 6px; }
.q-prompt { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 42px); line-height: 1.1; margin-bottom: 24px; }
.q-prompt.creole { color: var(--mc); }
.opts { display: grid; gap: 12px; }
@media (min-width: 700px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 16px; text-align: left;
  background: var(--cream); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink);
  font-size: 17px; font-weight: 600; cursor: pointer; transition: transform var(--t-fast), background var(--t-fast);
}
.opt:hover:not(:disabled) { transform: translateY(-2px); background: var(--sand); }
.opt:disabled { cursor: default; }
.opt-k { width: 32px; height: 32px; flex: none; border-radius: 8px; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 14px; background: var(--white); }
.opt.right { background: var(--palm-light); border-color: var(--palm); }
.opt.right .opt-k { background: var(--palm); color: var(--white); }
.opt.wrong { background: var(--error-bg); border-color: var(--error); animation: shake 400ms; }
.opt.wrong .opt-k { background: var(--error); color: var(--white); }
.feedback { margin-top: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-height: 26px; }
.feedback:empty { margin-top: 0; }
.feedback.ok { color: var(--palm); }
.feedback.no { color: var(--error); }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.fill-sentence { font-family: var(--font-display); font-size: clamp(24px, 4vw, 38px); line-height: 1.4; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fill-in {
  font: inherit; font-family: var(--font-body); font-weight: 700; font-size: .78em; color: var(--sea);
  background: var(--cream); border: 0; border-bottom: 4px solid var(--mc); border-radius: 8px 8px 0 0; padding: 2px 10px; min-width: 5ch; max-width: 100%;
  outline: none; transition: background var(--t-fast);
}
.fill-in:focus { background: var(--sun); }
.fill-in.right { border-color: var(--palm); background: var(--palm-light); color: var(--palm); }
.fill-in.wrong { border-color: var(--error); background: var(--error-bg); animation: shake 400ms; }

.dir-chip { display: inline-block; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--cream); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.tr-in { min-height: 90px; resize: vertical; line-height: 1.5; }
.tr-in[readonly] { background: var(--sand); }
.answer { margin-top: 18px; padding: 18px; background: var(--sea-light); border: 2.5px solid var(--ink); border-radius: 14px; }
.answer-text { font-family: var(--font-display); font-size: 24px; line-height: 1.2; }
.answer-note { margin-top: 6px; color: var(--ink-soft); }
.self-q { margin-top: 16px; font-weight: 700; }

.finish { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 20px 0; }
.finish-mascot { width: 110px; }
.finish h2 { font-size: 64px; }
.finish-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.finish-actions .btn.no-dot { gap: 8px; }

.mod-foot { display: flex; justify-content: flex-end; margin-top: 28px; }
