:root {
  --bg: #f4f1ea; --card: #fffdf8; --ink: #1f2a37; --muted: #6b7280; --line: #e5ded0;
  --brand: #1d5c63; --brand-2: #e8a33d; --ok: #2f855a; --bad: #c53030; --soft: #e9f2f1;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.narrow { max-width: 560px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.logo { font-weight: 800; letter-spacing: -.02em; font-size: 1.25rem; color: var(--brand); }
.logo span { color: var(--brand-2); }
.spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.card h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 650; cursor: pointer; background: var(--soft);
  color: var(--brand); transition: transform .05s, filter .15s; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.accent { background: var(--brand-2); color: #2a1a00; }
.btn.danger { background: #fde8e8; color: var(--bad); }
.btn.big { padding: 14px 22px; font-size: 1.1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.on { outline: 3px solid var(--brand-2); }
input[type=text], textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; }
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; }
label.lbl { display: block; font-weight: 650; margin: 10px 0 6px; }

.code { font-size: 3.2rem; font-weight: 850; letter-spacing: .12em; color: var(--brand); line-height: 1; }
.joinurl { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 4px 8px; border-radius: 6px; word-break: break-all; }
.qr { width: 132px; height: 132px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }

/* Player */
.playerbox { position: relative; }
.player { display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 16px 8px 8px; }
.pbtn { border: 0; background: rgba(255,255,255,.14); color: #fff; height: 42px; min-width: 42px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.pbtn.play { background: var(--brand-2); color: #2a1a00; min-width: 52px; height: 52px; font-size: 1.15rem; }
.ptime { font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 38px; }
.seek { flex: 1; accent-color: var(--brand-2); min-width: 60px; }
.playerbox.locked .pbtn, .playerbox.locked .seek { opacity: .4; pointer-events: none; }
.playerbox.locked .pbtn.play { opacity: .55; }
@media (max-width: 480px) { .pbtn.back, .pbtn.fwd { display: none; } }

.banner { border-radius: 12px; padding: 10px 14px; font-weight: 650; margin: 10px 0; }
.banner.ctrl { background: #fff3d6; color: #7a4b00; border: 1.5px solid var(--brand-2); }
.banner.info { background: var(--soft); color: var(--brand); }
.banner.warn { background: #fde8e8; color: var(--bad); }

/* Phase pills */
.phases { display: flex; gap: 8px; flex-wrap: wrap; }
.phase-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--soft); color: var(--brand); }
.phase-tag.answering { background: #fff3d6; color: #7a4b00; }
.phase-tag.results { background: #e6f4ea; color: var(--ok); }

/* Students list */
.students { list-style: none; padding: 0; margin: 0; }
.students li { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.students li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; }
.dot.on { background: #22c55e; }
.sname { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--brand); font-weight: 700; white-space: nowrap; }
.chip.hand { background: #fff3d6; color: #7a4b00; }
.chip.done { background: #e6f4ea; color: var(--ok); }
.chip.ctrl { background: var(--brand-2); color: #2a1a00; }
.mini { border: 0; background: var(--soft); color: var(--brand); border-radius: 8px; padding: 4px 9px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.mini.x { background: transparent; color: var(--muted); }
.mini.active { background: var(--brand-2); color: #2a1a00; }

/* Answers */
.qlist { display: grid; gap: 10px; }
.q { display: flex; gap: 10px; align-items: center; }
.qn { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { width: 52px; height: 46px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; }
.choice.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.mark { font-weight: 800; }
.mark.ok { color: var(--ok); } .mark.bad { color: var(--bad); }
.fix { font-size: .85rem; color: var(--ok); }

/* Leaderboard */
.lb { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.lb li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); }
.lb .rk { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; background: var(--soft); color: var(--brand); flex: none; }
.lb li:nth-child(1) .rk { background: #f6c945; color: #4a3500; }
.lb li:nth-child(2) .rk { background: #d5dbe3; color: #2d3748; }
.lb li:nth-child(3) .rk { background: #e3a877; color: #4a2300; }
.lb .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .pt { font-weight: 850; font-variant-numeric: tabular-nums; color: var(--brand); }
.lb li.me { outline: 3px solid var(--brand-2); }
.lb.big li { font-size: 1.15rem; padding: 12px 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; text-align: center; }
.stat b { display: block; font-size: 1.1rem; }
.bar { height: 6px; background: #eee; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--ok); }

.hero { text-align: center; padding: 28px 18px; }
.hero .emoji { font-size: 2.6rem; }
.status { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #e6f4ea; color: var(--ok); }
.status.off { background: #fde8e8; color: var(--bad); }
.tap { position: fixed; inset: 0; background: rgba(15,30,35,.72); display: grid; place-items: center; z-index: 50; }
.tap .btn { font-size: 1.2rem; padding: 18px 28px; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; background: #fff; }
.drop:hover { border-color: var(--brand); }

/* Bảng đáp án các nhóm */
.gridwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.grid-ans { border-collapse: collapse; width: 100%; min-width: 360px; }
.grid-ans th, .grid-ans td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 9px 10px; text-align: center; }
.grid-ans th { background: var(--soft); color: var(--brand); font-size: .9rem; white-space: nowrap; position: sticky; top: 0; }
.grid-ans th.me { background: var(--brand-2); color: #2a1a00; }
.grid-ans td.qcell { font-weight: 800; color: var(--brand); width: 44px; }
.grid-ans td.ans { font-weight: 650; }
.grid-ans td.me { background: #fffaf0; }
.grid-ans td.ok { background: #e6f4ea; color: var(--ok); }
.grid-ans td.bad { background: #fde8e8; color: var(--bad); }
.grid-ans td.edit { cursor: pointer; }
.grid-ans td.edit:hover { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.grid-ans .keycol { background: #f3f8f7; color: var(--ok); font-weight: 800; }
.teampick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.teampick button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 16px 10px; font-weight: 800; font-size: 1.05rem; cursor: pointer; color: var(--brand); }
.teampick button small { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.teampick button:hover:not([disabled]) { border-color: var(--brand); }
.teampick button[disabled] { opacity: .5; cursor: not-allowed; }
body.present .gridwrap .grid-ans th, body.present .gridwrap .grid-ans td { font-size: 1.25rem; padding: 12px 14px; }
.grid-ans .mini.grade { background: var(--brand); color: #fff; white-space: nowrap; }
.grid-ans tr.graded .qcell { background: #e6f4ea; }
.lang { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.lang button { border: 0; background: transparent; padding: 4px 10px; font-weight: 800; font-size: .8rem; cursor: pointer; color: var(--muted); }
.lang button.on { background: var(--brand); color: #fff; }

/* Lớp đông: bảng xoay */
.grid-ans.rot td.nmcell { text-align: left; font-weight: 700; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.grid-ans.rot tr.keyrow td { background: #f3f8f7; }
.grid-ans.rot tr.merow td { background: #fffaf0; }
/* Theo câu */
.byq-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.byq-q { font-size: 1.6rem; font-weight: 850; color: var(--brand); } .byq-q small { font-size: .9rem; color: var(--muted); }
.byq-key { font-size: 1.1rem; } .byq-key b { color: var(--ok); }
.bucket { position: relative; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 8px; overflow: hidden; }
.bucket .bfill { position: absolute; inset: 0 auto 0 0; background: var(--soft); z-index: 0; transition: width .3s; }
.bucket.ok .bfill { background: #d8efdf; } .bucket.bad .bfill { background: #f9dcdc; } .bucket.mix .bfill { background: #fdeccf; }
.bucket .brow, .bucket .bnames { position: relative; z-index: 1; }
.bucket .brow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.bucket .bans { flex: 1; font-weight: 800; font-size: 1.15rem; }
.bucket.ok .bans { color: var(--ok); } .bucket.bad .bans { color: var(--bad); }
.bucket .bcnt { font-weight: 800; color: var(--brand); white-space: nowrap; }
.bucket .bnames { padding: 0 12px 9px; font-size: .82rem; color: var(--muted); }
.bucket .bnames .me, .bucket.mine .bans { text-decoration: underline 3px var(--brand-2); text-underline-offset: 3px; }
/* Từng em */
.spot-name { font-size: 1.6rem; font-weight: 850; color: var(--brand); margin-bottom: 10px; }
.spot-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; margin-bottom: 8px; font-size: 1.2rem; }
.spot-row .spot-a { flex: 1; font-weight: 750; }
.spot-row.ok { background: #e6f4ea; color: var(--ok); } .spot-row.bad { background: #fde8e8; color: var(--bad); }
.spot-row .fix { color: var(--ok); font-size: .95rem; font-weight: 700; }
/* Thanh chọn kiểu hiển thị */
.viewbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.viewbar .mini.active { background: var(--brand); color: #fff; }
.viewsub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.viewsub select { border: 1.5px solid var(--line); border-radius: 8px; padding: 5px 8px; }
body.present #viewCard .byq-q { font-size: 2.2rem; } body.present #viewCard .bucket .bans { font-size: 1.6rem; }
body.present #viewCard .spot-row { font-size: 1.6rem; } body.present #viewCard .spot-name { font-size: 2.2rem; }
.mode-pick { display: flex; gap: 10px; justify-content: center; margin: 6px 0 14px; flex-wrap: wrap; }
.mode-pick label { border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; cursor: pointer; background: #fff; min-width: 170px; text-align: left; }
.mode-pick label:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.mode-pick small { display: block; color: var(--muted); font-weight: 500; }

/* ===== Trang giáo viên: màn hình Dạy (chiếu TV) ===== */
.tabs { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 800; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--brand); color: #fff; }
.roompill { background: var(--brand); color: #fff; border-radius: 999px; padding: 5px 14px; font-weight: 700; }
.roompill b { letter-spacing: .08em; font-size: 1.15em; }
body.teaching { font-size: clamp(15px, 1.05vw, 24px); }
body.teaching .wrap { max-width: none; padding: 14px 20px; }
#teach { display: grid; grid-template-columns: minmax(330px, 31%) 1fr; gap: 16px; align-items: start; }
#teach .tcol { display: flex; flex-direction: column; gap: 14px; }
#teach .card { margin: 0; }
#teach .card h2 { font-size: .8rem; }
.nowt { font-weight: 850; font-size: 1.15rem; color: var(--brand); margin-bottom: 10px; line-height: 1.25; }
.steps { display: flex; gap: 4px; margin-bottom: 12px; }
.step { flex: 1; text-align: center; font-size: .72rem; padding: 6px 2px; border-radius: 8px; background: var(--soft); color: var(--muted); font-weight: 800; white-space: nowrap; }
.step.on { background: var(--brand); color: #fff; } .step.done { color: var(--brand); }
.nextbtn { width: 100%; font-size: 1.35rem; padding: 18px 14px; border-radius: 16px; }
.subacts { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.tiles.dense { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.tile { border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; font-weight: 750; display: flex; align-items: center; gap: 6px; min-width: 0; }
.tile .tn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles.dense .tile { font-size: .78rem; padding: 5px 7px; border-width: 1.5px; }
.tile.off { opacity: .45; } .tile.sub { border-color: var(--ok); background: #e6f4ea; }
.tile.hand { border-color: var(--brand-2); background: #fff3d6; } .tile.ctrl { outline: 3px solid var(--brand-2); }
.tile button { border: 0; background: var(--brand); color: #fff; border-radius: 8px; padding: 3px 7px; font-weight: 800; cursor: pointer; font-size: .8rem; }
.handq { display: flex; flex-direction: column; gap: 6px; }
.handq .hq { display: flex; align-items: center; gap: 8px; background: #fff3d6; border: 1.5px solid var(--brand-2); border-radius: 12px; padding: 8px 10px; font-weight: 800; }
.handq .hq span { flex: 1; }
.stage { min-height: calc(100vh - 110px); }
.stagehead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.stagehead h2 { margin: 0; flex: 1; }
.joinbig { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 10px 6px; }
.joinbig .lbl2 { font-size: 1.2rem; color: var(--muted); font-weight: 700; }
.joinbig .bigcode { font-size: clamp(4rem, 8vw, 9rem); font-weight: 900; letter-spacing: .12em; color: var(--brand); line-height: 1; }
.joinbig .url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.2rem; background: var(--soft); padding: 6px 10px; border-radius: 8px; display: inline-block; margin-top: 10px; word-break: break-all; }
.joinbig img { width: clamp(180px, 16vw, 300px); height: auto; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.counter { text-align: center; padding: 10px 0 18px; } .counter b { font-size: clamp(4rem, 7vw, 8rem); color: var(--brand); line-height: 1; }
.counter span { display: block; color: var(--muted); font-weight: 700; font-size: 1.2rem; }
body.teaching .byq-q { font-size: 2.2rem; } body.teaching .bucket .bans { font-size: 1.5rem; }
body.teaching .spot-row { font-size: 1.5rem; } body.teaching .spot-name { font-size: 2.2rem; }
body.teaching .grid-ans th, body.teaching .grid-ans td { font-size: 1.1rem; }
body.teaching .stage .lb li { font-size: 1.3rem; padding: 12px 16px; }
.extnote { background: var(--soft); border-radius: 12px; padding: 12px; font-weight: 700; color: var(--brand); }
@media (max-width: 900px) { #teach { grid-template-columns: 1fr; } .joinbig { grid-template-columns: 1fr; } }

/* ===== Đáp án từng câu (thẻ lớn) ===== */
.qhead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.qnum { font-size: clamp(1.8rem, 3.2vw, 3.6rem); font-weight: 900; color: var(--brand); line-height: 1; }
.qnum small { font-size: .45em; color: var(--muted); }
.qkey { font-size: clamp(1.4rem, 2.6vw, 3rem); font-weight: 900; color: #fff; background: var(--ok); padding: 6px 20px; border-radius: 14px; }
.qkey.pending { background: var(--soft); color: var(--muted); }
.qcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 15vw, 300px), 1fr)); gap: clamp(10px, 1vw, 18px); }
.qc { position: relative; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: clamp(12px, 1.2vw, 22px); min-height: clamp(110px, 11vw, 210px);
  display: flex; flex-direction: column; justify-content: flex-start; }
.qc .qa { margin-top: auto; margin-bottom: auto; }
.qc .qt { font-weight: 900; color: #fff; background: var(--brand); font-size: clamp(1.25rem, 2.25vw, 2.9rem); line-height: 1.15;
  margin: calc(-1 * clamp(12px, 1.2vw, 22px)); margin-bottom: 10px; padding: clamp(8px, .8vw, 14px) clamp(12px, 1.2vw, 22px); padding-right: 1.7em;
  border-radius: 14px 14px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; display: block; }
.qc .qt.long { font-size: clamp(1.05rem, 1.75vw, 2.25rem); } .qc .qt.xlong { font-size: clamp(.95rem, 1.35vw, 1.75rem); }
.qc .qm { color: #fff !important; z-index: 2; top: clamp(6px, .7vw, 12px) !important; }
.qc.ok .qt { background: var(--ok); color: #fff; } .qc.bad .qt { background: var(--bad); color: #fff; }
.qc.me .qt { background: var(--brand-2); color: #2a1a00; }
.qcards.few .qc { min-height: clamp(130px, 16vw, 330px); }
.qcards.few .qc .qa { font-size: clamp(1.7rem, 3.6vw, 4.6rem); }
.qc .qa { word-break: normal; overflow-wrap: break-word; }
.qc .qa.s1, .qcards.few .qc .qa.s1 { font-size: clamp(1.4rem, 2.6vw, 3.3rem); }
.qc .qa.s2, .qcards.few .qc .qa.s2 { font-size: clamp(1.15rem, 1.9vw, 2.4rem); }
.qc .qa.s3, .qcards.few .qc .qa.s3 { font-size: clamp(1rem, 1.45vw, 1.8rem); }
.qc .qa { font-weight: 900; font-size: clamp(1.6rem, 3vw, 3.6rem); line-height: 1.1; color: var(--ink); }
.qc .qa .na { font-size: .45em; color: var(--muted); font-weight: 700; }
.qc .qm { position: absolute; top: 8px; right: 14px; font-size: clamp(1.4rem, 2.4vw, 2.8rem); font-weight: 900; }
.qc.ok { background: #e3f4e8; border-color: var(--ok); } .qc.ok .qa { color: var(--ok); }
.qc.bad { background: #fde8e8; border-color: var(--bad); } .qc.bad .qa { color: var(--bad); }
.qc.me { box-shadow: 0 0 0 4px var(--brand-2); }
.qc.edit { cursor: pointer; } .qc.edit:hover { filter: brightness(.97); }
/* Màn hình chờ */
#lobby { text-align: center; padding: 10px 0 30px; }
#lobby .lb-code { font-size: clamp(5rem, 13vw, 14rem); font-weight: 900; letter-spacing: .12em; color: var(--brand); line-height: 1; margin: 6px 0 10px; }
#lobby .lb-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(1rem, 1.6vw, 1.8rem); background: var(--soft); padding: 8px 14px; border-radius: 10px; display: inline-block; }
#lobby .lb-row { display: flex; gap: 30px; justify-content: center; align-items: center; flex-wrap: wrap; }
#lobby img { width: clamp(180px, 15vw, 320px); border-radius: 14px; border: 1px solid var(--line); background: #fff; }
#lobby .lb-count { font-size: clamp(1.2rem, 2vw, 2.2rem); font-weight: 800; color: var(--brand); margin: 22px 0 12px; }
#lobby .tiles { max-width: 1400px; margin: 0 auto 26px; }
#lobby .tiles .tile { font-size: clamp(1rem, 1.4vw, 1.6rem); padding: 12px; justify-content: center; }
#lobby .startbtn { font-size: clamp(1.4rem, 2.4vw, 2.6rem); padding: 18px 60px; border-radius: 18px; }

.qc.ok .qt { background: var(--ok); color: #fff; } .qc.bad .qt { background: var(--bad); color: #fff; }
.qc .qm { position: absolute; right: clamp(10px, 1vw, 18px); font-size: clamp(1.3rem, 2.4vw, 3rem); }

/* Bảng điểm nhiều bài */
.lbt { width: 100%; border-collapse: collapse; }
.lbt th { background: var(--soft); color: var(--brand); font-size: .85rem; padding: 8px 10px; text-align: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbt td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.lbt td.nm { text-align: left; font-weight: 800; }
.lbt td.pt-r { color: var(--muted); font-weight: 700; }
.lbt td.pt-t { font-weight: 900; color: var(--brand); font-size: 1.15em; }
.lbt .rk { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 850; background: var(--soft); color: var(--brand); }
.lbt tbody tr:nth-child(1) .rk { background: #f6c945; color: #4a3500; } .lbt tbody tr:nth-child(2) .rk { background: #d5dbe3; color: #2d3748; } .lbt tbody tr:nth-child(3) .rk { background: #e3a877; color: #4a2300; }
.lbt tr.me td { background: #fffaf0; }
body.teaching .stage .lbt th { font-size: clamp(.9rem, 1.2vw, 1.5rem); padding: 12px; }
body.teaching .stage .lbt td { font-size: clamp(1.1rem, 1.7vw, 2.1rem); padding: 12px 14px; }
body.teaching .stage .lbt .rk { width: 1.6em; height: 1.6em; }
.lbt .ls { display: none; }
@media (max-width: 640px) {
  .lbt .lf { display: none; } .lbt .ls { display: inline; }
  .lbt td, .lbt th { padding: 7px 6px; }
  .lbt td.nm { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
