/* 2K19 – giao diện dễ thương cho bé lớp 2 */
:root {
  --bg: #fff6ec;
  --card: #ffffff;
  --ink: #2d2a4a;
  --muted: #7a7696;
  --line: #f1e3d3;
  --accent: #ff7a59;
  --accent-d: #e35f3e;
  --ok: #22b07d;
  --ok-bg: #e5f8ef;
  --bad: #ef476f;
  --bad-bg: #fde8ee;
  --mid: #ffb020;
  --sun: #ffd166;
  --sky: #5aa9ff;
  --grape: #9b6bff;
  --radius: 22px;
  --shadow: 0 4px 0 rgba(120, 80, 40, 0.07), 0 10px 26px rgba(120, 80, 40, 0.08);
  --c: var(--accent);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Baloo 2', 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(#ffe2c7 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
[hidden] { display: none !important; }

.wrap { max-width: 880px; margin: 0 auto; padding: 12px 16px 110px; }

/* ---------- Header ---------- */
header.top { display: flex; align-items: center; gap: 8px; padding: 4px 0 14px; }
.sp { flex: 1; }
.logo { text-decoration: none; font-weight: 800; font-size: 32px; letter-spacing: 1px; display: flex; }
.logo span { display: inline-block; transform: rotate(-6deg); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); }
.logo .l1 { color: #ff7a59; }
.logo .l2 { color: #ffb020; transform: rotate(5deg); }
.logo .l3 { color: #22b07d; }
.logo .l4 { color: #5aa9ff; transform: rotate(6deg); }
.pill {
  background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 800;
  box-shadow: var(--shadow); text-decoration: none; white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: #137a55; box-shadow: none; }
.pill.mid { background: #fff3d6; color: #a06a00; box-shadow: none; }
.pill.no { background: var(--bad-bg); color: #b02a4d; box-shadow: none; }

/* ---------- Bottom nav ---------- */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
nav.bottom a {
  text-decoration: none; display: flex; flex-direction: column; align-items: center;
  font-size: 13px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: 14px; min-width: 60px;
}
nav.bottom a span { font-size: 24px; line-height: 1.1; }
nav.bottom a.on { color: var(--accent); background: #fff1e9; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: 2.5px solid var(--line); border-radius: 16px;
  padding: 10px 18px; font-weight: 800; font-size: 18px; text-decoration: none;
  box-shadow: 0 4px 0 var(--line); transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--c); border-color: transparent; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { color: var(--bad); border-color: #f7c6d3; box-shadow: 0 4px 0 #f7c6d3; }
.btn.small { padding: 6px 12px; font-size: 16px; border-radius: 12px; }
.btn.big { padding: 14px 24px; font-size: 21px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row.center { justify-content: center; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h3 { font-size: 20px; }
.sec { font-size: 21px; margin: 22px 4px 10px; }
.tip { background: #fff8dc; border: 2px dashed #ffd166; border-radius: 18px; padding: 12px 14px; margin: 10px 0; font-size: 17px; }
.tip a { color: var(--accent-d); font-weight: 700; }
.warn { background: #fff1f1; border: 2px solid #ffc9c9; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 16px; }
.big-emo { font-size: 64px; text-align: center; line-height: 1.1; }
.mbar { height: 10px; background: #f3e8dc; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.mbar i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width 0.5s; }

/* ---------- Home ---------- */
.hero { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 14px; }
.owl { font-size: 72px; line-height: 1; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.08)); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.bubble {
  position: relative; flex: 1; background: #fff; border-radius: 22px; padding: 14px 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.bubble::before { content: ''; position: absolute; left: -10px; bottom: 18px; border: 10px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble b { font-size: 24px; }
.namef { display: flex; gap: 8px; margin-top: 8px; }
.namef input { flex: 1; min-width: 0; border: 2.5px solid var(--line); border-radius: 12px; padding: 6px 12px; }

.countdown {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: linear-gradient(135deg, #ff9a76, #ff6f91); color: #fff; border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.cd-num { background: rgba(255, 255, 255, 0.25); border-radius: 18px; padding: 6px 14px; text-align: center; line-height: 1; }
.cd-num b { font-size: 40px; display: block; }
.cd-num small { font-size: 14px; }
.cd-txt { flex: 1; display: flex; flex-direction: column; }
.cd-txt b { font-size: 19px; }
.cd-txt small { opacity: 0.9; }
.countdown .mbar { background: rgba(255, 255, 255, 0.3); }
.countdown .mbar i { background: #fff; }

.daily {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: #fff; border: 3px solid #ffd166; border-radius: var(--radius); padding: 14px 18px;
  box-shadow: 0 5px 0 #ffd166;
}
.daily.done { border-color: #9be3c4; box-shadow: 0 5px 0 #9be3c4; }
.d-ic { font-size: 40px; animation: wiggle 2s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-12deg); } 20% { transform: rotate(10deg); } 30% { transform: rotate(0); } }
.d-tx { flex: 1; display: flex; flex-direction: column; }
.d-tx b { font-size: 21px; }
.d-tx small, .rankcard small, .tile small, .pcard small, .examcta small { color: var(--muted); font-size: 15px; }
.arrow { font-size: 34px; color: var(--muted); font-weight: 800; }

.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 680px) { .subjects { grid-template-columns: repeat(4, 1fr); } }
.subj {
  position: relative; background: #fff; border-radius: var(--radius); padding: 16px 14px; text-decoration: none;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; border-bottom: 6px solid var(--c);
}
.subj .s-ic { font-size: 42px; }
.subj b { font-size: 21px; }
.subj small { color: var(--muted); }
.subj.soon { opacity: 0.6; filter: grayscale(0.4); }

.rankcard {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; text-decoration: none;
  background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.rankcard > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.rk-ic { font-size: 38px; }
.rankcard .stk { font-size: 26px; letter-spacing: 2px; }

/* ---------- Subject page ---------- */
.pagehead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pagehead h1 { font-size: 25px; margin: 0; }
.backbtn {
  width: 42px; height: 42px; flex: none; border-radius: 14px; background: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; text-decoration: none; font-size: 32px; font-weight: 800; line-height: 1; padding-bottom: 4px;
}
.ready { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); --c: #ff7a59; }
.ready-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ready-top b { font-size: 19px; display: block; }
.ready-top small { color: var(--muted); }
.ready-num { font-size: 34px; font-weight: 800; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chipx { text-decoration: none; font-size: 14px; font-weight: 700; background: #f6efe8; border-radius: 99px; padding: 3px 10px; }
.chipx.ok { background: var(--ok-bg); color: #137a55; }
.chipx.mid { background: #fff3d6; color: #8d5c00; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 680px) { .tiles.three { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .tiles.three { grid-template-columns: 1fr; } .tiles.three .tile { flex-direction: row; flex-wrap: wrap; align-items: center; } .tiles.three .tile b { flex: 1; } .tiles.three .tile small, .tiles.three .tile .mbar { width: 100%; } }
.tile {
  background: #fff; border-radius: var(--radius); padding: 14px; text-decoration: none; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; transition: transform 0.1s;
}
.tile:active { transform: scale(0.97); }
.tile .t-ic { font-size: 36px; }
.tile b { font-size: 18px; line-height: 1.25; }
.examcta {
  display: flex; align-items: center; gap: 14px; text-decoration: none; margin-top: 22px;
  background: linear-gradient(135deg, #8f7bff, #6c5ce7); color: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 5px 0 #4b3bc4;
}
.examcta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.examcta b { font-size: 22px; }
.examcta small, .examcta .arrow { color: #ece8ff; }
.e-ic { font-size: 42px; }

/* Lesson memos */
.lesson-h { font-size: 20px; }
.memos { display: grid; gap: 10px; }
.memo { border-radius: 18px; padding: 12px 14px; border-left: 7px solid; }
.memo h4 { margin: 0 0 4px; font-size: 19px; }
.memo p { margin: 2px 0; }
.memo .ex { font-style: italic; color: #5a5578; }
.memo.c1 { background: #fff0ea; border-color: #ff7a59; }
.memo.c2 { background: #eaf4ff; border-color: #5aa9ff; }
.memo.c3 { background: #eafaf2; border-color: #22b07d; }
.memo.c4 { background: #f3edff; border-color: #9b6bff; }

/* Passage list */
.plist { display: grid; gap: 10px; }
@media (min-width: 680px) { .plist { grid-template-columns: 1fr 1fr; } }
.pcard { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 12px 14px; text-decoration: none; box-shadow: var(--shadow); }
.p-ic { font-size: 36px; }
.p-tx { flex: 1; display: flex; flex-direction: column; }
.p-tx b { font-size: 18px; }
.p-st { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.p-st b { font-size: 20px; }
.p-st i { font-style: normal; font-weight: 800; color: #fff; background: var(--sky); padding: 0 8px; border-radius: 99px; font-size: 13px; }
.badge { font-weight: 700; border-radius: 8px; padding: 0 6px; font-size: 13px; }
.badge.truyen { background: #fff0ea; color: #d2532f; }
.badge.thongtin { background: #eaf4ff; color: #2a74c9; }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; padding: 12px 16px 260px; }
.quiz-top { display: flex; align-items: center; gap: 12px; }
.x { font-size: 24px; width: 42px; height: 42px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); flex: none; }
.progress { flex: 1; height: 16px; background: #f1e3d3; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width 0.35s; }
.count { font-weight: 800; color: var(--muted); }
.qmeta { margin: 10px 4px 0; color: var(--muted); font-weight: 700; font-size: 16px; }
.passage { background: #fffaf2; border: 2.5px solid var(--line); border-radius: 18px; margin-top: 10px; }
.passage summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-weight: 800; cursor: pointer; list-style: none; }
.passage summary::-webkit-details-marker { display: none; }
.passage summary span::after { content: ' ▾'; color: var(--muted); }
.passage:not([open]) summary span::after { content: ' ▸ (bấm để xem bài)'; font-weight: 600; font-size: 14px; }
.ptext { padding: 0 16px 10px; font-size: 19px; max-height: 42vh; overflow: auto; }
.ptext p { margin: 0 0 8px; text-indent: 1.4em; }
.tbl { border-collapse: collapse; width: 100%; font-size: 17px; margin-bottom: 8px; }
.tbl th, .tbl td { border: 2px solid var(--line); padding: 4px 8px; text-align: left; }
.tbl th { background: #fff0e3; }
.qcard { background: #fff; border-radius: 24px; padding: 20px 18px; box-shadow: var(--shadow); margin-top: 12px; }
.qhead { display: flex; align-items: flex-start; gap: 10px; }
.qprompt { flex: 1; font-size: 22px; font-weight: 700; }
.say { font-size: 22px; width: 46px; height: 46px; flex: none; border-radius: 50%; background: #fff3e9; }
.say.sm { width: 36px; height: 36px; font-size: 17px; }
.say:active { transform: scale(0.9); }
.visual { margin: 14px 0 4px; text-align: center; }
.visual.small { transform: scale(0.85); margin: 6px 0; }
.sentence { display: inline-block; background: #f5f0ff; border-radius: 16px; padding: 10px 18px; font-size: 24px; font-weight: 700; }
.sentence.big { font-size: 38px; letter-spacing: 1px; }
.blank { display: inline-block; min-width: 1.4em; border-bottom: 4px dashed var(--accent); color: var(--accent); text-align: center; }
.hl { background: #ffe066; border-radius: 6px; padding: 0 4px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.choices.one { grid-template-columns: 1fr; }
@media (max-width: 400px) { .choices { grid-template-columns: 1fr; } }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 12px 14px;
  font-size: 20px; font-weight: 700; box-shadow: 0 4px 0 var(--line); min-height: 62px; transition: transform 0.08s;
}
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice .ck { flex: none; width: 30px; height: 30px; border-radius: 10px; background: #f6efe8; display: grid; place-items: center; font-size: 15px; color: var(--muted); }
.choice.ok { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 4px 0 #9be3c4; }
.choice.ok .ck { background: var(--ok); color: #fff; }
.choice.bad { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 4px 0 #f7b6c7; }
.choice.bad .ck { background: var(--bad); color: #fff; }
.choice.picked { border-color: var(--grape); background: #f3edff; }
.choice:disabled { cursor: default; }

/* order */
.order-built { min-height: 70px; border: 3px dashed #e8d6c3; border-radius: 18px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; background: #fffcf8; }
.order-built.vert, .order-pool.vert { flex-direction: column; align-items: stretch; }
.order-built.ok { border-color: var(--ok); background: var(--ok-bg); }
.order-built.bad { border-color: var(--bad); background: var(--bad-bg); }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; min-height: 20px; }
.token { background: #fff7ec; border: 3px solid #ffcfae; border-radius: 14px; padding: 8px 14px; font-size: 20px; font-weight: 700; box-shadow: 0 3px 0 #ffcfae; text-align: left; }
.token.in { background: #eaf4ff; border-color: #a9d0ff; box-shadow: 0 3px 0 #a9d0ff; }
.token .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 15px; margin-right: 8px; }
.ph { color: var(--muted); font-size: 16px; }
.actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* tap */
.tapline { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; line-height: 1.2; }
.tapw { font-size: 24px; font-weight: 700; padding: 6px 12px; border-radius: 12px; border: 3px solid transparent; background: #f8f4ef; }
.tapw.on { background: #ffe066; border-color: #f4b400; }
.tapw.ok { background: var(--ok-bg); border-color: var(--ok); }
.tapw.bad { background: var(--bad-bg); border-color: var(--bad); text-decoration: line-through; }
.tapw.miss { border-color: var(--ok); border-style: dashed; }
mark { background: #ffe066; border-radius: 5px; padding: 0 3px; }

/* classify */
.cls-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; min-height: 48px; align-items: center; }
.chip { background: #fff7ec; border: 3px solid #ffcfae; border-radius: 99px; padding: 6px 14px; font-size: 19px; font-weight: 700; box-shadow: 0 3px 0 #ffcfae; }
.chip.sel { background: #ffe066; border-color: #f4b400; transform: scale(1.08); box-shadow: 0 0 0 4px #fff3b0; }
.chip.ok { background: var(--ok-bg); border-color: var(--ok); box-shadow: none; }
.chip.bad { background: var(--bad-bg); border-color: var(--bad); box-shadow: none; }
.baskets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 520px) { .baskets { grid-template-columns: 1fr; } }
.basket { border-radius: 18px; padding: 10px; min-height: 110px; cursor: pointer; border: 3px dashed; }
.basket.b0 { background: #fff0ea; border-color: #ffb59e; }
.basket.b1 { background: #eaf4ff; border-color: #9fcaff; }
.basket.b2 { background: #eafaf2; border-color: #93dcb9; }
.bname { font-weight: 800; text-align: center; margin-bottom: 6px; }
.bwords { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bwords .chip { font-size: 17px; padding: 4px 10px; }

.hintwrap { margin-top: 16px; text-align: center; }
.hint-btn { font-weight: 800; color: #8d5c00; background: #fff3d6; border-radius: 99px; padding: 6px 16px; }
.hint { background: #fff8dc; border-radius: 14px; padding: 10px 14px; text-align: left; font-size: 17px; }

.toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -150%); z-index: 40;
  background: #2d2a4a; color: #fff; padding: 10px 18px; border-radius: 16px; font-weight: 700;
  transition: transform 0.25s; max-width: 92vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.shake { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  border-top: 4px solid; max-height: 70vh; overflow: auto;
}
.feedback.show { transform: none; }
.feedback.good { background: #e5f8ef; border-color: #9be3c4; }
.feedback.bad { background: #fde8ee; border-color: #f7b6c7; }
.fb-in { max-width: 760px; margin: 0 auto; }
.fb-row { display: flex; gap: 12px; align-items: flex-start; }
.fb-emo { font-size: 44px; line-height: 1; }
.fb-body { flex: 1; }
.fb-title { font-size: 24px; font-weight: 800; }
.good .fb-title { color: #137a55; }
.bad .fb-title { color: #b02a4d; }
.fb-ans { font-size: 19px; margin-top: 4px; }
.fb-ex { font-size: 17px; margin-top: 6px; background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 6px 10px; }
.ans-list { margin: 4px 0; padding-left: 22px; }
.big-next { width: 100%; margin-top: 12px; padding: 14px; font-size: 21px; }
.feedback.good .big-next { background: var(--ok); }
.feedback.bad .big-next { background: var(--bad); }

/* ---------- Result ---------- */
.res-card { background: #fff; border-radius: 28px; padding: 22px 18px; box-shadow: var(--shadow); text-align: center; }
.res-card.standalone { margin-top: 10px; }
.res-emo { font-size: 72px; line-height: 1.1; animation: pop 0.6s; }
@keyframes pop { 0% { transform: scale(0.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.res-card h1 { font-size: 26px; }
.score-ring {
  width: 150px; height: 150px; border-radius: 50%; margin: 14px auto; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #f3e8dc 0);
}
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring b { font-size: 46px; line-height: 1; }
.res-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.res-stars { font-size: 28px; font-weight: 800; color: #e09a00; margin-top: 10px; }
.new-sticker { margin-top: 10px; background: #fff3d6; border-radius: 16px; padding: 10px; font-weight: 700; }
.new-sticker span { font-size: 44px; display: inline-block; animation: pop 0.8s; vertical-align: middle; }
.rev-h { margin: 22px 4px 10px; }
.all-right { margin-top: 16px; background: var(--ok-bg); border-radius: 18px; padding: 14px; text-align: center; font-weight: 700; }
.reviews { display: grid; gap: 10px; }
.rev { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); border-left: 7px solid var(--bad); }
.rev.second { border-left-color: var(--mid); }
.rev-n { font-weight: 800; font-size: 16px; }
.rev-n small { color: var(--muted); font-weight: 600; }
.rev-p { font-size: 15px; color: var(--muted); }
.rev-q { font-size: 19px; font-weight: 700; margin: 4px 0; }
.rev-given { color: #b02a4d; }
.rev-ans { color: #137a55; font-weight: 700; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti span { position: absolute; top: -40px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- Read aloud ---------- */
.goal { background: #eafaf2; border-radius: 14px; padding: 8px 12px; font-size: 16px; }
.read-text { font-size: 25px; line-height: 1.75; margin: 14px 0 4px; padding: 14px 16px; background: #fffaf2; border-radius: 18px; border: 2.5px solid var(--line); }
.pz { color: var(--bad); font-weight: 800; }
.btn.recording { background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(239, 71, 111, 0.2); } }
.speed { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.speed div { background: #f3edff; border-radius: 16px; padding: 8px 18px; text-align: center; }
.speed b { font-size: 32px; display: block; line-height: 1.1; }
audio { width: 100%; max-width: 420px; }
.oq { border-top: 2px dashed var(--line); padding: 10px 0; }
.oq-q { font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; flex: none; }
.oq-a { background: #eafaf2; border-radius: 12px; padding: 8px 12px; margin-top: 6px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 18px; cursor: pointer; }
.ck input { width: 24px; height: 24px; accent-color: var(--ok); flex: none; margin-top: 2px; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; cursor: pointer; font-size: 16px; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 46px; height: 26px; border-radius: 99px; background: #e2d6ca; position: relative; flex: none; transition: background 0.2s; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { left: 23px; }
.toggle input:focus-visible + span { outline: 3px solid var(--sky); }
.checks { padding-left: 4px; list-style: none; margin: 10px 0; }
.checks li { padding: 4px 0; }

/* ---------- Dictation ---------- */
.dict-top { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 8px; }
.cd { font-weight: 800; background: #eaf4ff; border-radius: 10px; padding: 0 10px; }
.cd.late { background: var(--bad-bg); color: var(--bad); }
.dict-box { text-align: center; padding: 22px 10px; }
.dict-ear { font-size: 60px; animation: bob 2s infinite; }
.dict-text { font-size: 30px; font-weight: 800; margin: 8px 0; }
.dict-hidden { color: var(--muted); font-size: 20px; margin: 8px 0; }
.dict-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.tag { background: #fff3d6; border-radius: 99px; padding: 2px 12px; font-size: 16px; font-weight: 700; }
.model { background: #fffaf2; border: 2.5px solid var(--line); border-radius: 18px; padding: 14px 18px; font-size: 22px; line-height: 1.7; margin: 12px 0; }
.model-title { text-align: center; font-weight: 800; }
.model p { text-indent: 1.4em; margin: 6px 0 0; }
.errs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 420px; margin: 8px auto; }
.errb { background: #fff; border: 3px solid var(--line); border-radius: 14px; font-size: 22px; font-weight: 800; padding: 8px 0; box-shadow: 0 3px 0 var(--line); }
.errb:active { background: #ffe066; }

/* ---------- Writing ---------- */
.topic-card { display: flex; flex-direction: column; align-items: flex-start; position: relative; background: linear-gradient(135deg, #fff0ea, #fff8dc); }
.topic-card .say { position: absolute; right: 14px; top: 14px; }
.t-label { font-weight: 800; color: var(--accent); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.topic-card h2 { font-size: 24px; padding-right: 50px; }
.step h3 { display: flex; align-items: center; gap: 8px; }
.stepn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; }
.goiy { margin: 6px 0 10px; padding-left: 24px; }
.goiy li { padding: 2px 0; }
.wordbank { display: flex; flex-wrap: wrap; gap: 8px; }
.wordbank span { background: #eaf4ff; border-radius: 99px; padding: 3px 12px; font-weight: 700; color: #2a74c9; }
textarea { width: 100%; border: 3px solid var(--line); border-radius: 16px; padding: 12px; font-size: 20px; line-height: 1.6; resize: vertical; background: repeating-linear-gradient(#fff, #fff 31px, #f3e8dc 32px); }
textarea:focus, input:focus, select:focus { outline: 3px solid #ffd2bf; border-color: var(--accent); }
.autocheck { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 15px; font-weight: 700; }
.autocheck .ok { color: #137a55; background: var(--ok-bg); border-radius: 99px; padding: 2px 10px; }
.autocheck .no { color: #8d5c00; background: #fff3d6; border-radius: 99px; padding: 2px 10px; }
.wscore { font-size: 22px; text-align: center; margin-top: 8px; }
.wscore b { font-size: 34px; color: var(--accent); }
.sample summary { font-weight: 800; cursor: pointer; font-size: 19px; }
.sample-text { font-size: 20px; line-height: 1.7; text-indent: 1.4em; background: #fffaf2; border-radius: 14px; padding: 12px; }

/* ---------- Exam intro ---------- */
.exam-intro { text-align: center; --c: #7b61ff; }
.exam-intro .checks { text-align: left; max-width: 480px; margin: 12px auto; }

/* ---------- Stickers / progress ---------- */
.stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
@media (max-width: 420px) { .stickers { grid-template-columns: repeat(4, 1fr); } }
.stk { aspect-ratio: 1; display: grid; place-items: center; font-size: 34px; background: #f3ebe2; border-radius: 18px; filter: grayscale(1); opacity: 0.5; }
.stk.on { background: #fff; box-shadow: var(--shadow); filter: none; opacity: 1; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 680px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: #fff; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); text-align: center; }
.stats b { font-size: 30px; display: block; line-height: 1.1; }
.stats small { color: var(--muted); }
.days { display: flex; gap: 4px; align-items: flex-end; height: 110px; }
.day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.day i { width: 100%; background: #c8b8ff; border-radius: 6px 6px 2px 2px; min-height: 3px; }
.day.dl i { background: #ff9f1c; }
.day small { font-size: 12px; color: var(--muted); }
.prow { display: grid; grid-template-columns: 150px 1fr 48px; align-items: center; gap: 8px; padding: 4px 0; text-decoration: none; font-size: 16px; }
.prow .mbar { margin: 0; }
.prow b { text-align: right; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; gap: 8px; align-items: center; border-bottom: 2px dashed var(--line); padding: 6px 0; font-size: 16px; }
.hist li span { flex: 1; }
.hist small { color: var(--muted); }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; margin-bottom: 12px; }
.form input:not([type=checkbox]), .form select { border: 2.5px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 600; }
.form label.toggle { flex-direction: row; }
