:root {
  --ink: #2d2a4a;
  --ink-soft: #6b6890;
  --purple: #7c5cff;
  --purple-dark: #5a3fd6;
  --green: #22c55e;
  --green-dark: #16a34a;
  --yellow: #ffc83d;
  --yellow-dark: #e5a800;
  --red: #ff5d73;
  --red-dark: #e0334d;
  --orange: #ff9f43;
  --sky: #d7f0ff;
  --cream: #fff6e5;
  --card: #ffffff;
  --line: #ece9ff;
  --radius: 26px;
  --shadow: 0 10px 30px rgba(76, 58, 170, .12);
}

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

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Baloo Bhaijaan 2', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, #eef8ff 45%, var(--cream) 100%) fixed;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}

.loading { display: grid; place-items: center; min-height: 70vh; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid #fff; border-top-color: var(--purple);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px; padding: 10px 24px; border-radius: 20px;
  font-size: 21px; font-weight: 800; color: #fff;
  background: var(--purple); box-shadow: 0 6px 0 var(--purple-dark);
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple-dark); }
.btn.green { background: var(--green); box-shadow: 0 6px 0 var(--green-dark); }
.btn.green:active:not(:disabled) { box-shadow: 0 2px 0 var(--green-dark); }
.btn.yellow { background: var(--yellow); color: #5b4100; box-shadow: 0 6px 0 var(--yellow-dark); }
.btn.yellow:active:not(:disabled) { box-shadow: 0 2px 0 var(--yellow-dark); }
.btn.red { background: var(--red); box-shadow: 0 6px 0 var(--red-dark); }
.btn.light { background: #fff; color: var(--ink); box-shadow: 0 6px 0 #d9d4f5; }
.btn.light:active:not(:disabled) { box-shadow: 0 2px 0 #d9d4f5; }
.btn.block { width: 100%; }
.btn.small { min-height: 46px; font-size: 18px; padding: 6px 16px; border-radius: 16px; }

.icon-btn {
  width: 52px; height: 52px; border-radius: 18px; background: #fff;
  display: grid; place-items: center; font-size: 24px;
  box-shadow: 0 4px 0 #d9d4f5;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9d4f5; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 22px 18px; box-shadow: var(--shadow);
}

/* ---------- Login ---------- */
.login { text-align: center; padding-top: 4vh; }
.login .mascot-big { font-size: 92px; line-height: 1; animation: float 3s ease-in-out infinite; }
.login h1 { margin: 6px 0 0; font-size: 38px; color: var(--purple-dark); direction: ltr; }
.login p { margin: 4px 0 18px; font-size: 21px; color: var(--ink-soft); }
.code-boxes { display: flex; gap: 8px; justify-content: center; direction: ltr; margin-bottom: 20px; }
.code-box {
  width: 46px; height: 58px; border-radius: 16px; background: #fff;
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
  box-shadow: inset 0 -4px 0 var(--line);
}
.code-box.filled { color: var(--purple-dark); box-shadow: inset 0 -4px 0 var(--purple); }
.code-boxes.shake { animation: shake .4s; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 330px; margin: 0 auto; direction: ltr; }
.key {
  height: 68px; border-radius: 20px; background: #fff; font-size: 30px; font-weight: 800;
  box-shadow: 0 5px 0 #d9d4f5;
}
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 #d9d4f5; }
.key.go { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-dark); }
.key.del { font-size: 26px; }
.pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
  max-width: 480px; margin: 0 auto;
}
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px;
  border-radius: 24px; background: #fff; box-shadow: 0 6px 0 #d9d4f5; transition: transform .08s;
}
.pick:active, .pick.chosen { transform: translateY(4px); box-shadow: 0 2px 0 #d9d4f5; }
.pick.chosen { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-dark); }
.pick-av { font-size: 54px; line-height: 1.1; }
.pick-name { font-size: 20px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.login .err { color: var(--red-dark); font-size: 19px; min-height: 30px; margin-top: 12px; }

/* ---------- Home ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 36px; box-shadow: var(--shadow); flex: none;
}
.hello { flex: 1; min-width: 0; }
.hello small { display: block; color: var(--ink-soft); font-size: 16px; line-height: 1.2; }
.hello strong { display: block; font-size: 24px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-badge {
  display: flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 999px;
  background: #fff; font-size: 22px; font-weight: 800; color: #b77d00; box-shadow: var(--shadow);
}

.mail-banner {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 22px;
  background: linear-gradient(135deg, #ffe680, var(--yellow)); color: #5b4100;
  font-size: 20px; font-weight: 800; box-shadow: 0 6px 0 var(--yellow-dark);
  animation: pop .5s ease;
}
.mail-banner .big { font-size: 34px; animation: wiggle 1.6s ease-in-out infinite; }

.section-title { font-size: 22px; font-weight: 800; margin: 6px 4px 10px; }

/* الأذونات */
.perm-intro { text-align: center; font-size: 18px; color: var(--ink-soft); margin: 0 0 12px; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: #f7f5ff; margin-bottom: 10px; }
.perm-ico { font-size: 34px; }
.perm-txt { flex: 1; }
.perm-txt strong { display: block; font-size: 20px; }
.perm-txt small { display: block; font-size: 15px; color: var(--ink-soft); line-height: 1.4; }
.perm-ok { font-size: 30px; }
.perm-denied { color: var(--red-dark); font-size: 14px; max-width: 130px; text-align: center; line-height: 1.3; }

/* الحصّالة */
.piggy-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; padding: 14px 16px 16px;
  border-radius: 24px; background: linear-gradient(180deg, #fff9f2, #ffe9f2); box-shadow: 0 6px 0 #f3c3d7; text-align: center;
}
.piggy-title { font-size: 17px; font-weight: 800; color: #9d2b63; }
/* المبلغ فوق العلبة */
.piggy-amount {
  font-size: 28px; font-weight: 800; color: #fff; line-height: 1.2; padding: 4px 18px; border-radius: 999px;
  background: linear-gradient(180deg, #f0b429, #d99500); box-shadow: 0 4px 0 #b37b00; text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.tin { width: 104px; margin-top: 6px; filter: drop-shadow(0 6px 6px rgba(90, 60, 80, .18)); cursor: pointer; }
.tin svg { display: block; width: 100%; height: auto; }
.tin.shake-tin { animation: tinShake .5s ease; }
@keyframes tinShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 50% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
.piggy-next { font-size: 15px; font-weight: 700; color: #8a3a62; line-height: 1.5; margin-top: 4px; }
.tin-drop { position: relative; display: flex; justify-content: center; padding-top: 34px; }
.tin-drop .tin { width: 112px; }
.drop-coin { position: absolute; top: 0; left: 50%; font-size: 34px; transform: translate(-50%, -30px); opacity: 0;
  animation: coinDrop 1.1s ease-in .3s forwards; z-index: 2; }
@keyframes coinDrop {
  0% { transform: translate(-50%, -40px) rotate(0); opacity: 1; }
  70% { transform: translate(-50%, 34px) rotate(90deg) scaleX(.35); opacity: 1; }
  100% { transform: translate(-50%, 44px) rotate(90deg) scaleX(.2); opacity: 0; }
}
.tin-win { animation: tinShake .5s ease 1.3s; }
.piggy-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.pdot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #e98ab5; display: inline-block; }
.pdot.on { background: #e8457f; border-color: #e8457f; }
.piggy-win {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 14px; padding: 16px;
  border-radius: 24px; background: linear-gradient(135deg, #fff4c2, #ffe066); box-shadow: 0 6px 0 #e5b800;
  font-size: 20px; font-weight: 800; color: #6b4b00; animation: pop .5s ease;
}
.piggy-win-plus { font-size: 38px; color: #1f8a3c; animation: pop .5s ease; }
.piggy-win-total { font-size: 16px; font-weight: 700; }
.piggy-hint { margin: 4px 0 14px; padding: 10px 14px; border-radius: 18px; background: #ffe3ef; color: #8a3a62; font-size: 18px; font-weight: 700; }
.confetti.coin { background: none; width: auto; height: auto; font-size: 30px; }
.sent-card.redo { background: #fff1f2; box-shadow: 0 5px 0 #fecdd3; }
.sent-redo { color: var(--red-dark); font-weight: 800; white-space: nowrap; }
.fb-item.rejected { background: #fff1f2; }
.fb-redo { color: var(--red-dark); font-weight: 800; font-size: 17px; margin: 4px 0; }

/* جمل الحفظ فوق «رحلتي» */
.sent-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sent-count { font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.sent-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.sent-card {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 22px;
  background: #fff; box-shadow: 0 5px 0 #e4e0f7;
}
.sent-card.done { background: #f0fdf4; box-shadow: 0 5px 0 #bfe9cf; }
.sent-num {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--line); color: var(--purple-dark); font-weight: 800; font-size: 17px;
}
.sent-card.done .sent-num { background: var(--green); color: #fff; }
.sent-body { flex: 1; min-width: 0; }
.sent-en { direction: ltr; text-align: left; font-size: 19px; font-weight: 800; line-height: 1.3; }
.sent-ar { font-size: 15px; color: var(--ink-soft); line-height: 1.4; }
.sent-mark { color: var(--green-dark); font-weight: 800; white-space: nowrap; }
.sent-icons { display: flex; gap: 6px; flex: none; }
.sicon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px;
  box-shadow: 0 4px 0 rgba(0,0,0,.08);
}
.sicon:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.sicon.listen { background: #e0f2fe; }
.sicon.read { background: #fef3c7; }
.sicon.rec { background: #ffe4e6; }
@media (max-width: 380px) {
  .sent-card { flex-wrap: wrap; }
  .sent-icons { width: 100%; justify-content: flex-end; }
}

.mark-box { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; flex-wrap: nowrap; }
.mark-box .result-stars, .celebrate .mark-box .result-stars {
  font-size: 30px; min-height: 0; letter-spacing: 2px; margin: 0; white-space: nowrap;
}
.celebrate .big-mark .result-stars { font-size: 38px; }
.mark-label { font-size: 18px; font-weight: 800; color: var(--ink-soft); }
.mark-pct { font-size: 24px; font-weight: 800; color: var(--green-dark); }
.big-mark { margin: 6px 0 4px; }
.big-mark .result-stars { font-size: 44px; }
.sent-ok { color: var(--green-dark); line-height: 1.4; }

.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 20px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; width: 160px; }
.node-wrap:nth-child(4n+2) { transform: translateX(-70px); }
.node-wrap:nth-child(4n+4) { transform: translateX(70px); }
.node {
  position: relative; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; font-size: 44px;
  background: #fff; box-shadow: 0 7px 0 #d9d4f5;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 #d9d4f5; }
.node.done { background: #dcfce7; box-shadow: 0 7px 0 #9be3b5; }
.node.current { background: var(--purple); box-shadow: 0 7px 0 var(--purple-dark); animation: bounce 1.6s ease-in-out infinite; }
.node.locked { background: #eceaf5; box-shadow: 0 7px 0 #d6d2e8; filter: grayscale(1); opacity: .75; }
.node .lock { position: absolute; bottom: -4px; left: -4px; font-size: 26px; filter: none; }
.node .check {
  position: absolute; top: -4px; right: -4px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 20px; display: grid; place-items: center; font-weight: 800;
}
.node-label { margin-top: 10px; font-size: 18px; font-weight: 800; text-align: center; line-height: 1.2; }
.node-stars { font-size: 18px; letter-spacing: 2px; direction: ltr; min-height: 24px; }
.start-tag {
  margin-top: 6px; padding: 2px 14px; border-radius: 999px; background: var(--yellow);
  color: #5b4100; font-weight: 800; font-size: 16px;
}

.empty { text-align: center; padding: 40px 10px; font-size: 22px; color: var(--ink-soft); }
.empty .big { font-size: 70px; }

/* ---------- Lesson intro ---------- */
.lesson-head { text-align: center; margin: 4px 0 18px; }
.lesson-head .big { font-size: 74px; line-height: 1.1; }
.lesson-head h2 { margin: 4px 0 0; font-size: 30px; }
.lesson-head .stars-line { font-size: 26px; direction: ltr; }
.preview { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; direction: ltr; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: #fff; font-size: 19px; font-weight: 700; box-shadow: 0 3px 0 var(--line);
}
.steps { display: flex; flex-direction: column; gap: 14px; }
.step {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 6px 0 #d9d4f5;
}
.step:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #d9d4f5; }
.step .num {
  width: 62px; height: 62px; flex: none; border-radius: 20px; display: grid; place-items: center;
  font-size: 34px; background: var(--line);
}
.step .txt { flex: 1; }
.step .txt strong { display: block; font-size: 22px; line-height: 1.2; }
.step .txt small { display: block; font-size: 16px; color: var(--ink-soft); line-height: 1.3; }
.step .state { font-size: 28px; }
.step.active { box-shadow: 0 6px 0 var(--purple-dark); background: var(--purple); color: #fff; }
.step.active .num { background: rgba(255,255,255,.22); }
.step.active small { color: #ece7ff; }
.step.done .num { background: #dcfce7; }
.step:disabled { opacity: .55; }

/* ---------- Practice ---------- */
.practice-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar { flex: 1; height: 18px; border-radius: 999px; background: #fff; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.06); }
.bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffd85c, var(--yellow)); transition: width .4s ease; }
.stage-label { text-align: center; font-size: 20px; font-weight: 800; color: var(--purple-dark); margin-bottom: 10px; }

.sentence-card { text-align: center; padding: 26px 16px 20px; }
.sentence {
  direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px;
  font-size: clamp(30px, 9vw, 46px); font-weight: 800; line-height: 1.3; min-height: 64px;
}
.word { padding: 0 8px; border-radius: 14px; transition: background .3s, color .3s; }
.word.ok { background: #dcfce7; color: var(--green-dark); }
.word.close { background: #ffedd5; color: #c2410c; cursor: pointer; }
.word.miss { background: #ffe4e6; color: var(--red-dark); cursor: pointer; text-decoration: underline wavy rgba(224,51,77,.5); text-underline-offset: 6px; }
.word.masked { color: #b9b3e0; letter-spacing: 3px; }
.meaning { margin-top: 10px; font-size: 21px; color: var(--ink-soft); }
.listen-row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

.mascot { display: flex; align-items: flex-end; gap: 10px; margin: 18px 4px 6px; }
.mascot .owl { font-size: 52px; line-height: 1; flex: none; }
.bubble {
  position: relative; flex: 1; padding: 12px 16px; border-radius: 20px 20px 20px 6px;
  background: #fff; font-size: 20px; font-weight: 700; box-shadow: var(--shadow); min-height: 54px;
}
.bubble.good { background: #dcfce7; color: #14532d; }
.bubble.mid { background: #fff3d6; color: #7a4b00; }
.bubble.bad { background: #ffe8ec; color: #881337; }
.heard { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; opacity: .8; }

.mic-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 6px; }
.mic {
  position: relative; width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center; font-size: 52px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #9b82ff, var(--purple));
  box-shadow: 0 8px 0 var(--purple-dark), 0 14px 30px rgba(124,92,255,.35);
}
.mic:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 3px 0 var(--purple-dark); }
.mic.listening { background: radial-gradient(circle at 35% 30%, #ff8a9a, var(--red)); box-shadow: 0 8px 0 var(--red-dark); }
.mic.listening::before, .mic.listening::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 5px solid rgba(255,93,115,.45); animation: ring 1.4s ease-out infinite;
}
.mic.listening::after { animation-delay: .7s; }
.mic-hint { font-size: 19px; font-weight: 700; color: var(--ink-soft); min-height: 28px; }
.timer { font-size: 24px; font-weight: 800; direction: ltr; color: var(--red-dark); }

/* "أنت قلت": كلمات الطفل كما سمعها التطبيق */
.said-card {
  margin-top: 14px; padding: 14px 16px; border-radius: 22px; background: #fff;
  box-shadow: var(--shadow); animation: pop .35s ease;
}
.said-label { font-size: 18px; font-weight: 800; color: var(--ink-soft); margin-bottom: 8px; }
.said-words { direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.sw {
  display: inline-block; padding: 2px 12px; border-radius: 14px; font-size: clamp(22px, 6.5vw, 30px);
  font-weight: 800; line-height: 1.4; border: 2px solid transparent;
}
.sw.ok { background: #dcfce7; color: var(--green-dark); }
.sw.close { background: #ffedd5; color: #c2410c; }
.sw.miss { background: #ffe4e6; color: var(--red-dark); text-decoration: line-through; text-decoration-thickness: 2px; }
.sw.missing { background: #fff; color: var(--red-dark); border: 2px dashed var(--red); min-width: 48px; text-align: center; }
.sw.extra { background: #f1f0f7; color: #9a96b8; font-weight: 600; }

.en-word { direction: ltr; unicode-bidi: isolate; font-weight: 800; color: var(--purple-dark); }

/* التصحيح خطوة خطوة */
.fix-card { padding: 20px 16px; }
.fix-context {
  direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px;
  font-size: 20px; color: var(--ink-soft); margin-bottom: 14px;
}
.fix-context .cur { color: var(--ink); background: #fff3c4; border-radius: 10px; padding: 0 8px; font-weight: 800; }
.fix-compare { display: flex; flex-direction: column; gap: 12px; }
.fix-row, .fix-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fix-now:empty { display: none; }
.fix-now { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.fix-label { font-size: 19px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.fix-said {
  direction: ltr; font-size: clamp(26px, 8vw, 36px); font-weight: 800; padding: 2px 14px; border-radius: 14px;
  background: #ffe4e6; color: var(--red-dark); text-decoration: line-through; text-decoration-thickness: 3px;
}
.fix-said.none { text-decoration: none; border: 2px dashed var(--red); background: #fff; }
.fix-correct {
  direction: ltr; font-size: clamp(30px, 9vw, 42px); font-weight: 800; padding: 4px 16px; border-radius: 16px;
  background: #dcfce7; color: var(--green-dark); box-shadow: 0 4px 0 #9be3b5;
}
.fix-correct:active { transform: translateY(3px); box-shadow: 0 1px 0 #9be3b5; }

.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
.mic:disabled { filter: grayscale(.6); }

.result-stars { text-align: center; font-size: 44px; letter-spacing: 6px; direction: ltr; min-height: 56px; }
.result-stars .s { display: inline-block; animation: pop .4s ease both; }
.s.off { filter: grayscale(1); opacity: .3; }
.result-stars .s:nth-child(2) { animation-delay: .12s; }
.result-stars .s:nth-child(3) { animation-delay: .24s; }

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

.audio-box { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 12px; }
.audio-box audio { width: 100%; }
.sent-badge {
  text-align: center; padding: 12px; border-radius: 18px; background: #dcfce7;
  color: var(--green-dark); font-size: 21px; font-weight: 800;
}
.notice {
  padding: 12px 16px; border-radius: 18px; background: #fff3d6; color: #7a4b00;
  font-size: 17px; margin-bottom: 14px;
}

/* ---------- Celebrate ---------- */
.celebrate { text-align: center; padding-top: 6vh; }
.celebrate .big { font-size: 110px; line-height: 1; animation: pop .6s ease; }
.celebrate h2 { font-size: 34px; margin: 10px 0 4px; }
.celebrate p { font-size: 21px; color: var(--ink-soft); margin: 0 0 18px; }
.celebrate .result-stars { font-size: 64px; margin-bottom: 22px; }
.celebrate .btn { margin-top: 12px; }

.confetti { position: fixed; top: -20px; width: 12px; height: 18px; border-radius: 3px; z-index: 50; pointer-events: none; animation: fall linear forwards; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(45,42,74,.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 85vh; overflow: auto;
  background: #fff; border-radius: 28px; padding: 22px 18px; animation: up .25s ease;
}
.sheet h3 { margin: 0 0 12px; font-size: 26px; text-align: center; }
.fb-item { padding: 14px; border-radius: 20px; background: #f7f5ff; margin-bottom: 12px; }
.fb-item.new { background: #fff8e1; }
.fb-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fb-item .en { direction: ltr; font-size: 22px; font-weight: 800; }
.fb-item .stars { font-size: 24px; direction: ltr; }
.fb-item .comment { font-size: 19px; margin: 6px 0; }
.fb-item audio { width: 100%; margin-top: 6px; }
.fb-item small { color: var(--ink-soft); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  z-index: 60; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 18px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.wiggle { animation: shake .4s; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ring { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
