/* ---------- whiteboards (social/board.js) ---------- */
.qb { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; background: color-mix(in oklab, var(--bg-base) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-align: left; animation: qsFade 0.2s ease both; }
.qb-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.qb-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.qb-title > .material-symbols-outlined { color: var(--accent-cyan); }
.qb-title span { display: flex; flex-direction: column; min-width: 0; }
.qb-title b { font: 700 0.95rem var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-title small { font-size: 0.72rem; color: var(--text-muted); }
.qb-grow { flex: 1; }
.qb-people { display: flex; padding-left: 8px; }
.qb-face { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -7px; border-radius: 50%; background: hsl(var(--h, 200) 70% 45%); color: #fff; font: 700 0.7rem var(--font-ui); box-shadow: 0 0 0 2px var(--bg-base); flex: none; }
.qb-face.sm { width: 24px; height: 24px; margin: 0; font-size: 0.6rem; box-shadow: none; }
.qb-face.more { background: rgba(var(--ink-rgb), 0.2); }
.qb-play .material-symbols-outlined { font-size: 1.1rem; }
.qb-main { flex: 1; min-height: 0; display: flex; }
.qb-stage { flex: 1; min-width: 0; display: grid; place-items: center; padding: 8px; }
.qb-paper { position: relative; border-radius: calc(14px * var(--round, 1)); overflow: hidden; background-color: #fbfbf8; background-image: radial-gradient(rgba(0, 0, 0, 0.12) 1px, transparent 1.4px); background-size: 24px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.1); touch-action: none; }
.qb-canvas { position: absolute; inset: 0; display: block; cursor: crosshair; touch-action: none; }
.qb-canvas[data-tool="text"], .qb-canvas[data-tool="note"] { cursor: text; }
.qb-canvas[data-tool="eraser"] { cursor: none; }
.qb-cursors { position: absolute; inset: 0; pointer-events: none; }
.qb-cursor { position: absolute; left: 0; top: 0; transition: transform 0.08s linear, opacity 0.4s; }
.qb-cursor svg { display: block; fill: hsl(var(--h) 75% 48%); stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.qb-cursor span { position: absolute; left: 14px; top: 14px; padding: 2px 7px; border-radius: 99px; background: hsl(var(--h) 75% 45%); color: #fff; font: 600 0.68rem var(--font-ui); white-space: nowrap; }
.qb-cursor.idle { opacity: 0.25; }
.qb-write { position: absolute; z-index: 2; min-width: 60px; padding: 0; border: 2px dashed rgba(0, 0, 0, 0.3); border-radius: 4px; background: rgba(255, 255, 255, 0.7); font-family: Inter, system-ui, sans-serif; font-weight: 700; line-height: 1.2; resize: none; outline: none; field-sizing: content; }
.qb-write.note { padding: 0.7em; font-weight: 600; border: none; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.qb-banner { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 24px); padding: 10px 16px; border-radius: calc(14px * var(--round, 1)); background: rgba(16, 18, 28, 0.92); color: #fff; font: 500 0.9rem var(--font-ui); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); display: flex; align-items: center; gap: 8px; text-align: center; }
.qb-banner[hidden] { display: none; }
.qb-banner.flash { animation: qsCardIn 0.25s var(--ease) both; }
.qb-banner .material-symbols-outlined { color: #ffc53d; }
.qb-word { font: 800 1.15rem var(--font-display); letter-spacing: 0.04em; color: #ffc53d; }
.qb-mask { display: inline-flex; gap: 6px; }
.qb-mask i { display: inline-block; width: 18px; border-bottom: 3px solid #fff; font: 800 1.15rem var(--font-display); font-style: normal; text-align: center; line-height: 1.3; text-transform: uppercase; }
.qb-mask i.sp { width: 10px; border: none; }
.qb-banner small { color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; }
.qb-pick { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.qb-pick > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qb-pick .qs-btn { font-size: 1rem; padding: 10px 18px; }
.qb-over { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 10px; }
.qb-over > b { display: flex; align-items: center; gap: 6px; font: 800 1.2rem var(--font-display); }
.qb-over ol { margin: 0; padding: 0; list-style: none; min-width: 200px; }
.qb-over li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.qb-over li:first-child { color: #ffc53d; font-weight: 700; }
.qb-timer { position: absolute; left: 0; right: 0; top: 0; z-index: 3; height: 6px; background: rgba(0, 0, 0, 0.08); }
.qb-timer[hidden] { display: none; }
.qb-timer i { display: block; height: 100%; background: linear-gradient(90deg, #30a46c, #0090ff); transition: width 0.25s linear; }
.qb-timer.low i { background: #e5484d; }
.qb-timer span { position: absolute; right: 10px; top: 10px; padding: 2px 8px; border-radius: 99px; background: rgba(16, 18, 28, 0.85); color: #fff; font: 700 0.8rem var(--font-mono); }

/* the game's panel */
.qb-game { flex: none; width: 300px; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 0; }
.qb-game[hidden] { display: none; }
.qb-g-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.qb-g-head b { display: flex; align-items: center; gap: 6px; flex: 1; font-size: 0.9rem; }
.qb-g-head b .material-symbols-outlined { color: var(--accent-cyan); }
.qb-g-head small { color: var(--text-muted); font-size: 0.74rem; }
.qb-scores { margin: 0; padding: 0 10px 8px; list-style: none; display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--line); }
.qb-scores li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; font-size: 0.84rem; }
.qb-scores li > i { width: 14px; font-style: normal; color: var(--text-muted); font-size: 0.72rem; }
.qb-scores li.drawing { background: rgba(var(--accent-rgb), 0.12); }
.qb-scores li.got { background: rgba(48, 164, 108, 0.16); }
.qb-scores li.gone { opacity: 0.45; }
.qb-scores .material-symbols-outlined { font-size: 1rem; color: var(--accent-cyan); }
.qb-scores li.got .material-symbols-outlined { color: #30a46c; }
.qb-s-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-scores b { font: 700 0.82rem var(--font-mono); }
.qb-log { flex: 1; min-height: 60px; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; }
.qb-log p { margin: 0; overflow-wrap: anywhere; }
.qb-log p b { color: hsl(var(--h) 70% 62%); }
.qb-log p.inner { opacity: 0.75; font-style: italic; }
.qb-log p.sys { color: var(--text-muted); font-size: 0.78rem; }
.qb-log p.sys.good { color: #30a46c; font-weight: 700; }
.qb-log p.sys.close { color: #f76b15; font-weight: 600; }
.qb-log p.sys.reveal { color: var(--text-main); font-weight: 600; }
.qb-guess { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.qb-guess input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.9rem var(--font-ui); outline: none; }
.qb-guess input:focus { border-color: var(--border-focus); }

/* the toolbar */
.qb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); transition: opacity 0.2s; }
.qb-bar.off { opacity: 0.35; pointer-events: none; }
.qb-tools, .qb-colors, .qb-sizes, .qb-acts { display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.05); }
.qb-tools button, .qb-acts button, .qb-sizes button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: none; border-radius: 10px; background: none; color: var(--text-muted); cursor: pointer; }
.qb-tools button:hover, .qb-acts button:hover, .qb-sizes button:hover { color: var(--text-main); background: rgba(var(--ink-rgb), 0.07); }
.qb-tools button.on, .qb-acts button.on, .qb-sizes button.on { background: var(--text-main); color: var(--bg-base); }
.qb-tools button:disabled { opacity: 0.3; cursor: default; }
.qb-acts button[hidden] { display: none; }
.qb-colors { gap: 5px; padding: 6px 8px; }
.qb-colors button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid rgba(var(--ink-rgb), 0.18); background: var(--c); cursor: pointer; transition: transform 0.12s; }
.qb-colors button:hover { transform: scale(1.12); }
.qb-colors button.on { box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--accent-cyan); transform: scale(1.1); }
.qb-sizes i { display: block; width: var(--s); height: var(--s); border-radius: 50%; background: currentColor; }
.qb-menu { display: flex; flex-direction: column; gap: 6px; }
.qb-menu button { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--text-main); text-align: left; cursor: pointer; }
.qb-menu button:hover { background: rgba(var(--ink-rgb), 0.05); }
.qb-menu b { display: block; font-size: 0.88rem; }
.qb-menu small { display: block; font-size: 0.76rem; color: var(--text-muted); }

/* the pen button in a chat's header: lit up while someone's drawing */
.qb-open { position: relative; }
.qb-open.live { color: var(--accent-cyan); }
.qb-open.live::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 8px #3dffa8; }
.qd-board { display: block; width: min(100%, 420px); margin: 8px 0 4px; border-radius: 10px; border: 1px solid var(--line-strong); }

@media (max-width: 860px) {
    .qb-main { flex-direction: column; }
    .qb-game { width: auto; max-height: 38vh; border-left: none; border-top: 1px solid var(--line); }
    .qb-scores { flex-direction: row; overflow-x: auto; padding-top: 0; }
    .qb-scores li { flex: none; }
    .qb-g-head { padding: 8px 12px 6px; }
    .qb-log { min-height: 40px; }
    .qb-play span:not(.material-symbols-outlined) { display: none; }
    .qb-title small { display: none; }
    .qb-bar { gap: 6px; padding-left: 6px; padding-right: 6px; }
    .qb-tools { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
    .qb-tools button, .qb-acts button, .qb-sizes button { width: 34px; height: 34px; }
    .qb-colors button { width: 22px; height: 22px; }
}
html[data-fancy="low"] .qb { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-base); }
.qb-play[hidden] { display: none; }
