:root {
  --paper: #f3efe6;
  --ink: #24251f;
  --muted: #77786d;
  --line: #d9d5c9;
  --red: #e13b2b;
  --green: #3a7754;
  --yellow: #ecbf48;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, #fffaf0, transparent 75%), var(--paper);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #3574bc;
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  color: inherit;
}
button[hidden],
[hidden] {
  display: none !important;
}
.app {
  max-width: 460px;
  min-height: 100svh;
  margin: auto;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
}
header {
  height: 73px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.7px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 13px;
  height: 13px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 2px 0 #9c271a;
}
.edition {
  font:
    9px ui-monospace,
    monospace;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0;
}
.icon-control {
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  font-size: 18px;
  height: 34px;
  min-width: 61px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.icon-control span {
  font:
    9px ui-monospace,
    monospace;
}
.home {
  padding-top: 27px;
  flex: 1;
}
.eyebrow,
.section-label,
.round-label,
.home-footer,
.machine-label,
.mini-label,
.orbit-label,
label,
.connection,
.app-footer {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1.3px;
  font-weight: 600;
}
.live-dot {
  display: inline-block;
  height: 6px;
  width: 6px;
  background: var(--red);
  border-radius: 50%;
  margin-right: 5px;
}
.home h1 {
  font-size: clamp(62px, 18vw, 83px);
  line-height: 0.91;
  letter-spacing: -5px;
  margin: 23px 0 17px;
  font-weight: 900;
}
.home h1 em {
  color: var(--red);
  font-style: normal;
}
.intro {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  color: #68695f;
}
.intro strong {
  color: var(--ink);
}
.mini-machine {
  height: 169px;
  margin: 21px 0 22px;
  background: var(--ink);
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 31px,
    #ffffff06 31px 32px
  );
}
.mini-label {
  position: absolute;
  top: 17px;
  left: 15px;
  color: #cecdbd;
  font-size: 8px;
  writing-mode: vertical-rl;
}
.mini-button {
  height: 127px;
  width: 127px;
  border-radius: 50%;
  border: 5px solid #9d2c21;
  background: radial-gradient(circle at 40% 20%, #fa6747, #e43524 65%);
  box-shadow:
    0 9px 0 #861f18,
    0 12px 0 9px #151510,
    0 0 0 9px #49483d;
  display: grid;
  place-items: center;
  transform: rotate(-12deg);
}
.mini-button span {
  text-align: center;
  color: #fff3db;
  font-weight: 900;
  font-size: 23px;
  line-height: 0.93;
  letter-spacing: -1px;
}
.orbit-label {
  position: absolute;
  bottom: 13px;
  right: 13px;
  color: #cecdbd;
  font-size: 7px;
  letter-spacing: 1px;
}
label {
  display: block;
  margin: 12px 0 8px;
  font-size: 9px;
}
input {
  background: #fffdf6;
  border: 1px solid #c9c5ba;
  border-radius: 8px;
  width: 100%;
  height: 47px;
  padding: 0 13px;
  outline-offset: 3px;
  font-size: 16px;
  color: var(--ink);
}
input:focus {
  outline: 2px solid var(--ink);
}
#room-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 700;
}
.primary {
  border: 0;
  background: var(--ink);
  color: #fff9ea;
  border-radius: 8px;
  min-height: 47px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 13px;
  transition: background 0.15s;
}
.primary:hover {
  background: #424335;
}
.primary span {
  font-size: 23px;
  font-weight: 400;
}
.primary:disabled {
  background: #d6d4c8;
  color: #848678;
}
.text-control {
  background: none;
  border: 0;
  padding: 12px 0;
  font-size: 12px;
  text-decoration: none;
}
#join-toggle {
  width: 100%;
  color: #64665a;
}
#join-toggle span {
  margin-left: 6px;
}
.home-footer {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--muted);
  margin: 12px 0 25px;
  letter-spacing: 0.4px;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 6.8px;
  letter-spacing: 0.4px;
  min-height: 40px;
  margin-top: auto;
  color: var(--muted);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.app-footer button {
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
}
.game {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 55px;
}
.room-code {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 4px 0;
  border: 0;
}
.room-code span {
  font:
    9px ui-monospace,
    monospace;
  color: var(--muted);
  letter-spacing: 1px;
}
.room-code b {
  font:
    700 18px ui-monospace,
    monospace;
  letter-spacing: 2px;
}
.room-code i {
  font-style: normal;
  color: var(--red);
  font-size: 20px;
}
.round-label {
  font-size: 9px;
  letter-spacing: 1px;
}
.round-label b {
  font-size: 17px;
  margin-left: 7px;
}
.round-label span {
  color: var(--muted);
  margin-left: 5px;
}
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 5px;
}
.status-bar .eyebrow {
  font-size: 8px;
  color: var(--muted);
}
h2 {
  margin: 6px 0 0;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.9px;
}
.connection {
  font-size: 8px;
  letter-spacing: 0.6px;
  color: var(--green);
  white-space: nowrap;
}
.connection.offline {
  color: var(--red);
}
.score-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 8px;
}
.score-panel .eyebrow {
  font-size: 8px;
  color: var(--muted);
}
.score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-variant-numeric: tabular-nums;
  height: 64px;
}
.score > span {
  font-size: 65px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -4px;
}
.score small {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
}
.rate-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.rate-block > span:first-child {
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 900;
  color: var(--red);
}
.rate-block small {
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 0.6px;
  color: var(--muted);
}
#total {
  background: #e7e3d8;
  border-radius: 4px;
  padding: 5px 8px;
  font:
    9px ui-monospace,
    monospace;
  margin-top: 5px;
}
.arena {
  position: relative;
  overflow: clip;
  overflow-clip-margin: 8px;
  height: clamp(184px, 29svh, 259px);
  display: grid;
  place-items: center;
  margin: 4px 0 0;
  isolation: isolate;
}
.hazard-ring {
  height: 92%;
  aspect-ratio: 1;
  border: 1px dashed #bcb9ab;
  border-radius: 50%;
  position: absolute;
}
.button-base {
  width: clamp(168px, 25svh, 228px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    #888779,
    #d2cec0 18%,
    #6a6a5e 48%,
    #afab9e 75%,
    #656357
  );
  padding: 8px;
  box-shadow:
    0 4px 0 #aaa698,
    0 9px 18px #35332125;
}
.hold-button {
  border: 3px solid #c32e22;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: radial-gradient(
    ellipse at 45% 15%,
    #fb6a4e 0%,
    #ef4832 35%,
    #df2d20 72%,
    #c5251b
  );
  box-shadow:
    inset 0 3px 2px #ffa084,
    0 7px 0 #8f2118,
    0 10px 8px #421a1545;
  color: #fff5df;
  position: relative;
  top: -4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    transform 0.08s,
    box-shadow 0.08s,
    filter 0.2s;
  outline-offset: 8px;
}
.hold-button > * {
  pointer-events: none;
}
.hold-button strong {
  font-size: 36px;
  letter-spacing: -1.5px;
  font-weight: 900;
  line-height: 1;
}
.hold-button small {
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 1.4px;
  margin-top: 5px;
}
.hold-button #button-icon {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.3;
}
.hold-button.pressed {
  transform: translateY(6px);
  box-shadow:
    inset 0 2px 9px #7d160e55,
    0 1px 0 #8f2118;
  filter: saturate(1.15);
}
.hold-button.safe {
  background: radial-gradient(ellipse at 40% 20%, #71b98b, #39815c);
  border-color: #326849;
  box-shadow:
    inset 0 2px 2px #92cfa5,
    0 7px 0 #254e38;
  color: #f5ffea;
}
.hold-button.dead {
  background: radial-gradient(ellipse at 40% 20%, #63645c, #3b3d36);
  border-color: #34362e;
  box-shadow:
    inset 0 2px 2px #838378,
    0 7px 0 #252720;
}
.machine-label {
  position: absolute;
  bottom: -6px;
  font-size: 6px;
  letter-spacing: 1.5px;
  color: #99988b;
}
.instruction {
  text-align: center;
  min-height: 51px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.instruction > span {
  font-size: 12px;
  font-weight: 700;
}
.instruction small {
  font-size: 10px;
  color: var(--muted);
}
.players-section {
  margin-top: auto;
  padding-top: 9px;
}
.section-label {
  font-size: 8px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}
.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}
.player {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 7px 8px;
  border-radius: 6px;
  min-height: 37px;
  background: #fffcf245;
}
.avatar {
  height: 21px;
  width: 21px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #646557;
  background: #e0dfd2;
}
.player.me .avatar {
  background: var(--ink);
  color: var(--paper);
}
.player-name {
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-copy {
  flex: 1;
  min-width: 0;
}
.player-status {
  font:
    7px ui-monospace,
    monospace;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin-top: 2px;
}
.player-score {
  font:
    700 12px ui-monospace,
    monospace;
  letter-spacing: -0.5px;
}
.player.banked {
  border-color: #9cbea5;
}
.player.banked .player-status {
  color: var(--green);
}
.player.holding .avatar,
.player.ready .avatar {
  background: #f4d7c4;
  color: #bb3624;
}
.player.busted .player-status,
.player.forfeit .player-status {
  color: #b23e31;
}
.player.offline {
  opacity: 0.65;
}
.remove-seat {
  background: transparent;
  border: 0;
  font-size: 18px;
  padding: 1px 3px;
}
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 66px;
}
.bottom-bar > span {
  font-size: 10px;
  color: var(--muted);
  max-width: 50%;
  line-height: 1.4;
}
.compact {
  width: auto;
  min-width: 152px;
  font-size: 12px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0 13px;
  gap: 18px;
}
.compact span {
  font-size: 18px;
}
.burst {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -7px;
  color: #fff5da;
  text-shadow: 4px 4px 0 #7c2018;
  transform: rotate(-9deg);
  pointer-events: none;
}
.arena.explode .burst {
  display: grid;
  animation: burst 0.7s ease-out both;
}
.arena.explode {
  animation: shake 0.4s linear;
}
.bank-flash {
  animation: bank 0.55s ease-out;
}
.arena.live .hazard-ring {
  border-color: #c27555;
  animation: orbit 18s linear infinite;
}
.arena.counting .hold-button strong {
  font-size: 70px;
}
.arena.counting .hazard-ring {
  border: 2px solid var(--yellow);
}
.arena.winner .hazard-ring {
  border: 3px dotted #cba338;
}
.arena.winner .hold-button {
  background: radial-gradient(ellipse at 40% 20%, #f9d676, #d8a332);
  border-color: #b98b22;
  box-shadow:
    inset 0 2px 2px #fff0ae,
    0 7px 0 #8e6a18;
  color: #3b3320;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  max-width: 390px;
  width: calc(100% - 32px);
  padding: 28px;
  max-height: 85svh;
}
dialog::backdrop {
  background: #1e201ab3;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 39px;
  line-height: 0.95;
  margin: 20px 0;
}
dialog ol {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
dialog li {
  margin: 13px 0;
}
dialog p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.dialog-close {
  position: absolute;
  right: 15px;
  top: 11px;
  border: 0;
  background: none;
  font-size: 27px;
  padding: 5px 10px;
}
#toast {
  position: fixed;
  bottom: 23px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 13px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.4;
  border-radius: 8px;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  max-width: 90vw;
  width: max-content;
  z-index: 5;
  box-shadow: 0 4px 20px #0003;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes bank {
  0% {
    color: var(--green);
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes burst {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-9deg);
  }
  18% {
    opacity: 1;
    transform: scale(1.12) rotate(-9deg);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.2) rotate(-9deg);
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
@media (min-width: 700px) {
  body {
    background: #e4e0d5;
  }
  .app {
    background: var(--paper);
    box-shadow: 0 0 90px #3332;
    padding: 0 27px;
    border-left: 1px solid #cbc7bb;
    border-right: 1px solid #cbc7bb;
  }
  .home {
    padding-top: 35px;
  }
}
@media (max-height: 750px) {
  header {
    height: 54px;
  }
  .home {
    padding-top: 18px;
  }
  .home h1 {
    font-size: 65px;
    margin: 16px 0;
  }
  .mini-machine {
    height: 130px;
    margin: 17px 0;
  }
  .mini-button {
    height: 100px;
    width: 100px;
  }
  .mini-button span {
    font-size: 20px;
  }
  .home-footer {
    margin: 8px 0 13px;
  }
  .room-bar {
    height: 44px;
  }
  .status-bar {
    min-height: 44px;
  }
  h2 {
    font-size: 21px;
  }
  .score-panel {
    padding: 9px 0 3px;
  }
  .score {
    height: 53px;
  }
  .score > span {
    font-size: 53px;
  }
  .arena {
    height: clamp(170px, 26svh, 198px);
  }
  .button-base {
    width: clamp(157px, 24svh, 181px);
  }
  .instruction {
    min-height: 45px;
  }
  .bottom-bar {
    min-height: 57px;
  }
  .player {
    min-height: 32px;
    padding: 5px 7px;
  }
  .app-footer {
    min-height: 30px;
  }
  .app-footer button {
    padding: 8px 0;
  }
}
@media (max-height: 660px) {
  .app {
    padding: 0 16px;
  }
  .home h1 {
    font-size: 54px;
  }
  .mini-machine {
    height: 100px;
    margin: 13px 0;
  }
  .mini-button {
    height: 79px;
    width: 79px;
  }
  .mini-button span {
    font-size: 15px;
  }
  .intro {
    font-size: 13px;
  }
  .arena {
    height: 154px;
  }
  .button-base {
    width: 142px;
  }
  .hold-button strong {
    font-size: 29px;
  }
  .hold-button small {
    font-size: 7px;
  }
  .machine-label {
    font-size: 5px;
  }
  .score > span {
    font-size: 44px;
  }
  .score {
    height: 44px;
  }
  .score-panel {
    padding-top: 5px;
  }
  .instruction {
    padding-top: 9px;
    min-height: 42px;
  }
  .player {
    min-height: 30px;
    padding: 4px 6px;
  }
  .room-bar {
    height: 39px;
  }
  .status-bar {
    min-height: 38px;
  }
  .app-footer > span {
    font-size: 6px;
  }
  .bottom-bar {
    min-height: 50px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
.game.crowded .arena {
  height: clamp(150px, 23svh, 210px);
}
.game.crowded .button-base {
  width: clamp(138px, 21svh, 185px);
}
@media (max-height: 710px) {
  header {
    height: 46px;
  }
  .game .room-bar {
    height: 37px;
  }
  .game .status-bar {
    min-height: 37px;
  }
  .game .score-panel {
    padding: 5px 0 2px;
  }
  .game .score {
    height: 45px;
  }
  .game .score > span {
    font-size: 45px;
  }
  .game .arena {
    height: 151px;
  }
  .game .button-base {
    width: 140px;
  }
  .game .hold-button strong {
    font-size: 29px;
  }
  .game .instruction {
    min-height: 42px;
    padding-top: 10px;
  }
  .game .players-section {
    padding-top: 7px;
  }
  .game .player {
    min-height: 30px;
    padding: 4px 6px;
  }
  .game .bottom-bar {
    min-height: 50px;
  }
  .game .section-label {
    margin-bottom: 5px;
  }
  .app-footer {
    min-height: 27px;
  }
  .app-footer button {
    padding: 6px 0;
  }
}
/* Public room browser and intermission controls. */
.browse-home .mini-machine {
  display: none;
}
.browse-home h1 {
  font-size: clamp(48px, 14vw, 64px);
  margin: 18px 0 14px;
}
.browse-home .intro {
  margin-bottom: 20px;
}
.room-directory {
  margin: 24px 0 20px;
}
#rooms {
  display: grid;
  gap: 9px;
}
.room-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 13px;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}
.room-choice strong {
  display: block;
  font-size: 15px;
}
.room-choice small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.room-choice:disabled {
  opacity: 0.55;
}
.join-arrow {
  flex-shrink: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.rooms-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 16px 14px;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.leave-control {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 8px;
  min-height: 34px;
  font-size: 10px;
}
.room-bar {
  gap: 10px;
}
.room-bar .round-label {
  margin-left: auto;
}
.player.ready .avatar,
.player.holding .avatar {
  background: var(--red);
  color: #fff9eb;
  box-shadow: 0 2px 0 #98261c;
}
.player.ready,
.player.holding {
  border-color: #df6b5c;
  background: #fbe6dd;
}
.player.ready .player-status,
.player.holding .player-status {
  color: #b32e21;
  font-weight: 700;
}
.idle-warning {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  width: min(410px, calc(100% - 24px));
  background: #fff8dc;
  border: 2px solid #d69b39;
  border-radius: 12px;
  box-shadow: 0 5px 28px #24251f40;
  padding: 16px;
  z-index: 6;
}
.idle-warning strong {
  font-size: 17px;
}
.idle-warning p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.idle-warning .primary {
  margin: 0;
  min-width: 100px;
  width: auto;
  justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 360px) {
  .room-code b {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .round-label {
    letter-spacing: 0;
  }
  .round-label b {
    margin-left: 3px;
  }
  .idle-warning {
    padding: 12px;
    gap: 8px;
  }
}

.name-entry {
  display: flex;
  gap: 8px;
}
.name-entry input {
  flex: 1;
  min-width: 0;
}
#random-name {
  width: 50px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--red);
  font-size: 29px;
}
.name-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}
.hold-button.resetting {
  animation: reset-button 0.45s ease-out;
}
@keyframes reset-button {
  from {
    transform: translateY(6px) scale(0.92);
    filter: grayscale(1);
  }
  to {
    transform: translateY(0) scale(1);
    filter: grayscale(0);
  }
}
/* Name rolling has both visual and announced states; muted play remains complete. */
#name-entry[data-state="rolling"] input {
  border: 2px solid #b47c15;
  background: #fff2cb;
  color: #76500c;
}
#name-entry[data-state="rolling"] #random-name {
  background: #f5d783;
  color: #76500c;
}
#name-entry[data-state="rolling"] #random-name {
  animation: dice-tumble 0.18s linear infinite;
}
#name-entry[data-state="complete"] input {
  border: 2px solid var(--green);
  background: #edf7e9;
  color: #24563a;
}
#name-entry[data-state="complete"] + #name-status {
  color: #24563a;
  font-weight: 700;
}
#name-status {
  min-height: 15px;
}
@keyframes dice-tumble {
  25% {
    transform: rotate(8deg);
  }
  75% {
    transform: rotate(-8deg);
  }
}
.arena.revealing {
  overflow: visible;
  z-index: 3;
}
.arena.revealing .button-base {
  opacity: 0.12;
}
.arena.revealing .burst {
  display: none;
}
.round-reveal {
  position: absolute;
  z-index: 4;
  left: -4px;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff9e9;
  border: 2px solid #24251f;
  border-radius: 17px;
  box-shadow: 0 14px 38px #24251f45;
  padding: 18px;
  text-align: center;
  max-height: calc(100svh - 140px);
  overflow-y: auto;
}
.reveal-heading {
  font:
    700 10px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  margin: 0 0 13px;
  color: #666655;
}
.reveal-group {
  position: relative;
  padding: 12px 14px;
  border-radius: 10px;
}
.reveal-group.best,
.reveal-group.tied {
  background: #e4efdb;
  color: #214830;
}
.reveal-group.lowest {
  background: #f8e0d5;
  color: #85291e;
  margin-top: 10px;
}
.reveal-group h3 {
  font:
    800 12px ui-monospace,
    monospace;
  letter-spacing: 1px;
  margin: 0 0 5px;
}
.reveal-score {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reveal-score small {
  font:
    700 10px ui-monospace,
    monospace;
  letter-spacing: 0;
  margin-left: 6px;
}
.reveal-names {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 4px;
  font-size: 20px;
  line-height: 1.12;
  font-weight: 800;
}
.reveal-names li {
  overflow-wrap: anywhere;
  min-width: 0;
}
.reveal-names.many {
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  font-size: 14px;
}
.tie-note {
  font-size: 12px;
  color: #646655;
  margin: 12px 0;
}
.reveal-countdown {
  font:
    700 11px ui-monospace,
    monospace;
  margin: 14px 0 0;
  color: #646655;
}
.game.showing-results .score-panel,
.game.showing-results .instruction,
.game.showing-results .players-section {
  opacity: 0.25;
}
@media (max-height: 710px) {
  .round-reveal {
    padding: 12px;
  }
  .reveal-heading {
    margin-bottom: 9px;
  }
  .reveal-group {
    padding: 9px 12px;
  }
  .reveal-score {
    font-size: 37px;
  }
  .reveal-names {
    font-size: 17px;
  }
  .reveal-names.many {
    font-size: 12px;
  }
  .reveal-countdown {
    margin-top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #name-entry[data-state="rolling"] #random-name,
  .hold-button.resetting {
    animation: none;
  }
}
/* The standings are a main game panel, continuously ordered by total points. */
.game .players-section {
  padding: 13px 12px 10px;
  margin: auto -6px 0;
  border: 1px solid #bab6a7;
  border-radius: 13px;
  background: #e8e4d8;
  box-shadow: 0 4px 0 #d5d0c1;
}
.game .players-section .section-label {
  align-items: center;
  margin-bottom: 10px;
  font-size: 10px;
  color: #4c4e41;
  letter-spacing: 1px;
}
#players-title {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.game .players {
  grid-template-columns: 1fr;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.game .player {
  min-height: 45px;
  padding: 7px 10px;
  gap: 10px;
  background: #fffdf5;
  border-radius: 7px;
}
.game .avatar {
  width: 29px;
  height: 29px;
  font-size: 14px;
  border-radius: 7px;
}
.game .player-name {
  font-size: 14px;
}
.game .player-status {
  font-size: 9px;
  margin-top: 3px;
}
.game .player-score {
  font-size: 23px;
  letter-spacing: -1px;
}
.game .player.rank-first {
  border-color: #bd9229;
  background: #fff3c4;
}
.game .player.ready,
.game .player.holding {
  border-color: #de6b5c;
  background: #fbe6dd;
}
.game.roster-grid .players {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.game.roster-grid .player {
  min-height: 54px;
  gap: 6px;
  padding: 7px;
}
.game.roster-grid .avatar {
  width: 24px;
  height: 27px;
  font-size: 12px;
}
.game.roster-grid .player-name {
  font-size: 12px;
}
.game.roster-grid .player-score {
  font-size: 20px;
}
.game.roster-grid .player-status {
  font-size: 8px;
}
.game .room-bar {
  height: 42px;
}
.game .status-bar {
  min-height: 42px;
}
.game .score-panel {
  padding: 8px 0 3px;
}
.game .score {
  height: 54px;
}
.game .score > span {
  font-size: 54px;
}
.game .arena {
  height: 185px;
}
.game .button-base {
  width: 170px;
}
.game .instruction {
  min-height: 42px;
  padding-top: 9px;
}
.game .bottom-bar {
  min-height: 40px;
}
body:has(.game:not([hidden])) header {
  height: 52px;
}
body:has(.game:not([hidden])) .app-footer {
  min-height: 30px;
}
/* Winners get a gold trophy and falling confetti; losers get a broken-heart stamp. */
.reveal-group.best {
  background: linear-gradient(135deg, #fff6b0, #ffd45b);
  color: #513406;
  border: 2px solid #c99312;
  border-radius: 18px 18px 7px 7px;
  box-shadow: 0 4px 0 #c9952566;
}
.reveal-group.lowest {
  color: #ffe6e0;
  background: #422739;
  border: 2px solid #a94658;
  border-left: 7px solid #ed6b6b;
  border-radius: 4px 17px 4px 17px;
}
.reveal-group.lowest::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(
    135deg,
    #ed6b6b 0 6px,
    transparent 6px 12px
  );
  border-radius: inherit;
}
.reveal-group.tied {
  background: #e5ddff;
  color: #4b3570;
  border: 2px solid #a48dc7;
}
.result-emblem {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 39px;
  height: 39px;
  padding: 4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 2;
}
.best .result-emblem {
  background: #fff8d4;
  border-radius: 50%;
  color: #8b5a02;
  animation: trophy-cheer 0.8s ease-in-out 3;
}
.lowest .result-emblem {
  color: #ff929d;
  animation: heart-wobble 0.55s ease-out;
}
.reveal-group h3 {
  margin-left: 36px;
  margin-right: 15px;
}
.reveal-group h3,
.reveal-score,
.reveal-names {
  position: relative;
  z-index: 1;
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  width: 5px;
  height: 10px;
  left: calc(var(--i) * 8.1% + 3%);
  top: -12px;
  background: #d44651;
  animation: confetti-drop 2.6s ease-out both;
  animation-delay: calc(var(--i) * 0.045s);
}
.confetti i:nth-child(3n) {
  background: #399d95;
  border-radius: 50%;
}
.confetti i:nth-child(3n + 1) {
  background: #8261c7;
}
@keyframes trophy-cheer {
  50% {
    transform: translateY(-3px) rotate(-9deg) scale(1.07);
  }
}
@keyframes heart-wobble {
  25% {
    transform: rotate(-12deg);
  }
  65% {
    transform: rotate(8deg);
  }
}
@keyframes confetti-drop {
  10% {
    opacity: 1;
  }
  to {
    transform: translateY(200px) rotate(270deg);
    opacity: 0;
  }
}
@media (max-height: 710px) {
  body:has(.game:not([hidden])) header {
    height: 42px;
  }
  .game .room-bar {
    height: 35px;
  }
  .game .status-bar {
    min-height: 35px;
  }
  .game .score-panel {
    padding: 4px 0 1px;
  }
  .game .score {
    height: 43px;
  }
  .game .score > span {
    font-size: 43px;
  }
  .game .arena {
    height: 145px;
  }
  .game .button-base {
    width: 136px;
  }
  .game .instruction {
    min-height: 37px;
    padding-top: 7px;
  }
  .game .players-section {
    padding: 9px 9px 8px;
  }
  .game .players-section .section-label {
    margin-bottom: 7px;
  }
  #players-title {
    font-size: 16px;
  }
  .game .player {
    min-height: 38px;
    padding: 4px 8px;
  }
  .game .avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .game .player-name {
    font-size: 13px;
  }
  .game .player-status {
    font-size: 8px;
    margin-top: 2px;
  }
  .game .player-score {
    font-size: 21px;
  }
  .game .bottom-bar {
    min-height: 34px;
  }
  .game.roster-grid .player {
    min-height: 45px;
    padding: 5px;
  }
  .game.roster-grid .player-name {
    font-size: 11px;
  }
  .game.roster-grid .player-score {
    font-size: 18px;
  }
  .game.roster-grid .avatar {
    width: 22px;
    height: 25px;
  }
  .result-emblem {
    width: 33px;
    height: 33px;
    top: 7px;
    left: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .best .result-emblem,
  .lowest .result-emblem,
  .confetti i {
    animation: none;
  }
  .confetti i {
    top: 7px;
    opacity: 0.5;
  }
}

/* Replay is a large peer control beside FIN, available to every player. */
.game .arena.winner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.game .arena.winner .button-base {
  width: 140px;
  flex-shrink: 0;
}
.arena.winner .hazard-ring,
.arena.winner .machine-label {
  display: none;
}
.replay-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 160px;
  min-height: 112px;
  padding: 12px 8px;
  border: 2px solid #23553b;
  border-radius: 18px;
  background: #d8f3bd;
  color: #183f2b;
  box-shadow: 0 5px 0 #65965d;
  touch-action: manipulation;
}
.replay-control > span {
  font-size: 30px;
  line-height: 1;
}
.replay-control strong {
  font-size: 23px;
  letter-spacing: 0.5px;
}
.replay-control small {
  font-size: 10px;
}
.replay-control:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #65965d;
}
.replay-control.replay-ready {
  background: #24563c;
  color: #fffce9;
  opacity: 1;
}
.game .player.replay-ready {
  background: #e5f4d9;
  border-color: #397347;
}
.game .player.replay-ready .player-status {
  color: #24563c;
  font-weight: 800;
  white-space: normal;
  line-height: 1.2;
}
.game .bottom-bar > span {
  max-width: 100%;
}
@media (max-height: 710px) {
  .game .arena.winner {
    gap: 16px;
  }
  .game .arena.winner .button-base {
    width: 130px;
  }
  .replay-control {
    min-height: 100px;
    width: 154px;
  }
}
