/* Buzzboard: a game-show stage for both the editor and the full screen game.
   Shares styles.css for buttons, fields, sheets, toasts and the about section. */
.bz-page { --accent: #2B3FD0; --accent-ink: #FFFFFF; --accent-soft: #E6E9FE; --accent-text: #2B3FD0; --gold: #FFE07A; --tile: #2B3FD0; --tile-deep: #1A238C; background: var(--bg); }
.bz-page #bzSound .off, .bz-page #bzSound[aria-pressed="false"] .on { display: none; }
.bz-page #bzSound[aria-pressed="false"] .off { display: block; }

/* ---------- The stage behind the editor ---------- */
.bz-night {
  position: relative; overflow: hidden; color: #FFF7EC; padding-bottom: 56px;
  background: radial-gradient(70% 50% at 50% 0%, #3A47C9 0%, #1A1F6E 45%, #0C0F38 100%);
}
.bz-night::before, .bz-night::after { /* two slow spotlights sweeping the stage */
  content: ""; position: absolute; top: -20%; width: 60%; height: 140%; pointer-events: none; opacity: .5;
  background: radial-gradient(closest-side, rgba(255, 240, 200, .16), transparent);
  animation: spot-sweep 9s ease-in-out infinite alternate;
}
.bz-night::before { left: -15%; }
.bz-night::after { right: -15%; animation-delay: -4.5s; animation-direction: alternate-reverse; }
@keyframes spot-sweep { from { translate: -8% 0; rotate: -8deg; } to { translate: 14% 0; rotate: 8deg; } }
.bz-night > * { position: relative; z-index: 1; }
.bz-bar { display: flex; align-items: center; gap: 10px; max-width: 1080px; margin: 0 auto; padding: 14px 16px; }
.bz-brand { display: inline-flex; align-items: center; gap: 9px; color: #FFF7EC; text-decoration: none; font: 800 21px var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
.bz-brand svg { width: 28px; height: 28px; }
.bz-by { color: #A9AED0; font-size: 13.5px; font-weight: 600; text-decoration: none; margin-right: auto; white-space: nowrap; }
.bz-by:hover { color: var(--gold); }
.bz-night .pill { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #FFF7EC; }
.bz-main { max-width: 1080px; margin: 0 auto; padding: 4px 16px 0; display: grid; gap: 26px; }
.bz-hero { text-align: center; padding-top: 10px; }
.bz-hero h1 { margin: 0; font: 800 clamp(32px, 6.4vw, 60px)/1.02 var(--f-display); letter-spacing: -.035em; text-wrap: balance; text-shadow: 0 6px 30px rgba(0, 0, 0, .35); }
.bz-hero p { margin: 12px auto 0; max-width: 38em; color: #C9CCE6; font-size: clamp(15.5px, 2.2vw, 18px); text-wrap: balance; }
#bzApp { display: grid; gap: 22px; }
.bz-switch { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: #A9AED0; }
.bz-picker { max-width: 60%; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #FFF7EC; font-weight: 600; }
.bz-picker option { color: var(--ink); }

/* The marquee sign with the game's name */
.bz-sign {
  position: relative; justify-self: center; width: min(100%, 640px); padding: 22px 30px; border-radius: 22px;
  background: linear-gradient(#E3467D, #B92F62); box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 -6px 0 rgba(0, 0, 0, .15);
  animation: sign-in .7s var(--spring) backwards;
}
@keyframes sign-in { from { opacity: 0; translate: 0 -30px; scale: .9; } }
.bz-sign-bulbs { position: absolute; inset: 7px; display: flex; flex-wrap: wrap; justify-content: space-between; align-content: space-between; pointer-events: none; }
.bz-sign-bulbs i { width: 9px; height: 9px; border-radius: 50%; background: #FFF4C2; box-shadow: 0 0 8px 2px rgba(255, 224, 122, .8); animation: bulb 1.2s ease-in-out infinite; }
.bz-sign-bulbs i:nth-child(n+12) { align-self: flex-end; }
@keyframes bulb { 50% { opacity: .35; box-shadow: none; } }
.bz-sign-input {
  position: relative; display: block; width: 100%; border: 0; background: transparent; text-align: center;
  font: 800 clamp(28px, 5.4vw, 46px)/1.1 var(--f-display); letter-spacing: -.02em; color: #FFF7EC; text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.bz-sign-input::placeholder { color: rgba(255, 247, 236, .55); }
.bz-sign-input:focus { outline: none; }

/* ---------- The board (editor and game share it) ---------- */
.bz-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(6px, 1vw, 12px); width: 100%; }
.bz-head {
  display: grid; place-items: center; min-height: 64px; padding: 8px; border-radius: 12px; text-align: center;
  background: linear-gradient(#1A238C, #121A6B); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08);
  font: 800 clamp(12px, 1.6vw, 17px)/1.15 var(--f-display); letter-spacing: .04em; text-transform: uppercase; color: #FFF7EC; overflow-wrap: anywhere;
}
.bz-head-input { width: 100%; border: 0; background: transparent; color: #FFF7EC; text-align: center; font: inherit; letter-spacing: inherit; text-transform: uppercase; }
.bz-head-input::placeholder { color: rgba(255, 247, 236, .45); }
.bz-head-input:focus { outline: none; }
.bz-head.edit:focus-within { box-shadow: inset 0 0 0 2px var(--gold); }
.bz-tile {
  position: relative; display: grid; place-items: center; align-content: center; gap: 4px; min-height: clamp(64px, 11vh, 120px); padding: 8px 6px;
  border: 0; border-radius: 12px; cursor: pointer; color: var(--gold);
  background: linear-gradient(160deg, #3A50E8, var(--tile) 45%, var(--tile-deep));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .25), 0 8px 18px rgba(0, 0, 0, .3);
  transition: transform .15s var(--ease-out), filter .15s;
}
.bz-tile:hover:not(:disabled) { transform: translateY(-3px) scale(1.03); filter: brightness(1.12); }
.bz-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bz-value { font: 800 clamp(22px, 3.6vw, 44px)/1 var(--f-display); letter-spacing: -.02em; text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(255, 224, 122, .35); }
.bz-snippet { max-width: 100%; font: 600 12px/1.25 var(--f-body); color: #DDE1FF; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bz-snippet.add { color: rgba(255, 247, 236, .55); }
.bz-tile.edit:not(.filled) { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18); }
.bz-tile.edit:not(.filled) .bz-value { color: rgba(255, 224, 122, .5); text-shadow: none; }
.bz-tile.filled::after { content: "✓"; position: absolute; top: 6px; right: 8px; color: #8EDBB0; font-size: 13px; font-weight: 800; }
.bz-tile.used, .bz-tile.empty { cursor: default; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); }
.bz-tile.used::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--won, rgba(255, 255, 255, .15)); box-shadow: 0 0 12px var(--won, transparent); }
.bz-tile.cascade { animation: tile-in .55s var(--spring) backwards; animation-delay: var(--d); }
@keyframes tile-in { from { opacity: 0; transform: rotateX(80deg) translateY(-20px); } }
.bz-tile.lifted { visibility: hidden; }

.bz-editor { display: grid; gap: 12px; }
.bz-size { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.bz-stepper { display: inline-flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-weight: 700; font-size: 14px; }
.bz-stepper span { min-width: 7.5em; text-align: center; }
.bz-stepper button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #FFF7EC; font-size: 18px; cursor: pointer; }
.bz-stepper button:disabled { opacity: .35; cursor: default; }
.bz-filled { color: #A9AED0; font-size: 13.5px; font-weight: 600; }

/* Teams: little podiums */
.bz-teams { display: grid; justify-items: center; gap: 12px; }
.bz-teams h2 { margin: 0; font: 800 22px var(--f-display); }
.bz-team-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bz-team-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, .09); box-shadow: inset 0 -4px 0 var(--team); }
.bz-team-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--team); box-shadow: 0 0 10px var(--team); }
.bz-team-input { width: 9em; border: 0; background: transparent; color: #FFF7EC; font: 700 15px var(--f-body); }
.bz-team-input::placeholder { color: rgba(255, 247, 236, .55); }
.bz-team-input:focus { outline: none; }
.bz-team-chip button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #FFF7EC; cursor: pointer; font-size: 12px; }
.bz-team-add { padding: 8px 14px; border-radius: 14px; border: 2px dashed rgba(255, 255, 255, .3); background: none; color: var(--gold); font-weight: 700; cursor: pointer; }

/* The big Play button */
.bz-play-area { display: grid; justify-items: center; gap: 10px; text-align: center; }
.bz-play {
  height: 68px; padding: 0 56px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #FFEFA8, var(--gold) 50%, #F5B82E); color: #1B2033; font: 800 26px var(--f-display); letter-spacing: .02em;
  box-shadow: 0 14px 34px rgba(245, 184, 46, .4), inset 0 -4px 0 rgba(0, 0, 0, .12); transition: transform .15s var(--ease-out);
}
.bz-play.ready { animation: play-glow 2.4s ease-in-out infinite; }
.bz-play:hover { transform: translateY(-2px) scale(1.03); }
.bz-play:active { transform: scale(.96); }
.bz-play:disabled { opacity: .45; cursor: default; animation: none; }
@keyframes play-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 224, 122, .5), 0 14px 34px rgba(245, 184, 46, .4); } 50% { box-shadow: 0 0 0 12px rgba(255, 224, 122, 0), 0 14px 34px rgba(245, 184, 46, .4); } }
.bz-keys { margin: 0; max-width: 36em; color: #A9AED0; font-size: 13.5px; }
.bz-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.bz-link { border: 0; background: none; padding: 4px; color: var(--gold); font-weight: 700; font-size: 14px; cursor: pointer; }
.bz-link:hover { text-decoration: underline; }
.bz-edit-kicker { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font: 800 15px var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.bz-edit-kicker strong { font-size: 22px; color: #F5B82E; }
.sheet .field-label { display: grid; gap: 6px; }

/* ---------- The game: full screen ---------- */
body.bz-open { overflow: hidden; }
.bz-stage {
  position: fixed; inset: 0; z-index: 25; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2vh; overflow: hidden;
  padding: 3.4vh 2.4vw calc(2vh + env(safe-area-inset-bottom, 0px)); color: #FFF7EC;
  background: radial-gradient(80% 60% at 50% 0%, #2F3BB0 0%, #141A62 45%, #080A2A 100%); animation: fade .35s;
}
.bz-spots { position: absolute; inset: 0; pointer-events: none; }
.bz-spots i { position: absolute; top: -30%; width: 55%; height: 160%; background: radial-gradient(closest-side, rgba(255, 240, 200, .12), transparent); animation: spot-sweep 8s ease-in-out infinite alternate; }
.bz-spots i:first-child { left: -10%; }
.bz-spots i:last-child { right: -10%; animation-direction: alternate-reverse; animation-delay: -4s; }
.bz-bulbs { position: absolute; top: 8px; left: 2vw; right: 2vw; display: flex; justify-content: space-between; pointer-events: none; }
.bz-bulbs i { width: 8px; height: 8px; border-radius: 50%; background: #FFF4C2; box-shadow: 0 0 10px 2px rgba(255, 224, 122, .8); animation: bulb 1.2s ease-in-out infinite; }
.bz-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.bz-top, .bz-stage .bz-grid, .bz-scores { position: relative; z-index: 1; }
.bz-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.bz-title { margin: 0; font: 800 clamp(22px, 3.6vh, 40px) var(--f-display); letter-spacing: -.02em; }
.bz-left { color: #A9AED0; font-weight: 700; font-size: clamp(13px, 1.8vh, 18px); }
.bz-top-actions { margin-left: auto; display: flex; gap: 8px; }
.bz-top-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); color: #E8E9F3; font-weight: 700; font-size: 14px; cursor: pointer; }
.bz-top-btn:disabled { opacity: .35; cursor: default; }
.bz-top-btn kbd, .bz-stage kbd { background: transparent; border-color: rgba(255, 255, 255, .3); color: inherit; font-size: .8em; }
.bz-stage .bz-grid { align-content: stretch; grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); min-height: 0; }
.bz-stage .bz-head { min-height: 0; font-size: clamp(13px, 2.2vh, 26px); }
.bz-stage .bz-tile { min-height: 0; }
.bz-stage .bz-value { font-size: clamp(24px, 6.5vh, 74px); }

/* The scoreboard */
.bz-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2vh 1vw; }
.bz-team {
  display: grid; justify-items: center; gap: 2px; min-width: clamp(110px, 13vw, 200px); padding: 1vh 1.4vw; border-radius: 14px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 -5px 0 var(--team);
}
.bz-team-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: clamp(13px, 1.9vh, 20px); }
.bz-team-score { font: 800 clamp(24px, 4.8vh, 52px)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.bz-team.lead .bz-team-score { color: var(--gold); text-shadow: 0 0 18px rgba(255, 224, 122, .5); }
.bz-team.bump { animation: chip-pop .5s var(--spring); }
.bz-team.shake { animation: team-shake .45s ease-in-out; }
@keyframes team-shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.bz-float { position: fixed; z-index: 45; pointer-events: none; font: 800 clamp(30px, 6vh, 64px) var(--f-display); color: var(--gold); text-shadow: 0 0 20px rgba(255, 224, 122, .6), 0 4px 0 rgba(0, 0, 0, .3); }
.bz-float.wrong { color: #FF8A80; text-shadow: 0 4px 0 rgba(0, 0, 0, .3); }

/* A clue, filling the stage */
.bz-veil { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(6, 8, 30, .55); animation: fade .25s; }
.bz-veil.leaving { background: transparent; transition: background .3s; }
.bz-card {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3vh; width: min(100%, 1300px); min-height: min(78vh, 760px); padding: 4vh 4vw;
  border-radius: 28px; text-align: center; overflow: hidden;
  background: linear-gradient(160deg, #3A50E8, #2B3FD0 45%, #1A238C); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 30px 80px rgba(0, 0, 0, .55);
}
.bz-card-head { display: flex; gap: 18px; align-items: baseline; margin: 0; font: 800 clamp(15px, 2.6vh, 28px) var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: #DDE1FF; }
.bz-card-points { color: var(--gold); }
.bz-clue-text { margin: 0; max-width: 24ch; font: 800 clamp(30px, 8vh, 92px)/1.12 var(--f-display); letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.bz-clue-text.mid { font-size: clamp(26px, 6.4vh, 72px); max-width: 30ch; }
.bz-clue-text.long { font-size: clamp(22px, 4.6vh, 52px); max-width: 38ch; }
.bz-answer { margin: 0; padding: .3em .9em; border-radius: 16px; background: var(--gold); color: #1B2033; font: 800 clamp(24px, 5.4vh, 60px)/1.15 var(--f-display); animation: answer-in .5s var(--spring); }
@keyframes answer-in { from { opacity: 0; scale: .6; translate: 0 20px; } }
.bz-show { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border: 0; border-radius: 999px; cursor: pointer; background: var(--gold); color: #1B2033; font: 800 clamp(16px, 2.6vh, 26px) var(--f-display); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.bz-show kbd { border-color: rgba(27, 32, 51, .3); }
.bz-award { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bz-award-team { display: inline-flex; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.bz-award-team.tried { opacity: .55; }
.bz-right { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; cursor: pointer; background: var(--team); color: #1B2033; font: 800 clamp(14px, 2.2vh, 22px) var(--f-display); }
.bz-right span { font-family: var(--f-body); font-weight: 700; }
.bz-right kbd { border-color: rgba(27, 32, 51, .3); color: #1B2033; }
.bz-wrong { width: 44px; border: 0; cursor: pointer; background: rgba(0, 0, 0, .3); color: #FFF7EC; font-size: 22px; font-weight: 800; }
.bz-nobody { padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #E8E9F3; font-weight: 700; cursor: pointer; }

/* The double-points burst */
.bz-bonus { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 2vh; background: #E3467D; animation: fade .2s; }
.bz-bonus.gone { opacity: 0; transition: opacity .3s; }
.bz-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(rgba(255, 224, 122, .35) 0 10deg, transparent 10deg 20deg); animation: rays 6s linear infinite; }
@keyframes rays { to { rotate: 1turn; } }
.bz-bonus strong { position: relative; font: 800 clamp(44px, 12vh, 140px)/1 var(--f-display); letter-spacing: -.03em; color: #FFF7EC; text-shadow: 0 6px 0 rgba(0, 0, 0, .2); animation: bonus-pop .7s var(--spring); }
.bz-bonus span { position: relative; font-weight: 700; font-size: clamp(16px, 2.6vh, 28px); }
@keyframes bonus-pop { from { scale: .2; rotate: -12deg; } }

/* The title card and the finale */
.bz-intro, .bz-finale {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; align-content: center; gap: 2.4vh; padding: 4vh 4vw; text-align: center;
  background: radial-gradient(80% 70% at 50% 45%, rgba(26, 31, 110, .92), rgba(8, 10, 42, .98)); cursor: pointer; animation: fade .35s;
}
.bz-finale { cursor: default; }
.bz-intro.leaving { animation: title-out .45s var(--ease-out) forwards; }
.bz-intro-kicker, .bz-finale-kicker { margin: 0; font: 800 clamp(14px, 2.4vh, 24px) var(--f-display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.bz-intro-title { margin: 0; font: 800 clamp(44px, 12vh, 150px)/1 var(--f-display); letter-spacing: -.04em; text-shadow: 0 0 40px rgba(255, 224, 122, .35), 0 6px 0 rgba(0, 0, 0, .3); animation: bonus-pop .8s var(--spring); }
.bz-intro-teams { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; margin: 0; }
.bz-intro-teams span { padding: 6px 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 -4px 0 var(--team); font-weight: 800; font-size: clamp(15px, 2.4vh, 24px); animation: rise .5s var(--ease-out) backwards .3s; }
.bz-intro-go { margin: 1vh 0 0; color: #C9CCE6; font-size: clamp(15px, 2.2vh, 22px); animation: hint-pulse 1.8s ease-in-out infinite; }
@keyframes hint-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.bz-finale-name { margin: 0; min-height: 1.1em; font: 800 clamp(48px, 13vh, 160px)/1.05 var(--f-display); letter-spacing: -.04em; text-wrap: balance; opacity: 0; }
.bz-finale-name.in { opacity: 1; animation: bonus-pop .8s var(--spring); color: #FFF7EC; text-shadow: 0 0 50px var(--team), 0 6px 0 rgba(0, 0, 0, .3); }
.bz-podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: min(100%, 560px); }
.bz-podium li { display: grid; grid-template-columns: 3em 1fr auto; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 14px; background: rgba(255, 255, 255, .07); box-shadow: inset 5px 0 0 var(--team); font-weight: 700; font-size: clamp(16px, 2.6vh, 26px); animation: rise .5s var(--ease-out) backwards; animation-delay: var(--d); }
.bz-podium li.first { background: rgba(255, 224, 122, .16); }
.bz-podium strong { font: 800 1.2em var(--f-display); font-variant-numeric: tabular-nums; }
.bz-place { text-align: center; }
.bz-finale-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 640px) {
  .bz-grid.edit { gap: 5px; }
  .bz-head { min-height: 52px; padding: 6px 4px; font-size: 11px; }
  .bz-tile.edit { min-height: 64px; padding: 6px 3px; }
  .bz-snippet { display: none; }
  .bz-sign { padding: 20px 18px; }
  .bz-top-actions { margin-left: 0; width: 100%; }
}
