/* Fizzle (public/fizzle.js). Everyone round a ring, the bomb in the middle with its burning fuse
   and an arrow pointing at whoever holds it; the question on a card beside the ring (below it on
   a phone). Every screen fits the window (style.css caps the match area). */
.fz { --fz-ember: #ff7a3d; --fz-gold: #ffc845; --fz-ink: #1b1140; display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
.fz > * { flex: none; }
.fz .gd-bar { flex-wrap: nowrap; margin-bottom: .85rem; }
.fz .gd-bar .gd-hint { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The stage's deadline is only a backstop (the fuse decides), so its clock stays out of sight. */
#party-match:has(.fz) #match-clock { visibility: hidden; }

.fz-stage {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 1.1rem;
  flex: 0 1 auto; height: clamp(17rem, 62vh, 32rem); min-height: 0;
}

/* ---- The ring. ---- */
.fz-ring { --fz-s: 1; --fz-bomb: 6rem; --fz-reach: 7rem; position: relative; min-width: 0; min-height: 0; }
/* The table everyone sits round. */
.fz-ring::before {
  content: ""; position: absolute; inset: 9% 7%; border: 3px dashed #ffffff26; border-radius: 50%;
  background: radial-gradient(closest-side, #ffffff14, #ffffff06 70%, transparent);
}
.fz-ring.is-shaking { animation: fz-shake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes fz-shake { 20%, 60% { translate: -7px 2px; } 40%, 80% { translate: 7px -2px; } }
.fz-center { position: absolute; left: 50%; top: 50%; z-index: 1; width: var(--fz-bomb); height: var(--fz-bomb); translate: -50% -50%; pointer-events: none; }
.fz-bomb { display: block; width: 100%; height: 100%; overflow: visible; }
.fz-bomb-body { fill: var(--fz-ink); stroke: #fffdf833; stroke-width: 2px; }
.fz-bomb-shine { fill: none; stroke: #ffffff55; stroke-width: 5px; stroke-linecap: round; }
.fz-bomb-cap { fill: #5c4f7a; stroke: var(--fz-ink); stroke-width: 2px; }
.fz-fuse-track { fill: none; stroke: #ffffff22; stroke-width: 4px; stroke-linecap: round; }
.fz-fuse { fill: none; stroke: #d9b98a; stroke-width: 4px; stroke-linecap: round; }
.fz-spark-star { fill: var(--fz-gold); animation: fz-flicker .18s steps(2) infinite; }
.fz-spark-core { fill: #fff3c4; }
@keyframes fz-flicker { 50% { transform: rotate(45deg) scale(.7); } }
.fz-bomb.is-out .fz-spark { display: none; }
.is-holding .fz-bomb { animation: fz-wobble .6s ease-in-out infinite; }
@keyframes fz-wobble { 50% { rotate: -6deg; } }
.fz.is-sparked .fz-bomb { animation: fz-sparked .6s ease-out; }
@keyframes fz-sparked { 30% { scale: 1.18; filter: drop-shadow(0 0 8px var(--fz-gold)); } }
/* The arrow: from the middle of the bomb out toward the holder, turning the short way round. */
.fz-arrow {
  position: absolute; left: 50%; top: 50%; width: var(--fz-reach); height: max(14px, calc(var(--fz-bomb) * .24));
  transform-origin: 0 50%; translate: 0 -50%; rotate: var(--fz-turn, 0deg); opacity: 0; pointer-events: none;
  transition: rotate .45s cubic-bezier(.3, 1.3, .5, 1), opacity .2s;
}
.fz-arrow.is-on { opacity: 1; }
.fz-arrow.is-instant { transition: opacity .2s; }
.fz-arrow svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fz-arrow-shape { fill: var(--fz-gold); stroke: var(--fz-ink); stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* The seats: hearts, portrait, name and the last answer given, sized by --fz-s. */
.fz .fz-seat {
  position: absolute; left: 0; top: 0; z-index: 2; display: grid; justify-items: center; gap: .1em; width: 5.8em; min-height: 0;
  padding: .25em .2em .2em; color: #fffdf8; font: 800 calc(1rem * var(--fz-s))/1 var(--font); text-align: center;
  background: transparent; border: 0; border-radius: 1em; box-shadow: none; translate: -50% -50%; cursor: default;
  transition: scale .2s, background .2s, opacity .2s;
}
.fz .fz-seat:disabled { opacity: 1; }
.fz-hearts { display: flex; gap: .08em; min-height: .9em; color: #ff5d73; font-size: max(.82em, 8px); line-height: 1; }
.fz-heart.is-lost { color: #ffffff30; }
.fz-spark-tag { color: var(--fz-gold); font-size: .9em; white-space: nowrap; }
.fz-seat-face .sb-face { width: 2.7em; height: 2.7em; border-width: .14em; font-size: 1em; transition: box-shadow .2s; }
/* Names and answers stay readable however small the seats get (they trim with an ellipsis). */
.fz-seat-name { max-width: 100%; overflow: hidden; font-size: max(.86em, 9.5px); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.fz-said {
  max-width: 100%; min-height: 1.15em; overflow: hidden; color: #ffffffa8; font-size: max(.72em, 8px); font-weight: 750; line-height: 1.25;
  letter-spacing: .03em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.fz-said.is-right { color: #a8e070; }
.fz-said.is-wrong { color: #ff9a8a; text-decoration: line-through; }
.fz-seat.is-mine .fz-seat-name { color: var(--fz-gold); }
.fz-seat.is-holder { z-index: 3; scale: 1.12; }
.fz-seat.is-holder .sb-face { box-shadow: 0 0 0 .2em var(--fz-gold), 0 0 1.1em var(--fz-ember); }
.fz-seat.is-out .sb-face { filter: grayscale(1); opacity: .55; }
.fz-seat.is-out .fz-seat-name { opacity: .7; text-decoration: line-through; }
.fz-seat.is-burned { animation: fz-burn .9s ease-out; }
@keyframes fz-burn { 0% { background: #ff7a3dcc; } 100% { background: transparent; } }
.fz-seat.is-caught { animation: fz-catch .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes fz-catch { from { scale: .8; } }
/* Passing: the players you can pass to beckon; tap one. */
.fz-ring.is-passing .fz-seat:not(.is-target, .is-holder) { opacity: .4; }
.fz .fz-seat.is-target { cursor: pointer; background: #ffffff12; outline: .15em dashed var(--fz-gold); outline-offset: .05em; animation: fz-beckon 1.1s ease-in-out infinite; }
.fz .fz-seat.is-target:hover, .fz .fz-seat.is-target:focus-visible { scale: 1.08; background: #ffc84533; }
@keyframes fz-beckon { 50% { outline-color: #ffc84555; } }

/* Lighting the fuse, and the pop: a word over the bomb. */
.fz-overlay {
  position: absolute; left: 50%; top: 50%; z-index: 4; display: grid; justify-items: center; gap: .3rem;
  width: min(92%, max(15rem, calc(var(--fz-bomb) * 2.4))); padding: .65rem .9rem .75rem; color: #fffdf8; text-align: center; background: #1b1140eb; border: 3px solid var(--fz-ink);
  border-radius: 18px; box-shadow: 0 0 0 4px #ffffff14; opacity: 0; scale: .85; translate: -50% -50%; pointer-events: none;
  transition: opacity .25s, scale .3s cubic-bezier(.2, 1.4, .4, 1);
}
.fz-overlay.is-on { opacity: 1; scale: 1; }
.fz-overlay-big { font: 800 clamp(1.4rem, 2.8vw, 2.3rem)/1 var(--font); letter-spacing: -.02em; }
.fz-overlay-small { font: 750 clamp(.82rem, 1.5vw, 1rem)/1.25 var(--font); }
.fz-overlay.is-boom .fz-overlay-big { color: var(--fz-ember); animation: fz-boom .6s cubic-bezier(.2, 1.6, .4, 1); text-shadow: 0 0 24px #ff7a3d99; }
@keyframes fz-boom { from { scale: .3; opacity: 0; } }

/* ---- The question. ---- */
.fz-side { display: flex; flex-direction: column; gap: .55rem; min-width: 0; min-height: 0; }
.fz-side > * { flex: none; }
.fz .fz-card {
  display: flex; flex-direction: column; gap: .5rem; flex: 1 1 0; min-height: 0; padding: .7rem .85rem .8rem; color: var(--gd-ink);
  background: var(--gd-paper); border: 3px solid var(--gd-ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--gd-ink);
}
.fz-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1.4rem; }
.fz-topic {
  padding: .1rem .5rem .14rem; background: #ffe1cc; border: 2px solid var(--gd-ink); border-radius: 999px;
  font: 800 .7rem/1.15 var(--font); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.fz-topic:empty { display: none; }
.fz-whose { overflow: hidden; color: var(--gd-muted); font: 800 .82rem/1.2 var(--font); text-overflow: ellipsis; white-space: nowrap; }
.is-holding .fz-whose { color: #c2481f; }
.fz-question { flex: 1 1 auto; min-height: 3.4em; margin: 0; overflow: hidden; font: 800 clamp(1.05rem, 2vw, 1.65rem)/1.25 var(--font); }
.fz-card.is-empty .fz-question { color: var(--gd-muted); font-size: 1rem; }
.fz-card.is-empty .fz-options { visibility: hidden; }
.fz-card.is-over .fz-whose { color: #c2321c; }
.fz-card.is-over .fz-options { opacity: .55; }
.fz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; flex: none; }
.fz .fz-option {
  display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 3rem; padding: .35rem .6rem; color: var(--gd-ink); text-align: left;
  background: #fffdf8; border: 2.5px solid var(--gd-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--gd-ink); font: inherit; cursor: pointer;
  transition: translate .15s, box-shadow .15s, background .2s;
}
.fz .fz-option:not(:disabled):hover { translate: 0 -2px; box-shadow: 4px 5px 0 var(--gd-ink); }
.fz .fz-option:disabled { cursor: default; opacity: 1; }
.fz-option-letter {
  display: grid; flex: none; place-items: center; width: 1.6rem; height: 1.6rem; color: #fffdf8; background: var(--fz-ink); border-radius: 8px;
  font: 800 .8rem/1 var(--font);
}
.fz-option-text { min-width: 0; font: 750 .95rem/1.2 var(--font); overflow-wrap: anywhere; }
.fz-option.is-picked { background: #fff1c9; }
.fz-option.is-right { background: #c9f2c2; }
.fz-option.is-right .fz-option-letter { background: #2c7a3a; }
.fz-option.is-wrong { background: #ffd0cc; }
.fz-option.is-wrong .fz-option-letter { background: #c2321c; }
.fz-waiting { margin: 0; color: #c2481f; font: 800 .9rem/1.2 var(--font); }
.fz-waiting:empty { display: none; }
.fz .fz-spark-button {
  align-self: flex-start; min-height: 2.8rem; padding: .3rem 1.2rem; color: var(--fz-ink); background: var(--fz-gold); border: 2.5px solid var(--gd-ink);
  border-radius: 999px; box-shadow: 3px 3px 0 var(--gd-ink); font: 800 1rem/1 var(--font);
}
.fz .fz-spark-button[hidden] { display: none; }
.fz-credit { margin: 0; overflow: hidden; color: var(--muted); font-size: .66rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Laptop heights. ---- */
@media (min-width: 46.01rem) and (max-height: 50rem) {
  .fz .gd-bar { margin-bottom: .6rem; }
  .fz-stage { height: clamp(15rem, 60vh, 28rem); gap: 1rem; }
  .fz .fz-option { min-height: 2.6rem; }
}
@media (min-width: 46.01rem) and (max-height: 38rem) {
  .fz-stage { height: clamp(13rem, 58vh, 22rem); }
  .fz .fz-card { padding-block: .5rem .55rem; gap: .35rem; }
  .fz .fz-option { min-height: 2.25rem; padding-block: .2rem; }
  .fz-credit { display: none; }
}

/* ---- A phone (either way up): the round fills the screen. ---- */
@media (max-width: 46rem), (max-height: 30rem) {
  .fz { flex: 1 1 0; }
  .fz .gd-bar { margin-bottom: .45rem; }
  .fz .gd-bar .gd-hint { font-size: .84rem; white-space: normal; line-height: 1.2; }
  .fz-stage { flex: 1 1 0; height: auto; gap: .5rem; }
  .fz .fz-card { padding: .5rem .6rem .6rem; border-width: 2.5px; border-radius: 13px; box-shadow: 3px 3px 0 var(--gd-ink); gap: .4rem; }
  .fz-card-head { min-height: 1.2rem; }
  .fz-whose { font-size: .74rem; }
  .fz-question { font-size: 1rem; }
  .fz .fz-option { min-height: 2.3rem; gap: .4rem; padding: .22rem .45rem; border-width: 2px; box-shadow: 2px 2px 0 var(--gd-ink); }
  .fz-option-letter { width: 1.35rem; height: 1.35rem; font-size: .72rem; }
  .fz-option-text { font-size: .84rem; }
  .fz-waiting { font-size: .8rem; }
  .fz-credit { font-size: .58rem; }
  .fz-overlay { padding: .45rem .7rem .55rem; border-radius: 14px; }
}
/* Upright: the ring on top, the question below. */
@media (max-width: 46rem) and (min-height: 30.01rem) {
  .fz-stage { display: flex; flex-direction: column; }
  .fz-ring { flex: 1 1 47%; min-height: 10rem; }
  .fz-side { flex: 1 1 53%; gap: .4rem; }
  .fz-question { min-height: 2.5em; }
  /* The round bar already says to tap a player. */
  .fz-waiting { display: none; }
  .fz-option-text { font-size: .78rem; line-height: 1.15; }
  .fz-options { gap: .4rem; }
  .fz .fz-option { min-height: 2.2rem; padding-block: .18rem; }
  .fz .fz-spark-button { align-self: stretch; min-height: 2.4rem; font-size: .92rem; }
}
/* Short phones: the topic tag goes, and the question gets more of the height. */
@media (max-width: 46rem) and (min-height: 30.01rem) and (max-height: 44rem) {
  .fz-topic { display: none; }
  .fz-ring { flex-basis: 44%; }
  .fz-side { flex-basis: 56%; }
}
/* Sideways: the ring beside the question. */
@media (max-height: 30rem) {
  .fz .gd-bar { margin-bottom: .3rem; }
  .fz-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: .6rem; }
  .fz-topic, .fz-credit { display: none; }
  .fz-question { font-size: .92rem; }
  .fz .fz-option { min-height: 2.1rem; }
}
