/* buzzer-play.css */
/* ============================================================
   CLASSROOM SHOWDOWN (v2.73.0) — THE GAME SCREEN.

   Left: the indigo side panel — logo, leaderboard, powers, utilities.
   Right: the scenic stage — the team banner, the round pill, the question
   card, the buzzer on its rock, the status pill, and the cheering mascots.

   The buzzer is the Asset Pack's button: the idle art, and the pressed art
   swapped in while the finger is down or the team is already in. Transform
   and opacity only — no layout thrash while thirty kids hammer it.
   ============================================================ */

#playView{display:flex;background:var(--navy);overflow:hidden}
.sd-board-list li{min-width:0}

/* ---------------------------------------------------------- side panel */
.sd-side{
  flex:0 0 auto;width:clamp(236px,23vw,343px);min-height:100%;
  display:flex;flex-direction:column;padding:14px 16px calc(14px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg,#2A2D7A 0%,#20205F 45%,#17184E 100%);
  border-right:2px solid rgba(80,232,255,.25);
  box-shadow:inset -8px 0 20px rgba(0,0,0,.18);overflow-y:auto;
}
.sd-side-logo{width:88%;max-width:280px;margin:0 auto 12px;filter:drop-shadow(0 6px 10px rgba(0,0,0,.35))}
.sd-board{
  background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.03));
  border:2px solid rgba(80,232,255,.28);border-radius:26px;padding:14px 12px 12px;
  box-shadow:0 10px 24px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.12);
}
.sd-board-h{
  display:flex;align-items:center;gap:10px;color:var(--lav);
  font-family:var(--display);font-weight:600;font-size:clamp(16px,1.4vw,22px);margin-bottom:10px;
}
.sd-board-h img{height:1.3em}
.sd-board-list{list-style:none;display:grid;gap:8px}
.sd-row{
  --tc:#7E858F;
  position:relative;min-width:0;display:flex;align-items:center;gap:8px;width:100%;
  padding:8px 10px 8px 12px;min-height:64px;cursor:pointer;text-align:left;
  background:linear-gradient(180deg,#3A3F96,#2A2D7A);border:2px solid #4A50B0;border-radius:20px;
  color:#fff;font-family:var(--display);font-weight:600;font-size:clamp(15px,1.3vw,21px);
  box-shadow:0 4px 12px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.15);
  transition:transform .12s ease,box-shadow .12s ease;
}
.sd-row:hover{transform:translateY(-1px)}
.sd-row.mine{
  border-color:var(--cyan);
  box-shadow:0 0 0 2px var(--cyan),0 0 20px rgba(80,232,255,.55),0 4px 12px rgba(0,0,0,.25);
  animation:sd-glow 2s ease-in-out infinite;
}
@keyframes sd-glow{
  0%,100%{box-shadow:0 0 0 2px var(--cyan),0 0 14px rgba(80,232,255,.45),0 4px 12px rgba(0,0,0,.25)}
  50%{box-shadow:0 0 0 2px var(--cyan),0 0 26px rgba(80,232,255,.75),0 4px 12px rgba(0,0,0,.25)}
}
.sd-row-dot{position:absolute;left:-7px;top:50%;width:12px;height:12px;border-radius:50%;
  background:var(--tc);border:2px solid #fff;transform:translateY(-50%);box-shadow:0 0 8px var(--tc)}
.sd-row-av{width:clamp(38px,3.8vw,52px);height:clamp(38px,3.8vw,52px);flex:0 0 auto;display:flex;align-items:center;justify-content:center}
.sd-row-av img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 4px rgba(0,0,0,.35))}
.sd-row-av:empty{width:12px}
.sd-row-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sd-row-pts{
  flex:0 0 auto;min-width:40px;padding:5px 8px;border-radius:14px;text-align:center;
  background:linear-gradient(180deg,color-mix(in srgb,var(--tc) 85%,#fff),var(--tc));
  border:2px solid color-mix(in srgb,var(--tc) 70%,#000);
  font-family:var(--display);font-weight:700;font-size:1.05em;font-variant-numeric:tabular-nums;
  box-shadow:0 3px 0 color-mix(in srgb,var(--tc) 60%,#000);
}
.sd-board-note{color:var(--lav);opacity:.8;font-size:clamp(12px,1vw,15px);font-weight:700;margin-top:10px;line-height:1.35}
.sd-powers-wrap{margin-top:12px;border-top:1px solid rgba(80,232,255,.25);padding-top:10px}
.powers{display:flex;flex-wrap:wrap;gap:8px;align-content:flex-start}
.power{
  display:flex;align-items:center;gap:6px;padding:8px 14px;cursor:pointer;
  border:2px solid var(--accent);border-radius:999px;
  background:color-mix(in srgb,var(--accent) 30%,#20205F);
  color:#fff;font-family:var(--sans);font-size:13.5px;font-weight:800;
}
.power:active{filter:brightness(.9)}
.power-view{opacity:.7;border-style:dashed}   /* v2.74.2 — still a tap: it opens the power's card to read */
.power-up{cursor:default;background:linear-gradient(180deg,#FFF6E8,#FFE8CC);color:#7A4A00;border-color:var(--yellow,#F3C845)}   /* v2.75.28 — armed Double Down / Firewall (0135) */
.power-off{opacity:.55;border-color:rgba(255,255,255,.35);background:rgba(255,255,255,.08)}   /* v2.75.3 — held, not usable right now (0117) */
.sheet-why{color:#B45309;font-weight:800}
.power-n{white-space:nowrap}

.sd-utils{margin-top:auto;padding-top:16px;display:grid;gap:12px}
.sd-util{
  display:flex;align-items:center;gap:14px;padding:6px 8px;border:0;background:transparent;
  color:var(--lav);font-family:var(--sans);font-weight:800;font-size:clamp(14px,1.1vw,18px);
  cursor:pointer;text-align:left;border-radius:12px;
}
.sd-util img{height:30px;width:30px;object-fit:contain}
button.sd-util:hover{background:rgba(255,255,255,.06);color:#fff}
div.sd-util{cursor:default}

/* --------------------------------------------------------------- stage */
.sd-stage-area{
  position:relative;flex:1;min-width:0;min-height:100%;
  display:flex;flex-direction:column;align-items:center;
  padding:clamp(10px,1.6vh,18px) clamp(12px,2vw,30px) calc(12px + env(safe-area-inset-bottom));
  background:url(showdown/bg/game.webp) center/cover no-repeat;overflow:hidden;
}
/* The mascots and signs on this screen are painted into bg/game.webp; no
   separate assets are placed (v2.74.0 — they were being drawn twice). */

.sd-round-pill{
  position:absolute;right:2%;top:2%;z-index:4;
  display:flex;align-items:center;gap:8px;padding:8px 16px;
  background:rgba(35,32,105,.78);border:2px solid rgba(157,238,255,.6);border-radius:999px;
  color:#fff;font-family:var(--display);font-weight:600;font-size:clamp(13px,1.2vw,18px);
  backdrop-filter:blur(4px);
}
.sd-round-pill img{height:1.3em}

/* The team banner. */
.sd-turn{
  position:relative;z-index:3;display:flex;align-items:center;gap:12px;
  width:min(92%,560px);min-height:78px;margin-top:4px;padding:8px 22px 8px 8px;
  background:linear-gradient(180deg,#3F8BFF,#2F63D8);border:3px solid #9DEEFF;border-radius:999px;
  box-shadow:0 0 0 4px rgba(91,228,255,.55),0 10px 24px rgba(23,92,210,.35);
  animation:sd-banner-in .26s ease-out;
}
@keyframes sd-banner-in{from{transform:translateY(-12px);opacity:0}to{transform:none;opacity:1}}
.sd-turn-av{
  flex:0 0 auto;width:78px;height:78px;margin:-14px 0 -14px -4px;
  display:flex;align-items:center;justify-content:center;
}
.sd-turn-av img{width:78px;height:78px;object-fit:contain;filter:drop-shadow(0 6px 8px rgba(0,0,0,.35))}
.sd-turn-av img:not([src]){display:none}
.sd-turn-txt{display:flex;flex-direction:column;align-items:center;flex:1;min-width:0;line-height:1.05}
.sd-turn-team{
  font-family:var(--display);font-weight:700;color:#fff;font-size:clamp(22px,2.8vw,40px);
  text-shadow:0 3px 0 rgba(23,27,85,.55);letter-spacing:.02em;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sd-turn-sub{
  margin-top:4px;padding:3px 14px;border-radius:999px;background:#CFF2FF;
  color:var(--ink);font-weight:800;font-size:clamp(12px,1.2vw,16px);white-space:nowrap;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;
}
/* ONE burst each side (v2.74.2). fx/emph-small.webp is a 400×145 sheet
   with a burst at each end (x 0–77 and 323–400) of a transparent middle;
   drawn whole on each side, every side showed both. Each side is the whole
   sheet clipped to its own end: the visible burst is 19.25% of the box, so
   at this box width it is 29–46px wide. The clipped-away part of the box
   lies under the banner; it takes no taps. */
.sd-fx-turn-l,.sd-fx-turn-r{position:absolute;top:50%;width:clamp(150px,16vw,240px);transform:translateY(-50%)}
.sd-fx-turn-l{left:-3.5vw;clip-path:inset(0 80.75% 0 0)}
.sd-fx-turn-r{right:-3.5vw;clip-path:inset(0 0 0 80.75%)}

/* The question card. */
.sd-qcard{
  position:relative;z-index:4;width:min(96%,1000px);margin-top:clamp(8px,1.6vh,18px);   /* v2.75.16 — above the buzzer's rays: the question is never covered */
  padding:clamp(12px,1.6vw,22px) clamp(16px,3vw,44px) clamp(14px,2vw,26px);
  background:linear-gradient(180deg,#FFFFFF,#F4FAFF);border-radius:34px;
  box-shadow:0 14px 30px rgba(20,44,110,.3),inset 0 2px 0 #fff;
  display:flex;flex-direction:column;align-items:center;
}
.sd-qcard::after{
  content:'';position:absolute;left:34%;right:34%;bottom:-14px;height:28px;
  background:inherit;border-radius:0 0 50% 50% / 0 0 100% 100%;
  box-shadow:0 10px 16px -10px rgba(20,44,110,.3);
}
.sd-qcard.power{background:linear-gradient(180deg,#FFF6E8,#FFE8CC);box-shadow:0 0 0 4px var(--yellow),0 14px 30px rgba(20,44,110,.3)}
.sd-qcat{
  align-self:flex-start;display:flex;align-items:center;gap:8px;
  color:var(--royal);font-weight:900;font-size:clamp(11px,1vw,15px);letter-spacing:.08em;text-transform:uppercase;
}
.sd-qcat img{height:clamp(22px,2.2vw,34px)}
.sd-prompt{
  margin-top:6px;text-align:center;font-family:var(--display);font-weight:700;color:var(--ink);
  font-size:clamp(20px,3.4vw,56px);line-height:1.12;white-space:pre-line;max-width:100%;
  max-height:30vh;overflow:hidden;   /* v2.75.15 — fit-text.js shrinks a long one to fit; no scrolling */
}
.sd-prompt:empty{display:none}
.qimg{margin-top:10px;max-width:min(92%,520px);max-height:24vh;border-radius:14px;object-fit:contain;border:2px solid #DCEFFF}
.qimg[hidden]{display:none}

/* ---------------------------------------------------------- THE BUZZER */
.sd-buzz-wrap{
  position:relative;z-index:3;flex:1;min-height:0;
  display:flex;align-items:center;justify-content:center;width:100%;margin-top:8px;
}
.buzzer{
  position:relative;width:min(40vw,34vh,340px);aspect-ratio:1;border:0;padding:0;   /* v2.75.4 — Chris: "too big" (was 52vw/44vh/440px) */
  background:transparent;cursor:pointer;flex:0 0 auto;
  touch-action:manipulation;user-select:none;-webkit-user-select:none;
  filter:drop-shadow(0 18px 18px rgba(28,24,88,.28));
  transition:transform .14s cubic-bezier(.2,.9,.3,1.2);
}
.buzzer img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
.buzzer-pressed{opacity:0}
.buzzer.down .buzzer-idle,.buzzer:active .buzzer-idle,.buzzer.locked .buzzer-idle{opacity:0}
.buzzer.down .buzzer-pressed,.buzzer:active .buzzer-pressed,.buzzer.locked .buzzer-pressed{opacity:1}
.buzzer:active{transform:scale(.94)}
/* The art says BUZZ!; the word is for assistive tech and the tests. */
.buzzer-word{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* Already in the queue: stays pressed and goes quiet, so a kid hammering
   it gets an answer from the button rather than from nothing happening. */
.buzzer.locked{cursor:default;filter:grayscale(1) brightness(.9) drop-shadow(0 10px 12px rgba(28,24,88,.28))}
/* Nothing to buzz on yet: all the way to grey. Partial desaturation is what
   makes mud; grey reads as "off", and the orange is unmistakable the moment
   a question lands. */
.buzzer.idle{cursor:default;filter:grayscale(1) brightness(.92) drop-shadow(0 14px 16px rgba(28,24,88,.24))}
.buzzer:focus-visible{outline:4px solid var(--cyan);outline-offset:6px;border-radius:50%}

.sd-buzz-rays{
  position:absolute;left:50%;top:50%;width:min(52vw,44vh,440px);   /* v2.75.16 — 1.3× the buzzer (was 1.55×) */
  transform:translate(-50%,-50%);opacity:0;pointer-events:none;
  transition:opacity .3s ease;
}
body.sd-live .sd-buzz-rays{opacity:.9;animation:sd-spin 24s linear infinite}
@keyframes sd-spin{from{transform:translate(-50%,-50%) rotate(0)}to{transform:translate(-50%,-50%) rotate(360deg)}}
.sd-fx-buzz-l,.sd-fx-buzz-r{
  position:absolute;top:34%;width:clamp(50px,6vw,100px);opacity:0;transition:opacity .3s;
}
.sd-fx-buzz-l{left:calc(50% - min(20vw,17vh,170px) - 8vw)}   /* v2.75.4 — half the new buzzer width */
.sd-fx-buzz-r{right:calc(50% - min(20vw,17vh,170px) - 8vw);transform:scaleX(-1)}
body.sd-live .sd-fx-buzz-l,body.sd-live .sd-fx-buzz-r{opacity:1}

/* v2.75.6 — the standing "click or spacebar" note under the status line */
.sd-hint{position:relative;z-index:4;margin:6px 0 0;font-size:12.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:rgba(255,255,255,.85);text-shadow:0 1px 2px rgba(20,44,110,.5);text-align:center}
.sd-status{
  position:relative;z-index:4;margin-top:6px;padding:10px 26px;min-height:44px;   /* v2.75.16 — above the rays too */
  display:flex;align-items:center;justify-content:center;text-align:center;
  background:rgba(35,32,105,.78);border:2px solid rgba(157,238,255,.45);border-radius:999px;
  color:#fff;font-family:var(--display);font-weight:600;font-size:clamp(14px,1.5vw,22px);
  backdrop-filter:blur(4px);max-width:96%;
}
.sd-status:empty{opacity:0}

/* ------------------------------------------------------------ narrow */
/* On a phone the side panel would eat the buzzer, so it becomes a strip
   across the top of the stage instead of a column beside it. */
@media (max-width:700px){
  #playView{flex-direction:column;height:100%}
  .sd-stage-area{min-height:0;flex:1}
  .sd-side{
    width:100%;min-height:0;flex:0 0 auto;padding:8px 10px;border-right:0;
    border-bottom:2px solid rgba(80,232,255,.25);overflow:visible;
  }
  .sd-side-logo{display:none}
  .sd-board{padding:8px}
  .sd-board-h{font-size:14px;margin-bottom:6px}
  .sd-board-list{grid-auto-flow:column;grid-auto-columns:minmax(172px,1fr);overflow-x:auto;gap:6px;padding:0 0 2px 6px}
  .sd-row{min-height:52px;padding:6px 8px 6px 10px;font-size:14px}
  .sd-row-av,.sd-row-av img{width:36px;height:36px}
  .sd-board-note{display:none}
  .sd-powers-wrap{margin-top:6px;padding-top:6px}
  .powers{flex-wrap:nowrap;overflow-x:auto;gap:6px}
  .power{flex:0 0 auto;padding:7px 11px;font-size:12.5px}
  .sd-utils{margin-top:6px;padding-top:0;grid-auto-flow:column;justify-content:space-between;gap:6px}
  .sd-util{padding:2px 4px;font-size:12px;gap:6px}
  .sd-util img{width:20px;height:20px}
  .sd-stage-area{padding:10px 10px calc(10px + env(safe-area-inset-bottom))}
  .sd-round-pill{position:static;order:-1;margin-bottom:6px;align-self:flex-end;font-size:12px;padding:5px 12px}
  .sd-turn{min-height:64px;width:100%}
  .sd-turn-av,.sd-turn-av img{width:60px;height:60px}
  .sd-fx-turn-l,.sd-fx-turn-r{display:none}
  .sd-qcard{padding:10px 14px 14px;border-radius:24px}
  .sd-qcard::after{display:none}
  .buzzer{width:min(50vw,28vh)}   /* v2.75.4 — was 64vw/36vh */
  .sd-buzz-rays{width:min(76vw,42vh)}
  .sd-fx-buzz-l,.sd-fx-buzz-r{display:none}
  .qimg{max-height:18vh}
}
@media (prefers-reduced-motion:reduce){
  .buzzer,.sd-buzz-rays,.sd-fx-buzz-l,.sd-fx-buzz-r{transition:none}
  body.sd-live .sd-buzz-rays{animation:none}
  .sd-row.mine{animation:none}
  .sd-turn{animation:none}
}
