/* Layout from the supplied /versions/v1/ reference. */
:root {
  --app-height: 100dvh;
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-right: env(safe-area-inset-right, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-left: env(safe-area-inset-left, 0px);
  --room-score-height: 20px;
  --control-radius: 18px;
  --control-font-size: 15px;
  --meta-font-size: 12px;
}
html, body, #app {
  min-width: 0;
  height: 100%;
  height: var(--app-height);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
* {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { touch-action: manipulation; }
dialog, dialog::backdrop { overscroll-behavior: none; }
html:has(dialog[open]), body:has(dialog[open]), #app:has(dialog[open]) { overflow: hidden; }
/* Keep the page canvas and the iOS status-bar safe area the same solid color. */
html, body, #app { background: #070d19; }
.arcade-shell {
  --shell-inline-padding: 12px;
  --shell-left-padding: max(var(--shell-inline-padding), var(--app-safe-left));
  --shell-right-padding: max(var(--shell-inline-padding), var(--app-safe-right));
  --arena-left-inset: var(--shell-left-padding);
  --arena-right-inset: var(--shell-right-padding);
  width: min(100%, 1024px);
  height: var(--app-height);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: max(8px, var(--app-safe-top)) var(--shell-right-padding) max(10px, var(--app-safe-bottom)) var(--shell-left-padding);
}
.site-header, .score-ribbon, .contenders, .spectator-panel { flex: none; }
.site-header { min-height: 58px; }
.brand-logo { width: clamp(88px, 12vw, 150px); }
.broadcast-summary { gap: 8px; }
.broadcast-live {
  gap: 0;
  border: 1px solid #657084;
  border-radius: 999px;
  overflow: hidden;
  background: #111827;
  box-shadow: none;
}
.live-label, .viewer-count {
  min-height: 30px;
  padding: 3px 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .015em;
  background: transparent;
}
.live-label { border-right: 1px solid #56607255; }
.live-label i { width: 11px; height: 11px; }
.viewer-count { border-radius: 0; }
.viewer-count .ui-icon { width: 19px; height: 19px; }
.round-progress { font-size: 14px; color: #f7f7fa; }
.round-progress .round-word, .round-progress .round-total, .round-progress .round-slash { color: #9ea8bd; }
.round-progress strong { font-weight: 800; }
.round-progress .round-slash { margin: 0 8px; }
.round-button { width: 43px; height: 43px; border: 1px solid #66758c; border-radius: 50%; background: #101827; }
.score-ribbon {
  position: relative;
  min-height: 37px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  overflow: hidden;
  background: linear-gradient(110deg,#079bea 0%,#0766d2 var(--blue-share,50%),#ed2850 var(--blue-share,50%),#f4385b 100%);
  box-shadow: none;
}
.score-ribbon strong { font-size: 23px; font-weight: 800; }
.contenders { position: relative; min-height: 42px; grid-template-columns: minmax(0,1fr) 42px minmax(0,1fr); gap: 7px; }
.contender {
  height: 40px;
  padding: 2px 9px;
  border: 2px solid #536075;
  border-radius: 13px;
  background: linear-gradient(#283345,#121b2c);
  gap: 8px;
}
.contender:last-child { justify-content: flex-start; }
.player-avatar { width: 32px; height: 32px; }
.player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.hearts .ui-icon { width: 15px; height: 15px; }
.player-timer { font-size: 13px; margin-left: auto; }
.contender:last-child .player-timer { margin-left: auto; }
.player-timer .ui-icon { display: none; }
.contenders .versus { visibility: hidden; }
.contenders::after {
  content: 'VS';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  font-size: 19px; font-weight: 900; font-style: italic;
}
.arena-frame {
  flex: 1 1 auto;
  height: min(55vw, 56dvh);
  max-height: min(55vw, 56dvh);
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #073253;
  box-shadow: none;
}
.game-viewport { background: #073253; }
.spectator-panel {
  --control-row-height: 54px;
  --control-row-gap: 12px;
  display: flex;
  flex-direction: column;
  width: min(100%, 900px);
  align-self: center;
  gap: 7px;
  min-height: 0;
}
.bet-row { order: 2; display: grid; grid-template-columns: minmax(0,1fr) 120px minmax(0,1fr); gap: 8px; height: 54px; }
.bet-button {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 4px;
  padding: 0 0 0 8px;
  border-width: 2px;
  border-radius: 17px;
  text-align: center;
  font-size: 21px;
  font-weight: 800;
  text-transform: none;
}
.bet-blue { background: linear-gradient(#079efb,#0756cd); border-color: #45baff; }
.bet-red { background: linear-gradient(#ff315c,#c41846); border-color: #ff6a88; }
.bet-button > span:first-child { line-height: 1; }
.bet-percent { display: none; }
.bet-people { position: relative; isolation: isolate; align-self: stretch; padding: 0 8px 0 11px; margin: 0; border: 0; background: transparent; font-size: 14px; font-weight: 500; }
.bet-people::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #06376eb8; clip-path: polygon(10px 0,100% 0,100% 100%,0 100%); }
.bet-red .bet-people::before { background: #7e1239b8; }
.bet-people .ui-icon { width: 18px; height: 18px; }
.influence-trigger { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; width: 100%; height: 100%; overflow: hidden; padding: 0; border: 1px solid #687587; border-radius: 12px; background: linear-gradient(#35404f,#222b38); color: #e7ebf1; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.spend-label { align-self: center; padding: 0 3px; white-space: nowrap; }
.spend-balance { display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 0 6px; border-left: 1px solid #687587; background: #1c2736; white-space: nowrap; }
.spend-balance strong { font-size: 12px; font-weight: 800; }
.spend-coin { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid #ffe68c; border-radius: 50%; background: linear-gradient(#ffda50,#d89d0c); box-shadow: inset 0 -2px #a7770a; color: #fff4a4; font-size: 12px; line-height: 1; }
.influence-open .influence-trigger { background: linear-gradient(#202833,#141b24); border-color: #454f5e; color: #adb7c5; }
.influence-open .influence-trigger .spend-balance { background: #101720; border-left-color: #454f5e; }
.profile-wallet { flex: none; width: 28px; height: 22px; margin-left: 2px; border: 1px solid #ffe78c; border-radius: 999px; background: linear-gradient(#ffe875,#dba80b); box-shadow: inset 0 -2px #b88108; color: #fff; }
.profile-wallet strong { font-size: 13px; font-weight: 800; }
.identity-row {
  position: relative;
  isolation: isolate;
  order: 1;
  justify-content: flex-start;
  height: 38px;
  padding: 2px 8px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  font-size: 16px;
}
.identity-row::before { display: none; }
.mini-avatar { width: 29px; height: 29px; }
.identity-row:has(.identity-fallback) .identity-status,
.identity-row:has(.identity-fallback) .identity-retry { display: none; }
.identity-fallback { display: flex; align-items: center; gap: 5px; min-width: 0; }
.identity-fallback img { width: 29px; height: 29px; object-fit: contain; }
.hello-label, .guest-name { font-size: 16px; white-space: nowrap; }
.hello-label { color: #ccd4e2; font-weight: 400; }
.guest-name { font-weight: 800; }
.edit-name { display: flex; align-items: flex-end; justify-content: center; flex: none; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: #dce5f2; }
.edit-name svg { width: 18px; height: 18px; }
.power-grid { order: 3; display: none; grid-template-columns: repeat(6,minmax(0,1fr)); grid-template-rows: repeat(2,42px); gap: 7px; height: 91px; }
.influence-open .power-grid { display: grid; }
.power-grid > .power-card:first-of-type { display: none; }
.power-grid > .power-card { grid-column: span 2; }
.power-grid > .power-card:nth-of-type(n+5) { grid-column: span 3; }
.power-card, .power-more { min-width: 0; border: 2px solid #59677c; border-radius: 16px; background: linear-gradient(#253144,#141c2a); }
.reaction-bar { display: flex; align-items: center; justify-content: space-evenly; flex: none; width: 136px; height: 100%; margin-left: auto; padding: 0; }
.reaction-bar button { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; font-size: clamp(19px,3vw,28px); line-height: 1; text-transform: none; }
.reaction-bar button.selected { filter: drop-shadow(0 0 6px #fff9); transform: scale(1.13); }
.power-card { position: relative; flex-direction: row; justify-content: center; gap: 5px; padding: 2px 4px 17px; }
.power-card strong { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.power-icon { width: 22px; height: 22px; }
.power-price { position: absolute; right: 4px; bottom: 3px; font-size: 12px; color: white; }
.price-disc { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid #f7d858; border-radius: 50%; background: #28281c; box-shadow: none; color: #ffe066; font-size: 12px; font-weight: 800; }
.influence-trigger .spend-value { width: 24px; height: 24px; font-size: 16px; }
.power-more { font-size: 19px; letter-spacing: 1px; }
.play-row { order: 5; display: block; height: 54px; }
.play-button, .friends-button { width: 100%; height: 100%; border-radius: 17px; letter-spacing: 0; text-transform: none; }
.play-button {
  overflow: hidden;
  gap: 10px;
  background: linear-gradient(#416b50,#2d4f3c);
  border: 1px solid #779783;
  box-shadow: none;
  color: #e3eee5;
  font-size: 23px;
  font-weight: 800;
}
.play-button > .ui-icon { width: 29px; height: 29px; }
.queue-count {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  gap: 5px;
  padding: 0 7px 0 11px;
  border-left: 0;
  background: transparent;
  color: #f4fff6;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.queue-count::before, .join-queue-meta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #254533b8; clip-path: polygon(11px 0,100% 0,100% 100%,0 100%); }
.queue-stat { display: inline-flex; align-items: center; gap: 2px; }
.queue-stat svg { width: 15px; height: 15px; flex: none; }
.queue-stat b { font-size: 12px; font-weight: 700; }
.friends-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 5px;
  border: 2px solid #647086;
  background: linear-gradient(#263246,#151d2d);
  font-size: 15px;
  font-weight: 500;
}
.friends-icon { font-size: 23px; line-height: 1; }
.bet-button, .play-button, .friends-button {
  border-style: solid;
  border-radius: 12px;
  box-shadow: none;
}
.queue-waiting { order: 6; align-self: flex-start; margin-left: 12%; font-size: 13px; color: #bfc8d8; }
.local-toast { position: fixed; left: 50%; bottom: 20px; z-index: 20; transform: translateX(-50%) translateY(12px); padding: 9px 14px; border: 1px solid #71809a; border-radius: 12px; background: #202a3b; opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap; font-size: 12px; }
.local-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  :root { --control-font-size: 12px; }
  .arcade-shell { justify-content: space-evenly; gap: 4px; padding: max(6px, var(--app-safe-top)) 7px max(8px, var(--app-safe-bottom)); }
  .site-header { min-height: 48px; gap: 5px; }
  .brand-logo { width: clamp(78px,20vw,110px); }
  .broadcast-live { border-width: 1px; }
  .live-label, .viewer-count { min-height: 24px; padding: 2px 6px; font-size: 11px; }
  .live-label i { width: 8px; height: 8px; }
  .viewer-count .ui-icon { width: 14px; height: 14px; }
  .round-progress { font-size: 11px; }
  .round-progress .round-slash { margin: 0 4px; }
  .broadcast-tools { gap: 4px; }
  .round-button { width: 31px; height: 31px; border-radius: 50%; padding: 4px; }
  .round-button .ui-icon { width: 18px; height: 18px; }
  .score-ribbon { min-height: 30px; padding: 0 13px; border-radius: 13px; }
  .score-ribbon strong { font-size: 20px; }
  .contenders { min-height: 34px; grid-template-columns: minmax(0,1fr) 27px minmax(0,1fr); gap: 4px; }
  .contender { height: 34px; gap: 3px; padding: 1px 5px; border-width: 1px; border-radius: 9px; }
  .player-avatar { width: 23px; height: 23px; }
  .player-name { font-size: clamp(9px,2.8vw,12px); }
  .player-name { margin-right: 2px; }
  .hearts .ui-icon { width: clamp(9px,2.8vw,12px); height: clamp(9px,2.8vw,12px); }
  .player-timer { gap: 1px; font-size: clamp(8px,2.3vw,10px); }
  .player-timer .ui-icon { width: 10px; height: 10px; }
  .contenders::after { font-size: 15px; }
  .arena-frame { flex: 0 1 auto; height: min(55vw, 39dvh); max-height: none; }
  .spectator-panel { gap: 5px; }
  .wins-divider { height: 20px; }
  .wins-divider b { font-size: 12px; }
  .wins-divider strong { font-size: 15px; }
  .bet-row { height: 50px; gap: 6px; }
  .bet-button { font-size: clamp(13px,4.2vw,19px); border-radius: 13px; }
  .bet-people { font-size: 12px; }
  .bet-people .ui-icon { width: 14px; height: 14px; }
  .identity-row { height: 34px; font-size: 13px; }
  .mini-avatar { width: 24px; height: 24px; }
  .power-grid { height: 57px; gap: 4px; }
  .reaction-bar, .power-card, .power-more { border-width: 1px; border-radius: 12px; }
  .power-card strong { font-size: clamp(8px,2.4vw,11px); }
  .power-icon { width: 18px; height: 18px; }
  .power-price { font-size: 10px; }
  .play-row { height: 50px; gap: 6px; }
  .play-button { font-size: clamp(16px,5vw,22px); }
  .play-button > .ui-icon { width: 25px; height: 25px; }
  .friends-button { gap: 4px; font-size: clamp(10px,2.9vw,13px); }
  .friends-icon { font-size: 18px; }
  .queue-waiting { font-size: 11px; }
}
@media (max-width: 359px) {
  .brand-logo { width: 68px; }
  .round-progress { font-size: 10px; }
  .broadcast-tools { gap: 2px; }
  .contender { gap: 3px; }
  .hearts .ui-icon { width: 9px; height: 9px; }
  .bet-row { grid-template-columns: minmax(0,1fr) 60px minmax(0,1fr); }
  .bet-button { font-size: 10px; padding: 0 4px; }
  .bet-people { font-size: 9px; }
  .bet-people .ui-icon { width: 10px; height: 10px; }
  .influence-trigger { font-size: 8px; }
}
@media (max-height: 650px) {
  .arcade-shell { justify-content: flex-start; }
  .arena-frame { flex: 1 1 auto; min-height: 80px; }
}

/* The browser chrome and iPhone safe areas stay outside the page rows. */
@media (max-width: 600px) and (orientation: portrait) {
  .arcade-shell {
    --shell-inline-padding: 7px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 42px 31px minmax(0, 1fr) auto;
    align-content: stretch;
    justify-content: normal;
    gap: 12px;
    padding: max(6px, var(--app-safe-top)) var(--shell-right-padding) max(8px, var(--app-safe-bottom)) var(--shell-left-padding);
  }
  .site-header, .score-ribbon, .contenders, .arena-frame, .spectator-panel {
    min-width: 0;
    min-height: 0;
    margin: 0;
  }
  .site-header { height: 42px; }
  .brand-logo { width: clamp(68px, 21vw, 92px); }
  .broadcast-summary { gap: 7px; }
  .broadcast-live { min-height: 22px; }
  .live-label, .viewer-count { min-height: 21px; font-size: 11px; }
  .round-progress { font-size: 10px; }
  .round-button { width: 30px; height: 30px; }
  .score-ribbon { height: 24px; border-radius: 999px; }
  .score-ribbon strong { font-size: 18px; }
  .contenders { height: 31px; }
  .contender { height: 31px; }
  .player-avatar { width: 22px; height: 22px; }
  .player-name { font-size: clamp(9px, 2.9vw, 12px); }
  .player-timer { font-size: clamp(8px, 2.3vw, 10px); }
  .arena-frame {
    height: 100%;
    width: 100%;
    max-width: 100%;
    max-height: none;
    aspect-ratio: auto;
    justify-self: stretch;
    align-self: stretch;
    margin: 0;
    flex: none;
  }
  .spectator-panel { --control-row-height: 44px; width: 100%; gap: 12px; }
  .bet-row { height: 44px; grid-template-columns: minmax(0,1fr) 110px minmax(0,1fr); gap: 5px; }
  .bet-button { gap: 2px; padding: 0 0 0 6px; border-radius: 12px; font-size: clamp(11px, 3.3vw, 14px); }
  .bet-people { font-size: clamp(9px, 2.5vw, 11px); line-height: 1; }
  .bet-people { padding: 0 6px 0 9px; }
  .bet-people .ui-icon { width: 13px; height: 13px; }
  .influence-trigger { font-size: 10px; }
  .identity-row { height: 27px; min-height: 27px; padding: 1px 6px; font-size: 12px; }
  .identity-row { gap: 5px; }
  .hello-label, .guest-name { font-size: 13px; }
  .mini-avatar, .identity-fallback img { width: 22px; height: 22px; }
  .identity-fallback { gap: 4px; }
  .identity-fallback .hello-label { margin-left: 2px; }
  .edit-name { width: 21px; height: 21px; }
  .edit-name svg { width: 16px; height: 16px; }
  .profile-wallet { width: 25px; height: 19px; margin-left: 0; }
  .profile-wallet strong { font-size: 11px; }
  .reaction-bar { width: 115px; }
  .reaction-bar button { font-size: clamp(16px, 4.6vw, 19px); }
  .power-grid { grid-template-rows: repeat(2,38px); height: 80px; gap: 4px; }
  .power-card, .power-more { border-radius: 10px; }
  .power-card { gap: 3px; padding: 0 2px 11px; }
  .power-icon { width: 14px; height: 14px; }
  .power-card strong { font-size: clamp(7px, 2.1vw, 9px); }
  .power-price { font-size: 9px; }
  .price-disc { width: 20px; height: 20px; font-size: 10px; }
  .power-more { font-size: 15px; }
  .play-row { height: 44px; margin-top: 0; }
  .play-button, .friends-button { border-radius: 12px; }
  .play-button { display: grid; grid-template-columns: 22px minmax(0,1fr) 118px; gap: 5px; justify-content: space-between; padding: 0 0 0 10px; font-size: clamp(14px, 4vw, 17px); }
  .play-button > .ui-icon { width: 22px; height: 22px; }
  .queue-count { justify-content: center; gap: 7px; padding: 0 6px 0 10px; }
  .queue-stat { gap: 2px; }
  .queue-stat svg { width: 13px; height: 13px; }
  .queue-stat b { font-size: 11px; }
  .friends-button { font-size: clamp(9px, 2.65vw, 12px); }
  .friends-icon { font-size: 16px; }
  .queue-waiting { height: 9px; line-height: 9px; font-size: 9px; }
}

@media (max-width: 600px) and (max-height: 570px) and (orientation: portrait) {
  .arena-frame { width: 100%; }
}

@media (max-width: 359px) and (orientation: portrait) {
  .contender { padding-left: 3px; padding-right: 3px; }
  .player-name { margin-right: 0; }
  .identity-row { gap: 3px; }
  .reaction-bar { width: 92px; }
  .reaction-bar button { font-size: 15px; }
  .power-card { padding: 0 2px 11px; gap: 2px; }
  .power-card strong { font-size: 7px; }
  .price-disc { width: 18px; height: 18px; font-size: 9px; }
  .bet-row { grid-template-columns: minmax(0,1fr) 96px minmax(0,1fr); }
  .bet-button { font-size: 10px; padding: 0 0 0 4px; }
  .bet-people { font-size: 9px; }
  .bet-people { padding: 0 4px 0 7px; }
  .bet-people .ui-icon { width: 10px; height: 10px; }
  .influence-trigger { font-size: 8px; }
  .spend-balance { gap: 2px; padding: 0 4px; }
  .spend-coin { width: 15px; height: 15px; font-size: 10px; }
}

@media (max-width: 359px) and (max-height: 570px) and (orientation: portrait) {
  .arcade-shell { gap: 8px; }
  .spectator-panel { --control-row-gap: 8px; gap: 8px; }
  .play-row { margin-top: 0; }
}

/* Spend opens downwards into the Play row without resizing the arena. */
.spectator-panel { position: relative; }
/* Jump always occupies two control rows, including when bets are hidden. */
.spectator-controls { display: contents; }
.spectator-panel.has-control {
  height: calc(var(--control-row-height) * 2 + var(--control-row-gap));
  min-height: calc(var(--control-row-height) * 2 + var(--control-row-gap));
}
.has-control .spectator-controls { display: none; }
.has-control .spectator-controls > * { visibility: hidden; pointer-events: none; }
.spectator-identity { position: relative; order: 1; min-width: 0; }
.play-row { position: relative; }
.play-row .action-drawer { inset: 0; height: 100%; }
.play-row .action-drawer > .power-card:nth-of-type(n) { height: 100%; }

.bet-row { order: 3; }
.reaction-bar { order: 0; justify-content: flex-start; flex: 0 1 clamp(112px,35vw,138px); width: clamp(112px,35vw,138px); height: 34px; min-width: 0; margin: 0 0 0 auto; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.reaction-bar::-webkit-scrollbar { display: none; }
.reaction-bar button { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 22px; scroll-snap-align: start; }
.action-drawer { position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; display: none; align-items: stretch; gap: 6px; height: 44px; overflow-x: auto; overflow-y: hidden; padding: 0; background: #080d18f2; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.action-drawer::-webkit-scrollbar { display: none; }
.influence-open .action-drawer { display: flex; }
.action-drawer > .power-card, .action-drawer > .power-card:first-of-type, .action-drawer > .power-card:nth-of-type(n+5) { display: flex; flex: 0 0 148px; width: 148px; height: 44px; grid-column: auto; scroll-snap-align: start; }
.coin-actions .power-card { flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; padding: 0 0 0 8px; border: 1px solid #8a8c93; border-radius: 11px; background: linear-gradient(#25262b,#101115); }
.coin-actions .power-icon { flex: none; width: 20px; height: 20px; }
.coin-actions .power-card strong { flex: 1; max-width: none; min-height: 0; font-size: 11px; line-height: 1.08; font-weight: 600; white-space: normal; text-align: left; }
.coin-actions .power-price { position: static; display: inline-flex; align-items: center; justify-content: center; align-self: stretch; flex: none; gap: 3px; min-width: 38px; margin-left: auto; border-left: 1px solid #687587; font-size: 12px; line-height: 1; }
.action-coin { display: inline-grid; place-items: center; width: 12px; height: 12px; border: 1px solid #ffe88d; border-radius: 50%; background: #daa915; color: #fff5af; font-size: 8px; }
.coin-actions .power-card:not(.power-available) .action-coin { border-color: #d5d7df; background: #aeb2be; color: #f1f2f7; }
.actions-spend .action-drawer { align-items: center; }
.actions-spend .action-drawer > .power-card, .actions-spend .action-drawer > .power-card:first-of-type, .actions-spend .action-drawer > .power-card:nth-of-type(n+5) { flex-basis: 148px; width: 148px; height: 44px; }
.actions-spend .coin-actions .power-card { border-color: #667487; border-radius: 10px; background: linear-gradient(#35404f,#222b38); }
.actions-spend .coin-actions .power-price { background: #1c2736; }
.actions-spend .coin-actions .action-coin { border-color: #ffe68c; background: linear-gradient(#ffda50,#d89d0c); }
@media (max-width: 600px) and (orientation: portrait) {
  .identity-row { height: 36px; min-height: 36px; }
  .reaction-bar { height: 34px; }
  .reaction-bar button { height: 32px; font-size: 22px; }
  .action-drawer { height: 44px; }
}
@media (max-width: 359px) and (max-height: 570px) and (orientation: portrait) {
  .identity-row { height: 34px; min-height: 34px; }
  .reaction-bar { height: 32px; gap: 6px; }
  .reaction-bar button { height: 32px; font-size: 21px; }
  .action-drawer, .action-drawer > .power-card, .action-drawer > .power-card:first-of-type, .action-drawer > .power-card:nth-of-type(n+5) { height: 44px; }
}

/* Play replaces the bet row with two game choices without changing the page height. */
.play-mode-option { display: none; }
.play-options-open .bet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.play-options-open .bet-row > .bet-button,
.play-options-open .bet-row > .influence-trigger { display: none; }
.play-options-open .play-mode-option { grid-column: 1; grid-row: 1; }
.play-options-open .play-mode-option:last-child { grid-column: 2; }
.play-options-open .play-mode-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  isolation: isolate;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 0 0 8px;
  border: 1px solid #758198;
  border-radius: 11px;
  background: linear-gradient(#35404f, #222b38);
  color: #f0f3f8;
  box-shadow: none;
  text-align: left;
  text-transform: uppercase;
}
.play-mode-option .mode-title { flex: 1; font-size: clamp(11px, 3.3vw, 14px); font-weight: 800; text-align: center; white-space: nowrap; }
.play-mode-option .mode-meta { position: relative; isolation: isolate; display: flex; flex: none; flex-direction: column; align-items: flex-end; justify-content: center; align-self: stretch; gap: 1px; min-width: 76px; padding: 0 9px 0 12px; border-left: 0; color: #d8e0ea; font-size: 10px; line-height: 1.15; text-transform: none; white-space: nowrap; }
.play-mode-option .mode-meta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #233347; clip-path: polygon(11px 0, 100% 0, 100% 100%, 0 100%); }
.play-mode-option:last-of-type .mode-meta { min-height: 22px; }
.contender, .broadcast-live { border: 0; background: linear-gradient(#2c394d, #172235); }
.live-label { border-right: 0; }
.coin-actions .power-card,
.actions-spend .coin-actions .power-card { overflow: hidden; border-color: #8b939e; }
.coin-actions .power-price { border-left-color: #8b939e; background: #394452; }
.actions-spend .coin-actions .power-price { background: #4b596b; }
.bet-button.bet-selected { filter: brightness(1.16); box-shadow: 0 0 0 1px #ffffff80, 0 0 10px currentColor; }
.bet-button.bet-inactive { opacity: .42; filter: saturate(.35); }
.bet-button.bet-selected > span:first-child::after { content: '✓'; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; background: #ffffff36; color: #fff; font-size: 11px; line-height: 1; vertical-align: 1px; }
.play-button { position: relative; display: flex; justify-content: flex-end; gap: 0; padding: 0; font-weight: 800; text-transform: uppercase; }
.play-primary { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; gap: 10px; width: max-content; min-width: 0; transform: translate(-50%, -50%); }
.play-primary .ui-icon { flex: none; width: 24px; height: 24px; }
.play-button .queue-count { flex: 0 0 80px; gap: 0; padding: 0 7px 0 10px; }
.play-button .queue-stat { gap: 4px; }
.play-button .queue-stat svg { width: 16px; height: 16px; }
.play-button .queue-stat b { font-size: 14px; }
@media (max-width: 600px) and (orientation: portrait) {
  .play-button { font-size: clamp(11px, 3.3vw, 14px); }
}
@media (max-width: 359px) and (orientation: portrait) {
  .bet-button.bet-selected > span:first-child::after { width: 12px; height: 12px; margin-left: 2px; font-size: 9px; }
  .play-mode-option .mode-title { font-size: 11px; }
  .play-mode-option .mode-meta { font-size: 9px; }
  .play-mode-option .mode-meta { min-width: 67px; padding-right: 5px; }
}

/* Player timers, arena reactions, and player statistics. */
.contender .player-timer { display: inline-flex; min-width: 18px; margin-left: auto; margin-right: 6px; font-size: clamp(11px, 3.3vw, 14px); font-weight: 400; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.reaction-bar button:hover { filter: none; }
.reaction-bar button:active { filter: drop-shadow(0 0 5px #ffffffa0); transform: scale(1.12); }
.arena-frame .flying-reaction { position: absolute; right: 4px; bottom: 10px; z-index: 20; display: block; pointer-events: none; user-select: none; font-size: clamp(21px, 6vw, 27px); line-height: 1; filter: drop-shadow(0 2px 4px #0007); animation: reaction-fly 2.4s linear both; will-change: transform, opacity; }
.arena-frame .flying-reaction.bet-blue-flight,
.arena-frame .flying-reaction.bet-red-flight { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #e9f6ff; border-radius: 50%; color: #fff; font: 800 8px/1 Arial, sans-serif; letter-spacing: .02em; box-shadow: inset 0 0 0 2px #ffffff55, 0 2px 5px #0008; }
.arena-frame .flying-reaction.bet-blue-flight { background: #008de2; }
.arena-frame .flying-reaction.bet-red-flight { background: #e92750; }
@keyframes reaction-fly {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: .95; }
  48% { transform: translate3d(var(--flight-mid-drift), var(--flight-mid-height), 0) scale(1); opacity: .95; }
  70% { opacity: .38; }
  100% { transform: translate3d(var(--flight-end-drift), var(--flight-end-height), 0) scale(.25); opacity: 0; }
}
.arcade-shell { position: relative; }
@media (max-width: 359px) and (orientation: portrait) {
  .contender .player-timer { margin-right: 3px; }
}

.contender:first-child { justify-content: flex-end; }
.contender:first-child .player-timer { order: -4; margin-left: 0; margin-right: auto; }
.contender:first-child .hearts { order: -3; }
.contender:first-child .player-name { order: -2; }
.contender:first-child .player-avatar { order: -1; }
.contender:last-child { justify-content: flex-start; }
.contender:last-child .player-timer { margin-left: auto; }
.reaction-bar { flex: 1 1 50%; width: 50%; max-width: 50%; min-width: 32px; gap: 6px; scroll-snap-type: x mandatory; }
.reaction-bar button { flex: 0 0 32px; -webkit-tap-highlight-color: transparent; }
/* Right-align short lists without hiding the start of overflowing carousels. */
.reaction-bar button:first-child { margin-left: auto; }
.reaction-bar button.selected { filter: none; transform: none; }
.reaction-bar button:focus:not(:focus-visible) { outline: none; }
/* An open menu moves the green action state from its trigger to its choices. */
.play-options-open .play-button { background: linear-gradient(#35404f,#222b38); border-color: #687587; color: #d4dce6; box-shadow: none; }
.play-options-open .play-button .queue-count::before { background: #182332; }
.coin-actions .power-card.power-available,
.play-options-open .play-mode-option { background: linear-gradient(#416b50,#2d4f3c); border-color: #83b895; color: #e3eee5; }
.coin-actions .power-card.power-available .power-price { background: #254533b8; border-left-color: #779783; }
.play-mode-option .mode-meta::before { background: #254533b8; }
.play-mode-option .mode-meta { color: #e3eee5; }
.coin-actions .power-card:disabled,
.play-options-open .play-mode-option:disabled { background: linear-gradient(#303740,#20262e); border-color: #596574; color: #adb5c1; opacity: .62; cursor: not-allowed; filter: none; }
.coin-actions .power-card:disabled .power-price { background: #28313d; border-left-color: #596574; }
.play-options-open .play-mode-option:disabled .mode-meta::before { background: #1c2633; }
.play-options-open .play-mode-option.is-queued { border-color: #9cc3f1; background: #415d80; box-shadow: inset 0 0 0 1px #a4c4eb80, 0 0 10px #7da9dc55; }
.play-options-open .play-mode-option.is-queued .mode-meta::before { background: #2d527e; }
.play-mode-option.is-queued .mode-title { font-size: clamp(10px, 3vw, 12px); line-height: 1; }
.play-button.is-in-queue, .play-options-open .play-button.is-in-queue { background: linear-gradient(#416b50,#2d4f3c); border-color: #779783; color: #e3eee5; box-shadow: none; }
.play-button.is-in-queue .play-primary { left: 50%; }
.play-button.is-in-queue .queue-count { flex: 0 0 clamp(114px, 34vw, 136px); padding: 0 7px 0 14px; }
.play-button.is-in-queue .queue-count::before { background: #254533b8; }
.queue-details { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-width: 0; }
.queue-details > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.queue-details svg { flex: none; width: 13px; height: 13px; }
.queue-details b { font-size: 11px; font-weight: 700; line-height: 1; }
@media (max-width: 359px) { .queue-details svg { width: 11px; height: 11px; } .queue-details b { font-size: 10px; } }
.play-mode-option.is-queued .mode-title::before { content: '✓'; display: inline-grid; place-items: center; width: 12px; height: 12px; margin-right: 3px; border-radius: 50%; background: #d5e9ff33; font-size: 10px; vertical-align: 1px; }
.bet-button { position: relative; }
.bet-button > span:first-child { position: relative; }
.bet-button.bet-selected > span:first-child::after { position: absolute; top: 50%; left: 100%; margin: 0; transform: translateY(-50%); }
.play-button { border-width: 2px; }
.influence-trigger { font-size: 21px; }
@media (max-width: 600px) { .influence-trigger { font-size: clamp(11px, 3.3vw, 14px); } }
@media (max-width: 359px) { .influence-trigger { font-size: 10px; } }

@media (max-width: 359px) and (orientation: portrait) {
  .reaction-bar { gap: 4px; }
  .reaction-bar button { flex-basis: 27px; width: 27px; }
}

@media (min-width: 601px) {
  html, body, #app { height: auto; min-height: var(--app-height); overflow-x: hidden; overflow-y: auto; touch-action: auto; }
  .arcade-shell { --shell-inline-padding: 20px; --arena-left-inset: 0px; --arena-right-inset: 0px; width: min(100%, 1024px); height: var(--app-height); min-height: 0; margin-inline: auto; padding: max(6px, var(--app-safe-top)) var(--shell-right-padding) max(8px, var(--app-safe-bottom)) var(--shell-left-padding); justify-content: flex-start; gap: 12px; }
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; }
  .site-header .wordmark { justify-self: start; }
  .brand-logo { width: 110px; }
  .broadcast-summary { justify-self: center; }
  .broadcast-tools { justify-self: end; }
  .score-ribbon, .contenders { width: 100%; }
  .arena-frame { flex: 1 1 0; align-self: center; width: 100%; height: auto; max-height: none; }
  .spectator-panel { align-self: center; width: 100%; gap: 12px; }
  .bet-row { gap: 14px; }
  .bet-button, .influence-trigger, .play-button, .play-mode-option .mode-title { font-size: 16px; }
  .action-drawer { height: 54px; gap: 8px; overflow-x: auto; }
  .action-drawer > .power-card,
  .action-drawer > .power-card:first-of-type,
  .action-drawer > .power-card:nth-of-type(n+5),
  .actions-spend .action-drawer > .power-card,
  .actions-spend .action-drawer > .power-card:first-of-type,
  .actions-spend .action-drawer > .power-card:nth-of-type(n+5) {
    flex: 0 0 148px;
    width: 148px;
    height: 54px;
  }
}


/* Compact version-one header: round progress and viewers in one row. */
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 42px;
  height: 42px;
}
.site-header .wordmark { justify-self: start; }
.broadcast-summary { display: block; justify-self: center; min-width: 0; }
.broadcast-tools { justify-self: end; }
.broadcast-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  min-height: 0;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.broadcast-live .live-label, .broadcast-live .viewer-count {
  flex: none;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 18px;
}
.broadcast-live .live-label i { width: 8px; height: 8px; }
.broadcast-live .viewer-count { font-size: 14px; }
.broadcast-live .viewer-count .ui-icon { width: 15px; height: 15px; }
.broadcast-live .round-progress {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex: none;
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: #263348;
  color: #aeb7c5;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.broadcast-live .round-progress strong { color: #fff; font-size: 15px; font-weight: 800; }
.broadcast-live .round-progress .round-total { color: #fff; font-size: 12px; }
.broadcast-live .round-progress .round-slash { margin: 0 3px; color: #9da7b5; }
.contender:first-child .player-timer { margin-left: 7px; margin-right: auto; transform: translateX(1px); }
.contender:last-child .player-timer { margin-left: auto; margin-right: 6px; }

@media (max-width: 600px) and (orientation: portrait) {
  .site-header { grid-template-rows: 42px; }
  .site-header .wordmark { grid-column: 1; grid-row: 1; }
  .broadcast-summary { grid-column: 2; grid-row: 1; }
  .broadcast-tools { grid-column: 3; grid-row: 1; }
  .brand-logo { width: clamp(68px, 19vw, 78px); }
  .contender:first-child .player-timer { margin-left: 2px; }
  .contender:last-child .player-timer { margin-right: 2px; }
  .broadcast-live .live-label { font-size: 10px; }
  .broadcast-live .viewer-count { font-size: 12px; }
  .broadcast-live .round-progress { font-size: 9px; }
  .broadcast-live .round-progress strong { font-size: 12px; }
  .broadcast-live .round-progress .round-total { font-size: 10px; }
  .broadcast-live .viewer-count .ui-icon { width: 13px; height: 13px; }
  .broadcast-live .live-label i { width: 7px; height: 7px; }
}
@media (max-width: 359px) and (orientation: portrait) {
  .brand-logo { width: 60px; }
  .broadcast-tools { gap: 2px; }
  .site-header .round-button { width: 27px; height: 27px; min-width: 27px; }
  .broadcast-live { gap: 2px; }
  .broadcast-live .round-progress { padding-inline: 4px; font-size: 8px; }
  .broadcast-live .round-progress strong { font-size: 11px; }
  .broadcast-live .round-progress .round-total { font-size: 9px; }
  .broadcast-live .live-label { font-size: 9px; }
  .broadcast-live .viewer-count { font-size: 10px; }
}

/* Keep the live Phaser surface, loading feedback, and desktop page flow. */
body { position: static; inset: auto; }
/* Give iOS Home Screen apps a solid fixed surface for status-bar sampling.
   This also prevents root scrolling from activating the system edge effect. */
html.is-standalone, html.is-standalone body { height: var(--app-height); min-height: 0; overflow: hidden; }
html.is-standalone #app { position: fixed; inset: 0; height: var(--app-height); min-height: 0; overflow: hidden; }
html.is-standalone #app > .arcade-shell { height: 100%; min-height: 0; }
.game-viewport { background-image: none; }
.godot-host { z-index: 0; }
.game-overlay { z-index: 1; }
.local-toast { z-index: 60; max-width: calc(100% - 24px); white-space: normal; text-align: center; }
.identity-row { min-width: 0; padding-right: 0; }
.guest-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (max-height: 540px) and (orientation: landscape) {
  html, body, #app { height: var(--app-height); min-height: 0; overflow: hidden; }
  .arcade-shell {
    --shell-inline-padding: 8px;
    --arena-right-inset: 0px;
    display: grid; width: min(100%, 1024px); height: var(--app-height); min-height: 0;
    grid-template-columns: minmax(0, 1fr) clamp(180px, 30vw, 260px);
    grid-template-rows: 42px 34px minmax(0, 1fr);
    padding: max(5px, var(--app-safe-top)) var(--shell-right-padding) max(5px, var(--app-safe-bottom)) var(--shell-left-padding);
    /* The map-to-Jump spacing matches the names-to-map spacing. */
    gap: 5px;
  }
  .site-header, .score-ribbon, .contenders, .live-arena { grid-column: 1; }
  .site-header { min-width: 0; gap: 4px; }
  .brand-logo { width: 70px; }
  .broadcast-tools { gap: 3px; }
  .round-button { width: 28px; height: 28px; padding: 4px; }
  .round-button .ui-icon { width: 17px; height: 17px; }
  .score-ribbon { min-height: 24px; }
  .contenders { min-height: 34px; }
  .contender { height: 34px; gap: 4px; padding-inline: 4px; }
  .player-avatar { width: 23px; height: 23px; }
  .player-name { font-size: 11px; }
  .hearts .ui-icon { width: 10px; height: 10px; }
  .arena-frame { width: 100%; height: 100%; min-height: 0; max-height: none; align-self: stretch; }
  .spectator-panel { --control-row-height: 44px; grid-column: 2; grid-row: 1 / -1; width: 100%; gap: 12px; }
  .identity-row { flex-wrap: nowrap; height: 34px; min-height: 34px; gap: 4px; padding: 0; }
  .hello-label, .guest-name { font-size: 12px; }
  .mini-avatar { width: 24px; height: 24px; }
  .reaction-bar { flex-basis: 50%; width: 50%; margin-top: 0; }
  .bet-row { height: 44px; grid-template-columns: minmax(0,1fr) 68px minmax(0,1fr); gap: 4px; }
  .bet-button { justify-content: center; padding: 0; font-size: 10px; }
  .bet-people { display: none; }
  .influence-trigger { font-size: 10px; }
  .spend-balance { padding-inline: 3px; }
  .spend-coin { width: 13px; height: 13px; font-size: 9px; }
  .play-row, .action-drawer { height: 44px; }
  .play-button { font-size: 14px; }
  .play-button .queue-count { flex-basis: 48px; padding-inline: 5px; }
  .play-primary { left: 43%; gap: 5px; }
  .play-primary .ui-icon { width: 20px; height: 20px; }
  .action-drawer { overflow-x: auto; }
  .action-drawer > .power-card { flex: 0 0 148px; width: 148px; height: 44px; }
  .play-mode-option .mode-title { font-size: 10px; }
  .play-mode-option .mode-meta { min-width: 0; padding-inline: 6px; font-size: 8px; }
  .play-mode-option:last-child { flex-direction: column; justify-content: center; gap: 1px; padding: 2px 4px; }
  .play-mode-option:last-child .mode-title { flex: none; line-height: 1; }
  .play-mode-option:last-child .mode-meta { align-self: auto; align-items: center; min-height: 0; padding: 0; }
  .play-mode-option:last-child .mode-meta::before { display: none; }
}

.room-dialog {
  --dialog-top: max(16px, var(--app-safe-top));
  --dialog-right: max(14px, var(--app-safe-right));
  --dialog-bottom: max(16px, var(--app-safe-bottom));
  --dialog-left: max(14px, var(--app-safe-left));
  --dialog-height: calc(var(--app-height) - var(--dialog-top) - var(--dialog-bottom));
  position: fixed;
  inset: var(--dialog-top) var(--dialog-right) var(--dialog-bottom) var(--dialog-left);
  margin: auto;
  box-sizing: border-box;
  width: min(460px, calc(100vw - var(--dialog-left) - var(--dialog-right)));
  max-width: calc(100vw - var(--dialog-left) - var(--dialog-right));
  max-height: var(--dialog-height);
  padding: 0; border: 1px solid #40516c; border-radius: 20px;
  color: #eef4ff; background: #142033; box-shadow: 0 24px 100px #0009; overflow: hidden; overscroll-behavior: none;
}
.room-dialog > form { display: flex; flex-direction: column; max-height: calc(var(--dialog-height) - 2px); margin: 0; }
.room-dialog.account-modal { width: min(540px, calc(100vw - 28px)); }
.account-modal .account-modal-heading { flex: none; margin: 0; padding: 20px 24px 16px; border-bottom: 1px solid #34465e; background: #142033; }
.account-modal .room-dialog-body { --skin-preview-scroll-inset: 24px; padding-bottom: 22px; }
.room-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: none; touch-action: pan-y; scroll-padding-block: 12px; padding: 24px 24px 12px; }
.room-dialog-body > :last-child { margin-bottom: 0; }
.room-dialog-footer { flex: none; padding: 16px 24px max(24px, var(--app-safe-bottom)); }
.room-dialog::backdrop { background: #050a16b8; backdrop-filter: blur(5px); }
.room-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.room-dialog h2 { font-size: 22px; margin: 0; }
.room-dialog-heading button { background: transparent; color: #b5c5d8; font-size: 30px; border: 0; cursor: pointer; }
.room-dialog-heading button:focus-visible { outline: none; color: #eef4ff; }
.room-dialog fieldset { border: 0; margin: 0 0 20px; padding: 0; }
.room-dialog legend, .room-id-label { display: block; font-size: 13px; color: #b5c5d8; margin-bottom: 10px; }
.room-mode-choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid #34455e; border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.room-mode-choice:has(input:checked) { border-color: #27b5ff; background: #1c3450; }
.room-mode-choice input { margin-top: 4px; accent-color: #27b5ff; }
.room-mode-choice strong, .room-mode-choice small { display: block; }
.room-mode-choice small { margin-top: 4px; color: #b5c5d8; font-size: 12px; line-height: 1.5; }
.room-id-field { display: flex; align-items: center; background: #0d1727; border: 1px solid #40516c; border-radius: 10px; padding: 10px 12px; }
.room-id-field span { flex: none; color: #9db0c9; }
.room-id-field input { user-select: text; -webkit-user-select: text; width: 100%; min-width: 0; border: 0; outline: 0; color: #fff; background: transparent; font: inherit; letter-spacing: 1px; }
.room-id-copy { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -6px -6px 6px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #b5c5d8; cursor: pointer; }
.room-id-copy .ui-icon { width: 20px; height: 20px; }
.room-id-copy:hover:not(:disabled) { background: #25364c; color: #eef4ff; filter: none; }
.room-id-copy:focus-visible { outline: 2px solid #8db6e4; outline-offset: 1px; }
.room-id-copy:disabled { opacity: .35; cursor: default; }
.room-id-field:focus-within { outline: 2px solid #27b5ff; }
.room-id-field.room-id-available { border-color: #78c894; box-shadow: 0 0 0 1px #78c89440; }
.room-id-field.room-id-available:focus-within { outline-color: #78c894; }
.room-id-field.room-id-invalid { border-color: #ff8f9e; }
.room-id-field.room-id-invalid:focus-within { outline-color: #ff8f9e; }
.room-id-help { color: #b5c5d8; font-size: 12px; margin-bottom: 0; }
.room-availability { color: #b5c5d8; font-size: 12px; }
.room-availability.room-id-status-error { color: #ff8f9e; }
.room-error { color: #ff8f9e; font-size: 13px; }
.create-room-button, .room-play-current button { border: 0; border-radius: 12px; padding: 13px 18px; background: #bdf34a; color: #142033; font: inherit; font-weight: 700; cursor: pointer; }
.create-room-button { width: 100%; border: 2px solid #779783; background: linear-gradient(#416b50,#2d4f3c); color: #e3eee5; box-shadow: none; }
.create-room-button:disabled { opacity: .5; cursor: wait; }
@media (max-height: 740px) {
  .account-modal .account-modal-heading { margin: 0; padding: 14px 20px 12px; }
  .account-modal .room-dialog-body { --skin-preview-scroll-inset: 18px; }
  .room-dialog-body { padding: 18px 20px 12px; }
  .room-dialog-footer { padding: 12px 20px max(20px, var(--app-safe-bottom)); }
  .room-dialog-heading { margin-bottom: 14px; }
  .room-dialog h2 { font-size: 20px; }
  .room-dialog fieldset { margin-bottom: 14px; }
  .room-dialog legend, .room-id-label { margin-bottom: 8px; }
  .room-mode-choice { gap: 10px; padding: 10px; margin-bottom: 6px; }
  .room-mode-choice small { margin-top: 3px; line-height: 1.4; }
}
.room-play-current { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; color: #b5c5d8; }
/* Player rows inside the arena people dropdown. */
.roster-list { display: grid; gap: 6px; max-height: min(220px, 35dvh); padding: 0 10px 8px; overflow-y: auto; overscroll-behavior: contain; }
.roster-player > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.roster-player { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.roster-player .roster-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer; }
.roster-name:hover { color: #c9f3b8; text-decoration: underline; text-underline-offset: 2px; }
.roster-name:focus-visible { outline: 2px solid #a8da72; outline-offset: 2px; border-radius: 2px; }
.roster-player .mascot-avatar { width: 30px; height: 30px; }
.game-complete .winner-mascot { width: 100px; height: 100px; }

.game-complete .winner-name { max-width: calc(100% - 32px); overflow-wrap: anywhere; text-align: center; }

/* Reclaim the score and VS rows, including their gaps, in every page layout. */
@media (min-width: 601px) {
  .arcade-shell.is-multiplayer .arena-frame { height: calc(clamp(300px, calc(var(--app-height) - 430px), 540px) + 103px); }
}
@media (max-width: 600px) and (orientation: portrait) {
  .arcade-shell.is-multiplayer { grid-template-rows: 42px minmax(0, 1fr) auto; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .arcade-shell.is-multiplayer { grid-template-rows: 42px minmax(0, 1fr); }
  .arcade-shell.is-multiplayer .arena-frame { height: 100%; }
}

/* Pending predictions stay locked until coins-manager confirms the round. */
.bet-button:disabled { cursor: default; }
.bet-button:disabled:not(.bet-selected) { opacity: .55; }
.bet-button .bet-spinner { position: absolute; inset: 0; z-index: 1; margin: auto; pointer-events: none; width: 15px; height: 15px; border: 2px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: bet-spin .7s linear infinite; }
@keyframes bet-spin { to { transform: rotate(360deg); } }
@media (min-width: 601px) {
  .arcade-shell.is-multiplayer .arena-frame { height: calc(clamp(300px, calc(var(--app-height) - 430px), 540px) + 171px); }
}
@media (max-height: 540px) and (orientation: landscape) {
  .arcade-shell.is-multiplayer .arena-frame { height: 100%; }
}

/* Public queue size is delivered by the gateway, independently of the open room. */
.play-mode-option .public-queue { flex-direction: row; align-items: center; gap: 4px; min-width: 52px; font-size: 12px; }
.public-queue .ui-icon { width: 15px; height: 15px; }
.public-queue strong { font-variant-numeric: tabular-nums; }

/* Accepted forecasts count people once, including on narrow screens. */
.bet-button .bet-people { display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex-shrink: 0; min-width: 50px; padding: 0 8px 0 16px; font-size: 12px; }
.bet-button .bet-people .ui-icon { flex-shrink: 0; }
.bet-button .bet-people strong { font: inherit; font-weight: 700; }
@media (max-width: 600px) { .bet-button .bet-people { min-width: 40px; padding: 0 6px 0 14px; font-size: 10px; } .bet-button .bet-people .ui-icon { width: 12px; height: 12px; } }

.team-reward-rule { position: absolute; left: 42px; right: 42px; top: 50%; transform: translateY(-50%); text-align: center; font-size: clamp(8px,2.2vw,12px); line-height: 1.2; font-weight: 600; }
.team-reward-rule .spend-coin { width: 13px; height: 13px; font-size: 9px; vertical-align: middle; }


/* Give the identity row to the arena while Jump reserves two control rows. */
.arcade-shell.is-playing-duel .spectator-identity { display: none; }
@media (min-width: 601px) {
  .arcade-shell.is-playing-duel .arena-frame {
    /* Reclaim the score row and gap (49px), plus identity row and gap (50px). */
    height: calc(clamp(300px, calc(var(--app-height) - 430px), 540px) + 99px);
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .arcade-shell.is-playing-duel .arena-frame { height: 100%; }
}

/* Competition gives all space freed by solo play and hidden bets to the arena. */
@media (max-width: 600px) and (orientation: portrait) {
  .arcade-shell { --room-score-height: 18px; }
}
.arcade-shell.is-competition {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.arcade-shell.is-competition .arena-frame {
  flex: 1 1 0;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
}
@media (max-height: 540px) and (orientation: landscape) {
  .arcade-shell.is-competition {
    display: grid;
    grid-template-rows: 42px var(--room-score-height) 34px minmax(0, 1fr);
  }
  .arcade-shell.is-competition.competition-unlimited {
    grid-template-rows: 42px var(--room-score-height) minmax(0, 1fr);
  }
  .arcade-shell.is-competition.competition-solo {
    grid-template-rows: 42px minmax(0, 1fr);
  }
  .arcade-shell.is-competition .arena-frame { height: 100%; }
}

/* Mobile uses the page edges; desktop stays aligned with the other content. */
.arcade-shell > .arena-frame.live-arena {
  width: calc(100% + var(--arena-left-inset) + var(--arena-right-inset));
  max-width: calc(100% + var(--arena-left-inset) + var(--arena-right-inset));
  margin-inline: calc(-1 * var(--arena-left-inset)) calc(-1 * var(--arena-right-inset));
}

/* A room creator can advance the round from its number in the header. */
.broadcast-live .round-progress.has-skip { padding-block: 0; padding-right: 2px; min-height: 32px; align-items: center; }
.skip-level-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin-left: 3px;
  border: 0; border-radius: 50%; background: transparent; color: #fff;
  cursor: pointer; touch-action: manipulation;
}
.skip-level-button .ui-icon { width: 17px; height: 17px; }
.skip-level-button:hover:not(:disabled) { background: #3e536c; color: #fff; }
.skip-level-button:focus-visible { outline: 2px solid #aeb7c5; outline-offset: -2px; }
.skip-level-button:disabled { color: #8b9aae; opacity: .6; cursor: default; }
.skip-level-button[aria-busy="true"] .ui-icon { opacity: .45; }


/* Navigation uses the same round control as Share and Statistics. */
.site-header .wordmark.brand-navigation {
  display: flex; align-items: center; gap: 2px; height: 42px; min-height: 0;
  padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none;
  color: inherit; cursor: pointer; line-height: 1; text-decoration: none;
}
.brand-navigation .brand-back { flex: none; }
.brand-navigation:focus-visible { outline: 2px solid #a8d7ff; outline-offset: 2px; }

/* Drawers keep native focus trapping while their surfaces slide independently. */
.sliding-panel { transition: transform 240ms cubic-bezier(.22,.8,.25,1); will-change: transform; }
.sliding-panel[data-panel-side="bottom"] { transform: translate3d(0,var(--panel-drag,0px),0); }
.sliding-panel[data-panel-side="right"] { transform: translate3d(var(--panel-drag,0px),0,0); }
.sliding-panel[data-panel-side="bottom"].is-opening { animation: panel-enter-bottom 300ms cubic-bezier(.22,.8,.25,1); }
.sliding-panel[data-panel-side="right"].is-opening { animation: panel-enter-right 260ms cubic-bezier(.22,.8,.25,1); }
.sliding-panel.is-dragging { animation: none; transition: none; user-select: none; }
.sliding-panel[data-panel-side="bottom"].is-closing { animation: none; transform: translate3d(0,100%,0); }
.sliding-panel[data-panel-side="right"].is-closing { animation: none; transform: translate3d(100%,0,0); }
.sliding-panel::backdrop { transition: background 240ms, backdrop-filter 240ms; }
.sliding-panel.is-closing::backdrop { background: #03081100; backdrop-filter: blur(0); }
@keyframes panel-enter-bottom { from { transform: translate3d(0,100%,0); } }
@keyframes panel-enter-right { from { transform: translate3d(100%,0,0); } }
@media (prefers-reduced-motion: reduce) {
  .sliding-panel, .sliding-panel[data-panel-side].is-opening { animation: none; transition: none; }
  .sliding-panel::backdrop { transition: none; }
}

/* The join action rolls in over the original Play control; both remain separate. */
.room-dialog.join-sheet {
  --dialog-height: min(720px, calc(var(--app-height) - max(16px, var(--app-safe-top))));
  inset: auto auto 0 50%; margin: 0; translate: -50% 0;
  width: min(1024px, 100vw); max-width: 100vw; max-height: var(--dialog-height);
  border-radius: 24px 24px 0 0; border-bottom: 0; outline: none; background: #111c2b; border-color: #415b77;
}
.join-sheet > form { max-height: var(--dialog-height); }
.join-sheet-grip { flex: none; display: grid; place-items: center; width: 100%; min-height: 28px; padding: 8px 0; border: 0; background: transparent; cursor: grab; touch-action: none; }
.join-sheet-grip > span { display: block; width: 40px; height: 4px; border-radius: 4px; background: #8e9fb4; }
.join-sheet-grip:focus-visible > span { background: #fff; }
.join-sheet-heading { flex: none; padding: 0 24px 12px; margin: 0; touch-action: none; cursor: grab; }
.join-sheet .room-dialog-body { padding-top: 8px; padding-inline: 3%; }
.join-sheet .room-dialog-footer { padding-bottom: max(10px, var(--app-safe-bottom)); }
.join-sheet .join-game-mode { margin-bottom: 0; }

.join-dialog .join-nickname { position: relative; margin-bottom: 22px; }
.join-nickname-control { box-sizing: border-box; width: 100%; padding: 13px 44px 13px 14px; border: 1px solid #53627a; border-radius: 12px; background: #0e1726; color: #f0f5ff; font: inherit; font-size: 18px; font-weight: 400; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer; }
.join-nickname-control:focus-visible { outline: 2px solid #70d4ff; outline-offset: 2px; }
.join-nickname > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #b8c4d5; pointer-events: none; }
.join-dialog .join-team { margin-bottom: 18px; }
.join-dialog .room-dialog-body { padding-bottom: 8px; }
.join-dialog .room-dialog-body > :last-child { margin-bottom: 0; }
.join-dialog .room-dialog-body > .account-contents:last-child .join-signin-hint { margin-bottom: 0; }
.join-dialog.with-mode-picker .room-dialog-body { padding-top: 14px; }
.join-dialog.with-mode-picker .join-nickname { margin-bottom: 12px; }
.join-dialog.with-mode-picker .join-team-choice { padding-block: 8px; }
.join-dialog.with-mode-picker .join-team-choice.selected { padding-block: 7px; }
.join-dialog.with-mode-picker .join-team-choice .mascot-avatar { width: 56px !important; height: 56px !important; }
.join-team-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.join-team-choice { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 4px 14px; border: 1px solid #53627a; border-radius: 14px; background: #172134; cursor: pointer; }
.join-team-choice.selected { border: 2px solid #70d4ff; padding: 11px 3px 13px; background: #20364b; box-shadow: inset 0 0 0 1px #70d4ff26; }
.join-team-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.join-team-choice:has(input:focus-visible) { outline: 2px solid white; outline-offset: 3px; }
.join-team-choice > .join-team-check { position: absolute; right: 7px; top: 7px; width: 18px; height: 18px; padding: 3px; box-sizing: border-box; border-radius: 50%; color: white; background: #4dc6ff; }
.join-team-choice > strong { font-size: 17px; }
.join-copy { color: #b9c6d9; font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.join-signin-hint.is-highlighted { color: #ff6a73; }
.join-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.join-socials button { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #58687f; border-radius: 12px; background: #101a2b; color: #f4f7ff; font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; }
.join-socials button svg { width: 25px; height: 25px; }
.google-mark { font-family: Arial,sans-serif; font-size: 28px; font-weight: 800; background: conic-gradient(#4285f4 0 90deg,#34a853 90deg 180deg,#fbbc05 180deg 240deg,#ea4335 240deg 300deg,#4285f4 300deg); background-clip: text; -webkit-background-clip: text; color: transparent; }
.auth-flash button { animation: auth-invitation .4s ease-in-out 3; }
@keyframes auth-invitation { 50% { border-color: #81d8ff; background: #28455c; box-shadow: 0 0 0 2px #70d4ff6b; } }
.join-dialog .room-dialog-footer { padding-top: 6px; }
button.join-submit-button { display: flex; align-items: stretch; justify-content: center; gap: 10px; padding: 0; overflow: hidden; min-height: 66px; height: auto; }
button.join-submit-button:disabled { opacity: .5; cursor: default; filter: none; }
.join-submit-button > strong { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; text-align: center; text-transform: uppercase; font-size: inherit; }
button.join-queue-button { justify-content: space-between; gap: 0; }
.join-queue-button > strong { flex: 1; min-width: 0; align-items: center; text-align: center; }
.join-queue-button > strong small { font-size: 11px; font-weight: 500; text-transform: none; color: #d1e3cd; }
.join-queue-meta { position: relative; isolation: isolate; flex: none; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 18px 10px 20px; background: transparent; color: #f4fff6; font-size: 11px; font-weight: 500; text-transform: none; }
.join-queue-meta > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.join-queue-meta svg { width: 16px; height: 16px; }
@media (max-width: 380px) { button.join-submit-button { min-height: 80px; } }
.join-private-link { display: block; margin: 12px auto 0; padding: 3px; background: transparent; border: 0; color: #b6cee5; font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-height: 640px) { .join-dialog .join-nickname { margin-bottom: 14px; } .join-team-choice { padding-block: 6px; } .join-team-choice.selected { padding-block: 5px; } .join-team-choice .mascot-avatar { width: 56px !important; height: 56px !important; } .join-socials { margin-bottom: 10px; } }
@media (prefers-reduced-motion: reduce) { .auth-flash button { animation: none; outline: 2px solid #70d4ff; } }

/* Keep betting controls as compact as a single identity/reaction line. */
.identity-row { --identity-name-size: 16px; align-items: baseline; }
.identity-row > .reaction-strip { align-self: center; }
.identity-row .hello-label, .identity-row .guest-name { line-height: 1; }
.identity-row .hello-label { color: #9ea8b8; font-size: calc(var(--identity-name-size) - 2px); }
.identity-row .guest-name { color: #fff; font-size: var(--identity-name-size); }
@media (max-width: 600px) { .identity-row { --identity-name-size: 14px; } }
@media (max-height: 540px) and (orientation: landscape) { .identity-row { --identity-name-size: 13px; } }
.arcade-shell .bet-row {
  container: betting-row / inline-size;
  --bet-row-font-size: clamp(9px, 2.7cqi, 12px);
  height: 38px;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 28%, 120px) minmax(0, 1fr);
}
.arcade-shell .bet-row > .bet-button { font-size: var(--bet-row-font-size); grid-template: "label balance" minmax(0, 1fr) / minmax(0, 1fr) auto; }
/* Spend keeps its label and balance side by side at every width. */
.arcade-shell .bet-row > .influence-trigger { container: spend-trigger / inline-size; display: flex; flex-flow: row nowrap; min-width: 0; font-size: var(--bet-row-font-size); }
.arcade-shell .bet-row .spend-label { flex: 1 1 auto; min-width: 0; }
.arcade-shell .bet-row > .bet-button > span:first-child { font-size: calc(var(--bet-row-font-size) + 1px); }
.arcade-shell .bet-row .bet-people,
.arcade-shell .bet-row .spend-balance strong { font-size: inherit; }
.arcade-shell .bet-row .bet-people { min-width: 0; gap: 3px; padding: 0 6px 0 10px; }
.arcade-shell .bet-row .bet-people .ui-icon { width: 11px; height: 11px; }
.arcade-shell .bet-row .spend-balance { flex: 0 0 56px; width: 56px; min-width: 56px; max-width: 56px; gap: 3px; padding-inline: 6px; border-top-width: 0; border-left-width: 1px; border-left-style: solid; font-variant-numeric: tabular-nums; }
.arcade-shell .bet-row .spend-coin { width: 13px; height: 13px; font-size: 9px; }
@media (max-width: 600px), (max-height: 540px) and (orientation: landscape) {
  .arcade-shell .bet-row { height: 34px; }
}
@container betting-row (max-width: 360px) {
  .bet-row > .bet-button { flex-direction: column; justify-content: center; gap: 1px; padding: 0; }
  .bet-row > .bet-button > span:first-child { white-space: normal; }
  .arcade-shell .bet-row .bet-people { align-self: center; padding: 0; line-height: 1; }
  .bet-row .bet-people::before { display: none; }
}

/* Public turn clocks live in the arena; the former VS row belongs to the map. */
.arcade-shell.is-public > .arena-frame { flex: 1 1 0; height: auto; max-height: none; min-height: 0; }
.roster-turn-clock { flex: none; color: #b6c4d6; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) and (orientation: portrait) {
  .arcade-shell.is-public { grid-template-rows: 42px minmax(0, 1fr) auto; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .arcade-shell.is-public { grid-template-rows: 42px minmax(0, 1fr); }
  .arcade-shell.is-public > .arena-frame { grid-row: 2; height: 100%; }
  .arcade-shell.is-public > .spectator-panel { grid-row: 2; }
}

.connection-warning { position: fixed; z-index: 80; inset: 0 0 auto; box-sizing: border-box; width: min(100%,1024px); height: calc(22px + var(--app-safe-top)); margin-inline: auto; padding-top: var(--app-safe-top); background: linear-gradient(#670b13,#9e1823); border-bottom: 1px solid #e95b64; color: #ffe7e9; font-size: 11px; font-weight: 600; line-height: 21px; text-align: center; text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.arcade-shell.has-slow-connection > .site-header { transform: translateY(14px); }
