@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("../fonts/BeVietnamPro-Regular.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("../fonts/BeVietnamPro-SemiBold.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 800; font-display: swap; src: url("../fonts/BeVietnamPro-ExtraBold.woff") format("woff"); }

:root {
  /* bảng xanh và phấn màu */
  --board: #1d3a33;
  --board-deep: #142a25;
  --board-raised: #25483f;
  --board-line: rgba(243, 241, 231, 0.16);
  --chalk: #f3f1e7;
  --chalk-dim: rgba(243, 241, 231, 0.68);
  --yellow: #f6d55c;
  --pink: #f497b6;
  --blue: #8ccbf2;
  --mint: #8fe0b8;
  --orange: #f7a35c;
  --lilac: #c3a6f0;

  /* mặt bàn làm việc của quản trị */
  --desk: #eef1ec;
  --paper: #ffffff;
  --ink: #15302a;
  --ink-soft: #52665f;
  --rule: #d3dcd6;
  --primary: #1f5546;
  --primary-hover: #17463a;
  --danger: #b63a26;
  --ok: #1f7a52;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--board); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-md); padding: 12px 20px; font-weight: 600; line-height: 1.2; transition: background-color .15s, transform .1s, box-shadow .15s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-chalk { background: var(--yellow); color: #2a2410; box-shadow: 0 4px 0 #b99a2a; }
.btn-chalk:hover { background: #f9de7a; }
.btn-chalk:active { box-shadow: 0 2px 0 #b99a2a; transform: translateY(2px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { background: rgba(21, 48, 42, .05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9b2f1d; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn-icon { padding: 7px; width: 34px; height: 34px; border-radius: var(--r-sm); background: transparent; border: 1px solid var(--rule); color: var(--ink-soft); }
.btn-icon:hover:not([disabled]) { background: rgba(21, 48, 42, .06); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- bảng (sinh viên + đăng nhập) ---------- */
.board {
  min-height: 100vh; min-height: 100dvh; color: var(--chalk);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,.07), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(0,0,0,.25), transparent 60%),
    var(--board);
  padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}
.board-inner { max-width: 640px; margin: 0 auto; }
.demo-flag { display: inline-block; align-self: flex-start; font-size: 13px; color: var(--board-deep); background: var(--mint); border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.board .demo-flag { margin-bottom: 20px; }

.center-screen { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; justify-content: center; }
.hero-title { font-size: clamp(36px, 9vw, 64px); line-height: 1.08; font-weight: 800; margin: 0 0 20px; letter-spacing: -0.02em; text-wrap: balance; }
.chalk-underline { display: block; width: 180px; height: 14px; margin: 0 0 28px; color: var(--yellow); }
.lead { font-size: 18px; color: var(--chalk-dim); margin: 0 0 32px; max-width: 34em; }
.big-cta { font-size: 20px; padding: 18px 40px; border-radius: 16px; align-self: flex-start; }
.screen-icon { width: 72px; height: 72px; margin-bottom: 24px; }
.state-title { font-size: clamp(28px, 7vw, 40px); line-height: 1.15; font-weight: 800; margin: 0 0 12px; text-wrap: balance; }

/* phiếu trả lời */
.form-head { margin: 8px 0 28px; }
.form-head h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; }
.form-head p { margin: 0; color: var(--chalk-dim); }
.q-card { background: var(--board-raised); border: 1px solid var(--board-line); border-radius: var(--r-lg); padding: 22px 20px 24px; margin-bottom: 18px; scroll-margin-top: 16px; }
.q-card.invalid { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(247,163,92,.35); }
.q-num { font-size: 14px; font-weight: 600; color: var(--yellow); margin: 0 0 6px; }
.q-text { font-size: 20px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; white-space: pre-wrap; }
.q-hint { font-size: 14px; color: var(--chalk-dim); margin: 0 0 16px; }
.q-error { font-size: 14px; color: var(--orange); margin: 12px 0 0; font-weight: 600; }
.word-inputs { display: grid; gap: 10px; }
.word-field { display: flex; align-items: center; gap: 10px; }
.word-field label { flex: 0 0 auto; width: 52px; font-size: 14px; color: var(--chalk-dim); }
.chalk-input { width: 100%; background: var(--board-deep); border: 1.5px solid var(--board-line); border-radius: var(--r-md); padding: 13px 14px; font-size: 17px; color: var(--chalk); }
.chalk-input::placeholder { color: rgba(243,241,231,.35); }
.chalk-input:focus { outline: none; border-color: var(--yellow); }
.options { display: grid; gap: 10px; }
.option { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--board-line); background: var(--board-deep); cursor: pointer; transition: border-color .15s, background-color .15s; }
.option:hover { border-color: rgba(243,241,231,.4); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .letter { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; border: 1.5px solid rgba(243,241,231,.4); }
.option .otext { font-size: 17px; }
.option:has(input:checked) { border-color: var(--yellow); background: rgba(246,213,92,.12); }
.option:has(input:checked) .letter { background: var(--yellow); color: #2a2410; border-color: var(--yellow); }
.option:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.submit-row { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.submit-row .btn { font-size: 18px; padding: 16px; }
.submit-msg { color: var(--orange); font-weight: 600; margin: 0; }

/* đăng nhập */
.login-card { max-width: 400px; margin: 0 auto; }
.login-card h1 { font-size: 32px; line-height: 1.15; margin: 0 0 8px; font-weight: 800; }
.login-card p { color: var(--chalk-dim); margin: 0 0 28px; }
.login-card label { display: block; font-weight: 600; margin-bottom: 8px; }
.login-card .btn { width: 100%; margin-top: 16px; font-size: 17px; padding: 15px; }
.login-error { color: var(--orange); font-weight: 600; margin: 12px 0 0; min-height: 1.5em; }

/* ---------- quản trị ---------- */
.admin { min-height: 100vh; background: var(--desk); color: var(--ink); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--board); color: var(--chalk); }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-right: 8px; }
.brand svg { width: 28px; height: 28px; }
.tabs { display: flex; gap: 4px; background: rgba(0,0,0,.18); padding: 4px; border-radius: 12px; }
.tab { border: 0; background: transparent; color: var(--chalk-dim); padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 15px; }
.tab:hover { color: var(--chalk); }
.tab[aria-selected="true"] { background: var(--chalk); color: var(--board); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.2); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa59f; }
.status.on .dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(143,224,184,.25); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(143,224,184,0); } }
.count-pill { font-size: 14px; color: var(--chalk-dim); }
.count-pill b { color: var(--chalk); font-size: 16px; }
.btn-toggle-on { background: var(--mint); color: var(--board-deep); }
.btn-toggle-on:hover { background: #a6e8c7; }
.btn-toggle-off { background: var(--orange); color: #331a05; }
.btn-toggle-off:hover { background: #f9b47a; }
.topbar .btn-ghost { color: var(--chalk); border-color: var(--board-line); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.08); }

.admin-main { max-width: 1400px; margin: 0 auto; padding: 24px 16px 120px; }
.panel-title { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.panel-sub { color: var(--ink-soft); margin: 0 0 20px; }

/* soạn câu hỏi */
.editor { max-width: 860px; }
.share-box { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.share-box .lbl { font-weight: 600; }
.share-box code { font-family: var(--font); background: var(--desk); padding: 6px 10px; border-radius: 6px; font-size: 15px; word-break: break-all; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input, .textarea, .num { width: 100%; background: var(--paper); border: 1.5px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px; color: var(--ink); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.input:focus, .textarea:focus, .num:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,85,70,.15); }
.input.invalid, .textarea.invalid { border-color: var(--danger); }
.num { width: 88px; text-align: center; font-weight: 600; }

.qe { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 18px 20px; margin-bottom: 14px; }
.qe-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.qe-num { font-weight: 800; font-size: 18px; min-width: 64px; }
.seg { display: inline-flex; background: var(--desk); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(21,48,42,.15); }
.qe-tools { margin-left: auto; display: flex; gap: 6px; }
.qe-tools .del:hover { color: var(--danger); border-color: var(--danger); }
.wc-setting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--desk); border-radius: var(--r-md); padding: 12px 14px; }
.wc-setting label { font-weight: 600; font-size: 15px; }
.wc-setting small { color: var(--ink-soft); font-size: 14px; flex-basis: 100%; }
.opt-list { display: grid; gap: 8px; margin-bottom: 10px; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row .letter { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.add-btn { border: 1.5px dashed #a9b8b1; background: transparent; color: var(--primary); padding: 12px 18px; border-radius: var(--r-md); font-weight: 600; }
.add-btn:hover { background: rgba(31,85,70,.06); border-color: var(--primary); }
.empty-editor { border: 1.5px dashed #b9c6c0; border-radius: var(--r-lg); padding: 32px 20px; text-align: center; color: var(--ink-soft); }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--paper); border-top: 1px solid var(--rule); box-shadow: 0 -6px 20px rgba(21,48,42,.06); }
.savebar-inner { max-width: 1400px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.savebar .note { color: var(--ink-soft); font-size: 15px; margin-right: auto; }
.savebar .note.dirty { color: #8a5a00; font-weight: 600; }

/* thống kê */
.live { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.qlist { display: grid; gap: 8px; position: sticky; top: 76px; }
.qlist button { text-align: left; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 2px; }
.qlist button:hover { border-color: #a9b8b1; }
.qlist button[aria-current="true"] { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.qlist .t { font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qlist .m { font-size: 13px; color: var(--ink-soft); }
.stage-wrap { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--board-deep); height: min(72vh, 720px); min-height: 380px; }
.stage-wrap:fullscreen { border-radius: 0; height: 100vh; }
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; }
.stage-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.45)); }
.stage-head { position: absolute; left: 0; right: 0; top: 0; padding: 18px 22px; display: flex; gap: 16px; align-items: flex-start; color: var(--chalk); pointer-events: none; }
.stage-q { font-size: clamp(18px, 2.2vw, 30px); font-weight: 800; line-height: 1.2; margin: 0; max-width: 70%; text-wrap: balance; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.stage-tools { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.stage-tools button { border: 1px solid var(--board-line); background: rgba(20,42,37,.7); color: var(--chalk); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 600; backdrop-filter: blur(6px); }
.stage-tools button:hover { background: rgba(37,72,63,.9); }
.stage-tools button[aria-pressed="true"] { background: var(--chalk); color: var(--board); }
.stage-foot { position: absolute; left: 22px; bottom: 18px; color: var(--chalk); pointer-events: none; }
.stage-foot b { font-size: clamp(28px, 3vw, 44px); font-weight: 800; line-height: 1; display: block; }
.stage-foot span { color: var(--chalk-dim); font-size: 15px; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--chalk-dim); font-size: 18px; text-align: center; padding: 20px; pointer-events: none; }
.stage-err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--chalk); padding: 24px; text-align: center; }
.bar-label { color: var(--chalk); text-align: center; width: 150px; font-size: 14px; line-height: 1.3; pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.bar-label .pct { display: block; font-weight: 800; font-size: 20px; }
.bar-label .opt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stage-wrap:fullscreen .bar-label { width: 220px; font-size: 18px; }
.stage-wrap:fullscreen .bar-label .pct { font-size: 28px; }

.details { margin-top: 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 18px; }
.details h3 { margin: 0 0 12px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--desk); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 15px; }
.chip b { background: var(--paper); border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.rtable td { padding: 8px 6px; border-top: 1px solid var(--rule); vertical-align: middle; }
.rtable tr:first-child td { border-top: 0; }
.rtable .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 8px; }
.rtable .n { text-align: right; font-weight: 600; white-space: nowrap; width: 1%; }
.muted { color: var(--ink-soft); }
.demo-tools { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); font-size: 14px; }

/* hộp thoại + toast */
.modal-back { position: fixed; inset: 0; background: rgba(10,22,19,.55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--paper); border-radius: var(--r-lg); max-width: 440px; width: 100%; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 20px; color: var(--ink-soft); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--board-line); border-top-color: var(--yellow); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .live { grid-template-columns: 1fr; }
  .qlist { position: static; grid-auto-flow: column; grid-auto-columns: minmax(220px, 70%); overflow-x: auto; padding-bottom: 4px; }
  .stage-wrap, .stats-page .stage-wrap { height: 62vh; min-height: 340px; }
  .stage-q { max-width: 100%; }
  .stage-head { flex-direction: column; }
  .stage-tools { margin-left: 0; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .topbar-right { margin-left: 0; width: 100%; }
  .brand { margin-right: auto; }
  .count-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.savebar .btn { white-space: nowrap; }
@media (max-width: 640px) { .savebar .note { font-size: 13px; } }

/* nhóm nút trên sân khấu; màu do biến CSS đặt theo màu nền đã chọn */
.stage-wrap { --stage-ink: #f3f1e7; --stage-dim: rgba(243,241,231,.7); --tool-bg: rgba(0,0,0,.28); --tool-line: rgba(255,255,255,.18); --tool-on-bg: #f3f1e7; --tool-on-ink: #1d2a26; --vignette: rgba(0,0,0,.4); --label-shadow: 0 1px 6px rgba(0,0,0,.5); }
.stage-vignette { background: radial-gradient(120% 90% at 50% 45%, transparent 58%, var(--vignette)); }
.stage-head, .stage-foot { color: var(--stage-ink); }
.stage-foot span, .stage-empty { color: var(--stage-dim); }
.stage-q { text-shadow: var(--label-shadow); }
.stage-tools button { background: var(--tool-bg); color: var(--stage-ink); border-color: var(--tool-line); }
.stage-tools button:hover { background: var(--tool-bg); filter: brightness(1.15); }
.stage-tools button[aria-pressed="true"] { background: var(--tool-on-bg); color: var(--tool-on-ink); }
.stage-tools .tool-group { display: inline-flex; border: 1px solid var(--tool-line); border-radius: 10px; overflow: hidden; backdrop-filter: blur(6px); }
.stage-tools .tool-group button { border: 0; border-radius: 0; backdrop-filter: none; }
.stage-tools .tool-group button + button { border-left: 1px solid var(--tool-line); }
.bar-label { color: var(--stage-ink); text-shadow: var(--label-shadow); }

/* bảng chỉnh màu */
.color-panel .presets { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.preset { display: grid; gap: 6px; justify-items: start; border: 1.5px solid var(--rule); background: var(--paper); border-radius: var(--r-md); padding: 8px; font-size: 14px; font-weight: 600; }
.preset:hover { border-color: #a9b8b1; }
.preset[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(31,85,70,.2); }
.preset .pv { display: flex; gap: 4px; padding: 8px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.preset .pv i { width: 14px; height: 22px; border-radius: 3px; display: block; }
.color-rows { display: grid; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.color-row .cl { font-weight: 600; font-size: 15px; min-width: 130px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch-wrap { position: relative; }
.swatch { display: block; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(0,0,0,.22); cursor: pointer; }
.swatch input { width: 64px; height: 64px; margin: -12px; border: 0; padding: 0; cursor: pointer; background: none; }
.sw-del { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 13px; line-height: 20px; padding: 0; opacity: 0; transition: opacity .15s; }
.swatch-wrap:hover .sw-del, .sw-del:focus-visible { opacity: 1; }
@media (hover: none) { .sw-del { opacity: 1; } }
.sw-add { width: 40px; height: 40px; border-radius: 10px; border: 1.5px dashed #a9b8b1; background: transparent; color: var(--primary); font-size: 20px; font-weight: 600; }
.small { font-size: 13px; margin: 12px 0 0; }

/* công tắc bật tắt */
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; margin-left: auto; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #c5cfca; position: relative; transition: background-color .15s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* trang thống kê công khai */
.stats-title { font-weight: 600; color: var(--chalk-dim); }
.stats-page .stage-wrap { height: calc(100vh - 140px); min-height: 420px; }
.stats-msg { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.stats-msg .screen-icon { margin: 0 auto 16px; display: block; }
.stats-msg h1 { margin: 0 0 8px; font-size: 26px; }
.stats-msg p { color: var(--ink-soft); margin: 0; }
