/* ============================================================
   EEE S5 — Interactive Exam Game · static edition
   Dark electric theme · responsive · no frameworks
   ============================================================ */

:root {
  --bg: #070b14;
  --bg-soft: #0b1120;
  --card: rgba(255, 255, 255, 0.035);
  --card-solid: #0e1526;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #8091a8;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --cyan: #06b6d4;
  --cyan-soft: rgba(6, 182, 212, 0.14);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(245, 158, 11, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(6, 182, 212, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

button { font-family: inherit; }

/* ---------- Boot screen ---------- */
.boot-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
}
.spinner {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid var(--amber);
  border-top-color: transparent;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none; border: none; color: inherit; text-align: left;
}
.brand-zap {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber-soft), transparent);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}
.brand-title { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; }

.xp-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 220px;
}
.xp-chip .xp-num { font-weight: 800; color: var(--amber); font-size: 0.95rem; white-space: nowrap; }
.xp-chip .rank { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
.xp-bar {
  position: relative; flex: 1;
  height: 7px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.xp-bar > i {
  position: absolute; inset: 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), #fbbf24);
  transition: width 0.6s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s;
  min-height: 44px;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-color: transparent;
  color: #1c1004;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.42); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: 0.84rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

.subject-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  overflow: hidden;
}
.subject-card:hover { transform: translateY(-3px); border-color: var(--sc, var(--amber)); box-shadow: 0 12px 28px rgba(0,0,0,0.4), 0 0 0 1px var(--sc, var(--amber)); }
.subject-card .emoji {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--sc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent);
}
.subject-card h3 { font-size: 1.02rem; font-weight: 800; line-height: 1.3; color: var(--text); }
.subject-card .code {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--sc);
}
.subject-card p { font-size: 0.86rem; color: var(--text-dim); flex: 1; }
.subject-card .counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-faint); }
.subject-card .counts b { color: var(--text); }

/* ---------- Mode cards ---------- */
.mode-card {
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s, box-shadow 0.16s;
  padding: 16px;
}
.mode-card:hover { transform: translateY(-2px); border-color: var(--mc, var(--amber)); box-shadow: 0 8px 22px rgba(0,0,0,0.35); }
.mode-card .m-emoji {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mc) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 35%, transparent);
}
.mode-card .m-body { flex: 1; min-width: 0; }
.mode-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.mode-card p { font-size: 0.8rem; color: var(--text-dim); }
.mode-card .m-meta { font-size: 0.74rem; color: var(--text-faint); margin-top: 4px; white-space: nowrap; }
.mode-card .chev { color: var(--text-faint); font-size: 1.1rem; }

/* ---------- Section titles ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b3c0d4;
  margin: 26px 0 12px;
}
.section-title::before {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 99px;
  background: var(--amber);
  flex-shrink: 0;
}
h2.screen-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.screen-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 18px; }

/* ---------- Stats ---------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.stat-pill b { color: var(--text); }
.stat-pill.hl { border-color: rgba(16,185,129,0.4); background: var(--emerald-soft); color: #a7f3d0; }

/* ---------- Play screens ---------- */
.play-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.play-progress {
  height: 8px; border-radius: 99px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  margin-bottom: 18px;
}
.play-progress > i {
  display: block; height: 100%; width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), #fbbf24);
  transition: width 0.3s ease;
}
.timer-chip {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.02rem;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--rose-soft);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}
.timer-chip.low { animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.streak-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.85rem;
  color: #fdba74;
}
.streak-chip.hot { animation: flicker 0.6s ease infinite alternate; }
@keyframes flicker { from { opacity: 1; } to { opacity: 0.72; } }

.q-card { padding: 22px; }
.q-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.q-tag .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--amber); }
.q-text { font-size: 1.08rem; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }

