/* ============================================================
   Ms Luna's Learning Hub — styles.css (vanilla, no CDNs)
   Bright kid design · mobile/tablet-first · big touch targets
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #FFF7E0;
  --bg2: #FFE9B8;
  --card: #FFFFFF;
  --ink: #3A2C1B;
  --muted: #8A7353;
  --accent: #FF8A00;
  --accent-dark: #E67600;
  --accent2: #FF6F61;
  --green: #3BB273;
  --red: #F26D6D;
  --blue: #5AA9E6;
  --purple: #9B7EDE;
  --line: #EFE3C8;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(120, 80, 20, .12);
}

.theme-ocean {
  --bg1: #E3F4FF; --bg2: #C4E7FF; --accent: #1E88E5; --accent-dark: #1565C0;
  --accent2: #00ACC1; --ink: #12334F; --muted: #5A7E99; --line: #CFE4F5;
  --shadow: 0 6px 18px rgba(20, 60, 100, .14);
}

.theme-rocket {
  --bg1: #161D3A; --bg2: #252E5C; --card: #232B52; --accent: #FF6EC7; --accent-dark: #E04FA8;
  --accent2: #7C4DFF; --ink: #F2EEFF; --muted: #9FA8D8; --line: #333E75;
  --shadow: 0 6px 18px rgba(0, 0, 0, .4);
}

html, body { height: 100%; }

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100dvh;
  font-size: 16px;
}

button { font: inherit; color: inherit; }

#app {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px;
}

.screen { display: none; flex-direction: column; padding: 18px 16px 26px; flex: 1; animation: fadeIn .25s ease; }
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- shared bits ---------- */
.moon { font-size: 34px; line-height: 1; }
.moon-big { font-size: 64px; line-height: 1; text-align: center; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.scr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.scr-head h1 { font-size: 22px; }
.scr-head .sub { color: var(--muted); font-size: 14px; width: 100%; }

.btn {
  border: none; border-radius: 16px; cursor: pointer;
  min-height: 52px; padding: 12px 20px; font-size: 17px; font-weight: 700;
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--muted); border: 2px solid var(--line); }
.btn-big { width: 100%; min-height: 64px; font-size: 21px; border-radius: 20px; margin-top: 12px; }
.btn-round { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-size: 17px; flex: none; }
.btn-round-sm { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: #fff; cursor: pointer; flex: none; }
.btn-close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: none; background: #FFE4C4; cursor: pointer; font-size: 15px; font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: 108px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; z-index: 90; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: fadeIn .2s ease;
}
.hidden { display: none !important; }

.overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(40, 25, 5, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--card); border-radius: var(--radius); padding: 24px 20px;
  max-width: 420px; width: 100%; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.35);
  animation: popIn .18s ease;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.modal p { font-size: 18px; font-weight: 700; margin: 10px 0 18px; }
.modal-btns { display: flex; gap: 12px; }
.modal-btns .btn { flex: 1; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-top: 2px solid rgba(0,0,0,.05);
}
.tab {
  flex: 1; max-width: 170px; min-height: 56px; border: none; background: transparent;
  border-radius: 16px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.tab-ico { font-size: 22px; }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; gap: 12px; }
.mascot-btn {
  width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--accent);
  background: radial-gradient(circle at 35% 30%, #FFF8DC, #FFD98A);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
  box-shadow: var(--shadow); transition: transform .12s;
}
.mascot-btn:active { transform: scale(.9) rotate(-8deg); }
.home-title { flex: 1; }
.home-title h1 { font-size: 21px; line-height: 1.15; }
.home-title .who { color: var(--muted); font-size: 13px; font-weight: 600; }
.chip-row { display: flex; gap: 8px; }
.chip {
  background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 38px;
}
.chip:active { transform: scale(.95); }

.suggest {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border-left: 6px solid var(--accent);
  border-radius: 16px; padding: 12px 14px; margin-top: 14px; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 600; line-height: 1.4;
}
.suggest .moon { font-size: 26px; flex: none; }

.stats-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stat-card {
  background: var(--card); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow);
  font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px;
}
.stat-card .big { font-size: 20px; }

.day-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 700px) { .day-grid { grid-template-columns: repeat(3, 1fr); } }

