/* SAT Slayer - exam room (ported from SAT_PT5_PhongThi.html) and question content.
   Everything is scoped: .exam-root = the full-screen exam room; .sat-item = question HTML anywhere (exam, debrief, training). */

/* ---------------------------------------------------------------- question content (.sat-item) */
.sat-item { --serif: "Noto Serif", Georgia, "Times New Roman", serif; --isans: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.sat-item .passage, .sat-item .stem { font-family: var(--serif); font-size: 17px; line-height: 1.65; }
.sat-item .passage p { margin: 0 0 12px; }
.sat-item .tt { font-family: var(--isans); font-weight: 700; margin: 12px 0 4px; font-size: 15px; }
.sat-item .blank { display: inline-block; width: 72px; border-bottom: 1.5px solid currentColor; transform: translateY(-4px); }
.sat-item .poem { margin-left: 1.2em; line-height: 1.7; }
.sat-item ul.notes { margin: 6px 0 0 4px; padding-left: 22px; }
.sat-item ul.notes li { margin: 6px 0; }
.sat-item table.dt { border-collapse: collapse; margin: 6px auto 16px; font-family: var(--isans); font-size: 14.5px; }
.sat-item table.dt caption { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.sat-item table.dt th, .sat-item table.dt td { border: 1px solid #444; padding: 6px 14px; text-align: center; }
.sat-item table.dt th { background: #f1f2f5; }
.sat-item svg.fig { width: 100%; max-width: 560px; display: block; margin: 4px auto 16px; background: #fff; }
.sat-item .ftitle { font-weight: bold; text-align: center; margin: 10px 0 2px; font-size: .92em; }
.sat-item .m { font-family: "Times New Roman", "Liberation Serif", Georgia, serif; white-space: nowrap; font-size: 1.05em; }
.sat-item .m i { font-style: italic; }
.sat-item .frac, .sat-item .fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .92em; margin: 0 2px; line-height: 1.15; }
.sat-item .frac > span:first-child, .sat-item .fr > span:first-child { border-bottom: 1.3px solid currentColor; padding: 0 3px; }
.sat-item .frac > span:last-child, .sat-item .fr > span:last-child { padding: 0 3px; }
.sat-item .sq, .sat-item .sqrt { white-space: nowrap; }
.sat-item .rad { border-top: 1.3px solid currentColor; padding: 0 2px; }
.sat-item .ix { font-size: .6em; margin-right: -.35em; vertical-align: .9em; }
.sat-item mark.hl { background: #fde68a; cursor: pointer; padding: 0; color: inherit; }

/* ---------------------------------------------------------------- exam room chrome (.exam-root) */
.exam-root { --blue: #4B2A9B; --blue-d: #3a1f7c; --ink: #1e1e1e; --muted: #5f6368; --line: #d0d3d9; --soft: #f3f4f7; --red: #c8102e;
  position: fixed; inset: 0; z-index: 1000; background: #fff; color: var(--ink); display: flex; flex-direction: column;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.exam-root * { box-sizing: border-box; }
.exam-root button { font-family: inherit; cursor: pointer; }
.exam-root .hidden { display: none !important; }
.exam-root .btn { background: var(--blue); color: #fff; border: 0; border-radius: 24px; padding: 10px 26px; font-size: 15px; font-weight: 600; }
.exam-root .btn:hover { background: var(--blue-d); }
.exam-root .btn.ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.exam-root .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.exam-root .small { font-size: 13px; color: var(--muted); }
.exam-root header.tb { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 2px dashed #b9c0d0; flex: 0 0 auto; position: relative; }
.exam-root .tb-left .sec { font-size: 17px; font-weight: 700; }
.exam-root .tb-left .dir { font-size: 14px; font-weight: 600; background: none; border: 0; padding: 4px 0; color: var(--ink); }
.exam-root .tb-center { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.exam-root .timer { font-size: 21px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; min-height: 26px; }
.exam-root .timer.warn { color: var(--red); }
.exam-root .tb-center button { margin-top: 2px; font-size: 12px; font-weight: 600; border: 1px solid #6b6f76; background: #fff; border-radius: 14px; padding: 2px 12px; }
.exam-root .tb-right { display: flex; gap: 18px; }
.exam-root .tool { background: none; border: 0; display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink); gap: 3px; padding: 4px; }
.exam-root .tool svg { width: 22px; height: 22px; }
.exam-root .tool.on { color: var(--blue); }
.exam-root main.tm { flex: 1 1 auto; display: flex; overflow: hidden; position: relative; }
.exam-root .pane { overflow: auto; padding: 28px 34px 40px; }
.exam-root .pane.left { flex: 0 0 50%; }
.exam-root .divider { flex: 0 0 8px; background: #e7e9ee; cursor: col-resize; position: relative; }
.exam-root .divider::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4px; height: 36px; border-left: 2px solid #9aa0a6; border-right: 2px solid #9aa0a6; }
.exam-root .pane.right { flex: 1 1 auto; }
.exam-root .single { max-width: 780px; margin: 0 auto; }
.exam-root .qbar { display: flex; align-items: center; justify-content: space-between; background: #f0f1f4; border-bottom: 2px dashed #b9c0d0; height: 40px; margin: 0 0 16px; }
.exam-root .qnum { background: #000; color: #fff; font-weight: 700; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.exam-root .mark { display: flex; align-items: center; gap: 6px; margin-left: 12px; background: none; border: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.exam-root .mark svg { width: 16px; height: 18px; }
.exam-root .mark.on svg path { fill: var(--red); stroke: var(--red); }
.exam-root .elim-btn { margin-left: auto; margin-right: 8px; border: 1.5px solid #6b6f76; border-radius: 5px; background: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; text-decoration: line-through; color: var(--ink); }
.exam-root .elim-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.exam-root .stem { margin-bottom: 18px; }
.exam-root .choices { display: flex; flex-direction: column; gap: 13px; }
.exam-root .crow { display: flex; align-items: center; gap: 10px; }
.exam-root .choice { flex: 1; display: flex; align-items: center; gap: 14px; border: 1.5px solid #6b6f76; border-radius: 10px; padding: 11px 14px; background: #fff; text-align: left; font-family: "Noto Serif", Georgia, serif; font-size: 16.5px; line-height: 1.45; color: var(--ink); min-height: 52px; }
.exam-root .choice:hover { border-color: var(--blue); }
.exam-root .choice .lt { flex: 0 0 28px; height: 28px; border: 1.5px solid #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: inherit; font-weight: 700; font-size: 14px; }
.exam-root .choice.sel { border: 3px solid var(--blue); padding: 9.5px 12.5px; }
.exam-root .choice.sel .lt { background: var(--blue); border-color: var(--blue); color: #fff; }
.exam-root .choice.out { opacity: .45; position: relative; }
.exam-root .choice.out::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; border-top: 2px solid #000; }
.exam-root .strike { flex: 0 0 auto; border: 0; background: none; font-weight: 700; font-size: 12px; text-decoration: line-through; color: var(--ink); width: 44px; }
.exam-root .strike.undo { text-decoration: underline; color: var(--blue); }
.exam-root .spr-in { width: 180px; font-size: 20px; padding: 10px 12px; border: 1.5px solid #000; border-radius: 8px; }
.exam-root .preview { margin-top: 10px; font-size: 15px; }
.exam-root .spr-dir { font-size: 15px; line-height: 1.55; }
.exam-root .spr-dir h3 { margin-top: 0; }
.exam-root .spr-dir table { border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.exam-root .spr-dir th, .exam-root .spr-dir td { border: 1px solid #888; padding: 5px 10px; text-align: left; }
.exam-root footer.fb { height: 70px; border-top: 2px dashed #b9c0d0; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; flex: 0 0 auto; position: relative; }
.exam-root .fname { font-weight: 600; font-size: 15px; }
.exam-root .navpill { position: absolute; left: 50%; transform: translateX(-50%); background: #1e1e1e; color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.exam-root .overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; z-index: 1050; }
.exam-root .modal { margin: auto; background: #fff; border-radius: 12px; max-width: 760px; width: 92%; max-height: 86vh; overflow: auto; padding: 26px 30px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.exam-root .modal h2 { margin: 0 0 12px; font-size: 20px; }
.exam-root .modal .close { float: right; border: 0; background: none; font-size: 22px; }
.exam-root .navpop { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); padding: 20px 24px; z-index: 1040; width: min(620px, 94vw); }
.exam-root .navpop h3 { margin: 0 0 10px; font-size: 16px; text-align: center; }
.exam-root .legend { display: flex; gap: 18px; justify-content: center; font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.exam-root .legend span { display: flex; align-items: center; gap: 6px; }
.exam-root .grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; }
.exam-root .gq { position: relative; height: 38px; border: 1.5px dashed #555; background: #fff; color: var(--blue); font-weight: 700; font-size: 15px; border-radius: 3px; }
.exam-root .gq.ans { background: var(--blue); color: #fff; border: 1.5px solid var(--blue); }
.exam-root .gq .flag { position: absolute; top: -7px; right: -5px; width: 12px; height: 14px; }
.exam-root .gq .pin { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); width: 12px; }
.exam-root .lg-box { width: 16px; height: 16px; border: 1.5px dashed #555; display: inline-block; }
.exam-root .review { max-width: 820px; margin: 20px auto; padding: 0 24px; text-align: center; }
.exam-root .review h1 { font-size: 28px; margin: 10px 0; }
.exam-root .review .card { border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-top: 20px; text-align: left; }
.exam-root .calc { position: fixed; top: 90px; left: 24px; width: 300px; background: #fff; border: 1px solid #888; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); z-index: 1045; }
.exam-root .calc .ch { background: #1e1e1e; color: #fff; padding: 8px 12px; border-radius: 10px 10px 0 0; cursor: move; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.exam-root .calc .ch button { background: none; border: 0; color: #fff; font-size: 18px; }
.exam-root .calc .disp { margin: 10px; border: 1px solid #999; border-radius: 6px; padding: 6px 8px; font-family: Consolas, monospace; }
.exam-root .calc .disp input { width: 100%; border: 0; font-size: 17px; font-family: inherit; outline: none; }
.exam-root .calc .disp .res { text-align: right; font-size: 20px; font-weight: 700; min-height: 26px; }
.exam-root .calc .keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 10px 10px; }
.exam-root .calc .keys button { padding: 9px 0; border: 1px solid #bbb; border-radius: 6px; background: #f6f7f9; font-size: 14px; }
.exam-root .calc .keys button.op { background: #ece7f8; }
.exam-root .calc .keys button.eq { background: var(--blue); color: #fff; border-color: var(--blue); }
.exam-root .calc .mode { font-size: 12px; padding: 0 12px 8px; display: flex; gap: 10px; align-items: center; }
.exam-root .refgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; font-size: 14px; }
.exam-root .refgrid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; }
.exam-root .refgrid svg { width: 100%; max-width: 150px; height: 80px; }
.exam-root .toast { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); background: #1e1e1e; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 1060; }
.exam-root .break { margin: auto; text-align: center; }
.exam-root.is-break { background: #1d1140; color: #fff; }
.exam-root .brk-timer { font-size: 64px; font-weight: 800; margin: 6px 0 20px; font-variant-numeric: tabular-nums; }
.exam-root .brk-note { max-width: 520px; margin: 34px auto 0; text-align: left; font-size: 14px; line-height: 1.6; opacity: .9; }
@media (max-width: 820px) {
  .exam-root main.tm { flex-direction: column; overflow: auto; }
  .exam-root .pane.left { flex: 0 0 auto; border-bottom: 2px solid #e7e9ee; }
  .exam-root .divider { display: none; }
  .exam-root .pane { padding: 18px; }
  .exam-root header.tb, .exam-root footer.fb { padding: 0 12px; }
  .exam-root .tb-right { gap: 8px; }
  .exam-root .tool { font-size: 0; }
  .exam-root .fname { display: none; }
  .exam-root .grid { grid-template-columns: repeat(7, 1fr); }
  .exam-root .refgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------- debrief and session screens (colours come from app.css variables when present) */
.ss-wrap, .db-wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.ss-head h2, .db-head h2 { margin: 4px 0 6px; }
.ss-crumb, .db-meta, .ss-muted { color: var(--muted, #5f6368); font-size: 13px; }
.db-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.db-count { font-weight: 700; font-size: 14px; }
.db-card, .ss-card { background: var(--card, #fff); border: 2px solid var(--ink, #1e1e1e); border-radius: 16px; padding: 18px 20px; margin: 12px 0; box-shadow: 4px 4px 0 var(--ink, #1e1e1e); }
.db-item .passage, .db-item .stem { font-size: 16px; }
.db-choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.db-choice { border: 1.5px solid #b4b8bf; border-radius: 10px; padding: 8px 12px; font-family: "Noto Serif", Georgia, serif; }
.db-choice.ok { border-color: #127a3e; background: #eaf6ef; }
.db-choice.no { border-color: #c8102e; background: #fdecee; }
.db-choice.mine { border-color: #4B2A9B; background: #f1ecfb; }
.db-gate { margin-top: 14px; border-top: 1px dashed #b9c0d0; padding-top: 12px; }
.db-causes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.db-cause, .ss-c { border: 2px solid var(--ink, #1e1e1e); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; cursor: pointer; color: #1e1e1e; }
.db-cause.on, .ss-c.on { background: #4B2A9B; color: #fff; border-color: #4B2A9B; }
.db-note { display: block; font-weight: 700; margin: 8px 0 12px; }
.db-note textarea { display: block; width: 100%; margin-top: 6px; border: 2px solid var(--ink, #1e1e1e); border-radius: 10px; padding: 8px 10px; font: inherit; font-weight: 400; }
.db-explain { background: #f7f5fc; border-left: 4px solid #4B2A9B; border-radius: 8px; padding: 10px 16px; margin-top: 12px; color: #1e1e1e; }
.db-explain h4 { margin: 12px 0 4px; color: #4B2A9B; }
.db-vocab li { margin: 3px 0; }
.db-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.monster-card { display: flex; gap: 16px; align-items: flex-start; }
.monster-card .mc-art { font-size: 64px; flex: 0 0 96px; text-align: center; }
.monster-card .mc-art img { width: 96px; height: 96px; }
.monster-card dt { font-weight: 800; margin-top: 8px; }
.monster-card dd { margin: 2px 0 0; }
.ss-conf { display: flex; gap: 10px; margin: 12px 0; }
.ss-score div { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed #ccc; gap: 8px; }
.ss-score b { font-size: 26px; }
.ss-score .tot b { font-size: 34px; }
.ss-score .up { color: #127a3e; font-weight: 700; } .ss-score .down { color: #c8102e; font-weight: 700; }
.ss-reward { text-align: center; padding: 30px 10px; }
.ss-reward img, .ss-reward .art { width: 140px; height: 140px; }
.ss-reward .xp { font-size: 32px; font-weight: 900; color: #b8860b; }
.ss-tips li { margin: 8px 0; line-height: 1.5; }
.ss-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; }
@media (max-width: 600px) { .monster-card { flex-direction: column; } }
/* Light backgrounds always get dark text, so the debrief stays readable in dark mode. */
.db-choice.ok, .db-choice.no, .db-choice.mine, .sat-item table.dt th, .db-explain { color: #1e1e1e; }
.sat-item svg.fig { border-radius: 6px; }
@media (prefers-color-scheme: dark) { .sat-item table.dt th, .sat-item table.dt td { border-color: #8a80a8; } .sat-item table.dt th { background: #e9e4f7; } }
