/* ============ Teacher Mitra — styles ============ */
:root {
  --bg: #fdf4f8;
  --surface: #ffffff;
  --surface-2: #fef8fb;
  --ink: #1c2433;
  --ink-soft: #7a5a6e;
  --line: #f0d6e8;
  --primary: #e0457b;
  --primary-dark: #c23066;
  --primary-soft: #fce7f3;
  --green: #1f9d57;
  --green-soft: #e3f5ea;
  --red: #d33a3a;
  --red-soft: #fbe6e6;
  --purple: #7b3fdb;
  --purple-soft: #efe6fb;
  --amber: #d98a00;
  --amber-soft: #fbf0d6;
  --grey: #9aa4b5;
  --shadow: 0 1px 3px rgba(80, 20, 50, 0.06), 0 6px 18px rgba(80, 20, 50, 0.07);
  --radius: 16px;
  --radius-sm: 999px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.25; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary); }

/* ---------- top bar ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #e0457b, #f472b6); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(224, 69, 123, 0.32);
}
.brand .logo-img {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(224, 69, 123, 0.28);
}
.brand small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(224,69,123,.28); }
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(224,69,123,.38); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* language toggle pill */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.seg button.active { background: var(--primary); color: #fff; }

/* ---------- generic view container ---------- */
#view { flex: 1; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 26px 20px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-soft); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.pill.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* ---------- dashboard ---------- */
.hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; }
.hero .card { padding: 22px; flex: 1; min-width: 280px; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.test-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.test-card h3 { font-size: 16px; }
.test-card .meta { font-size: 13px; color: var(--ink-soft); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 28px 0 12px; font-weight: 700; display: flex; align-items: center; gap: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 10px; }

.attempt-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.attempt-row:last-child { border-bottom: 0; }
.attempt-score { font-weight: 800; font-size: 18px; min-width: 70px; }

/* ---------- instructions ---------- */
.instructions .card { padding: 26px; max-width: 760px; margin: 0 auto; }
.instructions ul { padding-left: 20px; }
.instructions li { margin: 6px 0; }
.intro-subtitle { margin: 6px 0 4px; color: var(--ink); font-weight: 700; }
.language-select {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.language-select h3 { margin: 0 0 4px; }
.language-select p { margin: 0; font-size: 13px; }
.language-choice-row { display: inline-grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 6px; margin-top: 10px; }
.language-choice {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  text-align: center;
  min-height: 38px;
  font-size: 14px;
  font-weight: 700;
}
.language-choice.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(224,69,123,.12);
}
.legend-inline { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.swatch { width: 22px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }

/* ============ EXAM ENGINE ============ */
.exam { display: flex; flex-direction: column; height: calc(100vh - 0px); }
.exam-header {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.exam-title { font-weight: 700; }
.timer {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px;
  background: var(--surface-2); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px;
}
.timer.warn { background: var(--red-soft); border-color: var(--red); color: var(--red); animation: pulse 1s infinite; }
.finish-test-btn { flex: none; }
@keyframes pulse { 50% { opacity: .6; } }

.section-tabs { display: flex; gap: 4px; padding: 8px 18px 0; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.section-tabs button {
  border: 1px solid var(--line); border-bottom: none; background: var(--surface-2);
  padding: 8px 14px; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.section-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.exam-body { flex: 1; display: grid; grid-template-columns: 1fr 320px; overflow: hidden; }
.q-pane { padding: 22px 26px; overflow-y: auto; }
.q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.q-num { font-weight: 800; font-size: 17px; }
.q-tags { margin-left: auto; display: flex; gap: 6px; }
.q-stem { font-size: 17px; font-weight: 600; margin-bottom: 18px; white-space: pre-wrap; }
.question-media-stack { display: grid; gap: 14px; max-width: 720px; margin-bottom: 18px; }
.match-columns {
  max-width: 720px;
  margin: -4px 0 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.question-media-stack .match-columns,
.question-media-stack .question-chart,
.question-media-stack .question-image { margin: 0; }
.question-image {
  max-width: min(100%, 620px);
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(143, 57, 94, .08);
}
.question-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.question-image figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.match-column {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.match-column-title { margin-bottom: 10px; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.match-column-list { display: grid; gap: 8px; }
.match-column-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 14px; font-weight: 650; line-height: 1.35; }
.match-column-key { color: var(--primary); font-weight: 800; white-space: nowrap; }
.match-column-text { min-width: 0; }
.question-chart {
  max-width: 720px;
  margin: -4px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.question-chart-title { margin-bottom: 12px; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.pie-chart-wrap { display: flex; align-items: center; gap: 18px; }
.pie-chart {
  width: 144px;
  aspect-ratio: 1;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.08);
}
.pie-chart-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 9px 14px;
  flex: 1;
  min-width: 0;
}
.pie-chart-item { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 700; }
.pie-chart-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.options { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--surface); transition: border-color .12s, background .12s; text-align: left; width: 100%;
}
.option:hover { border-color: var(--primary); background: var(--primary-soft); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option .key {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.option.selected .key { background: var(--primary); color: #fff; border-color: var(--primary); }
.option .txt { padding-top: 2px; }

.q-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* palette */
.palette { border-left: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; overflow: hidden; }
.palette-legend { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; font-size: 12px; }
.palette-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.dot { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid var(--line); }
.dot.answered { background: var(--green); border-color: var(--green); }
.dot.notans { background: var(--red); border-color: var(--red); }
.dot.notvisited { background: var(--surface); }
.dot.marked { background: var(--purple); border-color: var(--purple); }
.dot.ansmarked { background: var(--purple); border-color: var(--purple); position: relative; }
.dot.ansmarked::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }

.palette-grid { padding: 14px; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start; }
.pcell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font-weight: 700; font-size: 13px; color: var(--ink); display: grid; place-items: center; position: relative;
}
.pcell.answered { background: var(--green); border-color: var(--green); color: #fff; }
.pcell.notans { background: var(--red); border-color: var(--red); color: #fff; }
.pcell.marked { background: var(--purple); border-color: var(--purple); color: #fff; }
.pcell.ansmarked { background: var(--purple); border-color: var(--purple); color: #fff; }
.pcell.ansmarked::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.pcell.current { outline: 3px solid var(--primary); outline-offset: 1px; }
.palette-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.palette-section-label { grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 6px 0 2px; }

/* ============ RESULT ============ */
.result-hero { padding: 28px; text-align: center; margin-bottom: 18px; }
.verdict { font-size: 28px; font-weight: 800; }
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }
.big-score { font-size: 46px; font-weight: 800; margin: 4px 0; }
.result-insight { margin-top: 10px; font-weight: 600; font-size: 14px; color: var(--ink); background: var(--amber-soft); border-radius: 10px; padding: 8px 14px; display: inline-block; }
.level-check-note { margin: -6px 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.75); color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 18px; }
.result-actions .btn { min-width: 200px; padding: 12px 22px; font-size: 15px; }
.result-links { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.result-link-dot { color: var(--ink-soft); }
.text-link { background: none; border: 0; padding: 4px 2px; color: var(--primary); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.rev-report { margin-top: 10px; text-align: right; }
.rev-report .text-link { color: var(--ink-soft); font-weight: 500; font-size: 12px; }

/* ===== CTET community banner (result page) ===== */
.tm-community-banner { position: relative; width: 100%; max-width: 900px; margin: 0 auto 18px; background: rgba(255,218,218,0.2); border: 1px solid rgba(229,189,190,0.35); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(225,29,72,0.05); }
.tm-community-banner .cb-content { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 26px 18px; position: relative; z-index: 1; }
.tm-community-banner .cb-dismiss { position: absolute; top: 14px; right: 14px; z-index: 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); background: rgba(255,255,255,0.6); border: none; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px); transition: color .15s; }
.tm-community-banner .cb-dismiss:hover { color: var(--primary); }
.tm-community-banner .cb-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(224,69,123,0.1); color: var(--primary-dark); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tm-community-banner .cb-headline { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.tm-community-banner .cb-headline h2 { margin: 0; font-size: clamp(25px, 6.5vw, 34px); line-height: 1.24; font-weight: 800; letter-spacing: -0.02em; }
.tm-community-banner .cb-ink { color: var(--ink); }
.tm-community-banner .cb-rose { color: var(--primary); background: linear-gradient(to right, #e0457b, #fd8a42); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tm-community-banner .cb-sub { max-width: 420px; text-align: center; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.tm-community-banner .cb-chat-wrap { position: relative; width: 100%; display: flex; justify-content: center; padding: 8px 0; }
.tm-community-banner .cb-chat-glow { position: absolute; inset: 0; background: rgba(224,69,123,0.2); filter: blur(40px); border-radius: 50%; transform: scale(1.1); z-index: 0; }
.tm-community-banner .cb-chat-card { position: relative; z-index: 1; width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 12px; padding: 16px; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border: 1px solid #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(224,69,123,0.1); transform: rotate(1deg); }
.tm-community-banner .cb-bubble { width: 100%; align-self: flex-end; padding: 12px; background: #e7ffdb; border: 1px solid #d4f4c5; border-radius: 10px 2px 10px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tm-community-banner .cb-bubble p { margin: 0 0 4px; padding-right: 16px; font-size: 14px; color: #075e54; }
.tm-community-banner .cb-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 10px; font-weight: 500; color: #4a8b6d; }
.tm-community-banner .cb-input { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 8px 12px; background: #fff; border: 1px solid rgba(229,189,190,0.3); border-radius: 999px; }
.tm-community-banner .cb-input-bar { flex: 1; height: 12px; background: rgba(227,223,255,0.3); border-radius: 4px; }
.tm-community-banner .cb-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.tm-community-banner .cb-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 340px; padding: 15px 24px; background: #fff; border: 1px solid rgba(229,189,190,0.5); border-radius: 999px; cursor: pointer; transition: background .15s, transform .05s; }
.tm-community-banner .cb-cta:hover { background: var(--surface-2); }
.tm-community-banner .cb-cta:active { transform: translateY(1px); }
.tm-community-banner .cb-cta span { font-size: 15px; font-weight: 700; color: #1fa855; }
.tm-community-banner .cb-features { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 600; color: rgba(122,90,110,0.85); }
.tm-community-banner .cb-dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(229,189,190,0.7); }

/* compact variant — homepage below hero */
.tm-community-banner.cb-compact { margin: 0 0 18px; }
.cb-compact .cb-content { gap: 12px; padding: 16px 14px; }
.cb-compact .cb-headline h2 { font-size: clamp(19px, 5.5vw, 22px); line-height: 1.25; }
.cb-compact .cb-sub { font-size: 13px; line-height: 1.45; }
.cb-compact .cb-chat-wrap { padding: 4px 0; }
.cb-compact .cb-chat-card { max-width: 100%; padding: 8px; gap: 0; transform: none; background: rgba(255,255,255,0.9); }
.cb-compact .cb-bubble { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px; }
.cb-compact .cb-bubble p { margin: 0; padding: 0; font-size: 13px; }
.cb-compact .cb-cta { padding: 11px 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { padding: 14px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

/* compact single-card stat strip on the result page */
.stat-strip { display: flex; justify-content: space-around; align-items: center; padding: 12px 8px; margin: 0 0 16px; }
.ss-item { text-align: center; min-width: 60px; }
.ss-n { font-size: 18px; font-weight: 800; }
.ss-l { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

/* question-report modal options */
.report-options { display: flex; flex-direction: column; gap: 8px; }
.report-option { width: 100%; text-align: left; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .25s, transform .25s;
  z-index: 200; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.share-section {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.share-copy { min-width: 0; }
.share-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.share-copy h3 { margin-bottom: 2px; }
.share-copy p { margin: 0; }
.share-inline-link { margin-top: 10px; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.whatsapp-btn { display: inline-flex; align-items: center; gap: 8px; }
.whatsapp-icon { width: 20px; height: 20px; display: inline-flex; color: currentColor; }
.whatsapp-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-modal-body { display: grid; gap: 12px; }
.share-result-preview {
  width: min(100%, 340px);
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 28px rgba(80, 20, 50, .08);
}
.share-preview-brand { align-self: flex-start; color: var(--primary); font-weight: 900; font-size: 18px; }
.share-preview-title { align-self: flex-start; color: var(--ink-soft); font-weight: 800; font-size: 13px; margin-top: 2px; }
.share-preview-score { margin-top: auto; font-size: 50px; line-height: 1; font-weight: 900; }
.share-preview-label { margin-top: 8px; font-weight: 900; font-size: 18px; }
.share-preview-label.good { color: var(--green); }
.share-preview-label.warn { color: var(--amber); }
.share-preview-meta { margin-top: auto; color: var(--ink-soft); font-weight: 800; }
.share-preview-gap { margin-top: 4px; font-weight: 900; }
.share-preview-url { margin-top: 20px; padding-top: 14px; width: 100%; border-top: 1px solid var(--line); color: var(--primary); font-weight: 900; font-size: 13px; }
.share-modal-note { margin: 0; text-align: center; font-size: 13px; }

/* ============ REVIEW ============ */
.review-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.review-filters button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rev-q { padding: 18px; margin-bottom: 14px; }
.rev-q .q-stem { font-size: 16px; }
.rev-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 9px; margin: 7px 0; }
.rev-opt.correct { border-color: var(--green); background: var(--green-soft); }
.rev-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.rev-opt .tag { margin-left: auto; font-size: 12px; font-weight: 700; }
.rev-opt.correct .tag { color: var(--green); }
.rev-opt.wrong .tag { color: var(--red); }
.explain { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; font-size: 14px; }

/* ============ INSIGHTS ============ */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.insight-grid .card { padding: 18px; }
.insight-grid .full { grid-column: 1 / -1; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.bar-track { background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--primary); border-radius: 6px 0 0 6px; }
.bar-fill.good { background: var(--green); }
.bar-fill.mid { background: var(--amber); }
.bar-fill.bad { background: var(--red); }
.tlist-weak li, .tlist-strong li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.tlist-weak li:last-child, .tlist-strong li:last-child { border-bottom: 0; }
.reco { padding: 12px 14px; border-radius: 9px; background: var(--amber-soft); border: 1px solid #f0dca5; margin: 8px 0; font-size: 14px; }
.reco.ok { background: var(--green-soft); border-color: #bfe6cd; }

/* ============ modal ============ */
#modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 22, 40, .5); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 520px; width: 100%; padding: 24px; box-shadow: var(--shadow); }
.modal h2 { font-size: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.feedback-frame-wrap { height: min(72vh, 720px); margin-top: 12px; }
.feedback-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.modal:has(.feedback-frame) { max-width: 760px; }

/* ============ COUNTDOWN BANNER ============ */
.countdown-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-radius: var(--radius);
  margin-bottom: 16px; border: 1.5px solid transparent;
}
.banner-primary { background: var(--primary-soft); border-color: #f4b8d6; }
.banner-amber   { background: var(--amber-soft);   border-color: #f0c97a; }
.banner-red     { background: var(--red-soft);     border-color: #f4a6a6; }
.countdown-num  { font-size: 36px; font-weight: 900; line-height: 1; min-width: 48px; }
.banner-primary .countdown-num { color: var(--primary); }
.banner-amber   .countdown-num { color: var(--amber); }
.banner-red     .countdown-num { color: var(--red); }
.countdown-mid  { display: flex; flex-direction: column; gap: 2px; }
.countdown-label { font-weight: 700; font-size: 15px; }
.countdown-date  { font-size: 12px; color: var(--ink-soft); }

/* ============ SMART HERO ============ */
.hero-slider { margin-bottom: 10px; touch-action: pan-y; }
.hero-slider .smart-hero { min-height: 238px; margin-bottom: 10px; }
.hero-slide[hidden] { display: none; }
.hero-slider-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
}
.hero-slider-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  background: rgba(122,90,110,.28);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: width .18s ease, background .18s ease;
}
.hero-slider-dots button.active {
  width: 22px;
  border-radius: 999px;
  background: var(--primary);
}
.smart-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 10px;
  overflow: hidden;
  border-color: #efc5dc;
  background:
    linear-gradient(135deg, rgba(252,231,243,.92), rgba(255,255,255,.98) 42%, rgba(227,245,234,.78)),
    var(--surface);
}
.smart-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  background: linear-gradient(90deg, rgba(224,69,123,.10), transparent 34%);
  pointer-events: none;
}
.hero-copy, .hero-score-panel { position: relative; z-index: 1; }
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.hero-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.06;
  font-weight: 900;
}
.hero-copy p {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}
.hero-badge {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(224,69,123,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero-info {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.ctet-hero .hero-actions { margin-top: 14px; }
.hero-note {
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hero-score-panel {
  align-self: center;
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.hero-stat-kicker {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}
.hero-score-panel > .hero-stat-kicker { display: none; }
.hero-score-panel-compact {
  min-width: 210px;
  align-items: flex-start;
  padding: 4px 0;
}
.hero-score-panel-compact > .hero-stat-kicker { display: block; }
.hero-main-score {
  margin-top: 2px;
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  color: var(--ink);
}
.hero-side-score {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  color: var(--primary-dark);
}
.hero-split-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hero-score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.hero-score-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.hero-score-chip.good { color: var(--green); border-color: rgba(47,158,68,.22); background: rgba(47,158,68,.08); }
.hero-score-chip.warn { color: var(--amber); border-color: rgba(217,138,0,.24); background: rgba(217,138,0,.10); }
.hero-score-caption {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.hero-score-caption.good { color: var(--green); }
.hero-score-caption.warn { color: var(--amber); }

.score-dial {
  --dial-color: var(--primary);
  align-self: center;
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--dial-color) var(--score), var(--line) 0),
    var(--surface);
  box-shadow: 0 10px 24px rgba(80,20,50,.10);
}
.score-dial.good { --dial-color: var(--green); }
.score-dial.warn { --dial-color: var(--amber); }
.score-dial-inner {
  width: calc(100% - 18px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.9);
}
.score-dial-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: var(--ink);
}
.score-dial-label {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

/* ============ RESUME BANNER ============ */
.resume-banner {
  padding: 14px 18px; margin-bottom: 16px;
  border-left: 4px solid var(--amber);
}
.resume-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ============ FOCUS AREAS ============ */
.focus-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.focus-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.focus-icon { flex-shrink: 0; width: 30px; color: var(--ink-soft); display: inline-flex; justify-content: center; }
.focus-body { flex: 1; min-width: 0; }
.focus-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.focus-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.focus-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.focus-score { flex-shrink: 0; text-align: right; min-width: 48px; }
.focus-acc { font-size: 16px; font-weight: 800; }
.focus-acc.bad { color: var(--red); }
.focus-acc.mid { color: var(--amber); }
.focus-acc.ok  { color: var(--green); }
.focus-acc-sub { font-size: 10px; color: var(--ink-soft); margin-top: 1px; }
.focus-reason {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px;
}
.focus-trend { font-size: 11px; font-weight: 700; }
.focus-trend.up { color: var(--green); }
.focus-trend.down { color: var(--red); }
.section-title-sub { font-weight: 400; text-transform: none; font-size: 12px; margin-left: 4px; }

/* ============ PYQ CARDS ============ */
.pyq-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
  justify-content: space-between;
}
@media (hover: hover) { .pyq-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(224,69,123,.15); } }
.pyq-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.pyq-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pyq-icon  { width: 24px; height: 24px; color: var(--ink-soft); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.lucide-icon { width: 24px; height: 24px; display: block; }
.pyq-title { font-weight: 700; font-size: 15px; }
.pyq-meta  { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pyq-score { font-weight: 700; color: var(--green); font-size: 13px; }
.pyq-chevron { font-size: 22px; font-weight: 700; color: var(--ink-soft); }

/* ============ SECTIONAL GRID ============ */
.back-link { cursor: pointer; color: var(--primary); font-size: 14px; font-weight: 600; margin: 16px 0 4px; display: inline-block; }
.sectional-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.sectional-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 16px; gap: 6px; text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .sectional-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(224,69,123,.15); } }
.sec-icon  { width: 24px; height: 24px; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.sec-name  { font-weight: 700; font-size: 14px; }
.sec-meta  { font-size: 12px; }
.sec-best  { font-size: 12px; font-weight: 700; color: var(--green); }

/* ============ RESPONSIVE ============ */

/* Mobile-only UI elements: hidden on desktop */
.palette-header-mobile { display: none; }
.palette-backdrop { display: none; }
.palette-fab { display: none; }
.attempt-btns { display: flex; gap: 6px; }

/* --- Tablet (≤860px): palette moves below question --- */
@media (max-width: 860px) {
  .smart-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .exam-body { grid-template-columns: 1fr; }
  .palette { border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; }
  .palette-grid { grid-template-columns: repeat(8, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
  .exam { height: auto; }
}

/* --- Phone (≤600px): full mobile treatment --- */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .wrap { padding: 16px 14px 56px; }

  /* Topbar */
  #topbar { padding: 8px 14px; gap: 8px; }
  .brand .logo { width: 26px; height: 26px; font-size: 14px; }
  .brand small { display: none; }
  .brand .logo-img { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-controls { gap: 6px; }
  .feedback-btn { padding: 6px 10px; font-size: 12px; }

  /* Exam header: title+lang on row 1, timer+submit on row 2 */
  .exam-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 8px 10px;
    gap: 6px 8px;
  }
  .exam-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 13px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .exam-header .seg { grid-column: 1; grid-row: 2; justify-self: start; }
  .timer {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-left: 0;
    font-size: 14px;
    padding: 5px 9px;
  }
  .finish-test-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding: 6px 10px;
    font-size: 12px;
  }
  .exam-header > .btn.primary { order: 11; padding: 7px 12px; font-size: 13px; }

  /* Section tabs: bigger tap targets */
  .section-tabs { padding: 4px 10px 0; gap: 2px; }
  .section-tabs button { padding: 9px 10px; font-size: 12px; }

  /* Question pane */
  .q-pane { padding: 12px 14px calc(132px + env(safe-area-inset-bottom)); }
  .q-head { margin-bottom: 10px; }
  .q-num { font-size: 18px; }
  .q-tags { display: none; }
  .q-stem { font-size: 16px; }
  .match-columns { grid-template-columns: 1fr; gap: 10px; }
  .match-column { padding: 12px; }
  .match-column-row { font-size: 13px; }
  .question-chart { padding: 12px; }
  .pie-chart-wrap { gap: 12px; }
  .pie-chart { width: 118px; }
  .pie-chart-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .pie-chart-item { font-size: 12px; }
  .options { gap: 8px; }
  .option { padding: 14px 12px; font-size: 15px; }

  /* Thumb-zone action row */
  .q-actions {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 38;
    display: grid;
    grid-template-columns: minmax(118px, .82fr) minmax(0, 1.55fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .q-action-spacer { display: none; }
  .q-actions .btn {
    min-height: 48px;
    padding: 11px 12px;
    white-space: nowrap;
  }
  .q-prev,
  .q-next { width: 100%; }
  .q-next {
    min-height: 52px;
    box-shadow: 0 10px 24px rgba(224,69,123,.30);
  }

  /* Palette: slide-up bottom sheet */
  .palette {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    max-height: 65vh !important;
    border-top: 2px solid var(--primary) !important;
    border-left: 0 !important;
    border-radius: 16px 16px 0 0;
    z-index: 40;
    transform: translateY(calc(100% + 2px));
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    display: flex !important;
    flex-direction: column;
  }
  .palette.open { transform: translateY(0); }
  .palette-grid { grid-template-columns: repeat(5, 1fr) !important; padding: 12px; gap: 7px; }
  .pcell { font-size: 12px; }

  /* Palette mobile header */
  .palette-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
  }
  .palette-close-btn {
    border: 0; background: transparent;
    font-size: 20px; color: var(--ink-soft);
    padding: 2px 8px; cursor: pointer;
    line-height: 1; font-family: inherit;
  }

  /* Backdrop */
  .palette-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 18, 36, .45);
    z-index: 39;
  }
  .palette-backdrop.open { display: block; }

  /* FAB: floating palette trigger — subtle, left-anchored */
  .palette-fab {
    position: fixed;
    bottom: 20px; left: 16px;
    background: rgba(255,255,255,0.92); color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600; font-size: 13px;
    box-shadow: 0 2px 8px rgba(80,20,50,.10);
    z-index: 38;
    display: flex;
    align-items: center; gap: 6px;
    cursor: pointer; font-family: inherit;
    backdrop-filter: blur(6px);
  }
  .palette-fab:active { transform: scale(.95); }

  /* Dashboard */
  .hero { gap: 12px; flex-direction: column; }
  .hero .card { min-width: 0; padding: 16px; }
  .test-grid { grid-template-columns: 1fr; gap: 10px; }
  .attempt-row { flex-wrap: wrap; padding: 12px 14px; gap: 8px; align-items: flex-start; }
  .attempt-score { min-width: auto; font-size: 20px; }
  .attempt-btns { width: 100%; padding-top: 8px; border-top: 1px solid var(--line); }

  /* Result */
  .big-score { font-size: 32px; margin: 2px 0; }
  .verdict { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat .n { font-size: 20px; }
  .result-hero { padding: 16px 14px; margin-bottom: 12px; }
  .result-insight { font-size: 13px; padding: 7px 12px; }
  .result-actions { margin-bottom: 14px; }
  .result-actions .btn { min-width: 0; width: 100%; }
  .ss-n { font-size: 16px; }
  .share-section { align-items: flex-start; flex-direction: column; padding: 16px; }
  .share-actions { width: 100%; justify-content: stretch; }
  .share-actions .btn { width: 100%; justify-content: center; }
  .share-result-preview { width: min(100%, 310px); }

  /* Insights */
  .insight-grid .card { padding: 14px; }
  .bar-row { grid-template-columns: 90px 1fr 44px; font-size: 12px; }

  /* Review */
  .review-filters { gap: 6px; }
  .rev-q { padding: 14px; }

  /* Modal: bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-width: 100%; padding: 20px 16px 28px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; margin-top: 16px; }
  .modal-actions .btn { width: 100%; text-align: center; padding: 12px 16px; font-size: 15px; }
  .feedback-frame-wrap { height: 68vh; }
  .feedback-frame { border-radius: 10px; }

  /* Countdown */
  .countdown-banner { padding: 10px 14px; gap: 10px; }
  .countdown-num { font-size: 28px; min-width: 38px; }

  /* Smart hero */
  .smart-hero { padding: 16px; gap: 12px; }
  .hero-copy h1 { font-size: 24px; }
  .hero-copy p { max-width: 260px; }
  .hero-score-panel { padding: 0; gap: 8px; }
  .hero-score-panel-compact { min-width: 128px; align-items: flex-start; }
  .hero-main-score { font-size: 34px; }
  .hero-score-chip { min-height: 24px; padding: 4px 8px; font-size: 11px; }
  .hero-split-stats { gap: 10px; }
  .score-dial { width: 104px; }
  .score-dial-value { font-size: 19px; }

  /* PYQ cards */
  .pyq-card { padding: 14px; gap: 10px; }
  .pyq-title { font-size: 14px; }

  /* Focus row */
  .focus-chip { padding: 10px 14px; }

  /* Sectional grid: 2-col on phone */
  .sectional-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sectional-card { padding: 16px 12px; }
  .sec-icon { font-size: 26px; }
}



/* ============================================================
   Memory Game
   Straight-in recall game: tap an option, instant feedback,
   streaks + points. Clean SVG icons, no emoji. Big targets,
   no timers — tuned for 40–50 year old aspirants.
   ============================================================ */

/* ---- dashboard entry card ---- */
.mg-home-card {
  position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, #e0457b 0%, #f2622f 100%);
  color: #fff; box-shadow: 0 6px 20px rgba(224,69,123,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mg-home-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(224,69,123,.45); }
.mg-home-card:active { transform: translateY(0); }
.mg-home-card::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.32), transparent);
  transform: skewX(-20deg); animation: mg-shine 4s ease-in-out infinite;
}
.mg-home-icon {
  flex: none; width: 54px; height: 54px; border-radius: 16px;
  background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center;
}
.mg-home-icon svg, .mg-home-brain { width: 30px; height: 30px; stroke: #fff; }
.mg-home-body { flex: 1; min-width: 0; }
.mg-home-titlerow { display: flex; align-items: center; gap: 8px; }
.mg-home-title { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.mg-home-badge { background: rgba(255,255,255,.92); color: var(--primary-dark); font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.mg-home-sub { font-size: 13.5px; opacity: .92; margin-top: 3px; }
.mg-home-play {
  flex: none; background: #fff; color: var(--primary-dark); font-weight: 800;
  padding: 11px 22px; border-radius: 999px; font-size: 15px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* ---- shared bits ---- */
.mg-wrap { max-width: 640px; }
.mg-ic { display: inline-flex; }
.mg-ic svg { width: 15px; height: 15px; }

/* ---- game chrome ---- */
.mg-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.mg-exit { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; display: flex; }
.mg-exit svg { width: 18px; height: 18px; }
.mg-exit:hover { color: var(--primary); }
.mg-progress { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.mg-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #fd8a42); border-radius: 999px; transition: width .3s ease; }
.mg-count { font-size: 14px; font-weight: 700; color: var(--muted); min-width: 40px; text-align: right; }
.mg-chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  animation: mg-pop .35s cubic-bezier(.34,1.56,.64,1);
}
.mg-chip-streak { background: #fff1e6; color: #c2410c; }
.mg-chip-points { background: #fef7dd; color: #a16207; }

/* ---- question card ---- */
.mg-scene { position: relative; }
.mg-scene.enter { animation: mg-slide-in .3s ease; }
.mg-scene.fly-right { animation: mg-fly-right .3s ease-in forwards; }
.mg-scene.fly-left { animation: mg-fly-left .3s ease-in forwards; }

.mg-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 22px 20px;
}
.mg-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mg-card-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.mg-new-pill { font-size: 11px; font-weight: 800; background: var(--primary-soft); color: var(--primary-dark); padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; }
.mg-dots { display: inline-flex; gap: 4px; }
.mg-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.mg-dots i.filled { background: var(--primary); border-color: var(--primary); }
.mg-card-q { font-size: 20px; font-weight: 700; line-height: 1.45; }

/* ---- options ---- */
.mg-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.mg-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; font-size: 16px; font-weight: 600; color: var(--text);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.mg-opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.mg-opt:active:not(:disabled) { transform: scale(.985); }
.mg-opt-key {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 800; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--muted);
}
.mg-opt-text { flex: 1; line-height: 1.4; }
.mg-opt.correct { border-color: var(--green, #1f9d55); background: #eaf7ef; animation: mg-pop .3s cubic-bezier(.34,1.56,.64,1); }
.mg-opt.correct .mg-opt-key { background: var(--green, #1f9d55); border-color: var(--green, #1f9d55); color: #fff; }
.mg-opt.wrong { border-color: var(--red, #d64545); background: #fdecec; animation: mg-shake .3s ease; }
.mg-opt.wrong .mg-opt-key { background: var(--red, #d64545); border-color: var(--red, #d64545); color: #fff; }
.mg-opt.faded { opacity: .5; }
.mg-opt:disabled { cursor: default; }

/* ---- feedback panel ---- */
.mg-panel { display: none; margin-top: 14px; }
.mg-panel.show { display: block; animation: mg-rise .25s ease; }
.mg-panel-head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.mg-panel-head.good { color: var(--green, #1f9d55); }
.mg-panel-head.bad { color: var(--red, #d64545); font-size: 14.5px; font-weight: 700; }
.mg-panel-head .mg-ic svg { width: 18px; height: 18px; }
.mg-panel-hook {
  margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 10px; padding: 12px 14px;
}
.mg-next { width: 100%; margin-top: 14px; padding: 15px; font-size: 16px; }

/* ---- floating pop ---- */
.mg-pop {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 8px 16px; text-align: center;
  z-index: 5; pointer-events: none; animation: mg-praise 1.05s ease forwards; white-space: nowrap;
}
.mg-pop-main { font-size: 17px; font-weight: 800; color: var(--primary-dark); }
.mg-pop-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- confetti ---- */
.mg-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.mg-confetti i { position: absolute; top: -14px; width: 10px; height: 14px; opacity: .95; animation: mg-fall linear forwards; }

/* ---- summary ---- */
.mg-summary { text-align: center; padding: 30px 20px; }
.mg-summary-title { margin: 0 0 4px; font-size: 23px; }
.mg-summary-big { font-size: 44px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.mg-summary-rows { max-width: 320px; margin: 14px auto 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; box-shadow: var(--shadow); }
.mg-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 15px; }
.mg-summary-row + .mg-summary-row { border-top: 1px solid var(--line); }
.mg-summary-row-lbl { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.mg-summary-row-lbl .mg-ic { color: var(--primary); }
.mg-summary-row-val { font-weight: 800; }
.mg-summary-sub { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 420px; margin: 14px auto 22px; }
.mg-summary-actions { display: flex; flex-direction: column; gap: 10px; max-width: 280px; margin: 0 auto; }
.mg-summary-actions .btn { padding: 14px; font-size: 15px; }

/* ---- animations ---- */
@keyframes mg-shine { 0% { left: -60%; } 55% { left: 130%; } 100% { left: 130%; } }
@keyframes mg-slide-in { from { transform: translateX(46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mg-fly-right { to { transform: translateX(120%) rotate(6deg); opacity: 0; } }
@keyframes mg-fly-left { to { transform: translateX(-120%) rotate(-6deg); opacity: 0; } }
@keyframes mg-pop { 0% { transform: scale(.5); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes mg-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mg-shake { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
@keyframes mg-praise { 0% { transform: translate(-50%, 16px); opacity: 0; } 18% { transform: translate(-50%, 0); opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(-50%, -14px); opacity: 0; } }
@keyframes mg-fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  .mg-home-card::after { animation: none; }
  .mg-scene.enter, .mg-scene.fly-right, .mg-scene.fly-left,
  .mg-chip, .mg-opt.correct, .mg-opt.wrong, .mg-panel.show, .mg-pop { animation: none; }
  .mg-confetti { display: none; }
}

/* ---- global disclaimer footer ---- */
#app-footer {
  max-width: 640px;
  margin: 40px auto 0;
  padding: 20px 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}
