/* ===== Phòng thi thật (/test?de=…&thi=1, test.js room()) — 28/10 theo mẫu phòng thi chủ trung tâm gửi, giữ màu web:
   thanh trên xanh rừng · hai cột (trái hướng dẫn + tranh / đoạn văn, phải câu hỏi) · chân trang lưới câu + trước / sau. Vừa một màn hình laptop. */
.pt-room {
  --pt-forest: #3A4A32; --pt-forest-2: #4A5C40; --pt-olive: #5F6D45; --pt-cream: #F6F1E4; --pt-paper: #FBF7EC; --pt-card: #FFFDF7;
  --pt-line: #E2D8C0; --pt-ink: #2E3528; --pt-mute: #6E6A5C; --pt-orange: #D9824A; --pt-orange-2: #C46F3A; --pt-on: #EAF0DE;
  position: fixed; inset: 0; display: grid; grid-template-rows: 64px 1fr 60px; background: var(--pt-cream); color: var(--pt-ink);
  font-family: "Be Vietnam Pro", "Quicksand", system-ui, sans-serif; z-index: 5;
}
.pt-room button { font: inherit; cursor: pointer; }
/* ---- thanh trên ---- */
.pt-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 0 20px; background: var(--pt-forest); color: #FBF6EA; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.pt-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 6px; background: #FBF6EA; }
.pt-logo img { width: 32px; height: 32px; }
.pt-title { margin: 0; text-align: center; font: 700 19px/1.2 "Lora", Georgia, serif; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-title span { margin-right: 6px; padding: 3px 9px; border-radius: 6px; background: rgba(251, 246, 234, .16); font: 700 12px/1 "Be Vietnam Pro", sans-serif; letter-spacing: .06em; text-transform: uppercase; vertical-align: 3px; }
.pt-tools { display: flex; align-items: center; gap: 10px; }
.pt-ib { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(251, 246, 234, .16); color: #FBF6EA; }
.pt-ib svg { width: 20px; height: 20px; }
.pt-ib:hover { background: rgba(251, 246, 234, .26); }
.pt-volw { position: relative; }
.pt-vol { position: absolute; top: 50px; right: -8px; padding: 12px 14px; border-radius: 6px; background: var(--pt-card); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35); z-index: 3; }
.pt-vol input { width: 140px; accent-color: var(--pt-forest); }
.pt-count { min-width: 64px; padding: 9px 12px; border-radius: 6px; background: #FBF6EA; color: var(--pt-forest); font: 700 15px/1 "Be Vietnam Pro", sans-serif; text-align: center; }
.pt-clock { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 6px; background: rgba(251, 246, 234, .14); font: 700 15px/1 ui-monospace, "SF Mono", Consolas, monospace; }
.pt-clock svg { width: 17px; height: 17px; }
.pt-clock.low { background: #B5523B; }
.pt-submit { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--pt-orange); color: #fff; font-weight: 700 !important; font-size: 15px !important; box-shadow: 0 2px 0 var(--pt-orange-2); }
.pt-submit svg { width: 17px; height: 17px; }
.pt-submit:hover { background: var(--pt-orange-2); }
/* ---- thân hai cột ---- */
.pt-body { display: grid; grid-template-columns: minmax(0, var(--pt-l, 50%)) 12px minmax(0, 1fr); min-height: 0; }
.pt-body.dragging { cursor: col-resize; user-select: none; }
.pt-split { position: relative; display: grid; place-items: center; background: var(--pt-line); cursor: col-resize; touch-action: none; }
.pt-split i { width: 4px; height: 44px; border-radius: 4px; background: #B9B29E; box-shadow: 0 0 0 3px var(--pt-line); }
.pt-split:hover, .pt-split:focus-visible, .pt-body.dragging .pt-split { background: #D3C9AE; outline: none; }
.pt-split:hover i, .pt-split:focus-visible i, .pt-body.dragging .pt-split i { background: var(--pt-forest); }
.pt-left, .pt-right { min-height: 0; min-width: 0; overflow-y: auto; padding: 26px 32px 30px; }
.pt-left { background: var(--pt-paper); }
.pt-right { background: var(--pt-cream); }
.pt-dir { margin: 0 0 18px; font-weight: 700; font-size: 15.5px; line-height: 1.5; color: var(--pt-ink); }
.pt-fig { margin: 0; display: flex; justify-content: center; }
.pt-fig img { max-width: 100%; max-height: calc(100vh - 250px); border-radius: 6px; box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .45); }
.pt-passage { padding: 18px 22px; border: 1px solid var(--pt-line); border-radius: 6px; background: var(--pt-card); font: 400 16px/1.7 "Be Vietnam Pro", system-ui, sans-serif; color: var(--pt-ink); overflow-wrap: anywhere; }
.pt-passage h3 { margin: 0 0 12px; font: 700 15px/1.45 "Be Vietnam Pro", sans-serif; color: var(--pt-forest); }
.pt-passage p { margin: 0 0 12px; }
.pt-passage table { width: 100%; border-collapse: collapse; margin: 0 0 12px; table-layout: fixed; }
.pt-passage td, .pt-passage th { padding: 7px 10px; border: 1px solid var(--pt-line); text-align: left; vertical-align: top; }
.pt-passage img { max-width: 100%; }
.pt-passage .t-blank { display: inline-block; min-width: 64px; padding: 0 8px; border-bottom: 2px solid var(--pt-olive); border-radius: 4px; background: #F1ECDC; color: var(--pt-forest); font-weight: 700; text-align: center; }
.pt-passage .t-blank.done { background: var(--pt-on); }
.pt-listen { display: grid; place-items: center; gap: 12px; margin-top: 12vh; color: var(--pt-mute); }
.pt-wave { display: flex; align-items: flex-end; gap: 5px; height: 40px; }
.pt-wave i { width: 7px; border-radius: 4px; background: var(--pt-olive); animation: ptw 1.1s ease-in-out infinite; }
.pt-wave i:nth-child(1) { height: 30%; } .pt-wave i:nth-child(2) { height: 70%; animation-delay: .15s; } .pt-wave i:nth-child(3) { height: 100%; animation-delay: .3s; }
.pt-wave i:nth-child(4) { height: 60%; animation-delay: .45s; } .pt-wave i:nth-child(5) { height: 35%; animation-delay: .6s; }
@keyframes ptw { 50% { transform: scaleY(.4); } }
@media (prefers-reduced-motion: reduce) { .pt-wave i { animation: none; } }
.pt-qh { margin: 0 0 16px; font: 700 18px/1.2 "Lora", Georgia, serif; color: var(--pt-forest); }
.pt-q { margin-bottom: 26px; }
.pt-q.flagged .pt-stem b { color: var(--pt-orange-2); }
.pt-stem { margin: 0 0 12px; font-weight: 600; font-size: 16px; line-height: 1.5; }
.pt-opt { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--pt-line); border-radius: 6px; background: var(--pt-card); cursor: pointer; font-size: 16px; line-height: 1.45; transition: border-color .15s, background .15s; }
.pt-opt:hover { border-color: var(--pt-olive); }
.pt-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pt-opt i { flex: none; width: 18px; height: 18px; border: 2px solid #B9B29E; border-radius: 50%; }
.pt-opt.on { border-color: var(--pt-forest); background: var(--pt-on); box-shadow: inset 3px 0 0 var(--pt-forest); }
.pt-opt.on i { border-color: var(--pt-forest); background: radial-gradient(circle, var(--pt-forest) 0 4px, transparent 5px); }
.pt-opt:focus-within { outline: 2px solid var(--pt-olive); outline-offset: 2px; }
/* ---- chân trang ---- */
.pt-foot { display: flex; align-items: center; gap: 14px; padding: 0 20px; border-top: 1px solid var(--pt-line); background: var(--pt-card); }
.pt-mark { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--pt-line); border-radius: 6px; background: transparent; color: var(--pt-mute); font-weight: 600 !important; font-size: 14px !important; }
.pt-mark svg { width: 17px; height: 17px; }
.pt-mark.on { border-color: var(--pt-orange); background: #FBE9DC; color: var(--pt-orange-2); }
.pt-lnote { display: none; color: var(--pt-mute); font-size: 13.5px; }
.pt-nav { margin-left: auto; display: flex; gap: 8px; }
.pt-gridbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--pt-olive); color: #fff; font-weight: 700 !important; font-size: 15px !important; }
.pt-gridbtn svg { width: 17px; height: 17px; }
.pt-arrow { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 6px; background: var(--pt-forest); color: #fff; }
.pt-arrow svg { width: 20px; height: 20px; }
.pt-arrow:hover, .pt-gridbtn:hover { filter: brightness(1.1); }
.pt-foot.listen .pt-arrow, .pt-foot.listen .pt-gridbtn { display: none; }
.pt-foot.listen .pt-lnote { display: block; }
/* ---- lưới câu ---- */
.pt-gridpop { position: fixed; right: 20px; bottom: 70px; width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 160px); overflow-y: auto; padding: 16px 18px; border: 1px solid var(--pt-line); border-radius: 6px; background: var(--pt-card); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); z-index: 4; }
.pt-grid-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--pt-mute); }
.pt-grid-h b { font: 700 16px/1 "Lora", serif; color: var(--pt-forest); }
.pt-grid-h i { display: inline-block; width: 11px; height: 11px; margin: 0 4px 0 10px; border-radius: 3px; vertical-align: -1px; }
.pt-grid-h i.d { background: var(--pt-forest); } .pt-grid-h i.f { background: var(--pt-orange); } .pt-grid-h i.c { border: 2px solid var(--pt-olive); }
.pt-gp h4 { margin: 12px 0 7px; font-size: 13px; font-weight: 700; color: var(--pt-ink); }
.pt-gp > div { display: flex; flex-wrap: wrap; gap: 5px; }
.pt-n { width: 38px; height: 32px; border: 1px solid var(--pt-line); border-radius: 6px; background: #fff; color: var(--pt-ink); font-size: 13px !important; font-weight: 600 !important; }
.pt-n.d { background: var(--pt-forest); border-color: var(--pt-forest); color: #fff; }
.pt-n.f { box-shadow: inset 0 -3px 0 var(--pt-orange); }
.pt-n.c { outline: 2px solid var(--pt-olive); outline-offset: 1px; }
.pt-n:disabled { cursor: default; opacity: .55; }
/* ---- màn bắt đầu ---- */
.pt-start { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(233, 228, 210, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); z-index: 6; } /* mờ hẳn đề phía sau: chưa bấm bắt đầu thì không đọc được tranh / câu hỏi */
.pt-start-box { width: min(560px, 100%); padding: 28px 30px; border-radius: 8px; background: var(--pt-card); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.pt-start-tag { display: inline-block; padding: 5px 10px; border-radius: 6px; background: var(--pt-forest); color: #FBF6EA; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pt-start-box h2 { margin: 12px 0 4px; font: 700 24px/1.25 "Lora", Georgia, serif; color: var(--pt-forest); }
.pt-start-sub { margin: 0 0 14px; color: var(--pt-mute); font-weight: 600; }
.pt-start-box ul { margin: 0 0 16px; padding-left: 20px; line-height: 1.6; }
.pt-warn { padding: 10px 12px; border-radius: 6px; background: #FBE9DC; color: #8A4A22; font-size: 14px; }
.pt-start-a { display: flex; justify-content: flex-end; gap: 10px; }
/* ---- thông báo nhỏ ---- */
.pt-toast { position: fixed; left: 50%; top: 76px; transform: translate(-50%, -10px); padding: 10px 16px; border-radius: 6px; background: var(--pt-forest, #3A4A32); color: #FBF6EA; font: 600 14px/1.3 "Be Vietnam Pro", sans-serif; opacity: 0; pointer-events: none; transition: .25s; z-index: 9; }
.pt-toast.on { opacity: 1; transform: translate(-50%, 0); }
/* ---- màn hẹp: xếp chồng ---- */
@media (max-width: 860px) {
  .pt-room { grid-template-rows: auto 1fr auto; }
  .pt-top { grid-template-columns: auto 1fr; padding: 8px 12px; gap: 8px; }
  .pt-title { text-align: left; font-size: 15px; }
  .pt-tools { grid-column: 1 / -1; justify-content: space-between; }
  .pt-submit span { display: none; }
  .pt-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .pt-split { display: none; }
  .pt-left, .pt-right { overflow: visible; padding: 16px; }
  .pt-left { border-right: 0; border-bottom: 1px solid var(--pt-line); }
  .pt-foot { padding: 8px 12px; }
  .pt-mark span, .pt-lnote { display: none !important; }
}
/* ---- màn hướng dẫn (directions) trước mỗi Part nghe / phần đọc — 28/10 theo mẫu chủ trung tâm gửi ---- */
.pt-dirscreen { position: absolute; inset: 0; z-index: 5; display: grid; grid-template-rows: 64px 1fr; background: var(--pt-cream); }
.pt-dbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; background: var(--pt-forest); color: #FBF6EA; font-weight: 700; font-size: 16px; }
.pt-dbar > span { display: inline-flex; align-items: center; gap: 10px; }
.pt-dbar svg { width: 20px; height: 20px; }
.pt-dskip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid rgba(251, 246, 234, .45); border-radius: 6px; background: rgba(251, 246, 234, .12); color: #FBF6EA; font-weight: 700 !important; font-size: 14.5px !important; }
.pt-dskip:hover { background: rgba(251, 246, 234, .24); }
.pt-dbody { min-height: 0; overflow-y: auto; padding: 2.5vh 20px 24px; display: flex; flex-direction: column; align-items: center; justify-content: safe center; }
.pt-dbody h2 { margin: 0 0 12px; font: 700 clamp(28px, 3.4vw, 40px)/1.1 "Lora", Georgia, serif; letter-spacing: .02em; color: var(--pt-forest); }
.pt-dcard { width: min(760px, 100%); padding: 24px 28px; border: 1px solid var(--pt-line); border-radius: 6px; background: var(--pt-card); box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .4); font-size: 17px; line-height: 1.7; color: var(--pt-ink); }
.pt-dcard p { margin: 0; }
.pt-dcard h3 { margin: 18px 0 6px; font: 700 18px/1.3 "Lora", Georgia, serif; color: var(--pt-forest); }
.pt-dcard figure { margin: 12px 0 0; display: flex; justify-content: center; }
.pt-dcard figure img { max-width: min(420px, 100%); max-height: 26vh; border-radius: 6px; box-shadow: 0 8px 22px -14px rgba(0, 0, 0, .5); }
.pt-dex { margin-top: 16px !important; padding: 12px 16px; border: 1px solid #D6DDC4; border-radius: 6px; background: #EEF2E3; font-style: italic; font-size: 16px; }
.pt-dir-full { font-weight: 500 !important; }
.pt-dir-full b { display: block; margin-bottom: 4px; font-family: "Lora", Georgia, serif; color: var(--pt-forest); }
@media (max-width: 860px) { .pt-dirscreen { grid-template-rows: auto 1fr; } .pt-dbar { padding: 10px 12px; font-size: 14px; } .pt-dcard { padding: 16px; font-size: 15.5px; } }

/* 28/10 soát bằng Gemini: tương phản nút đạt chuẩn (cam / olive đậm hơn), viền focus bàn phím, ảnh thấp hơn trên điện thoại */
.pt-submit { background: #B25D2A; box-shadow: 0 2px 0 #8E4A20; } /* 28/10 đợt 2: #B5602C chữ trắng chỉ 4.49:1 */
.pt-submit:hover { background: #9E5326; }
.pt-gridbtn { background: #5F6D45; }
.pt-mark.on { color: #8A4A22; border-color: #8A4A22; }
.pt-arrow:disabled { opacity: .35; cursor: default; }
.pt-room button:focus-visible, .pt-dirscreen button:focus-visible { outline: 2px solid #D9C98F; outline-offset: 2px; }
.pt-room .pt-body button:focus-visible, .pt-gridpop button:focus-visible { outline-color: #3A4A32; }
@media (max-width: 860px) { .pt-fig img { max-height: 38vh; } }
