* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --plum: #6a2c70;
  --coral: #f08a5d;
  --pink: #f9ed69;
  --deep: #b83b5e;
  --ink: #2b1b2e;
  --paper: #fff8f3;
}

body {
  font-family: 'Poppins', -apple-system, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

.tamil, .result-tamil, .card-tamil, #tamilInput { font-family: 'Noto Sans Tamil', 'Poppins', sans-serif; }

.topbar {
  background: linear-gradient(120deg, var(--plum), var(--deep));
  color: #fff;
  padding: 18px 20px;
}
.brand { display: flex; align-items: center; gap: 14px; max-width: 820px; margin: 0 auto; }
.logo { font-size: 40px; }
.logo-img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.15); flex-shrink: 0; }
.company { font-size: 1.4rem; font-weight: 700; letter-spacing: .3px; }
.company-tag { font-size: .8rem; opacity: .9; font-weight: 400; margin-top: 1px; }
.company-tag i { opacity: .95; }

main { max-width: 820px; margin: 0 auto; padding: 28px 20px 60px; }

.hero { text-align: center; margin-bottom: 32px; }
.app-name {
  font-family: 'Noto Sans Tamil','Poppins',sans-serif;
  font-size: 2.4rem; font-weight: 700; color: var(--plum); line-height: 1.1;
}
.app-sub {
  font-size: .95rem; color: var(--deep); font-weight: 600; margin-top: 4px;
  display: inline-block; background: #fdeef3; padding: 4px 14px; border-radius: 30px;
}
.app-sub b { color: var(--plum); }
.hero h2 { font-size: 1.6rem; font-weight: 700; margin-top: 18px; }
.hero h2 span { color: var(--deep); }
.hero p { color: #6b5b6e; margin-top: 8px; }

.translator {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10);
  margin-bottom: 36px;
}
.translator label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: 10px; }
.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
#tamilInput {
  flex: 1; min-width: 180px;
  padding: 14px 16px; font-size: 1.1rem;
  border: 2px solid #eadfe6; border-radius: 12px; outline: none;
}
#tamilInput:focus { border-color: var(--plum); }
#translateBtn {
  padding: 14px 22px; font-size: 1rem; font-weight: 600;
  background: var(--plum); color: #fff; border: none;
  border-radius: 12px; cursor: pointer; transition: transform .1s;
}
#translateBtn:active { transform: scale(.97); }

