/* Trivia buzzer. Scoped to [data-buzzer] and .buzzer-dsp (display window). */
[data-buzzer] .buzzer-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; background: var(--canvas); border-radius: 12px; padding: 10px 14px; min-height: 56px; }
[data-buzzer] .buzzer-q { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--body); }
[data-buzzer] .buzzer-msg { flex: 1; min-width: 0; font-size: clamp(18px, 4.4vw, 24px); letter-spacing: -0.01em; }
[data-buzzer] .buzzer-timer { font-size: clamp(28px, 7vw, 44px); }
[data-buzzer] .buzzer-timer.is-zero { color: #e11900; }
[data-buzzer] .buzzer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) {
  [data-buzzer] .buzzer-grid[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-buzzer] .buzzer-grid[data-n="4"], [data-buzzer] .buzzer-grid[data-n="7"], [data-buzzer] .buzzer-grid[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [data-buzzer] .buzzer-grid[data-n="5"], [data-buzzer] .buzzer-grid[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
[data-buzzer] .buzzer-tile { position: relative; min-width: 0; border: 0; border-radius: 12px; background: var(--canvas); color: var(--ink); cursor: pointer;
  min-height: clamp(130px, 24vh, 280px); padding: 18px 10px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden;
  font: inherit; touch-action: manipulation; transition: transform .06s, opacity .15s; }
[data-buzzer] .buzzer-tile:active { transform: scale(.985); }
[data-buzzer] .buzzer-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[data-buzzer] .buzzer-bar { position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--tc); }
[data-buzzer] .buzzer-name { max-width: 100%; font-weight: 700; font-size: clamp(17px, 4vw, 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-buzzer] .buzzer-score { font-size: clamp(44px, 11vw, 88px); }
[data-buzzer] .buzzer-tag { font-size: 14px; color: var(--mute); font-weight: 600; }
[data-buzzer] .buzzer-tag kbd { font: 600 13px/1 var(--font); background: var(--soft); border-radius: 6px; padding: 3px 7px; color: var(--ink); }
[data-buzzer] .buzzer-tile.is-win { background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 4px var(--tc); }
[data-buzzer] .buzzer-tile.is-win .buzzer-tag { color: var(--on-ink); font-size: clamp(18px, 4vw, 26px); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
[data-buzzer] .buzzer-tile.is-win .buzzer-bar { height: 16px; }
[data-buzzer] .buzzer-tile.is-dim { opacity: .38; }
[data-buzzer] .buzzer-host { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
[data-buzzer] .buzzer-host .pill { min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-buzzer] .buzzer-host .pill:not(.pill-ink) { background: var(--canvas); }
[data-buzzer] .buzzer-host .pill:not(.pill-ink):hover { background: var(--pressed); }
[data-buzzer] .buzzer-tools .pill[hidden] { display: none !important; }
[data-buzzer] .buzzer-rows { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
[data-buzzer] .buzzer-row, [data-buzzer] .buzzer-rowhead { display: grid; grid-template-columns: 16px minmax(0, 1fr) 56px 88px; gap: 8px; align-items: center; }
[data-buzzer] .buzzer-rowhead { font-size: 13px; color: var(--body); font-weight: 600; }
[data-buzzer] .buzzer-rowhead span:first-child { grid-column: 2; }
[data-buzzer] .buzzer-key { text-align: center; text-transform: uppercase; font-weight: 700; }
[data-buzzer] .buzzer-row .inp { padding: 10px; }
[data-buzzer] .buzzer-note { grid-column: 1 / -1; margin: 0; font-size: 14px; }
body.is-focus [data-buzzer] .buzzer-grid { flex: 1; min-height: 0; grid-auto-rows: 1fr; }
body.is-focus [data-buzzer] .buzzer-tile { min-height: 0; }
body.is-focus [data-buzzer] .buzzer-tools .pill { display: none; }
@media (max-width: 400px) { [data-buzzer] .buzzer-host .pill { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { [data-buzzer] .buzzer-tile { transition: none; } }

/* display window (?display=1): black, fills the window, in both themes */
body.buzzer-display { background: #000; overflow: hidden; }
body.buzzer-display > :not(.buzzer-dsp) { display: none !important; }
.buzzer-dsp { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; padding: 2vh 2vw; gap: 2vh; font-variant-numeric: tabular-nums; }
.buzzer-dsp.is-idle { cursor: none; }
.buzzer-dsp-q { text-align: center; color: #9a9a9a; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: min(3.2vw, 5vh); }
.buzzer-dsp-main { flex: 1; min-height: 0; border-radius: 3vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; background: #141414; text-align: center; padding: 2vh 2vw; }
.buzzer-dsp-main.is-win { background: var(--tc); color: var(--tf, #fff); }
.buzzer-dsp-first { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; font-size: min(5vw, 8vh); }
.buzzer-dsp-name { max-width: 100%; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-size: min(13vw, 24vh); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buzzer-dsp-open { font-weight: 800; letter-spacing: -0.02em; font-size: min(8vw, 14vh); color: #fff; }
.buzzer-dsp-timer { font-weight: 800; font-size: min(9vw, 15vh); line-height: 1; }
.buzzer-dsp-timer.is-zero { text-decoration: underline; }
.buzzer-dsp-teams { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5vh 1.5vw; }
.buzzer-dsp-teams[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.buzzer-dsp-teams[data-n="3"], .buzzer-dsp-teams[data-n="5"], .buzzer-dsp-teams[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.buzzer-dsp-team { min-width: 0; border-top: max(8px, 1.4vh) solid var(--tc); background: #141414; border-radius: 1.5vh; padding: 1vh 1vw; display: flex; align-items: center; justify-content: space-between; gap: 1vw; font-size: min(3.4vw, 5.5vh); }
.buzzer-dsp-team b { font-weight: 800; font-size: 1.5em; }
.buzzer-dsp-tn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.buzzer-dsp-team.is-win { background: var(--tc); color: var(--tf, #fff); }
.buzzer-dsp-team.is-out { opacity: .4; }
.buzzer-dsp-ui { position: fixed; right: 16px; bottom: 16px; left: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; transition: opacity .4s; font-size: 14px; color: #9a9a9a; }
.buzzer-dsp.is-idle .buzzer-dsp-ui { opacity: 0; pointer-events: none; }
.buzzer-dsp-btn { border: 0; border-radius: 999px; background: #1c1c1c; color: #fff; font: inherit; font-size: 16px; font-weight: 600; min-height: 48px; padding: 10px 20px; cursor: pointer; }
.buzzer-dsp-btn:hover { background: #2e2e2e; }
.buzzer-dsp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