.day-card {
  border: none; border-radius: var(--radius); padding: 14px 12px 12px; text-align: left;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; min-height: 120px;
  border-top: 9px solid var(--card-accent, #ccc);
  transition: transform .12s ease;
}
.day-card:active { transform: scale(.97); }
.day-card .day-name { font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.day-card .subject { font-size: 19px; font-weight: 900; line-height: 1.2; }
.day-card .status { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: auto; }
.day-card.done .status, .day-card.done-today .status { color: var(--green); font-weight: 800; }
.day-card.today { outline: 3px solid var(--accent); animation: pulse 1.8s ease-in-out infinite; }
.day-card.locked { opacity: .55; filter: grayscale(.35); }
.day-card.explore-card { border-top-color: var(--accent2); background: linear-gradient(160deg, #FFF3F0, #FFE3FA); }
@keyframes pulse { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 7px rgba(255, 138, 0, .18), var(--shadow); } }

.sticker-wall { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.sticker {
  background: var(--card); border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 700; display: flex; gap: 6px; align-items: center;
}

.exam-card {
  margin-top: 14px; background: linear-gradient(120deg, #FFE3E3, #FFD6E8);
  border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 14px;
  display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow);
  animation: popIn .25s ease;
}
.exam-card .cal-ico { font-size: 28px; }
.exam-card .cal-txt { display: flex; flex-direction: column; gap: 2px; }
.exam-card .cal-name { font-weight: 800; font-size: 14px; }
.exam-card .cal-date { font-size: 13px; color: var(--muted); }
.exam-card.soon { outline: 3px solid var(--accent); animation: popIn .25s ease, pulse 1.8s ease-in-out infinite; }

/* ---------------- mascot reactions ---------------- */
.mascot-btn { position: relative; }
.mascot-btn.mascot-pop .moon { animation: mascotPop .6s ease; }
@keyframes mascotPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.35) rotate(-8deg); }
  60% { transform: scale(.9) rotate(6deg); }
  100% { transform: scale(1); }
}
.mascot-spark {
  position: absolute; top: 6px; font-size: 16px; pointer-events: none;
  animation: sparkUp .95s ease-out forwards;
}
@keyframes sparkUp {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-46px) scale(1.15); opacity: 0; }
}