.result {
  margin-top: 22px; text-align: center;
  background: linear-gradient(135deg, #fff3e9, #fdeef3);
  border-radius: 16px; padding: 22px;
}
.result.hidden, .no-match.hidden { display: none; }
.result-tamil { font-size: 1.6rem; font-weight: 600; color: var(--plum); }
.result-arrow { font-size: 1.4rem; color: var(--coral); margin: 4px 0; }
.result-english { font-size: 1.9rem; font-weight: 700; color: var(--deep); }
.speak {
  margin-top: 16px; padding: 10px 20px; font-size: .95rem; font-weight: 600;
  background: var(--coral); color: #fff; border: none; border-radius: 30px; cursor: pointer;
}
.no-match { margin-top: 18px; text-align: center; color: var(--deep); font-weight: 500; }

/* ---- LEVELS / CURRICULUM ---- */
.levels { margin-bottom: 34px; }
.levels-head h3 { font-size: 1.4rem; text-align: center; }
.levels-head .deck-sub { text-align: center; max-width: 560px; margin: 8px auto 20px; }
.level-cards { display: grid; gap: 18px; }
.level-card {
  position: relative; background: #fff; border-radius: 20px; padding: 22px 22px 20px;
  border: 2px solid #f0e6ec; box-shadow: 0 8px 30px rgba(106,44,112,.10);
  border-left: 8px solid var(--coral);
}
.level-card[data-level="2"] { border-left-color: #48b16b; }
.level-card[data-level="3"] { border-left-color: var(--plum); }
.level-card.locked { opacity: .82; }
.level-badge {
  position: absolute; top: -14px; right: 18px; font-size: 2rem;
  background: #fff; border-radius: 50%; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(106,44,112,.15);
}
.level-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-right: 44px; }
.level-num { font-size: 1.15rem; font-weight: 700; color: var(--plum); }
.level-tam { font-size: .9rem; color: var(--coral); font-weight: 600; font-style: italic; margin-top: 2px; }
.level-status {
  font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 30px;
  background: #e7f8ec; color: #1f7a41; white-space: nowrap;
}
.level-status.locked-tag { background: #f0e6ec; color: #8a7a8e; }
.level-goal { font-size: .95rem; font-weight: 600; color: var(--ink); margin: 14px 0 12px; }
.level-pace {
  font-size: .82rem; color: #5a4a5e; background: #fff8f3;
  border: 1.5px dashed #eadfe6; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px;
}
.level-pace b { color: var(--deep); }
.level-list { list-style: none; margin: 0 0 14px; padding: 0; }
.level-list li { font-size: .88rem; color: #5a4a5e; padding: 6px 0 6px 22px; position: relative; line-height: 1.5; border-bottom: 1px solid #f6eef2; }
.level-list li:last-child { border-bottom: none; }
.level-list li::before { content: "▸"; position: absolute; left: 4px; color: var(--coral); font-weight: 700; }
.level-list li b { color: var(--plum); }
.level-win {
  font-size: .85rem; font-weight: 600; color: var(--deep);
  background: #fdeef3; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.level-prog-top { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; color: #6b5b6e; margin-bottom: 6px; }
.level-bar { height: 10px; background: #f0e6ec; border-radius: 30px; overflow: hidden; }
.level-fill { height: 100%; width: 0%; border-radius: 30px; background: linear-gradient(90deg, var(--coral), var(--deep)); transition: width .5s ease; }
.level-card[data-level="2"] .level-fill { background: linear-gradient(90deg, #6fdda0, #48b16b); }
.level-card[data-level="3"] .level-fill { background: linear-gradient(90deg, var(--coral), var(--plum)); }

/* ---- POINTS HUD ---- */
.pts-hud {
  background: linear-gradient(135deg, #fff3e9, #fdeef3);
  border: 2px solid #f0e6ec; border-radius: 16px; padding: 16px 18px; margin-bottom: 20px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.pts-name-row { flex: 1; min-width: 220px; }
.pts-name-row label { display: block; font-size: .82rem; font-weight: 600; color: var(--plum); margin-bottom: 6px; }
#studentName {
  width: 100%; padding: 11px 14px; font-size: .95rem; font-family: inherit;
  border: 2px solid #eadfe6; border-radius: 12px; outline: none; background: #fff;
}
#studentName:focus { border-color: var(--plum); }
.pts-total-row {
  display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 600; color: var(--ink);
  background: #fff; border-radius: 30px; padding: 10px 18px; box-shadow: 0 4px 14px rgba(106,44,112,.08);
}
.pts-total-row b { color: var(--deep); font-size: 1.15rem; }
.pts-star { font-size: 1.2rem; }

/* ---- CERTIFICATE BUTTON ---- */
.cert-btn {
  width: 100%; margin-top: 14px; padding: 12px 16px; font-size: .92rem; font-weight: 700; font-family: inherit;
  border-radius: 30px; cursor: pointer; transition: transform .1s, box-shadow .12s;
  background: linear-gradient(90deg, var(--coral), var(--deep)); color: #fff; border: none;
}
.cert-btn:active { transform: scale(.98); }
.cert-btn.locked {
  background: #f0e6ec; color: #8a7a8e; cursor: not-allowed; box-shadow: none;
}
.cert-btn.ready { animation: certglow 1.6s ease-in-out infinite; }
@keyframes certglow { 0%,100% { box-shadow: 0 0 0 0 rgba(240,138,93,.5);} 50% { box-shadow: 0 0 0 8px rgba(240,138,93,0);} }

/* ---- CEFR EXPLAINER ---- */
.cefr-explain {
  background: #fff; border: 2px solid #f0e6ec; border-radius: 16px;
  padding: 4px 18px; margin-bottom: 20px; box-shadow: 0 6px 22px rgba(106,44,112,.07);
}
.cefr-explain summary {
  cursor: pointer; font-weight: 700; color: var(--plum); font-size: .98rem;
  padding: 14px 0; list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.cefr-explain summary::-webkit-details-marker { display: none; }
.cefr-explain summary::after { content: "▸"; color: var(--coral); transition: transform .2s; font-size: 1.1rem; }
.cefr-explain[open] summary::after { transform: rotate(90deg); }
.cefr-explain-body { padding: 4px 0 18px; }
.cefr-explain-body p { font-size: .9rem; color: #5a4a5e; margin-bottom: 12px; line-height: 1.6; }
.cefr-explain-body b { color: var(--plum); }
.cefr-ladder { display: grid; gap: 10px; margin: 4px 0 16px; }
.cefr-rung {
  display: flex; align-items: center; gap: 12px; font-size: .88rem; color: #5a4a5e;
  background: #fff8f3; border-radius: 12px; padding: 12px 14px; border: 1.5px solid #f0e6ec;
}
.cefr-tag {
  font-size: .8rem; font-weight: 700; color: #fff; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.cefr-tag.a { background: #48b16b; }
.cefr-tag.b { background: var(--coral); }
.cefr-tag.c { background: var(--plum); }
.cefr-why-title { font-weight: 700; color: var(--deep) !important; margin-top: 4px; }
.cefr-why { list-style: none; padding: 0; margin: 0 0 12px; }
.cefr-why li { font-size: .88rem; color: #5a4a5e; padding: 7px 0; border-bottom: 1px solid #f6eef2; line-height: 1.5; }
.cefr-why li:last-child { border-bottom: none; }
.cefr-why li b { color: var(--plum); }
.cefr-foot {
  font-size: .88rem; color: #5a4a5e; background: #fdeef3; border-radius: 12px;
  padding: 14px; margin-bottom: 0 !important; line-height: 1.6;
}

/* ---- PERFECT-DAY STREAK ---- */
.perfect-streaks { display: flex; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.streak-pill.perfect { background: #fff3e9; border-color: #f5dccb; color: var(--deep); }
.perfect-note { text-align: center; font-size: .82rem; color: #8a7a8e; max-width: 480px; margin: 0 auto 8px; line-height: 1.5; }
.perfect-note b { color: var(--plum); }

/* ---- BEFORE / AFTER VOICE RECORDER ---- */
.voice {
  background: #fff; border-radius: 20px; padding: 24px; margin-bottom: 32px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); border: 2px solid #f0e6ec;
}
.voice-label { font-size: 1.15rem; font-weight: 700; color: var(--plum); margin-bottom: 8px; }
.voice-intro { color: #6b5b6e; font-size: .92rem; margin-bottom: 18px; }
.passage {
  background: linear-gradient(135deg, #fff3e9, #fdeef3);
  border-radius: 16px; padding: 20px; margin-bottom: 18px;
}
.passage-lang { font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--deep); }
.passage p { font-size: 1.15rem; line-height: 1.7; margin: 10px 0 14px; color: var(--ink); }
.voice-hear, .voice-new {
  padding: 9px 18px; font-size: .88rem; font-weight: 600; font-family: inherit;
  border-radius: 30px; cursor: pointer; margin: 4px 6px 0 0; transition: transform .1s;
}
.voice-hear { background: var(--plum); color: #fff; border: none; }
.voice-new { background: #fff; color: var(--plum); border: 2px solid #eadfe6; }
.voice-hear:active, .voice-new:active { transform: scale(.97); }
.rec-box { text-align: center; }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rec-btn {
  padding: 14px 26px; font-size: 1rem; font-weight: 700; font-family: inherit;
  background: var(--deep); color: #fff; border: none; border-radius: 30px; cursor: pointer; transition: transform .1s;
}
.rec-btn:active { transform: scale(.97); }
.rec-btn.recording { background: #c0293f; animation: recpulse 1.1s infinite; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,41,63,.5);} 50% { box-shadow: 0 0 0 10px rgba(192,41,63,0);} }
.rec-timer { font-size: 1.1rem; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; }
.rec-timer.hidden { display: none; }
.rec-hint { margin-top: 12px; font-size: .88rem; color: #6b5b6e; }
.before-wrap { margin-top: 20px; background: #fff8f3; border: 2px dashed #eadfe6; border-radius: 16px; padding: 18px; }
.before-wrap.hidden { display: none; }
.before-label { font-weight: 700; color: var(--plum); margin-bottom: 10px; }
.before-wrap audio { width: 100%; }
.before-actions { margin-top: 12px; }
.after-note {
  margin-top: 14px; font-size: .88rem; line-height: 1.6; color: #6b5b6e;
  background: #fdeef3; border-radius: 12px; padding: 14px;
}

/* ---- BEFORE vs AFTER COMPARE ---- */
.compare {
  background: #fff; border-radius: 20px; padding: 24px; margin-bottom: 32px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); border: 2px solid #f0e6ec;
}
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.cmp-col {
  border-radius: 16px; padding: 18px; text-align: center;
  border: 2px dashed #eadfe6; background: #fff8f3;
}
.cmp-after { background: #fdeef3; border-color: #f3cfdc; }
.cmp-title { font-weight: 700; margin-bottom: 12px; color: var(--plum); }
.cmp-after .cmp-title { color: var(--deep); }
.cmp-load {
  display: inline-block; padding: 10px 18px; font-size: .88rem; font-weight: 600;
  background: var(--plum); color: #fff; border-radius: 30px; cursor: pointer; transition: transform .1s;
}
.cmp-after .cmp-load { background: var(--deep); }
.cmp-load:active { transform: scale(.97); }
.cmp-col audio { width: 100%; margin-top: 14px; }
.cmp-col audio.hidden { display: none; }
.cmp-name { font-size: .78rem; color: #6b5b6e; margin-top: 8px; word-break: break-all; }
.cmp-playboth {
  display: block; width: 100%; padding: 14px; font-size: 1rem; font-weight: 700; font-family: inherit;
  background: linear-gradient(90deg, var(--coral), var(--deep)); color: #fff;
  border: none; border-radius: 30px; cursor: pointer; transition: transform .1s;
}
.cmp-playboth:active { transform: scale(.97); }
.cmp-playboth.hidden { display: none; }
.cmp-hint { margin-top: 12px; font-size: .85rem; color: #6b5b6e; text-align: center; }
.cmp-caption { margin: 16px 0; text-align: center; }
.cmp-caption label { display: block; font-size: .82rem; font-weight: 600; color: var(--plum); margin-bottom: 8px; }
#cmpCaptionInput {
  width: 100%; max-width: 420px; padding: 12px 16px; font-size: .95rem; font-family: inherit;
  border: 2px solid #eadfe6; border-radius: 12px; outline: none; text-align: center;
}
#cmpCaptionInput:focus { border-color: var(--plum); }
.cmp-caption-preview {
  margin: 14px auto 0; max-width: 480px; padding: 14px 18px;
  background: linear-gradient(120deg, var(--plum), var(--deep)); color: #fff;
  font-size: 1.05rem; font-weight: 700; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(106,44,112,.22);
}

/* ---- WORD OF THE DAY ---- */
.wotd {
  background: linear-gradient(135deg, var(--plum), var(--deep));
  color: #fff; border-radius: 20px; padding: 20px 22px; margin-bottom: 32px;
  text-align: center; box-shadow: 0 8px 30px rgba(106,44,112,.18);
}
.wotd-label { font-size: .8rem; font-weight: 700; letter-spacing: .5px; opacity: .92; margin-bottom: 10px; }
.wotd-body { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.wotd-tamil { font-family: 'Noto Sans Tamil','Poppins',sans-serif; font-size: 1.6rem; font-weight: 600; }
.wotd-arrow { font-size: 1.3rem; color: var(--pink); }
.wotd-english { font-size: 1.5rem; font-weight: 700; color: var(--pink); }
.wotd-speak {
  margin-top: 14px; padding: 9px 20px; font-size: .9rem; font-weight: 600; font-family: inherit;
  background: rgba(255,255,255,.18); color: #fff; border: 2px solid rgba(255,255,255,.4);
  border-radius: 30px; cursor: pointer; transition: background .12s;
}
.wotd-speak:hover { background: rgba(255,255,255,.3); }

/* ---- GOAL / PROGRESS BAR ---- */
.goal { margin: 14px 0 4px; }
.goal-top { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: #6b5b6e; margin-bottom: 6px; }
.goal-top b { color: var(--plum); }
.goal-bar { height: 12px; background: #f0e6ec; border-radius: 30px; overflow: hidden; }
.goal-fill { height: 100%; width: 0%; border-radius: 30px; background: linear-gradient(90deg, var(--coral), var(--deep)); transition: width .4s ease; }
.goal-fill.gold { background: linear-gradient(90deg, #f9ed69, #f0b429, #e8a200); box-shadow: 0 0 12px rgba(240,180,41,.7); }

/* ---- CONFETTI ---- */
.confetti {
  position: fixed; top: -12px; width: 10px; height: 14px; z-index: 999;
  border-radius: 2px; opacity: .95; pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-12px) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 1; }
}
.goal-msg { margin-top: 8px; font-size: .85rem; font-weight: 600; color: #1f7a41; min-height: 18px; }
.share-btn {
  margin-top: 10px; padding: 11px 22px; font-size: .95rem; font-weight: 600; font-family: inherit;
  background: linear-gradient(90deg, var(--coral), var(--deep)); color: #fff;
  border: none; border-radius: 30px; cursor: pointer; transition: transform .1s;
}
.share-btn:active { transform: scale(.97); }
.share-btn.hidden { display: none; }

/* ---- QUIZ ---- */
.quiz { margin-bottom: 40px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.quiz-head h3 { font-size: 1.3rem; }
.streaks { display: flex; gap: 8px; }
.streak-pill {
  background: #fff3e9; color: var(--deep); font-weight: 600; font-size: .85rem;
  padding: 6px 12px; border-radius: 30px; border: 2px solid #f5dccb;
}
.streak-pill.best { background: #fdeef3; border-color: #f3cfdc; }
.streak-pill b { color: var(--plum); }
.quiz-card {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); margin-top: 14px; text-align: center;
}
.quiz-tamil {
  font-family: 'Noto Sans Tamil','Poppins',sans-serif;
  font-size: 1.8rem; font-weight: 600; color: var(--plum); margin-bottom: 18px;
}
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-opt {
  padding: 14px; font-size: 1rem; font-weight: 500; font-family: inherit;
  background: #fff8f3; color: var(--ink); border: 2px solid #eadfe6;
  border-radius: 12px; cursor: pointer; transition: transform .1s, border-color .1s;
}
.quiz-opt:hover { border-color: var(--coral); transform: translateY(-2px); }
.quiz-opt.correct { background: #e7f8ec; border-color: #48b16b; color: #1f7a41; }
.quiz-opt.wrong { background: #fdecee; border-color: var(--deep); color: var(--deep); }
.quiz-opt.dim { opacity: .45; }
.quiz-feedback { margin-top: 16px; font-weight: 600; min-height: 22px; }
.quiz-feedback.good { color: #1f7a41; }
.quiz-feedback.bad { color: var(--deep); }
.quiz-next {
  margin-top: 14px; padding: 12px 24px; font-size: 1rem; font-weight: 600;
  background: var(--plum); color: #fff; border: none; border-radius: 30px; cursor: pointer;
}
.quiz-next.hidden { display: none; }

/* ---- REVERSE THE MOTHER TONGUE ---- */
.reverse { margin-bottom: 40px; }
.reverse h3 { font-size: 1.3rem; }
.rev-card {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); text-align: center;
}
.rev-mt-label { font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--deep); margin-bottom: 8px; }
.rev-mt {
  font-size: 1.2rem; font-weight: 600; color: var(--plum); line-height: 1.5;
  background: #fff3e9; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.rev-mt .rev-ta { font-family: 'Noto Sans Tamil','Poppins',sans-serif; display: block; font-size: 1.35rem; margin-bottom: 4px; }
.rev-mt .rev-gloss { font-size: .85rem; color: #8a6a5e; font-style: italic; font-weight: 500; }
.rev-hint-order { font-size: .82rem; font-weight: 600; color: #6b5b6e; margin-bottom: 12px; }
.rev-build {
  min-height: 58px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
  background: #fff8f3; border: 2px dashed #eadfe6; border-radius: 14px; padding: 12px; margin-bottom: 16px;
}
.rev-build:empty::before { content: "Tap words below to build your sentence…"; color: #b7a7bb; font-size: .9rem; font-weight: 500; }
.rev-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 8px; }
.rev-chip {
  padding: 11px 18px; font-size: 1rem; font-weight: 600; font-family: inherit;
  background: #fff; color: var(--plum); border: 2px solid #eadfe6;
  border-radius: 30px; cursor: pointer; transition: transform .1s, border-color .1s, opacity .1s;
}
.rev-chip:hover { border-color: var(--coral); transform: translateY(-2px); }
.rev-chip.used { opacity: .3; pointer-events: none; }
.rev-chip.placed { background: var(--plum); color: #fff; border-color: var(--plum); }
.rev-build .rev-chip { cursor: pointer; }
.rev-feedback { margin-top: 6px; font-weight: 600; min-height: 22px; }
.rev-feedback.good { color: #1f7a41; }
.rev-feedback.bad { color: var(--deep); }
.rev-feedback .rev-fix { display: block; margin-top: 6px; font-size: .9rem; color: #6b5b6e; font-weight: 500; }
.rev-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

/* ---- SPOT THE MISTAKE ---- */
.spot { margin-bottom: 40px; }
.spot h3 { font-size: 1.3rem; }
.spot-card {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); text-align: center;
}
.spot-sentence {
  font-size: 1.35rem; font-weight: 600; color: var(--ink);
  background: #fff8f3; border: 2px dashed #eadfe6; border-radius: 14px;
  padding: 20px; margin-bottom: 18px; line-height: 1.4;
}
.spot-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spot-btn {
  padding: 14px; font-size: 1.05rem; font-weight: 700; font-family: inherit;
  border: 2px solid #eadfe6; border-radius: 12px; cursor: pointer; transition: transform .1s, border-color .1s;
}
.spot-btn.ok { background: #e7f8ec; color: #1f7a41; border-color: #bfe6cc; }
.spot-btn.no { background: #fdecee; color: var(--deep); border-color: #f3cfdc; }
.spot-btn:hover { transform: translateY(-2px); }
.spot-btn.dim { opacity: .4; }
.spot-feedback { margin-top: 16px; font-weight: 600; min-height: 22px; }
.spot-feedback.good { color: #1f7a41; }
.spot-feedback.bad { color: var(--deep); }
.spot-fix { display: block; margin-top: 6px; font-size: .9rem; color: #6b5b6e; font-weight: 500; }

/* ---- COMMON MISTAKES ---- */
.mistakes { margin-bottom: 40px; }
.mistakes h3 { font-size: 1.3rem; }
.mistake-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mistake-card {
  background: #fff; border-radius: 16px; padding: 18px;
  border: 2px solid #f0e6ec; box-shadow: 0 6px 22px rgba(106,44,112,.07);
}
.mis-wrong { font-weight: 600; color: var(--deep); text-decoration: line-through; text-decoration-color: rgba(184,59,94,.5); margin-bottom: 8px; }
.mis-right { font-weight: 700; color: #1f7a41; margin-bottom: 8px; }
.mis-x, .mis-tick { text-decoration: none; display: inline-block; margin-right: 4px; }
.mis-why { font-size: .85rem; color: #6b5b6e; margin-bottom: 12px; }
.mis-speak {
  padding: 8px 16px; font-size: .85rem; font-weight: 600; font-family: inherit;
  background: var(--coral); color: #fff; border: none; border-radius: 30px; cursor: pointer;
}

.deck h3 { font-size: 1.3rem; }
.deck-sub { color: #6b5b6e; margin-bottom: 16px; font-size: .9rem; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-tab {
  padding: 8px 16px; font-size: .9rem; font-weight: 600; font-family: inherit;
  background: #fff; color: var(--plum); border: 2px solid #eadfe6;
  border-radius: 30px; cursor: pointer; transition: all .12s;
}
.cat-tab:hover { border-color: var(--coral); }
.cat-tab.active { background: var(--plum); color: #fff; border-color: var(--plum); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card {
  background: #fff; border-radius: 14px; padding: 16px; cursor: pointer;
  border: 2px solid #f0e6ec; transition: transform .12s, border-color .12s;
  text-align: center;
}
.card:hover { transform: translateY(-3px); border-color: var(--coral); }
.card-tamil { font-size: 1.25rem; font-weight: 600; color: var(--plum); }
.card-english { font-size: 1rem; color: var(--deep); margin-top: 4px; }

/* ---- 5 SKILLS A DAY ---- */
.skills5 { margin-bottom: 34px; }
.skills5-head h3 { font-size: 1.4rem; text-align: center; }
.skills5-head .deck-sub { text-align: center; max-width: 580px; margin: 8px auto 18px; }
.skills5-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.s5-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 15px; font-size: .9rem; font-weight: 600; font-family: inherit;
  background: #fff; color: var(--plum); border: 2px solid #eadfe6;
  border-radius: 30px; cursor: pointer; transition: all .12s; position: relative;
}
.s5-tab:hover { border-color: var(--coral); }
.s5-tab.active { background: var(--plum); color: #fff; border-color: var(--plum); }
.s5-tab.done { border-color: #48b16b; }
.s5-tab.done::after { content: "✓"; position: absolute; top: -6px; right: -4px; background: #48b16b; color: #fff; font-size: .6rem; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.s5-tab.active.done::after { background: #48b16b; }

.skill-panel {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 8px 30px rgba(106,44,112,.10); border: 2px solid #f0e6ec;
}
.skill-title { font-size: 1.15rem; font-weight: 700; color: var(--plum); margin-bottom: 4px; }
.skill-sub { font-size: .85rem; color: #6b5b6e; margin-bottom: 16px; }
.skill-img {
  width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(106,44,112,.14);
}
.skill-passage {
  font-size: 1.1rem; line-height: 1.7; color: var(--ink);
  background: linear-gradient(135deg, #fff3e9, #fdeef3); border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.skill-prompt { font-size: 1rem; font-weight: 600; color: var(--deep); margin-bottom: 12px; }
.skill-hint { font-size: .82rem; color: #8a7a8e; margin-top: 8px; }
.skill-write {
  width: 100%; min-height: 100px; padding: 14px 16px; font-size: 1rem; font-family: inherit;
  border: 2px solid #eadfe6; border-radius: 12px; outline: none; resize: vertical; margin-bottom: 12px;
}
.skill-write:focus { border-color: var(--plum); }
.skill-listen-input {
  width: 100%; padding: 14px 16px; font-size: 1rem; font-family: inherit;
  border: 2px solid #eadfe6; border-radius: 12px; outline: none; margin: 12px 0;
}
.skill-listen-input:focus { border-color: var(--plum); }
.skill-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.skill-btn {
  padding: 11px 20px; font-size: .92rem; font-weight: 700; font-family: inherit;
  border: none; border-radius: 30px; cursor: pointer; transition: transform .1s;
  background: linear-gradient(90deg, var(--coral), var(--deep)); color: #fff;
}
.skill-btn:active { transform: scale(.97); }
.skill-btn.ghost { background: #fff; color: var(--plum); border: 2px solid #eadfe6; }
.skill-feedback { margin-top: 14px; font-weight: 600; min-height: 22px; }
.skill-feedback.good { color: #1f7a41; }
.skill-feedback.bad { color: var(--deep); }
.skill-feedback .skill-fix { display: block; margin-top: 4px; font-size: .9rem; color: #6b5b6e; font-weight: 500; }
.skill-done-badge {
  display: inline-block; margin-top: 12px; font-size: .82rem; font-weight: 700; color: #1f7a41;
  background: #e7f8ec; border: 2px solid #bfe6cc; border-radius: 30px; padding: 6px 14px;
}
.skills5-progress { text-align: center; margin-top: 18px; }
.s5-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.s5-dot { width: 14px; height: 14px; border-radius: 50%; background: #f0e6ec; border: 2px solid #eadfe6; transition: all .2s; }
.s5-dot.done { background: #48b16b; border-color: #48b16b; box-shadow: 0 0 8px rgba(72,177,107,.5); }
.s5-msg { font-size: .88rem; font-weight: 600; color: #6b5b6e; }
.s5-msg.all-done { color: #1f7a41; }
.skill-rec-audio { width: 100%; margin-top: 12px; }
.skill-rec-audio.hidden { display: none; }

/* ---- PRINT BUTTON ---- */
.print-btn {
  margin-top: 18px; padding: 11px 22px; font-size: .95rem; font-weight: 600; font-family: inherit;
  background: #fff; color: var(--plum); border: 2px solid var(--plum);
  border-radius: 30px; cursor: pointer; transition: transform .1s, background .12s;
}
.print-btn:hover { background: var(--plum); color: #fff; }
.print-btn:active { transform: scale(.97); }

/* ---- PRINTABLE CERTIFICATE ---- */
.cert-sheet { display: none; }

/* On-screen certificate preview (overlay) */
body.previewing-cert { overflow: hidden; }
body.previewing-cert .cert-sheet {
  display: flex !important; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(43,27,46,.72); padding: 20px; overflow-y: auto;
}
body.previewing-cert .cert-frame {
  background: #fff; max-width: 620px; width: 100%; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.cert-watermark {
  display: none; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-size: 4.5rem; font-weight: 800; letter-spacing: 8px;
  color: rgba(184,59,94,.16); pointer-events: none; z-index: 5; white-space: nowrap;
}
.cert-close {
  position: fixed; top: 16px; right: 20px; z-index: 1001;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: var(--deep); font-size: 1.4rem; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); display: none;
}
body.previewing-cert .cert-close { display: block; }

/* Save-as-PDF button inside the preview */
.cert-pdf-btn {
  position: fixed; top: 16px; left: 20px; z-index: 1001; display: none;
  padding: 11px 20px; border-radius: 30px; border: none; cursor: pointer;
  background: linear-gradient(90deg, var(--coral), var(--deep)); color: #fff;
  font-size: .9rem; font-weight: 700; font-family: inherit;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
body.previewing-cert .cert-pdf-btn { display: block; }

/* Preview button under each level card */
.cert-preview-btn {
  width: 100%; margin-top: 8px; padding: 10px 16px; font-size: .85rem; font-weight: 600; font-family: inherit;
  background: #fff; color: var(--plum); border: 2px solid #eadfe6;
  border-radius: 30px; cursor: pointer; transition: transform .1s, border-color .12s;
}
.cert-preview-btn:hover { border-color: var(--coral); }
.cert-preview-btn:active { transform: scale(.98); }
.cert-frame {
  border: 3px solid var(--plum); border-radius: 14px; padding: 10px;
}
.cert-inner {
  border: 2px solid var(--coral); border-radius: 10px; text-align: center;
  padding: 34px 30px; background: #fff;
}
.cert-logo { display: block; margin: 0 auto 8px; object-fit: contain; }
.cert-company { font-size: 1.5rem; font-weight: 700; color: var(--plum); }
.cert-tag { font-size: .9rem; color: var(--coral); margin-bottom: 18px; }
.cert-title { font-size: 2rem; font-weight: 700; color: var(--deep); letter-spacing: 1px; text-transform: uppercase; }
.cert-course { font-size: .95rem; font-weight: 600; color: var(--plum); margin-top: 4px; }
.cert-preline { font-size: .9rem; color: #666; margin-top: 24px; }
.cert-name {
  font-family: 'Noto Sans Tamil','Poppins',sans-serif;
  font-size: 2.2rem; font-weight: 700; color: var(--ink); margin: 8px 0;
  border-bottom: 2px dashed #e0cdd8; display: inline-block; padding: 0 24px 6px;
}
.cert-body { font-size: .95rem; color: #666; margin-top: 18px; }
.cert-level { font-size: 1.35rem; font-weight: 700; color: var(--plum); margin: 6px 0 2px; }
.cert-cefr { font-size: .82rem; font-weight: 700; color: #fff; background: var(--coral); display: inline-block; padding: 4px 12px; border-radius: 30px; margin-bottom: 8px; letter-spacing: .3px; }
.cert-desc { font-size: .9rem; color: #555; max-width: 420px; margin: 0 auto; }
.cert-cando-label { font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--coral); margin-top: 18px; }
.cert-cando { font-size: .9rem; color: #444; font-style: italic; max-width: 460px; margin: 4px auto 0; line-height: 1.5; }
.cert-foot { display: flex; justify-content: space-around; align-items: flex-end; margin-top: 40px; gap: 16px; }
.cert-foot-col { text-align: center; }
.cert-foot-val { font-size: 1.1rem; font-weight: 700; color: var(--deep); }
.cert-foot-sign { font-size: 1.15rem; font-weight: 700; color: var(--plum); font-style: italic; border-bottom: 1.5px solid #333; padding-bottom: 2px; }
.cert-foot-lbl { font-size: .72rem; color: #888; margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; }

/* ---- PRINTABLE WEEKLY SHEET ---- */
.print-sheet { display: none; }
.ps-head { text-align: center; border-bottom: 3px solid var(--plum); padding-bottom: 12px; margin-bottom: 20px; }
.ps-brand { font-size: 1.8rem; font-weight: 700; color: var(--plum); font-family: 'Noto Sans Tamil','Poppins',sans-serif; }
.ps-sub { font-size: .95rem; color: #555; margin-top: 4px; }
.ps-date { font-size: .85rem; color: #888; margin-top: 4px; }
.ps-title { font-size: 1.25rem; color: var(--deep); margin: 22px 0 12px; }
.ps-table { width: 100%; border-collapse: collapse; }
.ps-table tr { border-bottom: 1px solid #ddd; }
.ps-table td { padding: 12px 8px; font-size: 1.1rem; vertical-align: middle; }
.ps-table .ps-ta { font-family: 'Noto Sans Tamil','Poppins',sans-serif; font-weight: 600; color: var(--plum); width: 45%; }
.ps-table .ps-ar { color: var(--coral); text-align: center; width: 10%; }
.ps-table .ps-en { font-weight: 600; color: #222; }
.ps-mistakes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ps-m { border: 1.5px solid #ccc; border-radius: 10px; padding: 12px; }
.ps-m-wrong { color: var(--deep); text-decoration: line-through; font-weight: 600; margin-bottom: 4px; }
.ps-m-right { color: #1f7a41; font-weight: 700; margin-bottom: 4px; }
.ps-m-why { font-size: .85rem; color: #555; }
.ps-foot { text-align: center; margin-top: 26px; padding-top: 12px; border-top: 2px dashed #bbb; font-size: .85rem; color: #666; }

@media print {
  .topbar, main, footer { display: none !important; }
  body { background: #fff; }
  /* Default print = the weekly sheet */
  .print-sheet { display: block !important; padding: 10px; }
  .cert-sheet { display: none !important; }
  .ps-mistakes { break-inside: avoid; }

  /* When printing a certificate, show ONLY the certificate */
  body.printing-cert .print-sheet { display: none !important; }
  body.printing-cert .cert-sheet { display: block !important; padding: 10px; }
  /* Never print the control buttons */
  .cert-close, .cert-pdf-btn { display: none !important; }
}

footer { text-align: center; padding: 24px; color: #6b5b6e; font-size: .85rem; }
footer strong { color: var(--deep); }

@media (max-width: 480px) {
  .hero h2 { font-size: 1.6rem; }
  .result-english { font-size: 1.6rem; }
}