.q-image {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff; /* diagrams are white-background scans */
}
.q-blurb { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 14px; padding: 10px 14px; border-left: 3px solid var(--emerald); background: var(--emerald-soft); border-radius: 0 10px 10px 0; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  min-height: 48px;
}
.option:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(255,255,255,0.05); transform: translateX(3px); }
.option .key {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-size: 0.78rem; font-weight: 800;
  color: var(--text-dim);
}
.option.correct { border-color: rgba(16,185,129,0.65); background: var(--emerald-soft); }
.option.correct .key { background: var(--emerald); border-color: var(--emerald); color: #052e1c; }
.option.wrong { border-color: rgba(239,68,68,0.65); background: var(--rose-soft); }
.option.wrong .key { background: var(--danger); border-color: var(--danger); color: #fff; }
.option:disabled { cursor: default; opacity: 0.92; }
.option.dim { opacity: 0.45; }

.feedback {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  animation: fadeUp 0.25s ease;
}
.feedback.good { background: var(--emerald-soft); border: 1px solid rgba(16,185,129,0.4); }
.feedback.bad { background: var(--rose-soft); border: 1px solid rgba(239,68,68,0.4); }
.feedback .fb-title { font-weight: 800; margin-bottom: 4px; }
.feedback .fb-title.good { color: #6ee7b7; }
.feedback .fb-title.bad { color: #fda4af; }
.feedback p { color: var(--text-dim); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.next-row { margin-top: 16px; display: flex; justify-content: flex-end; }

/* ---------- Written answers (3/7 mark) ---------- */
.mark-badge {
  display: inline-block;
  font-size: 0.72rem; font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
.mark-badge.m3 { background: var(--cyan-soft); color: #67e8f9; border: 1px solid rgba(6,182,212,0.4); }
.mark-badge.m7 { background: rgba(99,102,241,0.16); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.45); }
.diagram-tip {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: #fcd34d;
  background: var(--amber-soft);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin-bottom: 14px;
}
.keypoints { list-style: none; display: grid; gap: 8px; margin: 14px 0; }
.keypoints li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
}
.keypoints li::before { content: "✓"; color: var(--emerald); font-weight: 800; }
.model-answer {
  font-size: 0.92rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  animation: fadeUp 0.25s ease;
}
.self-assess { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.self-assess .btn { flex-direction: column; gap: 2px; padding: 12px 6px; font-size: 0.84rem; }
.self-assess .btn small { font-size: 0.7rem; font-weight: 600; color: var(--text-faint); }
.self-assess .btn.good { border-color: rgba(16,185,129,0.5); background: var(--emerald-soft); }
.self-assess .btn.part { border-color: rgba(245,158,11,0.5); background: var(--amber-soft); }
.self-assess .btn.re { border-color: rgba(244,63,94,0.5); background: var(--rose-soft); }
@media (max-width: 560px) {
  .self-assess { grid-template-columns: 1fr; }
}

/* ---------- Flashcards ---------- */
.flash-wrap { perspective: 1400px; max-width: 620px; margin: 0 auto; width: 100%; }
.flash-card {
  position: relative;
  width: 100%;
  min-height: 300px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--card-solid), #101a30);
  box-shadow: var(--shadow);
}
.flash-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, #0e1a18, #102822); border-color: rgba(16,185,129,0.35); }
.flash-face .f-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }
.flash-face .f-term { font-size: 1.5rem; font-weight: 800; line-height: 1.25; }
.flash-face .f-def { font-size: 0.98rem; color: var(--text-dim); }
.flash-face .f-hint { position: absolute; bottom: 14px; font-size: 0.72rem; color: var(--text-faint); }
.flash-studied-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700;
  color: #6ee7b7;
}
.flash-nav { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Results ---------- */
.result-hero { text-align: center; padding: 34px 22px; }
.result-hero .big-emoji { font-size: 52px; }
.result-hero h2 { font-size: 1.5rem; font-weight: 800; margin: 10px 0 4px; color: var(--text); }
.result-hero .r-sub { color: var(--text-dim); font-size: 0.92rem; }
.result-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 22px 0; }
.result-stat {
  min-width: 110px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.result-stat .v { font-size: 1.4rem; font-weight: 800; color: var(--amber); }
.result-stat .l { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ach-card {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: transform 0.15s;
}
.ach-card:hover { transform: translateY(-2px); }
.ach-card .a-icon { font-size: 30px; margin-bottom: 8px; }
.ach-card .a-name { font-weight: 700; font-size: 0.86rem; }
.ach-card .a-desc { font-size: 0.72rem; color: var(--text-faint); margin-top: 3px; }
.ach-card.unlocked { border-color: rgba(245,158,11,0.45); background: linear-gradient(160deg, rgba(245,158,11,0.10), rgba(245,158,11,0.02)); }
.ach-card.unlocked .a-name { color: #fcd34d; }
.ach-card.locked { opacity: 0.45; filter: grayscale(0.8); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(8px);
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-dim);
}
.footer-inner a { color: #fcd34d; text-decoration: none; font-weight: 600; }
.footer-inner a:hover { text-decoration: underline; }
.visitor-box { display: inline-flex; align-items: center; gap: 8px; }
.visitor-box .visitor-count { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.visitor-box img { height: 26px; vertical-align: middle; image-rendering: pixelated; border-radius: 4px; }
.eyeball { font-size: 0.95rem; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  z-index: 100;
  width: min(94vw, 420px);
  pointer-events: none;
}
.toast {
  background: #101a2e;
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  text-align: center;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ---------- Study notes ---------- */
.note-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.note-banner > span:first-child { font-size: 1.25rem; line-height: 1.4; }
.note-banner p { font-size: 0.88rem; color: var(--text-dim); }
.note-banner b { color: var(--text); }
.note-modcard, .note-topcard {
  width: 100%; text-align: left; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s, box-shadow 0.16s;
}
.note-modcard:hover, .note-topcard:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.nm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.badge-co {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
}
.nm-meta { font-size: 0.74rem; color: var(--text-faint); }
.nm-title { font-size: 0.98rem; font-weight: 800; line-height: 1.35; color: var(--text); }
.nt-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.nt-title { font-size: 0.92rem; font-weight: 700; line-height: 1.4; color: var(--text); flex: 1; }
.badge-imp {
  flex-shrink: 0;
  display: inline-block;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}
.badge-imp.imp-high { color: #fda4af; border-color: rgba(244, 63, 94, 0.5); background: rgba(244, 63, 94, 0.12); }
.badge-imp.imp-med { color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.12); }
.badge-imp.imp-low { color: var(--text-faint); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.03); }
.note-meta { margin-top: 8px; font-size: 0.74rem; color: var(--text-faint); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dotsep { opacity: 0.6; }
.note-diagram {
  margin: 0 0 18px;
  background: #14141c;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px;
}
.note-diagram svg { display: block; width: 100%; height: auto; }
.note-diagram figcaption { margin-top: 10px; text-align: center; font-size: 0.74rem; color: var(--text-faint); }
.note-sec { margin-bottom: 14px; }
.note-sec h4 { color: #fcd34d; font-size: 0.92rem; font-weight: 800; margin-bottom: 10px; }
.note-points { list-style: none; display: grid; gap: 9px; }
.note-points li { display: flex; gap: 10px; font-size: 0.9rem; line-height: 1.55; color: #ccd5e3; }
.note-points li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--amber);
  margin-top: 8px;
  flex-shrink: 0;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.note-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.note-table th {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.note-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: #ccd5e3; }
.note-table tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.015); }
.note-formulas { margin-bottom: 14px; background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.35); }
.note-formulas h4 { color: #fcd34d; font-size: 0.92rem; font-weight: 800; margin-bottom: 10px; }
.note-formulas ul { list-style: none; display: grid; gap: 8px; }
.note-formulas code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  color: #ecd9a8;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 9px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.note-tips { margin-bottom: 14px; background: rgba(16, 185, 129, 0.07); border-color: rgba(16, 185, 129, 0.35); }
.note-tips h4 { color: #6ee7b7; font-size: 0.92rem; font-weight: 800; margin-bottom: 10px; }
.note-tips ul { list-style: none; display: grid; gap: 8px; }
.note-tips li { display: flex; gap: 9px; font-size: 0.9rem; line-height: 1.55; color: #ccd5e3; }
.note-tips li::before { content: "ℹ"; color: #34d399; font-weight: 800; flex-shrink: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .app-root { padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); }
  .xp-chip { min-width: 0; width: 100%; }
  .q-text { font-size: 1rem; }
  .flash-card { min-height: 260px; }
  .result-actions .btn { flex: 1; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