/* ---------------- celebration clip (CSS-animation fallback) ---------------- */
.celeb-clip {
  position: relative; margin: 8px 0 4px; padding: 18px 14px 14px;
  border-radius: var(--radius); overflow: hidden; text-align: center;
  background: linear-gradient(150deg, #FFF3D6, #FFE1F0 55%, #E3F0FF);
  box-shadow: var(--shadow); animation: popIn .3s ease;
}
.celeb-moon {
  display: inline-block; font-size: 46px;
  animation: celebDance 1.15s ease-in-out infinite;
}
@keyframes celebDance {
  0%,100% { transform: translateY(0) rotate(-6deg) scale(1); }
  25% { transform: translateY(-12px) rotate(5deg) scale(1.1); }
  50% { transform: translateY(0) rotate(-6deg) scale(1); }
  75% { transform: translateY(-7px) rotate(4deg) scale(1.05); }
}
.celeb-burst { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.celeb-burst span { font-size: 18px; animation: celebStar 1.15s ease-out infinite; }
.celeb-burst span:nth-child(2) { animation-delay: .15s; }
.celeb-burst span:nth-child(3) { animation-delay: .3s; }
.celeb-burst span:nth-child(4) { animation-delay: .45s; }
.celeb-burst span:nth-child(5) { animation-delay: .6s; }
.celeb-burst span:nth-child(6) { animation-delay: .75s; }
@keyframes celebStar {
  0% { transform: translateY(0) scale(.5) rotate(0deg); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-34px) scale(1.25) rotate(200deg); opacity: 0; }
}
.celeb-text { font-size: 21px; font-weight: 900; color: var(--accent-dark); margin-top: 8px; }
.celeb-sub { font-size: 14px; font-weight: 700; color: var(--muted); }

/* ---------- start ---------- */
.start-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 18px; text-align: center; margin-top: 8px;
}
.start-card h2 { font-size: 23px; margin: 8px 0 4px; }
.start-card .meta-line { color: var(--muted); font-weight: 600; font-size: 15px; }
.pass-note {
  background: #FFF3D6; border: 2px dashed var(--accent); border-radius: 14px;
  padding: 10px 12px; margin: 14px 0; font-size: 14px; font-weight: 600; line-height: 1.45;
}
.quote-bubble {
  background: #FFF8DC; border: 3px solid var(--accent); border-radius: 18px 18px 18px 4px;
  padding: 14px; font-size: 16px; font-weight: 600; line-height: 1.5; text-align: left;
  display: flex; gap: 10px; align-items: flex-start; margin: 14px 0;
}
.quote-bubble .text { flex: 1; }
.video-box { margin-top: 14px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-box iframe { width: 100%; aspect-ratio: 16 / 9; border: none; display: block; }
.video-offline {
  padding: 26px 14px; text-align: center; background: #2b2b33; color: #eee; font-weight: 600;
}
.video-offline p { margin: 6px 0; }

/* ---------- sheet ---------- */
.sheet-top { display: flex; align-items: center; gap: 10px; }
.sheet-title-wrap { flex: 1; min-width: 0; }
.sheet-title { font-size: 17px; font-weight: 900; line-height: 1.2; }
.sheet-sub { color: var(--muted); font-size: 13px; font-weight: 600; }
.timer-chip {
  background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 8px 12px; font-weight: 800; font-size: 15px; flex: none; font-variant-numeric: tabular-nums;
}
.timer-chip.amber { border-color: var(--accent); color: var(--accent-dark); animation: pulse 1.6s infinite; }

.progress-bar { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.progress-bar .seg {
  flex: 1; min-width: 12px; height: 14px; border-radius: 8px; background: var(--line);
  cursor: pointer; border: none; transition: background .2s, transform .15s;
}
.progress-bar .seg.answered { background: var(--green); animation: segPop .3s ease; }
.progress-bar .seg.current { background: var(--accent); outline: 2px solid var(--accent-dark); animation: segPulse 1.6s ease-in-out infinite; }
@keyframes segPop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
@keyframes segPulse { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }

.round-banner {
  margin-top: 12px; background: linear-gradient(120deg, #FFE9A8, #FFD76E);
  border-radius: 14px; padding: 10px 14px; font-weight: 800; font-size: 14px;
  text-align: center; animation: popIn .2s ease;
}

.section-head { margin-top: 16px; }
.section-head .s-title { font-size: 18px; font-weight: 900; color: var(--accent-dark); }
.section-head .s-inst { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.section-head .s-marks { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; margin-top: 6px; }

.q-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-top: 12px;
  animation: popIn .22s ease; /* question transition on every nav/jump */
}
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.q-num { background: var(--accent2); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 800; }
.q-marks { background: #FFF3D6; color: var(--accent-dark); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 800; border: 1.5px solid var(--accent); }
.q-topic { color: var(--muted); font-size: 12px; font-weight: 700; }
.q-prompt { font-size: 19px; line-height: 1.5; font-weight: 700; margin: 8px 0 16px; }
.q-extra-tag { background: var(--purple); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; }

.opt {
  display: flex; width: 100%; min-height: 56px; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 16px; background: #FFFDF6;
  margin-bottom: 10px; padding: 10px 14px; font-size: 17px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.opt.sel { border-color: var(--accent); background: #FFF3D6; box-shadow: 0 0 0 3px rgba(255, 138, 0, .15); }
.opt .tick { margin-left: auto; font-size: 20px; }

.tf-row { display: flex; gap: 12px; }
.tf-btn {
  flex: 1; min-height: 84px; border-radius: 18px; border: 3px solid var(--line);
  background: #FFFDF6; font-size: 26px; font-weight: 900; cursor: pointer;
}
.tf-btn.sel.true { border-color: var(--green); background: #E4F7EC; }
.tf-btn.sel.false { border-color: var(--red); background: #FDEBEB; }

.fill-row { display: flex; gap: 10px; align-items: center; }
.fill-input {
  flex: 1; min-height: 56px; border: 2px solid var(--line); border-radius: 16px;
  padding: 10px 16px; font: inherit; font-size: 18px; font-weight: 600; background: #FFFDF6; color: var(--ink);
}
.fill-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 138, 0, .15); }
.mic-btn { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: #FFFDF6; font-size: 22px; cursor: pointer; flex: none; }
.mic-btn.listening { border-color: var(--red); background: #FDEBEB; animation: pulse 1s infinite; }

.order-chosen { display: flex; flex-wrap: wrap; gap: 8px; min-height: 54px; align-items: center; background: #FFF8E1; border: 2px dashed var(--accent); border-radius: 16px; padding: 10px; margin-bottom: 12px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 10px 16px; font-size: 16px; font-weight: 700; cursor: pointer; min-height: 46px;
}
.chip.sel { border-color: var(--accent); background: #FFF3D6; }
.chip-placeholder { color: var(--muted); font-size: 14px; font-weight: 600; }

.match-grid { display: flex; flex-direction: column; gap: 10px; }
.match-left {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  border: 2px solid var(--line); border-radius: 16px; background: #FFFDF6;
  padding: 10px 14px; font-size: 16px; font-weight: 700; cursor: pointer; text-align: left;
}
.match-left.active { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(255, 111, 97, .2); }
.match-left .l-lbl { flex: 1; }
.match-left .l-val { background: var(--accent); color: #fff; border-radius: 12px; padding: 6px 12px; font-weight: 800; min-width: 44px; text-align: center; }
.match-rights { display: flex; flex-wrap: wrap; gap: 8px; }
.match-right { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 16px; font-size: 16px; font-weight: 700; cursor: pointer; min-height: 48px; }
.match-right.used { opacity: .4; border-color: var(--green); background: #E4F7EC; }
.match-hint-text { color: var(--muted); font-size: 13px; font-weight: 600; }

.hint-btn {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  background: #FFF8DC; border: 2px solid var(--accent); color: var(--accent-dark);
  border-radius: 999px; padding: 10px 18px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.hint-btn:active { transform: scale(.95); }

.sheet-nav { display: flex; gap: 12px; margin-top: 16px; }
.sheet-nav .btn { flex: 1; }

.hint-pop { position: fixed; left: 12px; right: 12px; bottom: 100px; z-index: 70; }
.hint-card {
  background: #FFF8DC; border: 3px solid var(--accent); border-radius: 20px;
  padding: 14px 16px; box-shadow: 0 12px 32px rgba(0,0,0,.28);
  animation: slideUp .22s ease; max-width: 520px; margin: 0 auto;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hint-head { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.hint-head .moon { font-size: 24px; }
.hint-card p { font-size: 16px; font-weight: 600; line-height: 1.5; }

/* ---------- review ---------- */
.review-head { text-align: center; }
.score-circle {
  width: 158px; height: 158px; border-radius: 50%; margin: 14px auto 6px;
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--line) 0);
  display: flex; align-items: center; justify-content: center;
}
.score-inner {
  width: 124px; height: 124px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.score-inner .pct { font-size: 34px; font-weight: 900; color: var(--accent-dark); }
.score-inner .frac { font-size: 13px; font-weight: 700; color: var(--muted); }
.stars-row { font-size: 34px; letter-spacing: 4px; margin: 6px 0; }
.stars-row .off { opacity: .22; filter: grayscale(1); }
.review-verdict { font-size: 19px; font-weight: 900; margin: 4px 0 2px; }
.bonus-note { display: inline-block; background: var(--purple); color: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 800; margin-top: 6px; }

.wrap-bubble {
  background: #FFF8DC; border: 3px solid var(--accent); border-radius: 18px 18px 18px 4px;
  padding: 14px; margin: 16px 0 6px; display: flex; gap: 10px; align-items: flex-start;
  font-weight: 600; line-height: 1.5; box-shadow: var(--shadow);
}
.wrap-bubble .text { flex: 1; font-size: 15px; }
.wrap-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.wrap-actions .lbl { color: var(--muted); font-size: 13px; font-weight: 700; }

.breakdown { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.bd-card {
  background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow);
  border-left: 8px solid var(--red);
}
.bd-card.correct { border-left-color: var(--green); }
.bd-card .bd-top { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.bd-card .bd-icon { font-size: 20px; }
.bd-card .bd-prompt { font-weight: 700; font-size: 16px; margin: 8px 0; line-height: 1.45; }
.bd-row { font-size: 14px; margin-top: 6px; line-height: 1.45; }
.bd-row .k { font-weight: 800; color: var(--muted); }
.bd-row.your { color: var(--red); }
.bd-row.your.correct { color: var(--green); }
.bd-row.answer { color: var(--green); font-weight: 600; }
.bd-explain {
  background: #FFF8E1; border-radius: 12px; padding: 10px 12px; margin-top: 10px;
  font-size: 14px; font-weight: 600; line-height: 1.5;
}

.review-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.review-actions .row { display: flex; gap: 10px; }
.review-actions .row .btn { flex: 1; }

/* ---------- feedback ---------- */
.fb-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 16px; margin-top: 8px; text-align: center; }
.fb-card h2 { font-size: 20px; }
.fb-emojis { display: flex; gap: 12px; margin: 18px 0; }
.fb-emoji {
  flex: 1; border: 3px solid var(--line); border-radius: 18px; background: #FFFDF6;
  padding: 14px 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fb-emoji .e { font-size: 40px; }
.fb-emoji span { font-size: 14px; font-weight: 800; color: var(--muted); }
.fb-emoji.sel { border-color: var(--accent); background: #FFF3D6; transform: translateY(-3px); }
.fb-q { font-weight: 800; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.fb-diff { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fb-diff button {
  border: 2px solid var(--line); border-radius: 999px; background: #FFFDF6;
  padding: 10px 16px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px;
}
.fb-diff button.sel { border-color: var(--green); background: #E4F7EC; color: #1E7A46; }
.fb-card textarea {
  width: 100%; margin-top: 16px; min-height: 90px; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px; font: inherit; font-size: 15px; background: #FFFDF6; color: var(--ink); resize: vertical;
}
.fb-card textarea:focus { outline: none; border-color: var(--accent); }
.fb-actions { display: flex; gap: 12px; margin-top: 14px; }
.fb-actions .btn { flex: 1; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; flex: 1; gap: 12px; }
.chat-msgs { display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 85%; }
.msg.kid { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--card); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 600; font-size: 15px; line-height: 1.45; box-shadow: var(--shadow); }
.msg.kid .bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg .moon { font-size: 26px; }
.chat-input-row { display: flex; gap: 10px; }
.chat-input-row input {
  flex: 1; min-height: 54px; border: 2px solid var(--line); border-radius: 16px;
  padding: 10px 16px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink);
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.note { color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; }

/* ---------- parent ---------- */
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); background: var(--card); }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-key {
  min-height: 62px; border-radius: 50%; border: none; background: var(--card);
  box-shadow: var(--shadow); font-size: 22px; font-weight: 900; cursor: pointer;
}
.pin-key:active { transform: scale(.92); background: var(--accent); color: #fff; }
.pin-msg { margin-top: 16px; text-align: center; font-weight: 700; font-size: 15px; color: var(--muted); }

/* ---------- explore ---------- */
.explore-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.explore-card {
  display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 18px;
  padding: 14px 16px; box-shadow: var(--shadow); border: none; cursor: pointer; text-align: left; font: inherit;
}
.explore-card .e-ico { font-size: 34px; }
.explore-card .e-title { font-size: 17px; font-weight: 900; }
.explore-card .e-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.explore-card .e-soon { margin-left: auto; background: var(--line); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; }
.canto-banner {
  background: linear-gradient(120deg, #FF6F61, #FF8A00); color: #fff; border-radius: 18px;
  padding: 18px; text-align: center; font-weight: 800; font-size: 17px; box-shadow: var(--shadow);
  line-height: 1.5;
}

/* ---------- confetti ---------- */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 100; display: none; }
#confetti-canvas.show { display: block; }

/* ---------- child picker ---------- */
.child-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px;
  background: #FFF8DC; border: 3px solid var(--accent); border-radius: 16px;
  padding: 14px; font-size: 17px; font-weight: 800; cursor: pointer;
}
.child-btn .avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; flex: none;
}

@media (max-width: 400px) {
  /* 360px phones: keep everything tappable + readable */
  .screen { padding: 14px 10px 22px; }
  .day-card { min-height: 104px; padding: 10px 9px 9px; }
  .day-card .subject { font-size: 17px; }
  .stat-card { padding: 8px 10px; font-size: 13px; }
  .stat-card .big { font-size: 17px; }
  .tab { min-height: 50px; }
  .tab-ico { font-size: 20px; }
  .home-head { gap: 8px; }
  .mascot-btn { width: 54px; height: 54px; }
  .q-card { padding: 14px 12px; }
  .q-prompt { font-size: 17px; }
  .sheet-title { font-size: 17px; }
  .score-circle { width: 118px; height: 118px; }
}

@media (min-width: 768px) {
  .screen { padding: 26px 32px 32px; }
  .q-prompt { font-size: 21px; }
  .opt { font-size: 18px; }
}

@media (min-width: 1024px) {
  #app { max-width: 980px; }
  .day-card .subject { font-size: 21px; }
  .q-card { padding: 24px 22px; }
  .tab { font-size: 14px; }
  .tab-ico { font-size: 26px; }
}

/* ---------------- 1G: PIN gate + chat + parent hub ---------------- */
.gate-card { max-width: 420px; margin-left: auto; margin-right: auto; }
.gate-sub { color: var(--muted); font-size: 14px; font-weight: 600; margin: 8px 0 14px; }
.moon-big { font-size: 56px; margin-top: 4px; }
.auth-link { display: block; margin: 14px auto 0; background: none; border: none; color: var(--accent); font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: underline; }

.q-prompt-row { display: flex; gap: 8px; align-items: flex-start; }
.q-prompt-row .q-prompt { flex: 1; }
.q-speak {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); background: #FFFDF6; font-size: 17px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.q-speak:active { transform: scale(.92); background: var(--accent); }

.chat-status { color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: center; min-height: 16px; }
.typing-msg .bubble.typing { display: flex; gap: 5px; padding: 14px 16px; }
.typing-msg .bubble.typing span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-msg .bubble.typing span:nth-child(2) { animation-delay: .15s; }
.typing-msg .bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
.chat-mic { width: 48px; height: 48px; }

.parent-actions { display: flex; justify-content: center; margin-top: 12px; }
.rep-load { text-align: center; color: var(--muted); font-weight: 700; padding: 30px 0; }
.rep-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 14px; }
.rep-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.rep-head .moon { font-size: 34px; }
.rep-head h2 { font-size: 20px; }
.rep-head p { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 2px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rep-table th, .rep-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.rep-table th { color: var(--muted); font-weight: 800; }
.rep-empty { color: var(--muted); font-weight: 600; }
.rep-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-topic { background: #FFF0D1; border: 1px solid var(--accent); color: #8a5a00; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 800; }
.rep-fb { list-style: none; padding: 0; font-size: 13px; color: #555; }
.rep-fb li { padding: 4px 0; }
.rep-card h3 { font-size: 14px; color: #7a5a00; }

/* ---------- explore module runner (batch 1H) ---------- */
.explore-head h1 { font-size: 18px; line-height: 1.2; margin-left: 6px; }
.explore-card .e-go {
  margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px;
  padding: 5px 13px; font-size: 12px; font-weight: 800;
}
.explore-card.locked-tile { opacity: .45; filter: grayscale(.35); cursor: not-allowed; }
.canto-divider {
  margin: 8px 4px 2px; font-size: 13px; font-weight: 900; color: var(--muted);
}
.canto-lock { display: flex; flex-direction: column; gap: 12px; }
.canto-start-card {
  text-align: center; background: linear-gradient(120deg, #FF6F61, #FF8A00); color: #fff;
  border-radius: 22px; padding: 18px; box-shadow: var(--shadow);
}
.lock-note { text-align: center; font-size: 14px; font-weight: 800; color: var(--muted); margin: 0; }
.learn-card-count {
  text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0 10px;
}
.flip-card { perspective: 1100px; margin-top: 2px; }
.flip-inner {
  position: relative; width: 100%; height: 320px; transform-style: preserve-3d;
  transition: transform .35s ease; cursor: pointer;
}
.flip-inner.flipped { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 22px; padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.flip-front { background: linear-gradient(160deg, #FFF3F0, #FFE3FA); border: 3px solid var(--accent); }
.flip-back { background: #fff; border: 3px solid var(--accent); transform: rotateY(180deg); }
.sec-chip {
  position: absolute; top: 12px; left: 12px; background: var(--line); border-radius: 999px;
  padding: 3px 12px; font-size: 12px; font-weight: 800; color: var(--muted);
}
.flip-title { font-size: 20px; font-weight: 900; line-height: 1.35; margin-top: 14px; }
.flip-content { font-size: 15px; line-height: 1.65; font-weight: 600; }
.flip-tap { margin-top: 14px; font-size: 12px; font-weight: 800; color: var(--muted); }
.card-speak {
  margin-top: 12px; background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 900; cursor: pointer;
}
.learn-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.learn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.learn-dot.current { background: var(--accent); transform: scale(1.3); }
.learn-nav { display: flex; gap: 10px; margin-top: 14px; }
.learn-nav .btn { flex: 1; }
.btn-skip { width: 100%; margin-top: 10px; min-height: 40px; font-size: 13px; }
.activity-card {
  background: #FFF8DC; border: 3px dashed var(--accent); border-radius: 22px;
  padding: 18px; text-align: center; box-shadow: var(--shadow);
}
.activity-text { font-size: 15px; line-height: 1.6; font-weight: 600; text-align: left; margin: 8px 0 0; }
.module-cta { width: 100%; margin-top: 14px; }
.done-card { text-align: center; background: var(--card); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.done-stars { font-size: 42px; letter-spacing: 6px; margin: 6px 0; }
.done-stars .off { opacity: .25; filter: grayscale(1); }
.done-score { font-size: 17px; font-weight: 800; }
.done-note { font-size: 15px; font-weight: 700; color: var(--muted); }
.done-activity { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 8px; }
@media (max-width: 400px) {
  .flip-inner { height: 300px; }
  .flip-title { font-size: 18px; }
  .flip-content { font-size: 14px; }
}

/* ---- photo marking (end-of-lesson) ---- */
.marking-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 16px; text-align: left; }
.marking-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.marking-head strong { font-size: 16px; }
.marking-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.marking-busy { text-align: center; font-weight: 800; color: var(--accent); padding: 18px 0; }
.marking-chip { display: inline-block; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 900; }
.marking-chip.pass { background: #E5F8EC; color: #1B7A3D; }
.marking-chip.fail { background: #FFF3E0; color: #B45309; }
.marking-feedback { margin: 10px 0 0; font-weight: 600; line-height: 1.5; }
.marking-items { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.marking-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.marking-item .mi-note { color: var(--muted); flex: 1; }
.marking-photos { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.marking-thumb { position: relative; }
.marking-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); }
.marking-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: #E5484D; color: #fff; font-weight: 900; }
.marking-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.marking-skip { background: none; border: none; color: var(--muted); text-decoration: underline; font-size: 12px; font-weight: 700; margin-top: 8px; width: 100%; text-align: center; }
.marking-done { font-weight: 800; color: #1B7A3D; }

/* ---- parent hub tabs + chat review ---- */
.parent-tabs { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; justify-content: center; }
.ptab { border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 13px; }
.ptab.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.clog-search { display: flex; gap: 8px; margin: 10px 0; }
.clog-search input { flex: 1; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); padding: 0 12px; font-size: 15px; }
.clog-days { display: flex; gap: 8px; flex-wrap: wrap; }
.clog-day { border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: 13px; color: var(--text); }
.clog-day.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.clog-day-head { margin: 12px 0 8px; font-size: 15px; }
.clog-msg { display: flex; gap: 8px; margin: 8px 0; }
.clog-msg.kid { justify-content: flex-end; }
.clog-bubble { background: var(--bg); border-radius: 14px; padding: 10px 14px; max-width: 85%; font-size: 14px; line-height: 1.45; }
.clog-msg.luna .clog-bubble { background: #FFF8E1; border: 1px solid #F3E5AB; }
.clog-empty { color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; padding: 16px 0; }
.clog-note { color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; margin-top: 14px; }
.marked-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.marked-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.marked-sheet { font-weight: 900; font-size: 15px; }
.marked-date { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.marked-photos { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.marked-photo { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.marked-photo img { width: 100%; height: 100%; object-fit: cover; }
.mp-placeholder { color: var(--muted); font-size: 24px; }
