:root {
  color-scheme: dark;
  --bg: #120b12;
  --surface: #21151d;
  --surface-2: #33202a;
  --text: #fff7f2;
  --muted: #d0b6b4;
  --line: #68414c;
  --hot: #ff315f;
  --orange: #ff7a30;
  --gold: #ffd35a;
  --mint: #65d6ad;
  --blue: #69c8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(135deg, #120b12 0%, #20111b 42%, #111827 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}

.hidden {
  display: none !important;
}

.gate {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 1.5rem;
  max-width: 720px;
}

.gate h1,
.topbar h1 {
  margin: 0;
  font-size: 4.75rem;
  line-height: 0.9;
}

.gate p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 42rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary,
.ghost,
.icon-button,
.gender-select {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.gender-select {
  background: var(--surface-2);
  color: var(--blue);
  font-weight: 900;
  padding: 0 0.75rem;
}

.primary {
  width: fit-content;
  padding: 0 1.25rem;
  border-color: var(--hot);
  background: var(--hot);
  color: #21060c;
  font-weight: 900;
}

.ghost,
.icon-button {
  background: var(--surface-2);
}

.ghost {
  padding: 0 1rem;
}

.icon-button {
  width: 2.75rem;
  font-size: 1.5rem;
  line-height: 1;
}

.game {
  min-height: calc(100svh - 2rem);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.75rem;
  align-content: start;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 2.75rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 1rem;
  font-weight: 900;
}

.tab[aria-selected="true"] {
  border-color: var(--hot);
  color: var(--text);
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 1rem;
}

.play-panel {
  min-height: min(48rem, calc(100svh - 10rem));
}

h2,
h3 {
  margin: 0;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.roster,
.scores {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.roster {
  display: grid;
  gap: 0.5rem;
}

.roster li {
  display: grid;
  grid-template-columns: 1fr 6rem 2.75rem;
  gap: 0.5rem;
}

.roster input,
.roster select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #130b0f;
  color: var(--text);
  padding: 0 0.75rem;
}

.round-stage {
  display: grid;
  gap: 0.35rem;
  padding: 0 0 0.5rem;
}

.round-stage h2 {
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

#verdict {
  min-height: 2.6rem;
  margin: 0;
  color: var(--gold);
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  font-weight: 800;
  line-height: 1.35;
}

#active-metric {
  margin: 0;
  color: var(--mint);
  font-size: clamp(1.25rem, 3vw, 2.2rem);
  font-weight: 900;
  text-transform: uppercase;
}

.timer {
  width: fit-content;
  min-width: 4rem;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 65%, var(--line));
  border-radius: 8px;
  color: var(--gold);
  padding: 0.25rem 0.6rem;
  font-size: 1.15rem;
  font-weight: 900;
}

.timer.is-low {
  border-color: var(--hot);
  color: var(--hot);
}

.heat-board {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 1rem;
  align-items: end;
  margin-top: 0.5rem;
}

.thermometer {
  position: relative;
  display: grid;
  grid-template-columns: 2.8rem minmax(5rem, 7.25rem);
  justify-items: center;
  justify-content: center;
  align-self: end;
  gap: 0.85rem;
  width: 100%;
  max-width: 15rem;
  min-height: clamp(22rem, calc(100svh - 17rem), 34rem);
  filter: drop-shadow(0 0 2rem color-mix(in srgb, var(--hot) 22%, transparent));
}

.thermometer::before {
  position: absolute;
  inset: 2rem 0;
  z-index: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 58% 20%, color-mix(in srgb, #fff 20%, transparent), transparent 18%),
    radial-gradient(circle at 50% 78%, color-mix(in srgb, var(--hot) 34%, transparent), transparent 36%);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.thermometer-scale {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: clamp(18rem, calc(100svh - 25rem), 27rem);
  padding: 0.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.thermometer-scale span {
  position: relative;
  width: 100%;
  text-align: right;
}

.thermometer-scale span::after {
  position: absolute;
  top: 50%;
  right: -1.5rem;
  width: 0.8rem;
  height: 2px;
  background: currentColor;
  content: "";
}

.thermometer-body {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
}

.thermometer-body::before {
  position: absolute;
  top: -0.9rem;
  z-index: 2;
  width: clamp(4.4rem, 7vw, 6.3rem);
  height: 1.35rem;
  border: 1px solid color-mix(in srgb, #fff 30%, var(--line));
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, color-mix(in srgb, #fff 62%, transparent), transparent 18%),
    linear-gradient(180deg, #2d1c23, #14090e);
  box-shadow: inset 0 0 0.8rem color-mix(in srgb, #fff 10%, transparent);
  content: "";
}

.thermometer-body::after {
  position: absolute;
  top: 15%;
  width: clamp(7.5rem, 14vw, 11rem);
  height: clamp(7.5rem, 14vw, 11rem);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.thermometer-track {
  position: relative;
  width: clamp(3.65rem, 6vw, 5.4rem);
  height: clamp(18rem, calc(100svh - 25rem), 27rem);
  overflow: hidden;
  border: 2px solid color-mix(in srgb, #fff 18%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(100deg, transparent 0 35%, color-mix(in srgb, #fff 20%, transparent) 36% 42%, transparent 43% 100%),
    radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--hot) 20%, transparent), transparent 42%),
    linear-gradient(90deg, color-mix(in srgb, #fff 14%, transparent), transparent 18% 72%, color-mix(in srgb, #000 30%, transparent)),
    #130b0f;
  box-shadow:
    inset 0 0 1.8rem color-mix(in srgb, #000 58%, transparent),
    inset 0.8rem 0 1.1rem color-mix(in srgb, #fff 12%, transparent),
    0 0 1.25rem color-mix(in srgb, var(--hot) 22%, transparent);
}

.thermometer-track::after {
  position: absolute;
  top: 7%;
  bottom: 11%;
  left: 22%;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, #fff 56%, transparent), transparent 68%);
  content: "";
  opacity: 0.78;
}

.thermometer-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 50%;
  overflow: hidden;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 8%, #fff7c7, transparent 14%),
    radial-gradient(circle at 62% 30%, color-mix(in srgb, #fff 34%, transparent) 0 0.35rem, transparent 0.42rem),
    radial-gradient(circle at 38% 54%, color-mix(in srgb, #fff 28%, transparent) 0 0.28rem, transparent 0.34rem),
    radial-gradient(circle at 58% 76%, color-mix(in srgb, #fff 26%, transparent) 0 0.42rem, transparent 0.5rem),
    linear-gradient(180deg, var(--gold), var(--orange) 42%, var(--hot) 78%, #bf1238);
  box-shadow:
    inset 0 0.6rem 1rem color-mix(in srgb, #fff 18%, transparent),
    0 0 2rem color-mix(in srgb, var(--hot) 70%, transparent);
  transition: height 120ms ease-out, filter 120ms ease-out;
}

.thermometer-fill::before {
  position: absolute;
  inset: -30% 0 0;
  background:
    repeating-radial-gradient(ellipse at 45% 10%, color-mix(in srgb, #fff 18%, transparent) 0 0.18rem, transparent 0.2rem 0.8rem),
    linear-gradient(100deg, transparent 0 30%, color-mix(in srgb, #fff 22%, transparent) 31% 38%, transparent 39% 100%);
  content: "";
  opacity: 0.7;
  animation: liquid-rise 900ms linear infinite;
}

.thermometer-bulb {
  position: relative;
  width: clamp(6.2rem, 10vw, 8.6rem);
  height: clamp(6.2rem, 10vw, 8.6rem);
  margin-top: -1.45rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #fff7c7 0 9%, transparent 10%),
    radial-gradient(circle at 40% 34%, var(--gold), var(--orange) 35%, var(--hot) 64%, #a50f33 100%);
  box-shadow:
    inset 0 -0.75rem 1.5rem color-mix(in srgb, #5b0017 44%, transparent),
    0 0 3rem color-mix(in srgb, var(--hot) 55%, transparent);
}

.thermometer-bulb::after {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, color-mix(in srgb, #fff 48%, transparent), transparent 13%),
    radial-gradient(circle, color-mix(in srgb, var(--gold) 34%, transparent), transparent 60%);
  content: "";
}

.thermometer[data-heat="medio"] .thermometer-fill,
.thermometer[data-heat="alto"] .thermometer-fill,
.thermometer[data-heat="maximo"] .thermometer-fill {
  filter: saturate(1.28) brightness(1.08);
}

.thermometer[data-heat="alto"],
.thermometer[data-heat="maximo"] {
  animation: pressure 520ms ease-in-out infinite alternate;
}

.thermometer.is-cracking .thermometer-track {
  transform: rotate(-1.7deg) scaleX(1.03);
  animation: crack-shake 110ms linear infinite;
}

.thermometer.is-cracking .thermometer-track::before {
  position: absolute;
  inset: 7% 24% 16% 29%;
  z-index: 3;
  background:
    linear-gradient(132deg, transparent 0 18%, #fff7f2 19% 21%, transparent 22% 100%),
    linear-gradient(52deg, transparent 0 32%, #fff7f2 33% 35%, transparent 36% 100%),
    linear-gradient(105deg, transparent 0 48%, #fff7f2 49% 51%, transparent 52% 100%),
    linear-gradient(28deg, transparent 0 58%, #fff7f2 59% 62%, transparent 63% 100%),
    linear-gradient(156deg, transparent 0 69%, #fff7f2 70% 72%, transparent 73% 100%);
  content: "";
  opacity: 0.92;
  filter: drop-shadow(0 0 0.35rem color-mix(in srgb, #fff 70%, transparent));
}

.thermometer.is-cracking .thermometer-body::after {
  animation: glass-pop 680ms ease-out infinite;
}

.thermometer.is-cracking .thermometer-bulb {
  animation: bulb-pulse 180ms ease-in-out infinite alternate;
}

.thermometer.is-broken {
  animation: break-shake 90ms linear 6;
}

.thermometer.is-broken::before {
  animation: broken-flash 480ms ease-out 1;
}

.thermometer.is-broken .thermometer-track {
  border-color: #fff7f2;
  box-shadow:
    inset 0 0 1.8rem color-mix(in srgb, #000 58%, transparent),
    inset 0.8rem 0 1.1rem color-mix(in srgb, #fff 14%, transparent),
    0 0 2rem color-mix(in srgb, #fff 42%, transparent),
    0 0 4.5rem color-mix(in srgb, var(--gold) 55%, transparent);
}

.thermometer.is-broken .thermometer-track::before {
  inset: 4% 14% 12% 16%;
  background:
    linear-gradient(128deg, transparent 0 14%, #fff7f2 15% 17%, transparent 18% 100%),
    linear-gradient(38deg, transparent 0 27%, #fff7f2 28% 31%, transparent 32% 100%),
    linear-gradient(96deg, transparent 0 41%, #fff7f2 42% 44%, transparent 45% 100%),
    linear-gradient(150deg, transparent 0 55%, #fff7f2 56% 59%, transparent 60% 100%),
    linear-gradient(24deg, transparent 0 70%, #fff7f2 71% 74%, transparent 75% 100%),
    linear-gradient(112deg, transparent 0 82%, #fff7f2 83% 85%, transparent 86% 100%);
}

.thermometer.is-broken .thermometer-body::after {
  animation: glass-pop 420ms ease-out infinite;
}

.thermometer.is-broken .thermometer-bulb {
  animation: broken-pop 360ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate;
}

.thermometer.is-broken output {
  color: #fff7c7;
  animation: broken-score 180ms linear infinite;
}

.thermometer output {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: clamp(2.25rem, 5vw, 3.9rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 1.25rem color-mix(in srgb, var(--hot) 55%, transparent);
}

.play-controls {
  position: relative;
  display: grid;
  gap: 1.25rem;
  align-content: center;
  justify-items: center;
  width: 100%;
  min-height: min(32rem, calc(100svh - 17rem));
}

.action-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 16rem) minmax(8rem, 1fr);
  align-items: end;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  width: min(100%, 64rem);
}

.step-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.step-progress span {
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.step-progress .active {
  border-color: var(--gold);
  color: var(--gold);
}

.step-progress .done {
  border-color: var(--mint);
  color: var(--mint);
}

.heat-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0.75rem;
  border-color: var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 120%, var(--gold), transparent 42%),
    linear-gradient(180deg, #ff9b3d, var(--hot) 55%, #a50f33);
  box-shadow:
    0 0 1.5rem color-mix(in srgb, var(--hot) 65%, transparent),
    0 0 3rem color-mix(in srgb, var(--orange) 28%, transparent);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1;
  overflow-wrap: anywhere;
  white-space: normal;
  text-shadow: 0 1px 0 color-mix(in srgb, #000 35%, transparent);
  transition: box-shadow 160ms ease, filter 160ms ease, transform 80ms ease;
}

.heat-button::before {
  position: absolute;
  inset: -55% 18% 42%;
  z-index: -1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 78%, transparent);
  filter: blur(1rem);
  content: "";
  opacity: 0.95;
}

.heat-button:hover,
.heat-button:focus-visible {
  box-shadow:
    0 0 2.25rem color-mix(in srgb, var(--gold) 72%, transparent),
    0 0 4rem color-mix(in srgb, var(--hot) 42%, transparent);
  filter: brightness(1.07);
}

.heat-button:active {
  transform: translateY(4px) scale(0.96);
}

.heat-button:disabled {
  cursor: default;
  filter: saturate(0.6);
  opacity: 0.78;
}

.pass-button {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0.75rem;
  border-color: color-mix(in srgb, var(--muted) 42%, var(--line));
  border-radius: 50%;
  color: var(--muted);
  font-weight: 900;
  font-size: clamp(1rem, 2vw, 1.45rem);
  line-height: 1;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pass-button:hover,
.pass-button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

#gender-toggle {
  width: fit-content;
  min-width: 6rem;
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
  color: var(--blue);
  font-weight: 900;
}

.heat-fx {
  position: absolute;
  inset: auto 0 4rem 0;
  min-height: 16rem;
  pointer-events: none;
}

.heat-fx span {
  position: absolute;
  left: calc(50% + var(--origin, 0rem));
  bottom: 0;
  color: var(--gold);
  font-size: var(--size, 1.45rem);
  font-weight: 900;
  line-height: 1;
  animation: float-heat var(--duration, 950ms) ease-out var(--delay, 0ms) forwards;
  text-shadow: 0 0 0.75rem color-mix(in srgb, var(--hot) 50%, transparent);
  will-change: opacity, transform;
}

.heat-fx .fx-alto,
.heat-fx .fx-maximo {
  filter: drop-shadow(0 0 0.75rem color-mix(in srgb, var(--gold) 70%, transparent));
}

.heat-fx .fx-maximo {
  animation-name: float-heat-max;
}

.final-results {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.final-total {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.fmk-panel {
  display: grid;
  gap: 1rem;
}

.fmk-options,
.fmk-form {
  display: grid;
  gap: 0.75rem;
}

.fmk-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fmk-options span {
  min-height: 3rem;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
  border-radius: 8px;
  color: var(--gold);
  padding: 0.7rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.fmk-field {
  display: grid;
  grid-template-columns: 5rem minmax(8rem, 1fr) minmax(10rem, 1.2fr);
  gap: 0.5rem;
  align-items: center;
}

.fmk-field span {
  color: var(--mint);
  font-weight: 900;
}

.fmk-field select,
.fmk-field input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #130b0f;
  color: var(--text);
  padding: 0 0.75rem;
}

.fmk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fmk-actions p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.fmk-history {
  margin-top: 0.75rem;
}

.fmk-history li {
  grid-template-columns: 1fr;
  align-items: start;
  padding: 0.5rem 0;
}

.fmk-history .score-name {
  white-space: normal;
}

.fmk-history small {
  color: var(--muted);
  line-height: 1.4;
}

.office-panel {
  display: grid;
  gap: 1rem;
}

.office-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) minmax(18rem, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.office-setup,
.office-card,
.office-fmk,
.office-scores {
  display: grid;
  gap: 0.75rem;
}

.office-setup textarea,
.office-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #130b0f;
  color: var(--text);
  padding: 0.75rem;
}

.office-setup textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.office-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--mint);
  font-weight: 900;
}

.office-toggle input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--hot);
}

.office-consent {
  margin: 0;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  padding-left: 0.75rem;
  line-height: 1.45;
}

.office-toolbar,
.office-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.office-toolbar select {
  flex: 1 1 12rem;
  min-height: 2.75rem;
}

.office-card {
  min-height: 16rem;
}

#office-player {
  margin-top: 0.5rem;
}

#office-prompt {
  min-height: 5.5rem;
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.35rem, 2.6vw, 2.2rem);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.office-actions button {
  flex: 1 1 8rem;
}

.office-fmk,
.office-scores {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.office-destiny {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.office-destiny span {
  min-height: 3rem;
  border: 1px solid color-mix(in srgb, var(--blue) 52%, var(--line));
  border-radius: 8px;
  color: var(--blue);
  padding: 0.65rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.office-history .score-name {
  white-space: normal;
}

@keyframes float-heat {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(var(--rise, -7rem)) translateX(var(--x, 0rem)) scale(1.35) rotate(var(--rotate, 8deg));
  }
}

@keyframes liquid-rise {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-1.1rem);
  }
}

@keyframes float-heat-max {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  55% {
    opacity: 1;
    transform: translateY(-4rem) translateX(0) scale(1.55) rotate(0deg);
  }

  to {
    opacity: 0;
    transform: translateY(var(--rise, -8rem)) translateX(var(--x, 0rem)) scale(1.75) rotate(var(--rotate, 8deg));
  }
}

@keyframes pressure {
  from {
    filter: drop-shadow(0 0 2rem color-mix(in srgb, var(--hot) 28%, transparent));
  }

  to {
    filter: drop-shadow(0 0 3.2rem color-mix(in srgb, var(--gold) 42%, transparent));
  }
}

@keyframes crack-shake {
  0%,
  100% {
    transform: rotate(-1.7deg) scaleX(1.03) translateX(0);
  }

  50% {
    transform: rotate(1.4deg) scaleX(1.06) translateX(2px);
  }
}

@keyframes glass-pop {
  from {
    opacity: 0.75;
    transform: scale(0.45);
  }

  to {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes broken-flash {
  0% {
    opacity: 0.95;
    transform: scale(0.6);
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes break-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  25% {
    transform: translateX(-3px) rotate(-1.6deg);
  }

  75% {
    transform: translateX(3px) rotate(1.6deg);
  }
}

@keyframes broken-pop {
  from {
    transform: scale(1);
    filter: brightness(1);
  }

  to {
    transform: scale(1.08);
    filter: brightness(1.25);
  }
}

@keyframes bulb-pulse {
  from {
    box-shadow:
      inset 0 -0.75rem 1.5rem color-mix(in srgb, #5b0017 44%, transparent),
      0 0 3rem color-mix(in srgb, var(--hot) 55%, transparent);
  }

  to {
    box-shadow:
      inset 0 -0.75rem 1.5rem color-mix(in srgb, #5b0017 44%, transparent),
      0 0 5rem color-mix(in srgb, var(--gold) 72%, transparent);
  }
}

@keyframes broken-score {
  0%,
  100% {
    transform: rotate(-2deg) scale(1);
  }

  50% {
    transform: rotate(2deg) scale(1.07);
  }
}

.scores {
  display: grid;
  gap: 0.5rem;
}

.scores li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.scores .score-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scores .score-total {
  color: var(--gold);
  font-weight: 900;
}

.compact li {
  grid-template-columns: 1fr auto;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 860px) {
  .game {
    min-height: calc(100svh - 1rem);
  }

  .topbar {
    align-items: end;
  }

  .play-panel {
    min-height: auto;
  }

  .heat-board {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.75rem;
  }

  .thermometer {
    max-width: 12.5rem;
    min-height: clamp(20rem, calc(100svh - 20rem), 30rem);
  }

  .thermometer-scale,
  .thermometer-track {
    height: clamp(17rem, calc(100svh - 29rem), 24rem);
  }

  .play-controls {
    width: 100%;
    min-height: 12rem;
    justify-items: center;
    text-align: center;
  }

  .step-progress {
    justify-content: center;
  }

  .action-row {
    grid-template-columns: minmax(6.25rem, 1fr) minmax(10rem, 12.5rem) minmax(6.25rem, 1fr);
  }

  .heat-fx {
    inset: auto 0 5.5rem 0;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 0.75rem, 1180px);
    padding: 0.5rem 0;
  }

  .topbar {
    display: grid;
    gap: 0.5rem;
  }

  .gate h1,
  .topbar h1 {
    font-size: 2.8rem;
  }

  .panel {
    padding: 0.75rem;
  }

  .round-stage h2 {
    font-size: clamp(2.25rem, 14vw, 4.2rem);
  }

  .thermometer {
    grid-template-columns: 2.1rem minmax(4.4rem, 5.2rem);
    gap: 0.5rem;
    max-width: 9.5rem;
    min-height: clamp(17rem, calc(100svh - 20rem), 26rem);
  }

  .thermometer-scale,
  .thermometer-track {
    height: clamp(15rem, calc(100svh - 29rem), 21rem);
  }

  .thermometer-scale {
    font-size: 0.72rem;
  }

  .thermometer-track {
    width: clamp(3rem, 10vw, 3.6rem);
  }

  .thermometer-bulb {
    width: clamp(5.25rem, 17vw, 6rem);
    height: clamp(5.25rem, 17vw, 6rem);
    margin-top: -1.05rem;
  }

  .thermometer output {
    font-size: 2rem;
  }

  .action-row {
    grid-template-columns: minmax(4.8rem, 0.8fr) minmax(8.7rem, 9.5rem) minmax(4.8rem, 0.9fr);
    gap: 0.5rem;
  }

  .heat-button,
  .pass-button {
    width: 100%;
    padding: 0.45rem;
  }

  .step-progress span {
    flex: 1 1 7rem;
  }

  .roster li {
    grid-template-columns: 1fr 5.5rem 2.75rem;
  }

  .fmk-options,
  .fmk-field,
  .office-grid,
  .office-destiny {
    grid-template-columns: 1fr;
  }

  .fmk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .fmk-actions .primary {
    width: 100%;
  }

  .office-toolbar,
  .office-actions {
    display: grid;
  }

  .office-actions button,
  .office-toolbar button {
    width: 100%;
  }
}

@media (max-width: 320px) {
  .tabs,
  .step-progress {
    gap: 0.25rem;
  }

  .tab {
    padding: 0 0.7rem;
  }

  .thermometer {
    grid-template-columns: 1.85rem 4.4rem;
    gap: 0.4rem;
    max-width: 8.15rem;
    min-height: 17rem;
  }

  .thermometer-scale,
  .thermometer-track {
    height: 14rem;
  }

  .heat-button,
  .pass-button {
    font-size: 0.78rem;
  }

  .action-row {
    grid-template-columns: minmax(4.35rem, 0.75fr) 8.15rem minmax(4.35rem, 0.85fr);
    gap: 0.25rem;
  }
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .play-panel {
    padding: 1.25rem;
  }
}
