/* Quiz nhóm: giao diện bổ sung cho ChiaNè / Trò chơi nhóm (game.css). */
.qz-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.qz-code-in { text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: .5em; padding-left: calc(.5em + 14px); text-transform: uppercase; }
.qz-code-tag { display: inline-block; padding: 0 .5em; border-radius: 10px; background: var(--teal-soft); color: var(--teal-deep); letter-spacing: .25em; font-weight: 800; }
.qz-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.qz-wait { margin: 8px 0; color: var(--ink-2); }
.qz-room .card { margin-bottom: 14px; }
.qz-msg { text-align: center; }
.qz-bigcode { font-size: clamp(2.4rem, 12vw, 3.6rem); font-weight: 800; letter-spacing: .3em; padding-left: .3em; color: var(--teal-deep); line-height: 1.15; }
.qz-guest-code { text-align: center; }
.qz-invite-grid { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 520px) { .qz-invite-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.qz-invite-info { min-width: 0; width: 100%; }
.qz-link { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.qz-link input { flex: 1; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: .9rem; }
.qz-qr { width: 200px; height: 200px; line-height: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.qz-qr svg { width: 100%; height: 100%; display: block; }
.qz-count { font-weight: 600; color: var(--ink-3); font-size: .9em; }
.qz-plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qz-prow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qz-prow.is-off { opacity: .6; }
.qz-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; }
.qz-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qz-pname small { color: var(--ink-3); font-weight: 500; }
.qz-badge { padding: 2px 8px; border-radius: 99px; background: var(--khaki-soft); color: var(--ink-2); font-size: .72rem; font-weight: 700; }
.qz-badge.is-off { background: var(--mahogany-soft); color: var(--mahogany); }
.qz-x { flex: none; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; font: inherit; font-weight: 700; color: var(--mahogany); cursor: pointer; }
.qz-x:hover, .qz-x.is-arm { background: var(--mahogany); color: #fff; border-color: var(--mahogany); }
.qz-lobby-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qz-lobby-actions .btn-primary { margin-left: auto; min-width: 190px; }
.qz-lock-ico { font-size: 1.2rem; margin-right: 4px; }
#qzLock.is-locked { border-color: var(--mahogany); background: var(--mahogany-soft); color: var(--mahogany); }
.qz-msgs { margin: 12px 0; max-height: 220px; min-height: 80px; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.qz-audio { position: absolute; width: 0; height: 0; overflow: hidden; }

.qz-home { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 420px) { .qz-home { grid-template-columns: 1fr; } }

/* ---- Màu và biểu tượng đáp án (hình + màu để người mù màu vẫn phân biệt được) ---- */
.qz-c0 { --c: #d1283f; } .qz-c1 { --c: #1b66c9; } .qz-c2 { --c: #c78d00; }
.qz-c3 { --c: #26890c; } .qz-c4 { --c: #7a42b5; } .qz-c5 { --c: #0b8f8f; }

/* ---- Trang tạo phòng ---- */
.qz-check { margin-top: 4px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.qz-check input { margin-top: 4px; width: 18px; height: 18px; }
.qz-q { margin-bottom: 14px; }
.qz-q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.qz-q-n { font-size: 1.1rem; }
.qz-q-time { white-space: nowrap; margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-2); }
.qz-q-time select { width: auto; padding: 6px 8px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; font: inherit; }
.qz-q-del, .qz-a-del { flex: none; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--mahogany); font: inherit; font-weight: 700; cursor: pointer; }
.qz-q-del:hover, .qz-a-del:hover { background: var(--mahogany); color: #fff; }
.qz-q-del[hidden], .qz-a-del[hidden], .qz-a-add[hidden] { display: none; }
.qz-q-text { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 16px; resize: vertical; margin-bottom: 10px; }
.qz-a-list { display: grid; gap: 8px; margin-bottom: 10px; }
.qz-a-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: var(--c); }
.qz-a-ok { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); color: #fff; font-weight: 800; cursor: pointer; }
.qz-a-ok input { width: 18px; height: 18px; accent-color: #fff; }
.qz-a-row:has(input[type=checkbox]:checked) { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #fff inset; }
.qz-a-row:has(input[type=checkbox]:checked) .qz-a-ok { background: #fff; color: var(--c); }
.qz-a-text { flex: 1; min-width: 0; padding: 8px 10px; border: 0; border-radius: 10px; background: #fff; font: inherit; font-size: 16px; }
.qz-a-del { border-color: rgba(255, 255, 255, .7); color: #fff; }
.qz-add { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.qz-hint { margin: 6px 0 0; color: var(--ink-3); font-size: .85rem; }
.qz-multi { margin: 4px 0 12px; text-align: center; font-weight: 700; color: var(--teal-deep); }
.qz-send { display: block; margin: 16px auto 0; min-width: 200px; }
.qz-ans.is-pick { outline: 4px solid #fff; box-shadow: 0 0 0 7px var(--ink); }
.qz-count { color: var(--ink-3); font-weight: 600; font-size: .9em; }

/* ---- Màn chơi: trang trống, chỉ nội dung cần thiết ---- */
body.qz-play .topbar, body.qz-play .app-footer, body.qz-play .qz-top { display: none; }
body.qz-play { background: #f4f1ea; }
.qz-game { max-width: 960px; margin: 0 auto; padding: 8px 0 40px; }
.qz-center { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.qz-intro-ico { font-size: 4rem; line-height: 1; }
.qz-big { margin: 0; font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1.2; }
.qz-sub { margin: 0; color: var(--ink-2); font-size: 1.1rem; }
.qz-count-big { font-size: 5rem; font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }
.qz-question { margin: 14px 0 18px; text-align: center; font-size: clamp(1.4rem, 5vw, 2.4rem); line-height: 1.3; overflow-wrap: anywhere; }
.qz-hbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.qz-qn { min-width: 90px; }
.qz-timer { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 180px; }
.qz-time { min-width: 2.2ch; text-align: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal-deep); }
.qz-bar { flex: 1; height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.qz-bar span { display: block; height: 100%; width: 100%; background: var(--teal); transition: width .15s linear; }
.qz-bar.is-low span { background: #d64545; }
.qz-bar.is-low + .x, .qz-timer:has(.is-low) .qz-time { color: #d64545; }
[data-role=player] > .qz-timer { margin-top: 6px; }

.qz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qz-answers.n2 { grid-template-columns: 1fr; }
@media (max-width: 560px) { .qz-answers { grid-template-columns: 1fr; } }
.qz-ans { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; border: 0; border-radius: 16px; background: var(--c); color: #fff; font: inherit; font-size: clamp(1.05rem, 3.6vw, 1.5rem); font-weight: 700; text-align: left; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); transition: transform .1s, opacity .2s; }
.qz-ans:disabled { cursor: default; }
.qz-ans:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.qz-ans .qz-sym { flex: none; width: 2.2rem; text-align: center; font-size: 1.6rem; }
.qz-ans-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qz-ans.is-mine { outline: 4px solid #fff; box-shadow: 0 0 0 7px var(--ink); }
.qz-ans.is-wrong { opacity: .35; }
.qz-ans.is-right { box-shadow: 0 0 0 5px #fff, 0 0 0 9px #26890c; }
.qz-ans.is-right::after { content: '✓'; position: absolute; right: -8px; top: -12px; width: 34px; height: 34px; line-height: 34px; text-align: center; border-radius: 50%; background: #26890c; font-size: 1.2rem; box-shadow: 0 0 0 3px #fff; }
.qz-dist { flex: none; min-width: 2ch; padding: 2px 10px; border-radius: 99px; background: rgba(0, 0, 0, .28); font-variant-numeric: tabular-nums; }
.qz-msg-line { margin: 18px 0 0; text-align: center; font-size: 1.4rem; font-weight: 800; }
.qz-msg-line.ok { color: #1f7a3d; }
.qz-msg-line.bad { color: #c0392b; }

.qz-top10 { margin-top: 26px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.qz-top10 h2 { margin: 0 0 10px; font-size: 1.2rem; }
.qz-top10 ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qz-rk { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.qz-rk.r1 { background: #fff4c7; border-color: #e6c84a; }
.qz-rk.r2 { background: #eef0f4; }
.qz-rk.r3 { background: #f8e6d6; }
.qz-pos { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--teal); color: #fff; font-weight: 800; font-size: .9rem; }
.qz-rn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 1.05rem; }
.qz-sc { font-variant-numeric: tabular-nums; }
.qz-game .wh-actions { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) { .qz-bar span, .qz-ans { transition: none; } }

/* ---- Tạo phòng: khoảng cách các khối, nút lưu, popup, bộ quiz đã lưu ---- */
#crForm > .card:first-child { margin-bottom: 26px; }
.qz-create-actions { display: flex; gap: 10px; align-items: stretch; margin-top: 6px; }
.qz-create-actions .btn-primary { flex: 1; }
.qz-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .5); }
.qz-modal[hidden] { display: none; }
.qz-modal-box { width: 100%; max-width: 380px; background: var(--paper); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-lift); }
.qz-modal-box h2 { margin: 0 0 12px; font-size: 1.2rem; }
.qz-modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.qz-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 210; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; box-shadow: var(--shadow-lift); }
.qz-sets { margin-top: 26px; }
.qz-sets h2 { font-size: 1.1rem; margin: 0 0 10px; }
.qz-set { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.qz-set-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; color: inherit; text-decoration: none; }
.qz-set-open b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-set-open small { color: var(--ink-3); }
.qz-set:hover { border-color: var(--teal); }
.qz-set-del { flex: none; margin-right: 10px; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--mahogany); font: inherit; font-weight: 700; cursor: pointer; }
.qz-set-del:hover { background: var(--mahogany); color: #fff; }
