:root {
  color-scheme: dark;
  --bg: #0d0f14;
  --panel: #171a22;
  --panel-2: #202532;
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7f8fb;
  --muted: #aeb6c7;
  --silver: #8e929b;
  --yellow: #f6c445;
  --blue: #3f6ee8;
  --green: #79c94b;
  --pink: #ef6cae;
  --white: #f7f7f2;
  --field-fill: #eef0eb;
  --danger: #f35b5b;
  --radius: 8px;
  --modal-close-inset: 18px;
  --modal-close-size: 34px;
  --field-size: 41px;
  --field-height: 41px;
  --yellow-col-gap: 12px;
  --yellow-row-gap: 6px;
  --track-gap: 12px;
  --track-row-gap: 5px;
  --track-score-height: 38px;
  --sheet-track-width: calc(
    var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) +
      var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) +
      var(--track-gap) + var(--track-gap) + var(--track-gap) + var(--track-gap) + var(--track-gap) + var(--track-gap) +
      var(--track-gap) + var(--track-gap) + var(--track-gap) + var(--track-gap) + var(--track-gap)
  );
  --sheet-card-width: calc(var(--sheet-track-width) + 28px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  min-height: 100vh;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(239, 108, 174, 0.2), transparent 24rem),
    linear-gradient(135deg, #0b0d12 0%, #171b23 52%, #090b0f 100%);
}

.welcome-screen[hidden] {
  display: none;
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(5, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.welcome-panel {
  width: min(100%, 1220px);
}

.welcome-brand {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  text-align: center;
}

.game-logo {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  margin: 0;
  color: inherit;
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-logo-word {
  display: inline-block;
  -webkit-text-stroke: 1.4px #ff7abc;
  paint-order: stroke fill;
  text-shadow:
    0 0 4px rgba(255, 122, 188, 0.95),
    0 0 14px rgba(255, 75, 168, 0.7),
    1px 0 #ff7abc,
    -1px 0 #ff7abc,
    0 1px #ff7abc,
    0 -1px #ff7abc;
}

.game-logo-light {
  color: #ffffff;
}

.game-logo-dark {
  color: #06060a;
}

.welcome-brand h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0;
}

.modal-brand {
  display: flex;
  justify-content: center;
  width: min(620px, calc(100vw - 48px));
  pointer-events: none;
}

.modal-game-logo {
  flex-wrap: nowrap;
  font-size: 42px;
  white-space: nowrap;
}

.welcome-brand p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.welcome-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 620px) minmax(230px, 280px);
  align-items: start;
  justify-content: center;
  gap: 14px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.welcome-side-stack {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
}

.welcome-card {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(18, 21, 29, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.welcome-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 20px;
}

.welcome-profile-card {
  position: sticky;
  top: 24px;
  gap: 12px;
}

.welcome-profile-login-button {
  justify-self: end;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.welcome-profile-login-button:hover,
.welcome-profile-login-button:focus-visible {
  border-color: rgba(239, 108, 174, 0.64);
  outline: none;
  background: rgba(239, 108, 174, 0.18);
  transform: translateY(-1px);
}

.welcome-profile-summary {
  display: grid;
  gap: 14px;
}

.welcome-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  justify-items: start;
  column-gap: 12px;
  row-gap: 10px;
  text-align: left;
}

.welcome-profile-identity {
  display: grid;
  width: 112px;
  max-width: 100%;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

button.welcome-profile-identity {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.welcome-profile-divider {
  justify-self: center;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.account-stats-button {
  display: grid;
  width: 100%;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.account-stats-button:hover,
.account-stats-button:focus-visible {
  border-color: rgba(239, 108, 174, 0.58);
  outline: none;
  background: rgba(239, 108, 174, 0.16);
  transform: translateY(-1px);
}

.account-stats-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.welcome-profile-avatar {
  position: relative;
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 14px 24px rgba(0, 0, 0, 0.28);
}

.welcome-profile-editor-trigger:hover .welcome-profile-avatar,
.welcome-profile-editor-trigger:focus-visible .welcome-profile-avatar {
  border-color: rgba(255, 255, 255, 0.62);
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 26px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

.welcome-profile-editor-trigger:focus-visible {
  outline: none;
}

.welcome-profile-avatar .avatar-svg {
  width: 100%;
  height: 100%;
}

.welcome-profile-badge {
  position: absolute;
  right: 2px;
  bottom: 6px;
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  background: #343945;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  line-height: 1;
}

.welcome-profile-side {
  display: grid;
  justify-self: end;
  justify-items: end;
  gap: 9px;
  min-width: 0;
  text-align: right;
}

.welcome-profile-quick-stats {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.welcome-profile-quick-stat {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 0;
}

.welcome-profile-quick-stat strong {
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
}

.welcome-profile-quick-stat small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.welcome-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 100%;
  justify-items: center;
}

.welcome-profile-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.welcome-profile-copy strong {
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.welcome-profile-copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.welcome-game-card {
  gap: 12px;
}

.welcome-game-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.welcome-language-card {
  gap: 12px;
}

.language-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.language-choice {
  display: grid;
  min-width: 0;
  gap: 8px;
  place-items: center;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 11px 8px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.language-choice:hover,
.language-choice:focus-visible {
  border-color: rgba(239, 108, 174, 0.58);
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.language-choice.selected {
  border-color: rgba(239, 108, 174, 0.78);
  color: #fff;
  background: rgba(239, 108, 174, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(239, 108, 174, 0.16);
}

.language-flag {
  font-size: 30px;
  line-height: 1;
  filter: saturate(1.08);
}

.auth-card[hidden],
#create-room-card[hidden],
#join-room-card[hidden] {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.auth-tab.active {
  color: #11131a;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.name-card {
  padding: 16px 18px;
}

.profile-editor-top {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.profile-editor-top .field-label {
  align-self: center;
}

.avatar-preview {
  position: relative;
  display: grid;
  width: 92px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(239, 108, 174, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 0 3px rgba(239, 108, 174, 0.08),
    0 0 22px rgba(239, 108, 174, 0.28);
  cursor: pointer;
  overflow: visible;
  padding: 0;
}

.avatar-preview::after {
  content: "\f4ca";
  position: absolute;
  right: -5px;
  bottom: 3px;
  z-index: 2;
  display: grid;
  width: 32px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(239, 108, 174, 0.72);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(37, 41, 52, 0.98), rgba(17, 19, 26, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 2px rgba(239, 108, 174, 0.16),
    0 12px 22px rgba(0, 0, 0, 0.38);
  font-family: bootstrap-icons, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.avatar-preview:hover::after {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 2px rgba(239, 108, 174, 0.22),
    0 0 18px rgba(239, 108, 174, 0.32),
    0 14px 26px rgba(0, 0, 0, 0.42);
  transform: translateY(-1px);
}

.account-summary {
  display: grid;
  gap: 10px;
}

.account-history {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: #171b25;
}

.account-level-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
  padding: 0;
  overflow: visible;
}

.account-level-copy {
  display: grid;
  min-width: 0;
  gap: 0;
}

.account-level-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-level-track {
  display: grid;
  grid-template-columns: 40px minmax(56px, 1fr) 40px;
  align-items: end;
  gap: 0;
}

.account-level-node {
  position: relative;
  z-index: 2;
  display: grid;
  width: 40px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(38, 43, 53, 0.96);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  transform-origin: center;
}

.account-level-node.current {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(239, 108, 174, 0.9);
  color: #fff;
  box-shadow: none;
}

.account-level-node.next {
  color: rgba(255, 255, 255, 0.68);
}

.account-level-node strong {
  color: inherit;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.account-level-middle {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  align-self: stretch;
  min-width: 0;
  margin-inline: -6px;
  padding-bottom: 16px;
}

.account-level-xp-label {
  position: absolute;
  right: -2px;
  bottom: 28px;
  left: -2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-level-caption {
  position: absolute;
  right: -2px;
  bottom: 1px;
  left: -2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.54);
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-level-connector {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 6px 12px rgba(0, 0, 0, 0.18);
}

.account-level-connector span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(239, 108, 174, 0.96), rgba(246, 196, 69, 0.94));
  box-shadow:
    0 0 14px rgba(239, 108, 174, 0.42),
    0 0 8px rgba(246, 196, 69, 0.22);
  transition: width 240ms ease;
}

.account-level-card.progress-celebrating .account-level-connector span {
  transition: none;
}

.account-level-node.level-up-pop {
  animation: account-level-number-pop 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.account-level-node.level-up-pop::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(246, 196, 69, 0.82);
  border-radius: inherit;
  pointer-events: none;
  animation: account-level-ring-pop 620ms ease-out both;
}

.level-sparkle-layer {
  position: absolute;
  inset: -18px -10px;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.level-sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: #fff;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.85),
    0 0 16px rgba(246, 196, 69, 0.64),
    0 0 22px rgba(239, 108, 174, 0.42);
  animation: level-sparkle-dust var(--duration) ease-out var(--delay) both;
}

.level-confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  overflow: visible;
}

.level-confetti {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: var(--height);
  border-radius: 2px;
  opacity: 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.22);
  transform-origin: center;
  animation: level-confetti-pop var(--duration) cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
}

@keyframes account-level-number-pop {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.28);
    border-color: rgba(246, 196, 69, 0.95);
    background: rgba(246, 196, 69, 0.98);
    color: #101218;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes account-level-ring-pop {
  0% {
    opacity: 0.86;
    transform: scale(0.7);
  }
  100% {
    opacity: 0;
    transform: scale(1.62);
  }
}

@keyframes level-confetti-pop {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.45);
  }
  12% {
    opacity: 1;
  }
  62% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rotate)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), calc(var(--dy) + var(--fall))) rotate(var(--rotate)) scale(0.72);
  }
}

@keyframes level-sparkle-dust {
  0% {
    opacity: 0;
    transform: translate(0, 10px) scale(0.35);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.06);
  }
}

.account-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.account-stat {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 7px 6px;
  background: #171b25;
}

.account-stat b {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat small,
.account-history-row small,
.account-history-row time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.account-stats-visual,
.account-area-breakdown {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  background: #171b25;
}

.account-stats-section-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.account-stats-section-head strong {
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.1;
}

.account-stats-section-head span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 850;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-score-chart {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-score-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 38 / 11;
  overflow: visible;
}

.account-chart-average {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-dasharray: 5 7;
  stroke-linecap: butt;
  stroke-width: 1.4;
}

.account-chart-average-label {
  fill: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 900;
  text-anchor: end;
}

.account-chart-average-label-bg {
  fill: rgba(18, 21, 29, 0.94);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.account-chart-line {
  fill: none;
  stroke: var(--pink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.2;
  filter: drop-shadow(0 0 9px rgba(239, 108, 174, 0.52));
}

.account-chart-dot {
  fill: var(--pink);
  stroke: none;
  stroke-width: 0;
}

.account-chart-dot.latest {
  fill: var(--pink);
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(239, 108, 174, 0.58));
}

.account-chart-axis,
.account-chart-tick {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-linecap: butt;
  stroke-width: 1.2;
}

.account-chart-x-label {
  fill: rgba(255, 255, 255, 0.54);
  font-size: 8px;
  font-weight: 850;
  text-anchor: middle;
}

.account-chart-axis-label {
  fill: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-anchor: middle;
  text-transform: uppercase;
}

.account-chart-empty {
  display: grid;
  min-height: 76px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.account-area-bars {
  display: grid;
  gap: 8px;
}

.account-area-row {
  --area-color: var(--silver);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px 16px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-area-row.area-yellow {
  --area-color: var(--yellow);
}

.account-area-row.area-silver {
  --area-color: var(--silver);
}

.account-area-row.area-blue {
  --area-color: var(--blue);
}

.account-area-row.area-green {
  --area-color: var(--green);
}

.account-area-row.area-pink {
  --area-color: var(--pink);
}

.account-area-name {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-area-track {
  display: block;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.account-area-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--area-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--area-color) 50%, transparent);
}

.account-area-row strong {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.account-area-row small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 850;
}

.account-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.account-history-head {
  justify-content: flex-start;
}

.account-history-list {
  display: grid;
  max-height: 158px;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.account-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 7px;
}

.account-history-row strong {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.account-history-row small {
  grid-column: 1 / -1;
}

.account-history-row.empty {
  grid-template-columns: 1fr;
}

.avatar-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-modal-backdrop[hidden] {
  display: none;
}

.avatar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 14px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.62);
}

.avatar-modal {
  position: relative;
  display: grid;
  width: min(100%, 640px);
  max-height: calc(100vh - 28px);
  gap: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #171a22;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.avatar-modal-body {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding-right: 0;
}

.avatar-modal-aside {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-modal-preview {
  display: grid;
  width: 152px;
  aspect-ratio: 1;
  justify-self: center;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.avatar-editor {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.avatar-name-control {
  width: 100%;
  margin: 0;
}

.avatar-editor-profile {
  display: grid;
  width: 100%;
  gap: 8px;
  min-width: 0;
}

.avatar-profile-field {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.avatar-profile-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.avatar-name-control input {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  outline: none;
}

.avatar-name-control input:focus {
  color: #fff;
}

.avatar-email-display strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.avatar-control-list {
  display: grid;
  gap: 5px;
}

.avatar-control-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.avatar-control-row.group-start {
  margin-top: 8px;
}

.avatar-control-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.avatar-stepper {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.avatar-stepper-button {
  display: grid;
  width: 30px;
  height: 32px;
  place-items: center;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.avatar-stepper-button:hover {
  color: #fff;
  background: rgba(239, 108, 174, 0.16);
}

.avatar-stepper-value {
  display: flex;
  min-width: 0;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 950;
}

.avatar-stepper-value span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button.avatar-random-button {
  display: grid;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  place-items: center;
}

.avatar-random-button .dice-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.avatar-random-button .dice-icon rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.avatar-random-button .dice-icon circle {
  fill: currentColor;
}

.avatar-swatch-picker {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.avatar-swatch-button {
  display: grid;
  width: 24px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  padding: 2px;
  background: transparent;
  cursor: pointer;
}

.avatar-swatch-button:hover {
  border-color: rgba(255, 255, 255, 0.48);
}

.avatar-swatch-button.selected {
  border-color: var(--pink);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.14),
    0 0 14px rgba(239, 108, 174, 0.32);
}

.avatar-swatch {
  width: 18px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-card .field-label[hidden],
.player-profile-auth .field-label[hidden] {
  display: none !important;
}

.field-label input {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 800;
}

.welcome-player-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.welcome-player-choice {
  position: relative;
  display: grid;
  min-height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.welcome-player-choice:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(239, 108, 174, 0.72);
  background: rgba(239, 108, 174, 0.12);
}

.welcome-player-choice:disabled {
  cursor: not-allowed;
}

.room-join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.welcome-player-choice.selected {
  border-color: var(--pink);
  background: rgba(239, 108, 174, 0.24);
  box-shadow: 0 0 0 2px rgba(239, 108, 174, 0.18);
}

.welcome-player-choice.selected .person-icon::before,
.welcome-player-choice.selected .person-icon::after {
  background: #ffffff;
  box-shadow: 0 0 10px rgba(239, 108, 174, 0.5);
}

body.bonus-focus-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: brightness(0.72) saturate(0.75);
}

button {
  font: inherit;
}

.app-shell {
  width: min(100% - 32px, 1500px);
  min-height: 100vh;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 0 36px;
}

.topbar {
  display: grid;
  grid-template-columns: 380px var(--sheet-card-width) 260px;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 4px 0 12px;
}

.topbar > * {
  min-width: 0;
}

.brand-block {
  justify-self: start;
}

.welcome-open .brand-block {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.welcome-open .welcome-brand {
  display: grid;
}

.brand-block h1 {
  margin: 0;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 34px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-score-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 42px;
  min-width: 0;
  max-width: 100%;
}

.topbar-right {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.top-score-chip {
  --score-color: var(--muted);
  display: grid;
  grid-template-columns: 9px auto auto;
  align-items: center;
  gap: 7px;
  min-width: 78px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.top-score-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--score-color);
  box-shadow: 0 0 10px var(--score-color);
}

.top-score-chip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.top-score-chip strong {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.top-score-silver {
  --score-color: var(--silver);
}

.top-score-yellow {
  --score-color: var(--yellow);
}

.top-score-blue {
  --score-color: var(--blue);
}

.top-score-green {
  --score-color: var(--green);
}

.top-score-pink {
  --score-color: var(--pink);
}

.top-score-fox {
  --score-color: var(--danger);
  grid-template-columns: 18px auto auto;
}

.top-score-fox::before {
  display: none;
}

.top-score-symbol {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.top-score-symbol .fox-icon {
  width: 18px;
  height: 18px;
}

.top-score-total {
  --score-color: #fff;
  border-color: rgba(239, 108, 174, 0.45);
  background: rgba(239, 108, 174, 0.16);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 15px;
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
}

.primary-button {
  border-color: rgba(239, 108, 174, 0.6);
  background: linear-gradient(180deg, #fa75b7, #c83f87);
  color: #fff;
  font-weight: 800;
}

.ghost-button:hover,
.icon-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.primary-button.legal-move:not(:disabled),
.ghost-button.legal-move:not(:disabled),
.bonus-token-button.legal-move:not(:disabled),
.panel-block.legal-move {
  border-color: rgba(239, 108, 174, 0.92);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.18),
    0 0 26px rgba(239, 108, 174, 0.34),
    0 12px 28px rgba(0, 0, 0, 0.22);
  animation: legal-move-glow 1180ms ease-in-out infinite alternate;
}

#roll-dice {
  position: relative;
  overflow: hidden;
}

#roll-dice.legal-move:not(:disabled)::before {
  content: "";
  position: absolute;
  top: -55%;
  bottom: -55%;
  left: -70%;
  z-index: 0;
  width: 48%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 18%,
    rgba(255, 255, 255, 0.76) 50%,
    rgba(255, 204, 232, 0.28) 72%,
    transparent 100%
  );
  filter: blur(0.5px);
  transform: skewX(-18deg);
  animation: roll-button-sheen 1450ms ease-in-out infinite;
}

.play-layout {
  display: grid;
  grid-template-columns: 380px max-content 260px;
  justify-content: center;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.turn-controls {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-self: start;
  justify-self: center;
  width: 260px;
  min-height: var(--sheet-panel-height, auto);
  gap: 10px;
}

.turn-controls .primary-button,
.turn-controls .ghost-button {
  width: 100%;
}

.turn-bonus-panel {
  width: 100%;
  margin-bottom: 2px;
}

.turn-bonus-panel[hidden] {
  display: none;
}

.spectator-profile-panel[hidden] {
  display: none;
}

.spectator-profile-panel {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px;
  border: 1px solid rgba(239, 108, 174, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(239, 108, 174, 0.18), rgba(255, 255, 255, 0.055)),
    rgba(15, 17, 23, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

.spectator-profile-panel.inactive-player {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(15, 17, 23, 0.9);
}

.spectator-profile-avatar {
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(38, 43, 53, 0.94);
}

.profile-avatar-button {
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.profile-avatar-button:hover,
.profile-avatar-button:focus-visible {
  border-color: rgba(239, 108, 174, 0.74);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.18),
    0 0 18px rgba(239, 108, 174, 0.3);
  outline: none;
  transform: translateY(-1px);
}

.spectator-profile-panel.inactive-player .spectator-profile-avatar {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.12);
}

.spectator-profile-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.spectator-profile-copy span {
  color: var(--pink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.spectator-profile-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spectator-profile-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel {
  --side-die-gap: 8px;
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

body.spectator-roll-active .side-panel {
  z-index: 998;
  pointer-events: none;
}

body.spectator-roll-active .turn-controls {
  z-index: 1002;
  visibility: visible;
  pointer-events: none;
}

body.watching-other-board .turn-controls > :not(.room-panel):not(.spectator-profile-panel) {
  display: none;
}

body.spectator-roll-active .turn-controls > :not(.room-panel):not(.spectator-profile-panel) {
  visibility: hidden;
  pointer-events: none;
}

body.spectator-roll-active .turn-controls > .room-panel,
body.spectator-roll-active .turn-controls > .spectator-profile-panel {
  visibility: visible;
}

body.spectator-roll-active .turn-controls > .room-panel {
  pointer-events: auto;
}

body.spectator-roll-active .pick-panel {
  position: relative;
  z-index: 999;
  visibility: visible;
  border-color: rgba(239, 108, 174, 0.62);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.12),
    0 18px 58px rgba(0, 0, 0, 0.34);
}

body.passive-observer-active.spectator-roll-active .side-panel > .round-panel,
body.passive-observer-active.spectator-roll-active .side-panel > .action-panel-block,
body.passive-observer-active.spectator-roll-active .side-panel > .pick-panel {
  visibility: visible;
}

body.passive-observer-active.spectator-roll-active .pick-panel {
  border-color: var(--line);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
}

.panel-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(15, 17, 23, 0.88);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
}

.panel-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-title-with-avatar {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-owner-avatar-slot {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.panel-owner-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  padding: 0;
  background: rgba(38, 43, 53, 0.94);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.22);
  color: inherit;
  font: inherit;
}

button.panel-owner-avatar,
button.field-owner-avatar {
  cursor: pointer;
  appearance: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

button.panel-owner-avatar:hover,
button.panel-owner-avatar:focus-visible,
button.field-owner-avatar:hover,
button.field-owner-avatar:focus-visible {
  border-color: rgba(239, 108, 174, 0.78);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.24),
    0 0 18px rgba(239, 108, 174, 0.34),
    0 8px 18px rgba(0, 0, 0, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.panel-owner-avatar .avatar-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.room-panel {
  display: grid;
  gap: 12px;
}

.turn-controls .room-panel {
  margin-top: auto;
}

.room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-head > div {
  min-width: 0;
}

.room-head .panel-title {
  margin-bottom: 3px;
}

.room-head strong {
  color: #fff;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.room-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.room-code-button {
  min-height: 34px;
  padding: 0 10px;
}

.room-settings-button,
.room-exit-button {
  display: grid;
  width: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  justify-self: end;
}

.room-settings-button i {
  display: block;
  font-size: 17px;
  line-height: 1;
}

.turn-controls .room-settings-button,
.turn-controls .room-exit-button {
  width: 38px;
}

.exit-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

body[data-can-act="true"] .turn-controls {
  border-color: rgba(239, 108, 174, 0.62);
}

.room-seat-list {
  display: grid;
  gap: 7px;
}

.room-seat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 6px;
  background: rgba(255, 255, 255, 0.055);
}

.room-seat.viewing {
  border-color: rgba(255, 255, 255, 0.96);
  outline: 3px solid rgba(255, 255, 255, 0.74);
  outline-offset: 1px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.12),
    0 0 22px rgba(255, 255, 255, 0.2);
}

.room-seat-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-seat-board {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
}

.room-seat-board:focus-visible {
  outline: none;
}

.room-seat-avatar-button {
  display: grid;
  width: 30px;
  min-width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition:
    transform 140ms ease;
}

.room-seat-avatar-button:hover,
.room-seat-avatar-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.room-seat-avatar-button:hover .seat-avatar,
.room-seat-avatar-button:focus-visible .seat-avatar {
  border-color: rgba(239, 108, 174, 0.62);
  box-shadow: 0 0 14px rgba(239, 108, 174, 0.34);
}

.seat-avatar {
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.placeholder-avatar {
  position: relative;
  border-color: rgba(255, 255, 255, 0.24);
  background: #262b35;
}

.room-seat.current {
  border-color: rgba(239, 108, 174, 0.72);
  background: rgba(239, 108, 174, 0.16);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.12),
    0 0 22px rgba(239, 108, 174, 0.18);
}

.room-seat.autopilot:not(.current) {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

.room-seat.empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.room-seat-name {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.room-seat-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-seat-kind {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-seat-score {
  display: grid;
  min-width: 46px;
  justify-items: end;
  gap: 1px;
}

.room-seat-score strong {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.room-seat-score small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.room-role-badge {
  border-radius: 999px;
  padding: 4px 7px;
  color: #101218;
  background: var(--yellow);
  font-size: 10px;
  line-height: 1;
}

.room-ai-button {
  min-width: 34px;
  min-height: 30px;
  font-size: 11px;
}

.room-lobby-actions {
  display: grid;
  gap: 10px;
}

.room-lobby-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.room-wide-button {
  width: 100%;
}

.room-lobby-modal-backdrop[hidden] {
  display: none;
}

.room-lobby-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at center, rgba(239, 108, 174, 0.16), transparent 34rem),
    rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}

.room-lobby-modal {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(620px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  background: #171a22;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
}

.room-lobby-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--modal-close-size);
  padding-right: calc(var(--modal-close-size) + 12px);
}

.room-lobby-modal h2 {
  margin: 0;
  font-size: 24px;
}

.room-settings-modal-backdrop[hidden] {
  display: none;
}

.room-settings-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}

.room-settings-modal {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(500px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  background: #171a22;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
}

.room-settings-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--modal-close-size);
  padding-right: calc(var(--modal-close-size) + 12px);
}

.room-settings-modal h2 {
  margin: 0;
  font-size: 24px;
}

.room-settings-content {
  display: grid;
  gap: 10px;
}

.player-profile-modal-backdrop[hidden],
.account-stats-modal-backdrop[hidden] {
  display: none;
}

.player-profile-modal-backdrop,
.account-stats-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}

.player-profile-modal,
.account-stats-modal {
  position: relative;
  display: grid;
  gap: 0;
  width: min(560px, calc(100vw - 48px));
  color: var(--text);
}

.account-stats-modal {
  gap: 12px;
  width: min(680px, calc(100vw - 48px));
}

.player-profile-modal-head,
.account-stats-modal-head {
  position: absolute;
  top: var(--modal-close-inset);
  right: var(--modal-close-inset);
  z-index: 3;
}

.player-profile-content,
.player-profile-stats,
.account-stats-content {
  display: grid;
  gap: 10px;
}

.player-profile-card,
.player-profile-auth-card,
.account-stats-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 18px 58px 18px 18px;
  background: #12151d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.account-stats-card {
  padding: 24px 18px 18px;
}

.account-stats-hero {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding-right: calc(var(--modal-close-size) + 12px);
}

.account-stats-hero + .account-level-card {
  margin-top: 4px;
}

.account-stats-avatar {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.account-stats-avatar .avatar-svg {
  width: 100%;
  height: 100%;
}

.account-stats-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.account-stats-hero strong {
  color: #fff;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.account-stats-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.player-profile-auth-card {
  border-color: rgba(255, 255, 255, 0.18);
  padding: 18px;
}

.player-profile-auth-intro {
  display: grid;
  gap: 4px;
  padding-right: 42px;
}

.player-profile-auth-intro h2 {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.08;
}

.player-profile-auth-intro h2 .bi {
  flex: 0 0 auto;
  color: var(--pink);
  font-size: 25px;
  -webkit-text-stroke: 0.85px currentColor;
  filter: drop-shadow(0 0 10px rgba(239, 108, 174, 0.66));
}

.player-profile-auth-intro h2 span {
  font-weight: 1000;
}

.player-profile-auth-intro > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.player-profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(239, 108, 174, 0.13), rgba(255, 255, 255, 0.05) 52%),
    rgba(255, 255, 255, 0.05);
}

button.player-profile-hero {
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.player-profile-hero-edit:hover,
.player-profile-hero-edit:focus-visible {
  border-color: rgba(239, 108, 174, 0.72);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(239, 108, 174, 0.12),
    0 0 24px rgba(239, 108, 174, 0.2);
}

.player-profile-avatar {
  display: grid;
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 22px rgba(239, 108, 174, 0.18);
}

.avatar-edit-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  width: 26px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  background: #343945;
  font-size: 12px;
}

.player-profile-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.player-profile-main span,
.player-profile-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.player-profile-main span {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.player-profile-main strong {
  overflow: hidden;
  color: #fff;
  font-size: 25px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-note {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 850;
}

.player-profile-note strong {
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.player-profile-auth {
  display: grid;
  gap: 12px;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.045);
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row strong {
  color: #fff;
  font-size: 14px;
  font-weight: 950;
}

.settings-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.settings-switch {
  position: relative;
  display: inline-grid;
  width: 50px;
  height: 28px;
  flex: 0 0 50px;
}

.settings-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-switch i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.settings-switch i::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f7f8fb;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease;
}

.settings-switch input:checked + i {
  border-color: rgba(239, 108, 174, 0.62);
  background: rgba(239, 108, 174, 0.72);
  box-shadow: 0 0 18px rgba(239, 108, 174, 0.25);
}

.settings-switch input:checked + i::before {
  transform: translateX(22px);
}

.settings-switch input:disabled {
  cursor: not-allowed;
}

.settings-switch input:disabled + i {
  opacity: 0.52;
}

.settings-debug-row {
  align-items: start;
}

.settings-debug-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 7px;
}

.settings-debug-actions button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.settings-debug-actions button:hover {
  border-color: rgba(239, 108, 174, 0.52);
  background: rgba(239, 108, 174, 0.16);
  transform: translateY(-1px);
}

.room-lobby-content {
  display: grid;
  gap: 14px;
}

.lobby-code-block {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(239, 108, 174, 0.38);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(239, 108, 174, 0.1);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.lobby-code-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  justify-content: flex-start;
  width: auto;
}

.lobby-code-block > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-code-block strong {
  color: #fff;
  font-size: 36px;
  letter-spacing: 0.1em;
}

.lobby-code-block.copied {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(239, 108, 174, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 24px rgba(239, 108, 174, 0.28);
}

.lobby-share-copy {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  transition:
    color 140ms ease,
    transform 140ms ease;
}

.lobby-share-copy:hover {
  color: #fff;
  transform: translateY(-1px);
}

.lobby-code-block.copied .lobby-share-copy {
  color: #fff;
}

.lobby-order-mode {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.lobby-order-mode > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-order-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lobby-order-mode-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.055);
  font-weight: 900;
  cursor: pointer;
}

.lobby-order-mode-button:hover {
  border-color: rgba(239, 108, 174, 0.56);
  background: rgba(239, 108, 174, 0.12);
}

.lobby-order-mode-button.selected {
  border-color: var(--pink);
  color: #fff;
  background: rgba(239, 108, 174, 0.2);
  box-shadow: 0 0 0 2px rgba(239, 108, 174, 0.13);
}

.lobby-seat-list {
  display: grid;
  gap: 10px;
}

.lobby-seat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.lobby-seat.with-order {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.lobby-seat.empty {
  background: rgba(255, 255, 255, 0.035);
}

.lobby-seat.ready {
  border-color: rgba(85, 211, 148, 0.44);
  background: rgba(85, 211, 148, 0.08);
}

.lobby-seat.waiting {
  border-color: rgba(246, 196, 69, 0.38);
  background: rgba(246, 196, 69, 0.07);
}

.lobby-seat-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lobby-seat-main.profile-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lobby-seat-main.profile-trigger:hover .seat-avatar,
.lobby-seat-main.profile-trigger:focus-visible .seat-avatar {
  border-color: rgba(239, 108, 174, 0.62);
  box-shadow: 0 0 14px rgba(239, 108, 174, 0.28);
}

.lobby-seat-main.profile-trigger:focus-visible {
  outline: none;
}

.lobby-seat-avatar {
  width: 40px;
  min-width: 40px;
}

.lobby-order-controls {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.lobby-order-button {
  width: 26px;
  min-width: 26px;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.lobby-order-button:hover:not(:disabled) {
  color: #fff;
  background: rgba(239, 108, 174, 0.12);
}

.lobby-order-button:disabled {
  cursor: default;
  opacity: 0.24;
}

.lobby-seat-main strong,
.lobby-seat-main small {
  display: block;
}

.lobby-seat-main strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-seat-main small,
.lobby-waiting {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-seat-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.lobby-seat-actions .lobby-ai-selector {
  flex: 0 1 220px;
}

.lobby-ready-check {
  display: grid;
  width: 25px;
  min-width: 25px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #153322;
  background: #55d394;
  box-shadow: 0 0 14px rgba(85, 211, 148, 0.34);
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
}

.lobby-ready-check.pending {
  border: 2px solid rgba(255, 255, 255, 0.32);
  color: transparent;
  background: transparent;
  box-shadow: none;
}

.lobby-ai-selector {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: stretch;
  gap: 4px;
  width: min(220px, 30vw);
  max-width: 100%;
  min-width: 0;
}

.lobby-ai-selected {
  display: grid;
  min-width: 0;
  min-height: 42px;
  align-content: center;
  justify-items: center;
  border: 0;
  gap: 2px;
  padding: 0 4px;
  text-align: center;
  background: transparent;
  box-shadow: none;
}

.lobby-ai-selected span,
.lobby-ai-selected small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-ai-selected span {
  font-size: 12px;
  font-weight: 950;
}

.lobby-ai-selected small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-ai-selected .ai-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 72px;
  min-width: 72px;
  max-width: none;
  min-height: 13px;
  overflow: visible;
  color: #f6c445;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  text-transform: none;
}

.lobby-ai-selected .ai-star {
  display: inline-block;
  flex: 0 0 13px;
  width: 13px;
  overflow: visible;
  color: #f6c445;
  text-align: center;
  text-shadow:
    0 0 5px rgba(246, 196, 69, 0.48),
    0 1px 2px rgba(0, 0, 0, 0.36);
}

.lobby-ai-selected .ai-star.half {
  color: transparent;
  background: linear-gradient(90deg, #f6c445 0 50%, rgba(246, 196, 69, 0.22) 50% 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.lobby-ai-selected .ai-star.empty {
  color: rgba(246, 196, 69, 0.22);
  text-shadow: none;
}

.lobby-ai-chevron {
  justify-self: center;
  width: 20px;
  min-width: 20px;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.lobby-ai-selected:hover,
.lobby-ai-chevron:hover {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.room-own-ai-control {
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.room-own-ai-control .lobby-ai-chevron {
  width: 20px;
  min-width: 20px;
  min-height: 36px;
}

.room-own-ai-control .lobby-ai-selected {
  min-height: 36px;
}

.lobby-footer {
  display: grid;
  gap: 10px;
}

.lobby-footer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.lobby-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.room-die {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
}

.room-die .die-face {
  --pip-size: 5px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.round-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.round-chip,
.action-row,
.score-row,
.log-entry {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.round-chip {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.round-chip.active {
  border-color: var(--pink);
  color: #fff;
  background: rgba(239, 108, 174, 0.2);
}

.round-chip.inactive-round {
  opacity: 0.38;
  background: rgba(255, 255, 255, 0.035);
}

.round-chip small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.round-condition {
  display: block;
  max-width: 56px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.round-player-condition {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.mini-person-icons {
  gap: 1px;
}

.mini-person-icons .person-icon {
  width: 8px;
  height: 14px;
}

.mini-person-icons .person-icon::before {
  width: 5px;
  height: 5px;
}

.mini-person-icons .person-icon::after {
  width: 8px;
  height: 8px;
  border-radius: 5px 5px 2px 2px;
}

.dice-tray {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 52px;
  min-height: 52px;
  align-items: center;
  gap: var(--side-die-gap);
  perspective: 720px;
}

.dice-tray.rolling-tray {
  filter: drop-shadow(0 0 16px rgba(246, 196, 69, 0.16));
}

body.dice-roll-active:not(.inline-roll-active) .dice-tray .die-button {
  visibility: hidden;
}

.roll-stage[hidden] {
  display: none;
}

.roll-stage {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  display: grid;
  width: 100vw;
  height: 100vh;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 34%, rgba(246, 196, 69, 0.18) 43%, transparent 54%),
    linear-gradient(244deg, transparent 0 35%, rgba(239, 108, 174, 0.2) 45%, transparent 56%),
    linear-gradient(180deg, rgba(4, 5, 10, 0.68), rgba(3, 4, 8, 0.82));
  opacity: 0;
  transition: opacity 100ms ease;
}

.roll-stage.visible {
  opacity: 1;
}

.roll-stage-player {
  position: absolute;
  top: clamp(34px, 9vh, 92px);
  left: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #fff;
  text-align: center;
  transform: translateX(-50%);
  text-shadow:
    0 3px 12px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(239, 108, 174, 0.58);
}

.roll-stage-player strong {
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 950;
  line-height: 1;
}

.roll-stage-player span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.roll-stage::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.roll-stage::before {
  inset: -14%;
  background: linear-gradient(104deg, transparent 0 38%, rgba(246, 196, 69, 0.24) 47%, rgba(255, 255, 255, 0.14) 50%, rgba(63, 110, 232, 0.2) 54%, transparent 66%);
  opacity: 0.48;
  animation: casino-scan 1800ms ease-in-out infinite alternate;
}

.roll-stage-dice {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: calc(100vw - 56px);
  max-width: 1180px;
  gap: 18px;
  padding: 28px 24px;
  transform: translateY(-5vh);
  perspective: 960px;
  filter:
    drop-shadow(0 20px 38px rgba(0, 0, 0, 0.62))
    drop-shadow(0 0 34px rgba(246, 196, 69, 0.32));
  animation: casino-stage-pulse 520ms ease-in-out infinite alternate;
}

.roll-stage-dice::before {
  content: "";
  position: absolute;
  left: -12vw;
  right: -12vw;
  top: 50%;
  height: 170px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(90deg, transparent, rgba(63, 110, 232, 0.16), rgba(246, 196, 69, 0.22), rgba(239, 108, 174, 0.16), transparent),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0.74;
  transform: translateY(-50%) skewY(-2deg);
  animation: casino-light-rush 1300ms ease-in-out infinite alternate;
}

.roll-stage-die {
  --die-glow: rgba(255, 255, 255, 0.72);
  position: relative;
  z-index: 1;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  transform-origin: 50% 20%;
  filter:
    drop-shadow(0 0 22px var(--die-glow))
    drop-shadow(0 28px 24px rgba(0, 0, 0, 0.58));
  will-change: transform, opacity;
}

.roll-stage-die[data-color="silver"] {
  --die-glow: rgba(220, 226, 238, 0.85);
}

.roll-stage-die[data-color="yellow"] {
  --die-glow: rgba(246, 196, 69, 0.92);
}

.roll-stage-die[data-color="blue"] {
  --die-glow: rgba(63, 110, 232, 0.94);
}

.roll-stage-die[data-color="green"] {
  --die-glow: rgba(121, 201, 75, 0.88);
}

.roll-stage-die[data-color="pink"] {
  --die-glow: rgba(239, 108, 174, 0.96);
}

.roll-stage-die::after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 122px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--die-glow), transparent);
  opacity: 0;
  transform: scaleX(0.55);
}

.roll-stage-die.rolling {
  animation: dice-drop 760ms cubic-bezier(0.13, 0.96, 0.22, 1.18) both;
  animation-delay: var(--roll-delay, 0ms);
}

.roll-stage-die.roll-settled {
  animation: dice-land 360ms cubic-bezier(0.2, 0.82, 0.32, 1.12) both;
}

.roll-stage-die.roll-settled::after {
  animation: landing-flare 360ms ease-out both;
}

.roll-stage-die.rolling .die-face {
  animation: stage-die-roll 680ms ease-in-out infinite;
}

.roll-stage-die.rolling .die-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.72) 44%, transparent 64%);
  mix-blend-mode: screen;
  opacity: 0.22;
  animation: slot-scan 740ms ease-in-out infinite;
  pointer-events: none;
}

.roll-stage-die.rolling .die-pip {
  animation: none;
}

.roll-stage-die.roll-settled .die-face {
  animation: settle-pop 360ms ease-out both;
}

.roll-stage-spectator .roll-stage-die.roll-settled {
  animation: none;
}

.roll-stage-spectator .roll-stage-die.roll-settled::after {
  animation: none;
}

.roll-stage-spectator .roll-stage-picked-die {
  left: auto;
  top: auto;
  right: clamp(42px, 12vw, 190px);
  bottom: clamp(148px, 24vh, 230px);
  width: clamp(82px, 12vw, 120px);
  height: clamp(82px, 12vw, 120px);
  transform: none;
}

.roll-stage-picked-die {
  --die-glow: rgba(255, 255, 255, 0.72);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 26px var(--die-glow))
    drop-shadow(0 32px 28px rgba(0, 0, 0, 0.64));
}

.roll-stage-picked-die[data-color="silver"] {
  --die-glow: rgba(220, 226, 238, 0.85);
}

.roll-stage-picked-die[data-color="yellow"] {
  --die-glow: rgba(246, 196, 69, 0.92);
}

.roll-stage-picked-die[data-color="blue"] {
  --die-glow: rgba(63, 110, 232, 0.94);
}

.roll-stage-picked-die[data-color="green"] {
  --die-glow: rgba(121, 201, 75, 0.88);
}

.roll-stage-picked-die[data-color="pink"] {
  --die-glow: rgba(239, 108, 174, 0.96);
}

.roll-stage-picked-die .die-face {
  --pip-size: 16%;
  width: 100%;
  height: 100%;
  border-radius: 14%;
}

.roll-stage-picked-die.taken {
  animation: spectator-die-taken 1080ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.roll-stage-picked-die.placing {
  animation: spectator-die-placed 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.die-flight {
  position: fixed;
  z-index: 95;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
  filter:
    drop-shadow(0 16px 22px rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.22));
}

.die-flight .die-face {
  --pip-size: 16%;
  width: 100%;
  height: 100%;
  border-radius: 14%;
}

.die-flight.discarded {
  filter:
    grayscale(1)
    saturate(0.08)
    brightness(0.92)
    drop-shadow(0 16px 22px rgba(0, 0, 0, 0.38));
  opacity: 0.72;
}

.spectator-dice-event {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(239, 108, 174, 0.18), rgba(0, 0, 0, 0) 34rem),
    linear-gradient(180deg, rgba(4, 5, 10, 0.48), rgba(3, 4, 8, 0.64));
  animation: spectator-event-in 160ms ease-out both;
}

.spectator-player-label {
  position: absolute;
  top: clamp(34px, 9vh, 92px);
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #fff;
  text-align: center;
  transform: translateX(-50%);
  text-shadow:
    0 3px 12px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(239, 108, 174, 0.58);
}

.spectator-player-label strong {
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 950;
  line-height: 1;
}

.spectator-player-label span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spectator-dice-main {
  position: absolute;
  right: clamp(16px, 5vw, 76px);
  bottom: clamp(18px, 6vh, 64px);
  display: grid;
  place-items: center;
}

.spectator-picked-die {
  --die-glow: rgba(255, 255, 255, 0.72);
  display: grid;
  width: 124px;
  height: 124px;
  place-items: center;
  filter:
    drop-shadow(0 0 24px var(--die-glow))
    drop-shadow(0 30px 26px rgba(0, 0, 0, 0.62));
}

.spectator-picked-die[data-color="silver"] {
  --die-glow: rgba(220, 226, 238, 0.85);
}

.spectator-picked-die[data-color="yellow"] {
  --die-glow: rgba(246, 196, 69, 0.92);
}

.spectator-picked-die[data-color="blue"] {
  --die-glow: rgba(63, 110, 232, 0.94);
}

.spectator-picked-die[data-color="green"] {
  --die-glow: rgba(121, 201, 75, 0.88);
}

.spectator-picked-die[data-color="pink"] {
  --die-glow: rgba(239, 108, 174, 0.96);
}

.spectator-picked-die .die-face {
  --pip-size: 16%;
  width: 100%;
  height: 100%;
  border-radius: 14%;
}

.spectator-dice-event.taking .spectator-picked-die {
  animation: spectator-die-taken 1080ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spectator-dice-event.placing .spectator-picked-die {
  animation: spectator-die-placed 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.spectator-silver-flight {
  position: absolute;
  left: clamp(16px, 5vw, 76px);
  bottom: clamp(18px, 6vh, 64px);
  max-width: min(48vw, 360px);
  display: grid;
  justify-items: start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spectator-silver-flight > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: start;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(18, 20, 27, 0.74);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.spectator-tray-die {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  animation: spectator-to-tray 980ms cubic-bezier(0.2, 0.82, 0.22, 1) var(--spectator-delay, 0ms) both;
}

.spectator-tray-die .die-face {
  --pip-size: 15%;
  width: 100%;
  height: 100%;
  border-radius: 14%;
}

.die-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  padding: 4px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 20%;
  will-change: transform, opacity;
}

.dice-tray .die-button {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 0;
}

.tray-die-shell {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
}

.tray-die {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  padding: 4px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.tray-die.retrievable {
  background: transparent;
}

.tray-die.retrievable .die-face {
  outline: 2px solid rgba(239, 108, 174, 0.88);
  outline-offset: 3px;
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.18),
    inset 2px 2px 5px rgba(255, 255, 255, 0.75),
    0 0 18px rgba(239, 108, 174, 0.36);
}

.tray-die.retrievable:hover {
  transform: translateY(-1px);
}

.tray-die.retrievable:hover .die-face {
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.18),
    inset 2px 2px 5px rgba(255, 255, 255, 0.75),
    0 0 24px rgba(239, 108, 174, 0.48);
}

.tray-die.silver-auto-selected:disabled,
.tray-die.plus-tray-selected:disabled,
.tray-die.passive-tray-selected {
  cursor: default;
  opacity: 1;
}

.tray-die.silver-auto-selected .die-face,
.tray-die.plus-tray-selected .die-face,
.tray-die.passive-tray-selected .die-face {
  outline: 3px solid rgba(239, 108, 174, 0.96);
  outline-offset: 4px;
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.18),
    inset 2px 2px 5px rgba(255, 255, 255, 0.75),
    0 0 0 2px rgba(255, 255, 255, 0.48),
    0 0 22px rgba(239, 108, 174, 0.44);
}

.tray-die.passive-tray-selected {
  cursor: pointer;
}

.tray-die.passive-tray-selected:hover {
  transform: translateY(-1px);
}

.passive-waiting-avatars {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateX(-50%);
}

.passive-pick-avatars {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.passive-waiting-avatar,
.passive-pick-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: #343842;
  box-shadow:
    0 0 0 1px rgba(37, 39, 48, 0.72),
    0 4px 10px rgba(0, 0, 0, 0.34);
}

.passive-waiting-avatar {
  width: 24px;
  height: 24px;
  border-color: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 1px rgba(37, 39, 48, 0.72),
    0 0 14px rgba(239, 108, 174, 0.34),
    0 4px 10px rgba(0, 0, 0, 0.34);
}

.passive-waiting-avatar + .passive-waiting-avatar,
.passive-pick-avatar + .passive-pick-avatar {
  margin-left: -7px;
}

.passive-waiting-avatar .avatar-svg,
.passive-pick-avatar .avatar-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plus-die-tagged {
  overflow: visible;
}

.plus-die-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 12;
  display: flex;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.34));
}

.plus-die-label {
  display: grid;
  min-width: 24px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  color: #fff;
  background: #242936;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.36),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.plus-die-avatar {
  display: grid;
  width: 23px;
  height: 23px;
  margin-left: -5px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: #343842;
  box-shadow: 0 0 0 1px rgba(37, 39, 48, 0.72);
}

.plus-die-avatar .avatar-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pick-slot .plus-die-badge {
  top: -9px;
  right: -9px;
}

.tray-die.silver-auto-pending:not(.silver-auto-selected) .die-face {
  outline: 2px dashed rgba(239, 108, 174, 0.92);
  outline-offset: 3px;
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.18),
    inset 2px 2px 5px rgba(255, 255, 255, 0.75),
    0 0 18px rgba(239, 108, 174, 0.34);
}

.tray-die.silver-auto-pending:not(:disabled):hover {
  transform: translateY(-1px);
}

.tray-die:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.tray-die.silver-auto-pending:disabled {
  opacity: 1;
}

.die-button.selected {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.die-button.unavailable {
  opacity: 1;
}

.die-button:disabled {
  cursor: not-allowed;
}

.die-button.rolling:disabled,
.die-button.roll-settled:disabled {
  cursor: wait;
}

.die-button.not-playable .die-face {
  opacity: 0.46;
  filter: saturate(0.62) brightness(1.06);
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.1),
    inset 2px 2px 5px rgba(255, 255, 255, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.14);
}

.die-button.not-playable .die-pip {
  opacity: 0.72;
}

.die-button.passive-discard .die-face {
  opacity: 0.66;
  filter: grayscale(1) saturate(0.08) brightness(0.96);
}

.die-button.passive-discard .die-pip {
  opacity: 0.54;
}

.die-button.not-playable::before,
.die-button.not-playable::after,
.die-button.not-playable .die-face::before,
.die-button.not-playable .die-face::after {
  content: none;
}

.die-button.rolling,
.die-button.roll-settled {
  opacity: 1;
  background: transparent;
}

.die-button.rolling {
  animation: none;
  transform: none;
}

.die-button.roll-settled {
  animation: none;
  transform: none;
}

.die-button.rolling .die-face {
  animation:
    small-die-value-shake 170ms steps(2, end) infinite,
    die-glow 520ms ease-in-out infinite;
}

.die-button.rolling .die-face::after {
  content: none;
}

.die-button.rolling .die-pip {
  animation: pip-flash 124ms ease-in-out infinite alternate;
}

.die-button.roll-settled .die-face {
  animation: small-die-settle 260ms ease-out both;
}

.die-face {
  position: relative;
  display: block;
  overflow: hidden;
  --pip-size: 6px;
  --pip-inner: 28%;
  --pip-middle: 50%;
  --pip-outer: 72%;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #101218;
  background: var(--white);
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, 0.18),
    inset 2px 2px 5px rgba(255, 255, 255, 0.75),
    0 5px 12px rgba(0, 0, 0, 0.28);
  font-weight: 900;
}

.silver-tray .die-face {
  --pip-size: 7px;
  width: 38px;
  height: 38px;
}

.dice-tray .die-face {
  --pip-size: 16%;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.empty-die {
  display: grid;
  place-items: center;
}

.die-pip {
  position: absolute;
  width: var(--pip-size);
  height: var(--pip-size);
  border-radius: 50%;
  background: #11141b;
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
}

.die-pip.tl {
  left: var(--pip-inner);
  top: var(--pip-inner);
}

.die-pip.tr {
  left: var(--pip-outer);
  top: var(--pip-inner);
}

.die-pip.ml {
  left: var(--pip-inner);
  top: var(--pip-middle);
}

.die-pip.mr {
  left: var(--pip-outer);
  top: var(--pip-middle);
}

.die-pip.c {
  left: var(--pip-middle);
  top: var(--pip-middle);
}

.die-pip.bl {
  left: var(--pip-inner);
  top: var(--pip-outer);
}

.die-pip.br {
  left: var(--pip-outer);
  top: var(--pip-outer);
}

.roll-stage-die .die-face {
  --pip-size: 16px;
  --pip-inner: 28%;
  --pip-outer: 72%;
  width: 102px;
  height: 102px;
  border: 2px solid rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  box-shadow:
    inset -8px -10px 20px rgba(0, 0, 0, 0.22),
    inset 5px 5px 14px rgba(255, 255, 255, 0.82),
    0 0 34px var(--die-glow),
    0 22px 34px rgba(0, 0, 0, 0.46);
}

.roll-stage-die .die-pip {
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.42),
    0 2px 2px rgba(0, 0, 0, 0.28);
}

.stage-face .die-pip {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.76);
}

.stage-value-1 .die-pip.c,
.stage-value-2 .die-pip.tl,
.stage-value-2 .die-pip.br,
.stage-value-3 .die-pip.tl,
.stage-value-3 .die-pip.c,
.stage-value-3 .die-pip.br,
.stage-value-4 .die-pip.tl,
.stage-value-4 .die-pip.tr,
.stage-value-4 .die-pip.bl,
.stage-value-4 .die-pip.br,
.stage-value-5 .die-pip.tl,
.stage-value-5 .die-pip.tr,
.stage-value-5 .die-pip.c,
.stage-value-5 .die-pip.bl,
.stage-value-5 .die-pip.br,
.stage-value-6 .die-pip.tl,
.stage-value-6 .die-pip.tr,
.stage-value-6 .die-pip.ml,
.stage-value-6 .die-pip.mr,
.stage-value-6 .die-pip.bl,
.stage-value-6 .die-pip.br {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@keyframes dice-drop {
  0% {
    opacity: 0;
    transform: translateY(-440px) rotateX(78deg) rotateZ(-44deg) scale(0.48);
  }
  48% {
    opacity: 1;
    transform: translateY(26px) rotateX(-18deg) rotateZ(18deg) scale(1.18);
  }
  68% {
    transform: translateY(-14px) rotateX(12deg) rotateZ(-10deg) scale(0.92);
  }
  84% {
    transform: translateY(6px) rotateX(-6deg) rotateZ(5deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) rotateZ(0deg) scale(1);
  }
}

@keyframes dice-land {
  0% {
    transform: translateY(-18px) scale(1.18);
  }
  42% {
    transform: translateY(12px) scale(0.84);
  }
  68% {
    transform: translateY(-5px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes die-tumble {
  0% {
    filter: brightness(1);
    transform: rotateZ(0deg) rotateY(0deg) scale(1);
  }
  50% {
    filter: brightness(1.24);
    transform: rotateZ(18deg) rotateY(14deg) scale(1.12);
  }
  100% {
    filter: brightness(1);
    transform: rotateZ(-18deg) rotateY(-14deg) scale(1);
  }
}

@keyframes small-die-value-shake {
  0% {
    filter: brightness(1);
    transform: translate(0, 0) rotateZ(-4deg) scale(1);
  }
  25% {
    filter: brightness(1.12);
    transform: translate(1px, -1px) rotateZ(7deg) scale(1.04);
  }
  55% {
    filter: brightness(1.2);
    transform: translate(-1px, 1px) rotateZ(-8deg) scale(1.03);
  }
  100% {
    filter: brightness(1);
    transform: translate(0, 0) rotateZ(4deg) scale(1);
  }
}

@keyframes stage-die-roll {
  0% {
    filter: brightness(1);
    transform: translateY(0) rotateZ(-4deg) scale(1);
  }
  50% {
    filter: brightness(1.16);
    transform: translateY(-5px) rotateZ(5deg) scale(1.04);
  }
  100% {
    filter: brightness(1);
    transform: translateY(0) rotateZ(-4deg) scale(1);
  }
}

@keyframes die-glow {
  0%,
  100% {
    box-shadow:
      inset -3px -4px 8px rgba(0, 0, 0, 0.18),
      inset 2px 2px 5px rgba(255, 255, 255, 0.75),
      0 5px 12px rgba(0, 0, 0, 0.28);
  }
  50% {
    box-shadow:
      inset -3px -4px 8px rgba(0, 0, 0, 0.12),
      inset 2px 2px 7px rgba(255, 255, 255, 0.95),
      0 0 26px rgba(246, 196, 69, 0.62),
      0 0 52px rgba(239, 108, 174, 0.42);
  }
}

@keyframes slot-scan {
  0% {
    transform: translateY(-72%);
  }
  100% {
    transform: translateY(72%);
  }
}

@keyframes pip-flash {
  0% {
    transform: translate(-50%, -50%) translate(-1px, 1px) scale(0.84);
    opacity: 0.34;
  }
  100% {
    transform: translate(-50%, -50%) translate(1px, -1px) scale(1.12);
    opacity: 1;
  }
}

@keyframes small-die-settle {
  0% {
    filter: brightness(1.35);
    transform: rotateZ(-5deg) scale(1.08);
  }
  58% {
    filter: brightness(1.1);
    transform: rotateZ(3deg) scale(0.96);
  }
  100% {
    filter: brightness(1);
    transform: rotateZ(0deg) scale(1);
  }
}

@keyframes settle-pop {
  0% {
    filter: brightness(1.5);
    transform: scale(1.32) rotateZ(-10deg);
  }
  46% {
    filter: brightness(1.2);
    transform: scale(0.88) rotateZ(5deg);
  }
  100% {
    filter: brightness(1);
    transform: scale(1) rotateZ(0deg);
  }
}

@keyframes casino-scan {
  0% {
    transform: translateX(-34px);
  }
  100% {
    transform: translateX(34px);
  }
}

@keyframes casino-stage-pulse {
  0% {
    filter:
      drop-shadow(0 20px 38px rgba(0, 0, 0, 0.62))
      drop-shadow(0 0 28px rgba(246, 196, 69, 0.26));
  }
  100% {
    filter:
      drop-shadow(0 24px 44px rgba(0, 0, 0, 0.68))
      drop-shadow(0 0 48px rgba(239, 108, 174, 0.4));
  }
}

@keyframes casino-light-rush {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 0 0, 114px 0;
  }
}

@keyframes passive-tray-glow {
  0% {
    filter: brightness(1.04);
  }
  100% {
    filter: brightness(1.14);
  }
}

@keyframes legal-move-glow {
  0% {
    filter: brightness(1.02);
  }
  100% {
    filter: brightness(1.1);
  }
}

@keyframes roll-button-sheen {
  0% {
    left: -70%;
    opacity: 0;
  }
  16% {
    opacity: 0.92;
  }
  58% {
    left: 122%;
    opacity: 0.74;
  }
  100% {
    left: 122%;
    opacity: 0;
  }
}

@keyframes landing-flare {
  0% {
    opacity: 0;
    transform: scaleX(0.32);
  }
  42% {
    opacity: 1;
    transform: scaleX(1.34);
  }
  100% {
    opacity: 0;
    transform: scaleX(1.9);
  }
}

@keyframes spectator-event-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spectator-die-taken {
  0% {
    opacity: 0;
    transform: translateY(-48px) rotateZ(-16deg) scale(0.62);
  }
  34% {
    opacity: 1;
    transform: translateY(10px) rotateZ(10deg) scale(1.18);
  }
  62% {
    transform: translateY(-4px) rotateZ(-5deg) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateZ(0deg) scale(1);
  }
}

@keyframes spectator-die-placed {
  0% {
    opacity: 1;
    transform: translateY(0) rotateZ(0deg) scale(1);
    filter: brightness(1.2);
  }
  42% {
    opacity: 1;
    transform: translateY(-14px) rotateZ(7deg) scale(1.2);
    filter: brightness(1.55);
  }
  100% {
    opacity: 0;
    transform: translateY(72px) rotateZ(-18deg) scale(0.18);
    filter: brightness(0.8);
  }
}

@keyframes spectator-to-tray {
  0% {
    opacity: 0;
    transform: translate(-42vw, -24vh) rotateZ(-24deg) scale(2.15);
  }
  58% {
    opacity: 1;
    transform: translate(10px, -8px) rotateZ(8deg) scale(1.18);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes passive-die-pop {
  0% {
    opacity: 0;
    transform: translateY(28px) rotateZ(-10deg) scale(0.44);
  }
  54% {
    opacity: 1;
    transform: translateY(-8px) rotateZ(7deg) scale(1.14);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateZ(0deg) scale(1);
  }
}

@keyframes bonus-burst-in {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  94% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes bonus-light-left {
  0% {
    opacity: 0;
    transform: translate(-132vw, -58%) rotate(-8deg) scaleX(0.58);
  }
  18% {
    opacity: 0.95;
  }
  54% {
    opacity: 1;
    transform: translate(-50%, -58%) rotate(-8deg) scaleX(1.08);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -58%) rotate(-8deg) scaleX(1.08);
  }
  100% {
    opacity: 0.82;
    transform: translate(-50%, -58%) rotate(-8deg) scaleX(1.08);
  }
}

@keyframes bonus-light-right {
  0% {
    opacity: 0;
    transform: translate(36vw, -40%) rotate(8deg) scaleX(0.58);
  }
  18% {
    opacity: 0.9;
  }
  54% {
    opacity: 1;
    transform: translate(-50%, -40%) rotate(8deg) scaleX(1.08);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -40%) rotate(8deg) scaleX(1.08);
  }
  100% {
    opacity: 0.8;
    transform: translate(-50%, -40%) rotate(8deg) scaleX(1.08);
  }
}

@keyframes bonus-center-flash {
  0% {
    opacity: 0;
    transform: scale(0.44);
  }
  42% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

@keyframes bonus-content-rise {
  0%,
  18% {
    opacity: 0;
    transform: translateY(18px) scale(0.72);
    filter: blur(5px);
  }
  34% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
    filter: blur(0);
  }
  46%,
  94% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

@property --circle-sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

@keyframes bonus-label-glow {
  0%,
  100% {
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.72),
      0 -1px 0 rgba(255, 255, 255, 0.52),
      1px 0 0 rgba(255, 255, 255, 0.48),
      -1px 0 0 rgba(255, 255, 255, 0.48),
      0 8px 18px rgba(0, 0, 0, 0.56),
      0 0 12px rgba(246, 196, 69, 0.7),
      0 0 34px rgba(239, 108, 174, 0.3);
  }
  50% {
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.86),
      0 -1px 0 rgba(255, 255, 255, 0.64),
      1px 0 0 rgba(255, 255, 255, 0.58),
      -1px 0 0 rgba(255, 255, 255, 0.58),
      0 8px 20px rgba(0, 0, 0, 0.62),
      0 0 18px rgba(255, 255, 255, 0.95),
      0 0 46px rgba(246, 196, 69, 0.72),
      0 0 70px rgba(239, 108, 174, 0.42);
  }
}

@keyframes bonus-token-jackpot {
  0%,
  28% {
    transform: scale(0.26) rotate(-8deg);
  }
  48% {
    transform: scale(1.42) rotate(4deg);
  }
  60% {
    transform: scale(0.94) rotate(-2deg);
  }
  72% {
    transform: scale(1.08) rotate(0);
  }
  88%,
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes bonus-target-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.86),
      0 0 16px rgba(239, 108, 174, 0.74),
      0 0 34px rgba(246, 196, 69, 0.28),
      0 10px 22px rgba(0, 0, 0, 0.35);
    filter: brightness(1.06);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.98),
      0 0 28px rgba(239, 108, 174, 0.98),
      0 0 54px rgba(246, 196, 69, 0.46),
      0 12px 28px rgba(0, 0, 0, 0.46);
    filter: brightness(1.18);
  }
}

@keyframes bonus-focus-frame-pulse {
  0% {
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--bonus-focus-color) 0%, transparent),
      0 0 0 color-mix(in srgb, var(--bonus-focus-color) 0%, transparent),
      0 0 0 color-mix(in srgb, var(--bonus-focus-color) 0%, transparent),
      0 0 0 color-mix(in srgb, var(--bonus-focus-color) 0%, transparent);
  }

  32% {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--bonus-focus-color) 38%, transparent),
      0 0 24px color-mix(in srgb, var(--bonus-focus-color) 72%, transparent),
      0 0 58px color-mix(in srgb, var(--bonus-focus-color) 42%, transparent),
      0 0 96px color-mix(in srgb, var(--bonus-focus-color) 24%, transparent);
  }

  100% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--bonus-focus-color) 30%, transparent),
      0 0 18px color-mix(in srgb, var(--bonus-focus-color) 58%, transparent),
      0 0 40px color-mix(in srgb, var(--bonus-focus-color) 34%, transparent),
      0 0 72px color-mix(in srgb, var(--bonus-focus-color) 18%, transparent);
  }
}

@keyframes bonus-line-glow {
  0% {
    opacity: 0;
    transform: scale(0.985);
    filter: brightness(1);
  }

  14% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1.16);
  }

  72% {
    opacity: 0.9;
    transform: scale(1.006);
    filter: brightness(1.08);
  }

  100% {
    opacity: 0;
    transform: scale(1.012);
    filter: brightness(1);
  }
}

@keyframes bonus-line-sweep-horizontal {
  0% {
    opacity: 0;
    transform: translateX(-72%) skewX(-16deg);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(72%) skewX(-16deg);
  }
}

@keyframes bonus-line-sweep-vertical {
  0% {
    opacity: 0;
    transform: translateY(-72%) skewY(-10deg);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(72%) skewY(-10deg);
  }
}

@keyframes bonus-arrow-orb-right {
  0% {
    left: 0;
    opacity: 0;
    transform: translateY(-50%) scaleX(0.58) scaleY(0.52);
  }

  14% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1) scaleY(0.9);
  }

  76% {
    opacity: 1;
    transform: translateY(-50%) scaleX(0.82) scaleY(0.7);
  }

  88% {
    left: calc(100% - var(--bonus-arrow-fade-distance));
    opacity: 0.28;
    transform: translateY(-50%) scaleX(0.5) scaleY(0.38);
  }

  100% {
    left: calc(100% - var(--bonus-arrow-end-distance));
    opacity: 0;
    transform: translateY(-50%) scaleX(0.3) scaleY(0.2);
  }
}

@keyframes bonus-arrow-orb-down {
  0% {
    top: 0;
    opacity: 0;
    transform: translateX(-50%) scaleX(0.52) scaleY(0.58);
  }

  14% {
    opacity: 1;
    transform: translateX(-50%) scaleX(0.9) scaleY(1);
  }

  76% {
    opacity: 1;
    transform: translateX(-50%) scaleX(0.7) scaleY(0.82);
  }

  88% {
    top: calc(100% - var(--bonus-arrow-fade-distance));
    opacity: 0.28;
    transform: translateX(-50%) scaleX(0.38) scaleY(0.5);
  }

  100% {
    top: calc(100% - var(--bonus-arrow-end-distance));
    opacity: 0;
    transform: translateX(-50%) scaleX(0.2) scaleY(0.3);
  }
}

@keyframes bonus-arrow-orb-up {
  0% {
    top: calc(100% - var(--bonus-arrow-runner-length));
    opacity: 0;
    transform: translateX(-50%) scaleX(0.52) scaleY(0.58);
  }

  14% {
    opacity: 1;
    transform: translateX(-50%) scaleX(0.9) scaleY(1);
  }

  76% {
    opacity: 1;
    transform: translateX(-50%) scaleX(0.7) scaleY(0.82);
  }

  88% {
    top: var(--bonus-arrow-fade-distance);
    opacity: 0.28;
    transform: translateX(-50%) scaleX(0.38) scaleY(0.5);
  }

  100% {
    top: var(--bonus-arrow-end-distance);
    opacity: 0;
    transform: translateX(-50%) scaleX(0.2) scaleY(0.3);
  }
}

@keyframes bonus-arrow-field-pulse {
  0% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
    box-shadow: 0 0 0 color-mix(in srgb, var(--bonus-line-color) 0%, transparent);
  }

  46% {
    transform: scale(1.035);
    filter:
      brightness(1.12)
      saturate(1.08)
      drop-shadow(0 0 5px color-mix(in srgb, var(--bonus-line-color) 48%, transparent));
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--bonus-line-color) 28%, transparent),
      0 0 10px color-mix(in srgb, var(--bonus-line-color) 18%, transparent);
  }

  100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
    box-shadow: 0 0 0 color-mix(in srgb, var(--bonus-line-color) 0%, transparent);
  }
}

@keyframes yellow-arrow-body-charge {
  0% {
    box-shadow:
      0 0 8px rgba(246, 196, 69, 0.95),
      0 0 16px rgba(246, 196, 69, 0.45);
    filter: brightness(1);
  }

  62% {
    box-shadow:
      0 0 10px rgba(255, 255, 255, 0.82),
      0 0 14px rgba(246, 196, 69, 0.74);
    filter: brightness(1.16);
  }

  100% {
    box-shadow:
      0 0 8px rgba(246, 196, 69, 0.95),
      0 0 16px rgba(246, 196, 69, 0.45);
    filter: brightness(1);
  }
}

@keyframes silver-arrow-body-charge {
  0% {
    box-shadow:
      0 0 7px rgba(142, 146, 155, 0.85),
      0 0 14px rgba(255, 255, 255, 0.34);
    filter: brightness(1);
  }

  62% {
    box-shadow:
      0 0 10px rgba(255, 255, 255, 0.9),
      0 0 14px rgba(183, 192, 207, 0.68);
    filter: brightness(1.16);
  }

  100% {
    box-shadow:
      0 0 7px rgba(142, 146, 155, 0.85),
      0 0 14px rgba(255, 255, 255, 0.34);
    filter: brightness(1);
  }
}

@keyframes yellow-arrow-tip-nudge-right {
  0%,
  100% {
    transform: translateY(-50%);
  }

  48% {
    transform: translateY(-50%) scaleX(1.18) scaleY(1.08);
  }
}

@keyframes yellow-arrow-tip-nudge-down {
  0%,
  100% {
    transform: translateX(-50%);
  }

  48% {
    transform: translateX(-50%) scaleX(1.08) scaleY(1.18);
  }
}

@keyframes silver-arrow-tip-nudge-up {
  0%,
  100% {
    transform: translateX(-50%);
  }

  48% {
    transform: translateX(-50%) scaleX(1.08) scaleY(1.18);
  }
}

@keyframes bonus-target-discharge {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  22% {
    transform: scale(1.1);
    filter: brightness(1.28);
  }

  58% {
    transform: scale(1.02);
    filter: brightness(1.14);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes marker-stroke-draw {
  0% {
    opacity: 0.2;
    background-size:
      0% 100%,
      0% 100%;
    filter: blur(0.8px);
  }
  68% {
    opacity: 1;
    background-size:
      104% 100%,
      104% 100%;
    filter: blur(0.1px);
  }
  100% {
    opacity: 1;
    background-size:
      100% 100%,
      100% 100%;
    filter: none;
  }
}

@keyframes marker-circle-draw {
  0% {
    --circle-sweep: 0deg;
    opacity: 0.25;
    filter: blur(1px);
  }
  72% {
    --circle-sweep: 372deg;
    opacity: 1;
    filter: blur(0.1px);
  }
  100% {
    --circle-sweep: 360deg;
    opacity: 1;
    filter: none;
  }
}

@keyframes marker-number-write {
  0% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    filter: blur(1px);
    transform: translateY(-2px) rotate(-3deg);
  }
  38% {
    opacity: 1;
    clip-path: inset(0 0 46% 0);
    filter: blur(0.4px);
    transform: translateY(-1px) rotate(-2deg);
  }
  76% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: blur(0.1px);
    transform: translateY(0) rotate(1deg);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: none;
    transform: translateY(0) rotate(-1.5deg);
  }
}

@keyframes remote-cell-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0),
      0 0 0 color-mix(in srgb, var(--remote-highlight) 0%, transparent);
    filter: brightness(1);
    transform: scale(1);
  }
  12% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 12px color-mix(in srgb, var(--remote-highlight) 74%, transparent),
      0 0 26px color-mix(in srgb, var(--remote-highlight) 44%, transparent);
    filter: brightness(1.22);
    transform: scale(1.035);
  }
  46% {
    box-shadow:
      0 0 0 7px color-mix(in srgb, var(--remote-highlight) 34%, transparent),
      0 0 24px color-mix(in srgb, var(--remote-highlight) 42%, transparent),
      0 0 40px rgba(255, 255, 255, 0.18);
    filter: brightness(1.08);
    transform: scale(1.02);
  }
  78% {
    box-shadow:
      0 0 0 14px color-mix(in srgb, var(--remote-highlight) 14%, transparent),
      0 0 32px color-mix(in srgb, var(--remote-highlight) 22%, transparent);
    filter: brightness(1.03);
    transform: scale(1.006);
  }
  100% {
    box-shadow:
      0 0 0 22px color-mix(in srgb, var(--remote-highlight) 0%, transparent),
      0 0 44px color-mix(in srgb, var(--remote-highlight) 0%, transparent);
    filter: brightness(1);
    transform: scale(1);
  }
}

[data-color="yellow"] .die-face {
  background: var(--yellow);
}

[data-color="blue"] .die-face {
  color: #fff;
  background: var(--blue);
}

[data-color="green"] .die-face {
  background: var(--green);
}

[data-color="pink"] .die-face {
  background: var(--pink);
}

[data-color="silver"] .die-face {
  background: var(--silver);
}

[data-color="blue"] .die-pip,
[data-color="pink"] .die-pip,
[data-color="silver"] .die-pip {
  background: #f8f8fb;
}

.die-meta {
  color: var(--muted);
  font-size: 12px;
}

.pick-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--side-die-gap);
}

.pick-track.readonly .pick-slot {
  cursor: default;
}

.pick-slot {
  appearance: none;
  position: relative;
  display: grid;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  padding: 0;
  color: #101218;
  background: var(--white);
  font: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.pick-slot.filled {
  border-color: rgba(255, 255, 255, 0.92);
  color: #101218;
  background: var(--white);
}

.pick-slot.observed.filled,
.pick-slot.observed.pending {
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.pick-slot.pending {
  border-color: rgba(255, 255, 255, 0.92);
  background: var(--white);
}

.pick-slot.observed.pending {
  border-color: rgba(255, 255, 255, 0.88);
}

.pick-slot.pending:not(.observed) .die-face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 3px solid rgba(239, 108, 174, 0.94);
  border-radius: inherit;
  pointer-events: none;
}

.pick-slot.undoable {
  cursor: pointer;
}

.pick-slot.plus-selectable {
  cursor: pointer;
  border-color: rgba(239, 108, 174, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 2px rgba(239, 108, 174, 0.14),
    0 0 22px rgba(239, 108, 174, 0.34),
    0 8px 18px rgba(0, 0, 0, 0.22);
  animation: legal-move-glow 1180ms ease-in-out infinite alternate;
}

.pick-slot.plus-selectable:hover {
  transform: translateY(-1px);
}

.pick-slot.undoable:hover {
  background: var(--white);
  transform: translateY(-1px);
}

.pick-slot.undoable:hover .die-face::after {
  border-color: rgba(239, 108, 174, 1);
}

.pick-slot .die-face {
  --pip-size: 16%;
  place-self: stretch;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.pick-number {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #101218;
  background: var(--white);
  font-size: 12px;
  font-weight: 950;
}

.pick-slot small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.pick-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.silver-tray-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
}

body.spectator-roll-active .silver-tray-panel {
  position: relative;
  z-index: 1001;
  visibility: visible;
}

body.spectator-roll-active .silver-tray-panel .panel-title {
  color: rgba(255, 255, 255, 0.84);
}

.silver-tray {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  width: 100%;
  max-width: 250px;
  max-height: 250px;
  aspect-ratio: 1 / 1;
  gap: 8px;
  border: 2px solid rgba(230, 233, 240, 0.72);
  border-radius: 50%;
  padding: 18px 26px;
  background:
    radial-gradient(ellipse at 44% 34%, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.14) 37%, rgba(120, 125, 137, 0.24) 69%, rgba(8, 9, 12, 0.52) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(70, 74, 84, 0.22));
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.08),
    inset -18px -18px 34px rgba(0, 0, 0, 0.28),
    inset 14px 12px 24px rgba(255, 255, 255, 0.16),
    0 18px 38px rgba(0, 0, 0, 0.32);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

body.spectator-roll-active .silver-tray-panel .tray-die {
  opacity: 1;
}

.silver-skip-button {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.silver-skip-button:hover:not(:disabled) {
  border-color: rgba(239, 108, 174, 0.92);
  box-shadow: 0 0 0 2px rgba(239, 108, 174, 0.16);
}

.silver-skip-button[hidden] {
  display: none;
}

.passive-observer-badge {
  position: fixed;
  top: clamp(18px, 5vh, 54px);
  left: 50%;
  z-index: 1000;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #fff;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  text-shadow:
    0 3px 12px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(239, 108, 174, 0.58);
}

.passive-observer-badge strong {
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 950;
  line-height: 1;
}

.passive-observer-badge span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.silver-tray.passive-choice-active,
.silver-tray.legal-move {
  border-color: rgba(239, 108, 174, 0.96);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.1),
    inset -18px -18px 34px rgba(0, 0, 0, 0.24),
    inset 14px 12px 24px rgba(255, 255, 255, 0.18),
    0 18px 38px rgba(0, 0, 0, 0.32),
    0 0 0 4px rgba(239, 108, 174, 0.2),
    0 0 30px rgba(239, 108, 174, 0.62),
    0 0 68px rgba(239, 108, 174, 0.34);
  filter: brightness(1.08);
  animation: passive-tray-glow 1200ms ease-in-out infinite alternate;
}

.silver-tray-empty {
  display: grid;
  width: 112px;
  min-height: 38px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.action-panel {
  display: grid;
  gap: 8px;
}

.action-lobby-note {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) max-content max-content;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.action-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.action-label-token {
  flex: 0 0 auto;
}

.disabled-action {
  opacity: 0.58;
}

.action-hint {
  display: grid;
  place-items: center;
}

.action-track {
  display: grid;
  grid-template-columns: repeat(6, 24px);
  gap: 6px;
}

.action-circle {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  padding: 0;
  background: rgba(216, 219, 228, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
}

button.action-circle {
  appearance: none;
  cursor: pointer;
}

.action-circle.unlocked {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(234, 236, 242, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 0 10px rgba(246, 196, 69, 0.22);
}

.action-circle.legal-move:hover {
  transform: scale(1.08);
  filter: brightness(1.12);
}

.action-circle.armed {
  border-color: var(--pink);
  background: rgba(239, 226, 236, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 0 0 2px rgba(239, 108, 174, 0.24),
    0 0 22px rgba(239, 108, 174, 0.42);
}

.action-circle.legal-move:hover:not(.spent)::before,
.action-circle.legal-move:hover:not(.spent)::after,
.action-circle.armed:not(.spent)::before,
.action-circle.armed:not(.spent)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 118%;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.34);
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.2),
    0 0 6px rgba(17, 17, 17, 0.12);
  clip-path: polygon(0 42%, 5% 18%, 18% 27%, 31% 8%, 53% 17%, 77% 3%, 100% 28%, 96% 78%, 82% 68%, 63% 92%, 42% 75%, 20% 96%, 4% 74%);
  pointer-events: none;
}

.action-circle.legal-move:hover:not(.spent)::before,
.action-circle.armed:not(.spent)::before {
  transform: translate(-50%, -50%) rotate(43deg) scaleX(1);
}

.action-circle.legal-move:hover:not(.spent)::after,
.action-circle.armed:not(.spent)::after {
  transform: translate(-50%, -50%) rotate(-43deg) scaleX(1);
}

.action-circle.spent::before,
.action-circle.spent::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 128%;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.78), #0d0d0d 14%, #151515 48%, rgba(17, 17, 17, 0.86) 80%, rgba(17, 17, 17, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 3px, rgba(0, 0, 0, 0) 3px 9px);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    100% 100%;
  clip-path: polygon(0 42%, 5% 18%, 18% 27%, 31% 8%, 53% 17%, 77% 3%, 100% 28%, 96% 78%, 82% 68%, 63% 92%, 42% 75%, 20% 96%, 4% 74%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-origin: center;
  pointer-events: none;
}

.action-circle.spent::before {
  background-position:
    left center,
    left center;
  transform: translate(-50%, -50%) rotate(43deg) scaleX(1);
}

.action-circle.spent::after {
  background-position:
    right center,
    right center;
  transform: translate(-50%, -50%) rotate(-43deg) scaleX(1);
}

.action-circle.just-drawn-cross.spent,
.action-circle.remote-drawn {
  --remote-highlight: var(--pink);
  z-index: 22;
  animation: remote-cell-pulse 980ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.action-circle.just-drawn-cross.spent::before {
  animation: marker-stroke-draw 620ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.action-circle.just-drawn-cross.spent::after {
  animation: marker-stroke-draw 700ms cubic-bezier(0.16, 1, 0.3, 1) 280ms backwards;
}

.action-reward {
  display: grid;
  place-items: center;
}

.action-reward-token {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.38),
    0 0 12px rgba(255, 255, 255, 0.14);
}

.action-buttons {
  display: flex;
  gap: 5px;
}

.bonus-token {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  padding: 0;
  color: #fff;
  background: #3a4050;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 10px rgba(0, 0, 0, 0.25);
}

.bonus-token.unlocked-bonus {
  opacity: 1;
  filter: none;
}

.bonus-token.unlocked-bonus::before,
.bonus-token.unlocked-bonus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 132%;
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.78), #0d0d0d 14%, #151515 48%, rgba(17, 17, 17, 0.86) 80%, rgba(17, 17, 17, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 3px, rgba(0, 0, 0, 0) 3px 9px);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    100% 100%;
  clip-path: polygon(0 42%, 5% 18%, 18% 27%, 31% 8%, 53% 17%, 77% 3%, 100% 28%, 96% 78%, 82% 68%, 63% 92%, 42% 75%, 20% 96%, 4% 74%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-origin: center;
  pointer-events: none;
}

.bonus-token.unlocked-bonus::before {
  background-position:
    left center,
    left center;
  transform: translate(-50%, -50%) rotate(43deg) scaleX(1);
}

.bonus-token.unlocked-bonus::after {
  background-position:
    right center,
    right center;
  transform: translate(-50%, -50%) rotate(-43deg) scaleX(1);
  pointer-events: none;
}

.bonus-cross-delay .bonus-token.unlocked-bonus::before,
.bonus-cross-delay .bonus-token.unlocked-bonus::after {
  visibility: hidden;
  opacity: 0;
}

.bonus-cross-finish .bonus-token.unlocked-bonus::before {
  animation: marker-stroke-draw 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bonus-cross-finish .bonus-token.unlocked-bonus::after {
  animation: marker-stroke-draw 520ms cubic-bezier(0.16, 1, 0.3, 1) 140ms both;
}

.small-token {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  font-size: 10px;
}

.bonus-reroll {
  background: #30343d;
}

.bonus-retrieve {
  background: #1f2530;
}

.bonus-plus {
  background: #242936;
}

.bonus-choice {
  background: #05060a;
}

.round-chip .bonus-choice {
  color: #fff;
  background: #242936;
}

.bonus-silver-choice {
  background: #6e7582;
}

.bonus-fox {
  background: var(--danger);
}

.fox-icon {
  width: 20px;
  height: 20px;
  overflow: visible;
}

.small-token .fox-icon {
  width: 15px;
  height: 15px;
}

.fox-icon .fox-head {
  fill: var(--danger);
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.fox-icon .fox-mask {
  fill: #fff;
}

.bonus-yellow-choice {
  color: #20180a;
  background: var(--yellow);
}

.bonus-blue-choice {
  background: var(--blue);
}

.bonus-green-choice {
  color: #11200e;
  background: var(--green);
}

.bonus-pink-choice {
  background: var(--pink);
}

.bonus-queue {
  display: grid;
  grid-template-columns: repeat(var(--bonus-choice-count, 1), minmax(0, 1fr));
  gap: 8px;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
}

.bonus-token-button {
  --bonus-button-color: var(--pink);
  --bonus-button-glow: rgba(239, 108, 174, 0.66);
  --bonus-button-halo: rgba(239, 108, 174, 0.26);
  position: relative;
  display: grid;
  min-height: 48px;
  min-width: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--bonus-button-color) 78%, #fff 22%);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.08)),
    var(--bonus-button-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -8px 16px rgba(0, 0, 0, 0.16),
    0 10px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.bonus-token-button.legal-move:not(:disabled) {
  border-color: color-mix(in srgb, var(--bonus-button-color) 72%, #fff 28%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -9px 16px rgba(0, 0, 0, 0.18),
    0 0 0 2px var(--bonus-button-halo),
    0 0 26px var(--bonus-button-glow),
    0 12px 28px rgba(0, 0, 0, 0.22);
  animation: legal-move-glow 1180ms ease-in-out infinite alternate;
}

.bonus-token-button.legal-move:not(:disabled)::before {
  content: "";
  position: absolute;
  top: -55%;
  bottom: -55%;
  left: -70%;
  z-index: 0;
  width: 48%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 18%,
    rgba(255, 255, 255, 0.76) 50%,
    color-mix(in srgb, var(--bonus-button-color) 36%, transparent) 72%,
    transparent 100%
  );
  filter: blur(0.5px);
  transform: skewX(-18deg);
  animation: roll-button-sheen 1450ms ease-in-out infinite;
}

.bonus-token-button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.bonus-token-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.bonus-token-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.bonus-button-token {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 48px;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.icon-button {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-weight: 900;
}

.point-badge {
  --point-fill: #f4f6fa;
  position: relative;
  isolation: isolate;
  display: inline-grid;
  min-width: 38px;
  min-height: 34px;
  place-items: center;
  padding: 0 7px;
  color: #101218;
  background: #fff;
  clip-path: polygon(
    50% 0%,
    58% 16%,
    74% 8%,
    76% 26%,
    94% 26%,
    84% 42%,
    100% 50%,
    84% 58%,
    94% 74%,
    76% 74%,
    74% 92%,
    58% 84%,
    50% 100%,
    42% 84%,
    26% 92%,
    24% 74%,
    6% 74%,
    16% 58%,
    0% 50%,
    16% 42%,
    6% 26%,
    24% 26%,
    26% 8%,
    42% 16%
  );
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.75))
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34));
}

.point-badge::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: var(--point-fill);
  clip-path: inherit;
}

.point-badge-value {
  position: relative;
  z-index: 1;
}

.small-point {
  min-width: 34px;
  min-height: 30px;
  font-size: 12px;
}

.score-row.total {
  border: 1px solid rgba(239, 108, 174, 0.4);
  color: #fff;
  font-weight: 900;
  background: rgba(239, 108, 174, 0.16);
}

.log-panel {
  display: grid;
  max-height: 190px;
  gap: 6px;
  overflow: auto;
}

.log-entry {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.selected-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
}

.selected-label[hidden] {
  display: none;
}

.turn-controls .selected-label {
  width: 100%;
}

.topbar .selected-label {
  min-width: 210px;
}

.selected-label.ready {
  border-color: rgba(239, 108, 174, 0.45);
  color: #fff;
}

.mini-skip-button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.sheet-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

body.bonus-focus-active .sheet-scroll,
body.bonus-effect-active .sheet-scroll {
  overflow: visible;
}

.sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  width: var(--sheet-card-width);
  gap: 14px;
  align-items: stretch;
  justify-content: start;
  margin: 0 auto;
}

.field-card {
  position: relative;
  z-index: 1;
  isolation: isolate;
  --bonus-focus-color: var(--pink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.silver-field,
.yellow-field,
.blue-field,
.green-field,
.pink-field {
  width: fit-content;
  max-width: none;
  justify-self: start;
  overflow: visible;
}

body.bonus-focus-active .field-card {
  z-index: 1;
  overflow: visible;
  opacity: 0.34;
  filter: saturate(0.45) brightness(0.68);
}

body.bonus-focus-active .field-card.bonus-focus-area {
  z-index: 70;
  border-color: color-mix(in srgb, var(--bonus-focus-color) 78%, #fff 22%);
  opacity: 1;
  filter: none;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--bonus-focus-color) 30%, transparent),
    0 0 18px color-mix(in srgb, var(--bonus-focus-color) 58%, transparent),
    0 0 40px color-mix(in srgb, var(--bonus-focus-color) 34%, transparent),
    0 0 72px color-mix(in srgb, var(--bonus-focus-color) 18%, transparent);
  animation: bonus-focus-frame-pulse 1220ms ease-out both;
}

body.bonus-focus-active .bonus-focus-surface {
  position: relative;
  z-index: 2;
  isolation: isolate;
  border-radius: calc(var(--radius) - 1px);
}

body.bonus-focus-active .field-card.bonus-focus-area > * {
  position: relative;
  z-index: 2;
}

body.bonus-focus-active .bonus-focus-surface > :not(.silver-column-arrows) {
  position: relative;
  z-index: 2;
}

body.bonus-focus-active .bonus-focus-surface > .silver-column-arrows {
  position: absolute;
  z-index: 0;
}

body.bonus-effect-active .field-card {
  z-index: 1;
}

body.bonus-effect-active .field-card.bonus-effect-area {
  z-index: 62;
}

body.bonus-effect-active .field-card.bonus-focus-area {
  z-index: 70;
}

.wide-field {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
}

.field-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.field-title span {
  font-size: 18px;
  font-weight: 900;
}

.field-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rule-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #101218;
  background: #f7f8fb;
  cursor: pointer;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.rule-button:hover {
  transform: translateY(-1px);
}

.field-title small {
  color: var(--muted);
  font-size: 12px;
}

.field-title-meta {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  text-align: right;
}

.field-owner-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  padding: 0;
  background: rgba(38, 43, 53, 0.94);
  box-shadow:
    0 0 0 2px rgba(239, 108, 174, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  color: inherit;
  font: inherit;
}

.field-owner-avatar .avatar-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.silver-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  --bonus-focus-color: #b7c0cf;
  border-color: rgba(160, 164, 174, 0.75);
}

.yellow-field {
  --bonus-focus-color: var(--yellow);
  border-color: rgba(246, 196, 69, 0.8);
}

.blue-field {
  --bonus-focus-color: var(--blue);
  border-color: rgba(63, 110, 232, 0.8);
}

.green-field {
  --bonus-focus-color: var(--green);
  border-color: rgba(121, 201, 75, 0.8);
}

.pink-field {
  --bonus-focus-color: var(--pink);
  border-color: rgba(239, 108, 174, 0.85);
}

.silver-board {
  position: relative;
  --silver-gap: 7px;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: 0;
  align-content: space-between;
  row-gap: 8px;
  column-gap: var(--silver-gap);
}

.bonus-row,
.silver-row,
.silver-score-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(var(--field-size), 1fr));
  gap: var(--silver-gap);
  align-items: center;
  justify-items: center;
  justify-content: start;
}

.bonus-row {
  z-index: 3;
}

.silver-column-arrows {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 0;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(6, minmax(var(--field-size), 1fr));
  grid-template-rows: repeat(6, var(--field-size));
  column-gap: var(--silver-gap);
  row-gap: 8px;
  align-content: space-between;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.silver-column-arrow {
  position: relative;
  z-index: 2;
  display: block;
  width: 14px;
  height: auto;
  grid-row: 1 / 6;
  justify-self: center;
  align-self: stretch;
}

.silver-column-arrow::before,
.silver-column-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.silver-column-arrow::before {
  top: calc(var(--field-size) + 13px);
  bottom: 0;
  width: 3px;
  border-radius: 0;
  background: #fff;
  box-shadow:
    0 0 7px rgba(142, 146, 155, 0.85),
    0 0 14px rgba(255, 255, 255, 0.34);
}

.silver-column-arrow::after {
  top: calc(var(--field-size) + 5px);
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 8px solid #fff;
  border-left: 5px solid transparent;
  filter:
    drop-shadow(0 0 5px rgba(142, 146, 155, 0.9))
    drop-shadow(0 0 9px rgba(255, 255, 255, 0.36));
}

.bonus-cell,
.score-cell,
.row-label {
  position: relative;
  display: grid;
  width: var(--field-size);
  height: var(--field-size);
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  overflow: visible;
}

.bonus-cell.silver-top-bonus {
  background: transparent;
}

.silver-score-row .score-cell {
  background: transparent;
}

.silver-score-badge {
  color: #fff;
  --point-fill: var(--silver);
}

.silver-row .row-label {
  height: var(--field-height);
}

.row-label {
  color: #101218;
}

.row-label.yellow {
  background: var(--yellow);
}

.row-label.blue {
  color: #fff;
  background: var(--blue);
}

.row-label.green {
  background: var(--green);
}

.row-label.pink {
  background: var(--pink);
}

.mark-cell,
.track-cell,
.yellow-cell {
  --remote-highlight: var(--pink);
  position: relative;
  display: grid;
  width: var(--field-size);
  height: var(--field-height);
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--field-fill);
  cursor: pointer;
  font-weight: 900;
}

.mark-cell.remote-drawn,
.yellow-cell.remote-drawn,
.track-cell.remote-drawn,
.mark-cell.just-drawn-cross,
.yellow-cell.just-drawn-cross,
.yellow-cell.just-drawn-circle,
.track-cell.just-drawn-number {
  z-index: 22;
  animation: remote-cell-pulse 980ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.yellow-cell {
  --remote-highlight: var(--yellow);
}

.mark-cell {
  color: #151820;
}

.mark-cell.yellow {
  --remote-highlight: var(--yellow);
  border-color: var(--yellow);
  color: #d49100;
}

.mark-cell.blue {
  --remote-highlight: var(--blue);
  border-color: var(--blue);
  color: var(--blue);
}

.mark-cell.green {
  --remote-highlight: var(--green);
  border-color: var(--green);
  color: #438d26;
}

.mark-cell.pink {
  --remote-highlight: var(--pink);
  border-color: var(--pink);
  color: var(--pink);
}

.mark-cell.marked,
.yellow-cell.marked {
  background: var(--field-fill);
}

.mark-cell.marked::before,
.mark-cell.marked::after,
.yellow-cell.marked::before,
.yellow-cell.marked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 92%;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.78), #0d0d0d 14%, #151515 48%, rgba(17, 17, 17, 0.86) 80%, rgba(17, 17, 17, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 3px, rgba(0, 0, 0, 0) 3px 9px);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    100% 100%;
  clip-path: polygon(0 42%, 5% 18%, 18% 27%, 31% 8%, 53% 17%, 77% 3%, 100% 28%, 96% 78%, 82% 68%, 63% 92%, 42% 75%, 20% 96%, 4% 74%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-origin: center;
  pointer-events: none;
}

.mark-cell.marked::before,
.yellow-cell.marked::before {
  --stroke-rotation: 43deg;
  background-position:
    left center,
    left center;
  transform: translate(-50%, -50%) rotate(var(--stroke-rotation)) scaleX(1);
}

.mark-cell.marked::after,
.yellow-cell.marked::after {
  --stroke-rotation: -43deg;
  background-position:
    right center,
    right center;
  transform: translate(-50%, -50%) rotate(var(--stroke-rotation)) scaleX(1);
}

.mark-cell.just-drawn-cross.marked::before,
.yellow-cell.just-drawn-cross.marked::before {
  animation: marker-stroke-draw 680ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.mark-cell.just-drawn-cross.marked::after,
.yellow-cell.just-drawn-cross.marked::after {
  animation: marker-stroke-draw 760ms cubic-bezier(0.16, 1, 0.3, 1) 360ms backwards;
}

body.move-preview-active .mark-cell.can-preview-mark:not(.marked):hover::before,
body.move-preview-active .mark-cell.can-preview-mark:not(.marked):hover::after,
body.move-preview-active .yellow-cell.can-preview-cross:not(.marked):hover::before,
body.move-preview-active .yellow-cell.can-preview-cross:not(.marked):hover::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 92%;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.34);
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.2),
    0 0 6px rgba(17, 17, 17, 0.12);
  clip-path: polygon(0 42%, 5% 18%, 18% 27%, 31% 8%, 53% 17%, 77% 3%, 100% 28%, 96% 78%, 82% 68%, 63% 92%, 42% 75%, 20% 96%, 4% 74%);
  transform-origin: center;
  pointer-events: none;
}

body.move-preview-active .mark-cell.can-preview-mark:not(.marked):hover::before,
body.move-preview-active .yellow-cell.can-preview-cross:not(.marked):hover::before {
  transform: translate(-50%, -50%) rotate(43deg);
}

body.move-preview-active .mark-cell.can-preview-mark:not(.marked):hover::after,
body.move-preview-active .yellow-cell.can-preview-cross:not(.marked):hover::after {
  transform: translate(-50%, -50%) rotate(-43deg);
}

body.move-preview-active .yellow-cell.can-preview-circle:not(.marked):not(.circled):hover::before {
  content: "";
  position: absolute;
  inset: 4px 5px 6px 4px;
  z-index: 6;
  border: 3px solid rgba(17, 17, 17, 0.34);
  border-radius: 48% 52% 46% 54% / 53% 44% 56% 47%;
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 6px rgba(17, 17, 17, 0.12);
  transform: rotate(-7deg);
  pointer-events: none;
}

.track-cell.number-filled {
  background: var(--field-fill);
}

body.move-preview-active .track-cell.can-preview-number:not(.filled):hover .track-value::after {
  content: none;
}

.yellow-board {
  --yellow-col-gap: 4px;
  --yellow-row-gap: 2px;
  --yellow-map-pad: 8px;
  --yellow-play-gap: 5px;
  --yellow-board-gap: 7px;
  display: grid;
  gap: var(--yellow-board-gap);
}

.yellow-score-strip {
  display: grid;
  grid-template-columns: repeat(5, max-content);
  gap: 5px 7px;
  align-items: center;
  justify-content: start;
  overflow: visible;
  padding-bottom: 2px;
}

.yellow-score-item {
  display: grid;
  position: relative;
  justify-items: center;
  width: max-content;
  padding: 0 0 2px 6px;
}

.yellow-score-count {
  position: absolute;
  left: 0;
  bottom: 1px;
  z-index: 3;
  display: grid;
  min-width: 13px;
  height: 13px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #101218;
  background: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.yellow-score-badge {
  --point-fill: var(--yellow);
}

.yellow-play-area {
  display: grid;
  grid-template-columns: max-content var(--field-size);
  gap: var(--yellow-play-gap);
  align-items: start;
}

.yellow-map {
  position: relative;
  border-radius: var(--radius);
  padding: var(--yellow-map-pad);
  --yellow-arrow-size: 10px;
  --yellow-arrow-half: 6px;
  --yellow-width: calc(
    var(--field-size) + var(--field-size) + var(--field-size) + var(--field-size) +
      var(--yellow-col-gap) + var(--yellow-col-gap) + var(--yellow-col-gap)
  );
  --yellow-height: calc(
    var(--field-height) + var(--field-height) + var(--field-height) + var(--field-height) + var(--field-height) +
      var(--yellow-row-gap) + var(--yellow-row-gap) + var(--yellow-row-gap) + var(--yellow-row-gap)
  );
  --yellow-x0: calc(var(--field-size) / 2);
  --yellow-x1: calc(var(--field-size) + var(--yellow-col-gap) + var(--field-size) / 2);
  --yellow-x2: calc(var(--field-size) + var(--yellow-col-gap) + var(--field-size) + var(--yellow-col-gap) + var(--field-size) / 2);
  --yellow-x3: calc(var(--field-size) + var(--yellow-col-gap) + var(--field-size) + var(--yellow-col-gap) + var(--field-size) + var(--yellow-col-gap) + var(--field-size) / 2);
  --yellow-y0: calc(var(--field-height) / 2);
  --yellow-y1: calc(var(--field-height) + var(--yellow-row-gap) + var(--field-height) / 2);
  --yellow-y2: calc(var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) / 2);
  --yellow-y3: calc(var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) / 2);
  --yellow-y4: calc(var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) + var(--yellow-row-gap) + var(--field-height) / 2);
  --yellow-row-bonus-edge-x: calc(var(--yellow-width) + var(--yellow-map-pad) + var(--yellow-play-gap));
  --yellow-column-bonus-edge-y: calc(var(--yellow-height) + var(--yellow-map-pad) + var(--yellow-board-gap));
  background: transparent;
}

.yellow-cells {
  position: relative;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(4, var(--field-size));
  grid-template-rows: repeat(5, var(--field-height));
  gap: var(--yellow-row-gap) var(--yellow-col-gap);
}

.yellow-line-layer {
  position: absolute;
  top: var(--yellow-map-pad);
  left: var(--yellow-map-pad);
  z-index: 0;
  isolation: isolate;
  width: var(--yellow-row-bonus-edge-x);
  height: var(--yellow-column-bonus-edge-y);
  pointer-events: none;
}

.yellow-line {
  position: absolute;
  z-index: 2;
  border-radius: 0;
  background: #fff;
  box-shadow:
    0 0 8px rgba(246, 196, 69, 0.95),
    0 0 16px rgba(246, 196, 69, 0.45);
}

.yellow-line::after {
  content: "";
  position: absolute;
  background: #fff;
  filter:
    drop-shadow(0 0 6px rgba(246, 196, 69, 0.95))
    drop-shadow(0 0 12px rgba(246, 196, 69, 0.42));
}

.yellow-line.v1,
.yellow-line.v2,
.yellow-line.v3,
.yellow-line.v0 {
  width: 3px;
  transform: translateX(-50%);
}

.yellow-line.v1::after,
.yellow-line.v2::after,
.yellow-line.v3::after,
.yellow-line.v0::after {
  left: 50%;
  bottom: calc(-1 * var(--yellow-arrow-size));
  width: calc(var(--yellow-arrow-half) * 2);
  height: var(--yellow-arrow-size);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
}

.yellow-line.v0 {
  left: var(--yellow-x0);
  top: var(--yellow-y1);
  height: calc(var(--yellow-column-bonus-edge-y) - var(--yellow-y1) - var(--yellow-arrow-size));
}

.yellow-line.v1 {
  left: var(--yellow-x1);
  top: var(--yellow-y0);
  height: calc(var(--yellow-column-bonus-edge-y) - var(--yellow-y0) - var(--yellow-arrow-size));
}

.yellow-line.v2 {
  left: var(--yellow-x2);
  top: var(--yellow-y1);
  height: calc(var(--yellow-column-bonus-edge-y) - var(--yellow-y1) - var(--yellow-arrow-size));
}

.yellow-line.v3 {
  left: var(--yellow-x3);
  top: var(--yellow-y0);
  height: calc(var(--yellow-column-bonus-edge-y) - var(--yellow-y0) - var(--yellow-arrow-size));
}

.yellow-line.h1,
.yellow-line.h2,
.yellow-line.h3,
.yellow-line.h4,
.yellow-line.h0 {
  height: 3px;
  transform: translateY(-50%);
}

.yellow-line.h1::after,
.yellow-line.h2::after,
.yellow-line.h3::after,
.yellow-line.h4::after,
.yellow-line.h0::after {
  top: 50%;
  right: calc(-1 * var(--yellow-arrow-size));
  width: var(--yellow-arrow-size);
  height: calc(var(--yellow-arrow-half) * 2);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
}

.yellow-line.h0 {
  left: var(--yellow-x1);
  top: var(--yellow-y0);
  width: calc(var(--yellow-row-bonus-edge-x) - var(--yellow-x1) - var(--yellow-arrow-size));
}

.yellow-line.h1 {
  left: var(--yellow-x0);
  top: var(--yellow-y1);
  width: calc(var(--yellow-row-bonus-edge-x) - var(--yellow-x0) - var(--yellow-arrow-size));
}

.yellow-line.h2 {
  left: var(--yellow-x1);
  top: var(--yellow-y2);
  width: calc(var(--yellow-row-bonus-edge-x) - var(--yellow-x1) - var(--yellow-arrow-size));
}

.yellow-line.h3 {
  left: var(--yellow-x0);
  top: var(--yellow-y3);
  width: calc(var(--yellow-row-bonus-edge-x) - var(--yellow-x0) - var(--yellow-arrow-size));
}

.yellow-line.h4 {
  left: var(--yellow-x1);
  top: var(--yellow-y4);
  width: calc(var(--yellow-row-bonus-edge-x) - var(--yellow-x1) - var(--yellow-arrow-size));
}

.yellow-space {
  width: var(--field-size);
  height: var(--field-height);
}

.yellow-cell {
  color: #d49100;
  border-color: var(--yellow);
}

.yellow-value {
  position: relative;
  z-index: 2;
}

.yellow-circle {
  position: absolute;
  inset: 4px 5px 6px 4px;
  z-index: 3;
  border: 0;
  border-radius: 50%;
  pointer-events: none;
}

.yellow-circle::before,
.yellow-circle::after {
  --circle-sweep: 360deg;
  content: "";
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 48% 52% 46% 54% / 53% 44% 56% 47%;
  background: conic-gradient(from -90deg, #111 0deg var(--circle-sweep), transparent var(--circle-sweep) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px) calc(100% - 1px), transparent 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px) calc(100% - 1px), transparent 100%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.yellow-circle::before {
  opacity: 0.96;
}

.yellow-circle::after {
  inset: 2px 0 0 1px;
  opacity: 0.55;
}

.yellow-cell.just-drawn-circle .yellow-circle::before {
  animation: marker-circle-draw 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.yellow-cell.just-drawn-circle .yellow-circle::after {
  animation: marker-circle-draw 760ms cubic-bezier(0.16, 1, 0.3, 1) 160ms both;
}

.yellow-row-rewards,
.yellow-column-rewards {
  display: grid;
  gap: var(--yellow-row-gap);
}

.yellow-row-rewards {
  grid-template-rows: repeat(5, var(--field-height));
  padding-top: var(--yellow-map-pad);
}

.yellow-column-rewards {
  grid-template-columns: repeat(4, var(--field-size));
  gap: var(--yellow-row-gap) var(--yellow-col-gap);
  padding: 0 0 0 var(--yellow-map-pad);
}

.yellow-reward-cell {
  position: relative;
  display: grid;
  width: var(--field-size);
  height: var(--field-size);
  aspect-ratio: 1 / 1;
  place-items: center;
  align-self: center;
  overflow: visible;
}

.track-board {
  display: grid;
  width: max-content;
  grid-template-columns: repeat(12, var(--field-size));
  column-gap: var(--track-gap);
  row-gap: var(--track-row-gap);
  align-items: start;
  overflow: visible;
  padding-bottom: 18px;
}

.blue-track,
.green-track {
  grid-template-columns: repeat(12, var(--field-size));
  grid-template-rows: var(--track-score-height) var(--field-size);
  align-items: start;
}

.pink-track {
  grid-template-columns: repeat(12, var(--field-size));
  grid-template-rows: var(--field-size);
  column-gap: var(--track-gap);
}

.blue-unit {
  display: grid;
  grid-template-rows: var(--track-score-height) var(--field-size);
  gap: 5px;
}

.track-score-row {
  display: grid;
  place-items: center;
}

.track-score-row .point-badge {
  color: #fff;
  --point-fill: var(--blue);
}

.blue-entry {
  position: relative;
  display: grid;
}

.relation-mark {
  position: absolute;
  top: 45%;
  right: calc(-1 * (var(--track-gap) / 2 + 18px));
  z-index: 36;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  font-family: "Marker Felt", "Comic Sans MS", "Bradley Hand", cursive;
  font-size: 48px;
  font-weight: 900;
  line-height: 0.8;
  pointer-events: none;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(63, 110, 232, 0.95),
    0 0 16px rgba(63, 110, 232, 0.72);
  transform: translateY(-50%);
  pointer-events: none;
}

.green-track {
  position: relative;
}

.green-pair-decoration {
  display: grid;
  width: calc((var(--field-size) * 2) + var(--track-gap));
  height: var(--track-score-height);
  grid-row: 1;
  place-items: center;
  z-index: 7;
  pointer-events: none;
}

.green-pair-score {
  display: grid;
  place-items: center;
}

.green-score-badge {
  min-width: 34px;
  min-height: 30px;
  color: #11200e;
  --point-fill: var(--green);
}

.green-score-badge .point-badge-value {
  font-family: "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 4px rgba(255, 255, 255, 0.2);
  transform: rotate(-3deg) translateY(1px);
}

.green-minus {
  position: relative;
  display: grid;
  width: calc((var(--field-size) * 2) + var(--track-gap));
  height: var(--field-size);
  grid-row: 2 / 3;
  align-self: center;
  justify-self: center;
  place-items: center;
  color: #fff;
  font-size: 0;
  z-index: 8;
  pointer-events: none;
}

.green-minus::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(121, 201, 75, 0.95),
    0 0 16px rgba(121, 201, 75, 0.74);
  transform: translate(-50%, -50%);
}

.track-cell {
  overflow: visible;
  align-content: center;
  color: #151820;
}

.track-score,
.track-preview-value,
.track-hint,
.track-bonus {
  display: block;
  width: 100%;
  text-align: center;
}

.track-value {
  display: block;
  min-height: 22px;
  width: 100%;
  text-align: center;
}

.track-cell.number-filled .track-value {
  color: #111;
  font-family: "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  transform-origin: top center;
  text-shadow:
    0.45px 0 rgba(17, 17, 17, 0.18),
    -0.35px 0 rgba(17, 17, 17, 0.12),
    0 1px rgba(255, 255, 255, 0.1);
  transform: rotate(-1.5deg);
}

.track-cell.just-drawn-number .track-value {
  animation: marker-number-write 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.track-score {
  color: var(--text);
  font-size: 12px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.pink-track .track-cell.has-threshold .track-score {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(239, 108, 174, 0.34);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  text-shadow: none;
  pointer-events: none;
}

.pink-track .track-cell.has-threshold .track-value {
  position: relative;
  z-index: 1;
}

.green-track .track-cell .track-score {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(121, 201, 75, 0.34);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  text-shadow: none;
  pointer-events: none;
}

.green-track .track-cell .track-value {
  position: relative;
  z-index: 1;
}

.track-value,
.track-preview-value {
  font-size: 18px;
}

.track-preview-value {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(21, 24, 32, 0.42);
  font-family: "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 21px;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 7px rgba(17, 17, 17, 0.1);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  transform: scale(0.92) rotate(-1.5deg);
}

body.move-preview-active .track-cell.can-preview-number:not(.filled):hover .track-preview-value {
  opacity: 1;
  transform: scale(1) rotate(-1.5deg);
}

body.watching-other-board .sheet-scroll button {
  cursor: default;
}

body.watching-other-board .sheet-scroll button:disabled {
  opacity: 1;
}

body.watching-other-board .sheet-scroll button:hover {
  transform: none;
}

body.move-preview-active.bonus-focus-active .field-card.bonus-focus-area .track-cell.can-preview-number:not(.filled):hover .track-preview-value {
  opacity: 0.92;
  transform: scale(1) rotate(-1.5deg);
}

.track-hint,
.track-bonus {
  color: var(--muted);
  font-size: 11px;
}

.track-bonus {
  position: absolute;
  left: 50%;
  bottom: -12px;
  z-index: 8;
  width: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

.track-bonus:empty {
  display: none;
}

.blue-track .track-cell {
  --remote-highlight: var(--blue);
  border-color: var(--blue);
}

.green-track .track-cell {
  --remote-highlight: var(--green);
  border-color: var(--green);
}

.pink-track .track-cell {
  --remote-highlight: var(--pink);
  border-color: var(--pink);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483647;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  background: rgba(38, 43, 53, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

.bonus-burst {
  position: fixed;
  inset: 0;
  z-index: 70;
  isolation: isolate;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 5, 8, 0.08), rgba(4, 5, 8, 0.28)),
    radial-gradient(circle at center, rgba(246, 196, 69, 0.2), rgba(239, 108, 174, 0.08) 26%, rgba(0, 0, 0, 0) 58%);
  animation: bonus-burst-in 3100ms ease both;
}

.bonus-burst::before,
.bonus-burst::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 142vw;
  height: 136px;
  border: 0;
  clip-path: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, rgba(246, 196, 69, 0), rgba(246, 196, 69, 0.18) 30%, rgba(255, 255, 255, 0.92) 50%, rgba(239, 108, 174, 0.28) 70%, rgba(239, 108, 174, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  box-shadow:
    0 0 30px rgba(246, 196, 69, 0.55),
    0 0 80px rgba(239, 108, 174, 0.28);
  transform-origin: center;
  animation: bonus-light-left 1500ms cubic-bezier(0.18, 0.88, 0.28, 1) 70ms both;
}

.bonus-burst::after {
  height: 112px;
  background:
    linear-gradient(90deg, rgba(46, 103, 212, 0), rgba(46, 103, 212, 0.18) 28%, rgba(255, 255, 255, 0.88) 50%, rgba(246, 196, 69, 0.3) 72%, rgba(246, 196, 69, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  animation-name: bonus-light-right;
  animation-delay: 120ms;
}

.bonus-burst-content {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 16px;
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: bonus-content-rise 3900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bonus-burst-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -86px -130px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.9), rgba(246, 196, 69, 0.42) 18%, rgba(239, 108, 174, 0.12) 42%, rgba(0, 0, 0, 0) 68%);
  filter: blur(3px);
  animation: bonus-center-flash 1600ms ease-out 220ms both;
}

.bonus-burst-round {
  color: #fff;
  font-size: clamp(22px, 3.2vw, 42px);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(16, 18, 24, 0.72),
    0 8px 20px rgba(0, 0, 0, 0.72),
    0 0 18px rgba(246, 196, 69, 0.95),
    0 0 38px rgba(239, 108, 174, 0.7);
  animation: bonus-label-glow 920ms ease-in-out 220ms 2 both;
}

.bonus-burst-label {
  color: #101218;
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 -1px 0 rgba(255, 255, 255, 0.52),
    1px 0 0 rgba(255, 255, 255, 0.48),
    -1px 0 0 rgba(255, 255, 255, 0.48),
    0 8px 18px rgba(0, 0, 0, 0.56),
    0 0 12px rgba(246, 196, 69, 0.7),
    0 0 34px rgba(239, 108, 174, 0.3);
  animation: bonus-label-glow 920ms ease-in-out 380ms 2 both;
}

.bonus-burst-tokens {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.burst-token {
  width: 92px;
  height: 92px;
  min-width: 92px;
  min-height: 92px;
  border-width: 4px;
  border-radius: 12px;
  padding: 0;
  font-size: 34px;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.92),
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 20px 34px rgba(0, 0, 0, 0.72),
    0 7px 0 rgba(0, 0, 0, 0.36),
    0 0 34px rgba(246, 196, 69, 0.78),
    0 0 70px rgba(239, 108, 174, 0.34);
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.76));
  transform-origin: center;
  animation: bonus-token-jackpot 1900ms cubic-bezier(0.16, 1, 0.3, 1) 260ms both;
}

.burst-token .fox-icon {
  width: 62px;
  height: 62px;
}

.bonus-burst-count {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  margin-left: -8px;
  color: #fff;
  background: rgba(18, 20, 27, 0.9);
  font-size: 24px;
  font-weight: 950;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.78),
    0 7px 14px rgba(0, 0, 0, 0.82),
    0 0 12px rgba(246, 196, 69, 0.85),
    0 0 28px rgba(239, 108, 174, 0.45);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.62),
    0 0 22px rgba(246, 196, 69, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.38);
  animation: bonus-token-jackpot 1900ms cubic-bezier(0.16, 1, 0.3, 1) 320ms both;
}

.bonus-line-sweep {
  --bonus-line-color: var(--pink);
  position: fixed;
  z-index: 64;
  isolation: isolate;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--bonus-line-color) 68%, #fff 32%);
  border-radius: 12px;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--bonus-line-color) 20%, transparent), transparent 72%),
    color-mix(in srgb, var(--bonus-line-color) 5%, transparent);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.36),
    0 0 18px color-mix(in srgb, var(--bonus-line-color) 64%, transparent),
    0 0 42px color-mix(in srgb, var(--bonus-line-color) 28%, transparent);
  animation: bonus-line-glow 1120ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bonus-line-sweep::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -24%;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--bonus-line-color) 34%, transparent) 35%, rgba(255, 255, 255, 0.94) 50%, color-mix(in srgb, var(--bonus-line-color) 34%, transparent) 65%, transparent),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
}

.bonus-line-sweep.horizontal::before {
  width: 92%;
  animation: bonus-line-sweep-horizontal 980ms cubic-bezier(0.18, 0.88, 0.28, 1) 70ms both;
}

.bonus-line-sweep.vertical::before {
  height: 92%;
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--bonus-line-color) 34%, transparent) 35%, rgba(255, 255, 255, 0.94) 50%, color-mix(in srgb, var(--bonus-line-color) 34%, transparent) 65%, transparent),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  animation: bonus-line-sweep-vertical 980ms cubic-bezier(0.18, 0.88, 0.28, 1) 70ms both;
}

.bonus-line-silver {
  --bonus-line-color: #b7c0cf;
}

.bonus-line-yellow {
  --bonus-line-color: var(--yellow);
}

.mark-cell.bonus-arrow-field-pulse,
.yellow-cell.bonus-arrow-field-pulse {
  animation: bonus-arrow-field-pulse 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, filter;
}

.bonus-line-blue {
  --bonus-line-color: var(--blue);
}

.bonus-line-green {
  --bonus-line-color: var(--green);
}

.bonus-line-pink {
  --bonus-line-color: var(--pink);
}

.bonus-line-token {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-width: 3px;
  font-size: 17px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(0, 0, 0, 0.38),
    0 0 22px color-mix(in srgb, var(--bonus-line-color) 62%, transparent);
  animation: bonus-token-jackpot 1040ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.bonus-line-token .fox-icon {
  width: 28px;
  height: 28px;
}

.bonus-arrow-sweep {
  --bonus-line-color: var(--pink);
  --bonus-arrow-fade-distance: min(30px, 16%);
  --bonus-arrow-end-distance: min(26px, 14%);
  --bonus-arrow-runner-length: 30px;
  --bonus-arrow-runner-thickness: 10px;
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.bonus-arrow-sweep {
  overflow: hidden;
  mix-blend-mode: screen;
}

.bonus-arrow-sweep::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.68),
    0 0 14px var(--bonus-line-color),
    0 0 20px color-mix(in srgb, var(--bonus-line-color) 54%, transparent);
  filter:
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 9px color-mix(in srgb, var(--bonus-line-color) 62%, transparent));
}

.bonus-arrow-sweep.horizontal::before {
  width: var(--bonus-arrow-runner-length);
  height: var(--bonus-arrow-runner-thickness);
  top: 50%;
  left: -12px;
  transform-origin: center;
  background:
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 32%, transparent) 24%, color-mix(in srgb, var(--bonus-line-color) 78%, #fff) 50%, rgba(255, 255, 255, 0.98) 68%, transparent 100%),
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 24%, transparent) 42%, transparent 100%);
}

.bonus-arrow-sweep.vertical::before {
  width: var(--bonus-arrow-runner-thickness);
  height: var(--bonus-arrow-runner-length);
  top: -12px;
  left: 50%;
  transform-origin: center;
  background:
    linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 32%, transparent) 24%, color-mix(in srgb, var(--bonus-line-color) 78%, #fff) 50%, rgba(255, 255, 255, 0.98) 68%, transparent 100%),
    linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 24%, transparent) 42%, transparent 100%);
}

.bonus-arrow-sweep.direction-up::before {
  background:
    linear-gradient(0deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 32%, transparent) 24%, color-mix(in srgb, var(--bonus-line-color) 78%, #fff) 50%, rgba(255, 255, 255, 0.98) 68%, transparent 100%),
    linear-gradient(0deg, transparent 0%, color-mix(in srgb, var(--bonus-line-color) 24%, transparent) 42%, transparent 100%);
}

.bonus-arrow-sweep.direction-right::before {
  animation: bonus-arrow-orb-right 920ms cubic-bezier(0.19, 0.84, 0.24, 1) both;
}

.bonus-arrow-sweep.direction-down::before {
  animation: bonus-arrow-orb-down 920ms cubic-bezier(0.19, 0.84, 0.24, 1) both;
}

.bonus-arrow-sweep.direction-up::before {
  animation: bonus-arrow-orb-up 920ms cubic-bezier(0.19, 0.84, 0.24, 1) both;
}

.yellow-line.bonus-arrow-live {
  animation: yellow-arrow-body-charge 920ms ease both;
}

.silver-column-arrow.bonus-arrow-live::before {
  animation: silver-arrow-body-charge 920ms ease both;
}

.yellow-line.bonus-arrow-nudge-right::after {
  transform-origin: left center;
  animation: yellow-arrow-tip-nudge-right 240ms cubic-bezier(0.2, 1.36, 0.34, 1) both;
}

.yellow-line.bonus-arrow-nudge-down::after {
  transform-origin: center top;
  animation: yellow-arrow-tip-nudge-down 240ms cubic-bezier(0.2, 1.36, 0.34, 1) both;
}

.silver-column-arrow.bonus-arrow-nudge-up::after {
  transform-origin: center bottom;
  animation: silver-arrow-tip-nudge-up 240ms cubic-bezier(0.2, 1.36, 0.34, 1) both;
}

.bonus-reward-discharge {
  --bonus-line-color: var(--pink);
  position: relative;
  z-index: 26;
  overflow: visible;
  animation: bonus-target-discharge 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bonus-reward-discharge .bonus-token {
  animation: bonus-token-jackpot 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.32),
    0 0 20px color-mix(in srgb, var(--bonus-line-color) 58%, transparent);
}

.turn-intro {
  position: fixed;
  inset: 0;
  z-index: 77;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(4, 5, 8, 0.12), rgba(4, 5, 8, 0.5)),
    radial-gradient(ellipse at center, rgba(239, 108, 174, 0.18), rgba(255, 255, 255, 0.06) 32%, rgba(0, 0, 0, 0) 62%);
  backdrop-filter: blur(3px);
  animation: turn-intro-fade 2100ms ease both;
}

.turn-intro::before,
.turn-intro::after {
  content: "";
  position: absolute;
  z-index: 0;
  display: none;
  left: 50%;
  top: 50%;
  width: 136vw;
  height: 118px;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, rgba(239, 108, 174, 0), rgba(239, 108, 174, 0.32) 36%, rgba(255, 255, 255, 0.9) 50%, rgba(246, 196, 69, 0.22) 66%, rgba(246, 196, 69, 0));
  box-shadow:
    0 0 30px rgba(239, 108, 174, 0.52),
    0 0 86px rgba(246, 196, 69, 0.18);
  transform-origin: center;
  animation: turn-intro-light-left 1160ms cubic-bezier(0.18, 0.88, 0.28, 1) 140ms both;
}

.turn-intro::after {
  height: 92px;
  background:
    linear-gradient(90deg, rgba(220, 226, 238, 0), rgba(220, 226, 238, 0.22) 34%, rgba(255, 255, 255, 0.86) 50%, rgba(239, 108, 174, 0.3) 68%, rgba(239, 108, 174, 0));
  animation-name: turn-intro-light-right;
  animation-delay: 230ms;
}

.turn-intro.self-turn::before,
.turn-intro.self-turn::after {
  display: none;
}

.turn-intro-content {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  perspective: 900px;
  animation: turn-intro-rise 2100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.turn-intro-coin-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 20px);
  max-width: min(720px, calc(100vw - 36px));
  perspective: 900px;
  margin-bottom: -6px;
  transform: translateY(-12px);
}

.turn-intro-coin-wrap {
  position: relative;
  width: clamp(126px, 18vw, 184px);
  height: clamp(126px, 18vw, 184px);
  transform-style: preserve-3d;
  filter:
    drop-shadow(0 22px 18px rgba(0, 0, 0, 0.66))
    drop-shadow(0 0 28px rgba(239, 108, 174, 0.5));
}

.turn-intro.multi-turn-intro .turn-intro-coin-wrap {
  width: clamp(92px, 13vw, 146px);
  height: clamp(92px, 13vw, 146px);
}

.turn-intro-coin-wrap::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  filter: blur(10px);
  transform: rotateX(62deg);
  animation: turn-intro-shadow 2100ms ease both;
}

.turn-intro-coin {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: turn-intro-coin 2100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.turn-intro-coin::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background:
    conic-gradient(from 32deg, #f6c445, #fff3a7, #ef6cae, #ffffff, #f6c445, #c9862f, #f6c445);
  transform: translateZ(-5px);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.62),
    inset 0 -18px 22px rgba(0, 0, 0, 0.28),
    0 0 34px rgba(239, 108, 174, 0.62),
    0 0 70px rgba(246, 196, 69, 0.28);
}

.turn-intro-coin-face {
  position: absolute;
  inset: 4px;
  display: grid;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  overflow: hidden;
  backface-visibility: hidden;
  background: #262b35;
  box-shadow:
    inset 0 0 0 4px rgba(239, 108, 174, 0.18),
    inset 0 -18px 20px rgba(0, 0, 0, 0.24);
}

.turn-intro-coin-front {
  transform: translateZ(6px);
}

.turn-intro-coin-back {
  color: #11141b;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 30%),
    linear-gradient(145deg, #ffe27d, #ef6cae 58%, #b83279);
  font-size: clamp(54px, 9vw, 92px);
  font-weight: 950;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.28);
  transform: rotateY(180deg) translateZ(6px);
}

.turn-intro-coin .avatar-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

@media (max-width: 540px) {
  .turn-intro.multi-turn-intro .turn-intro-coin-wrap {
    width: clamp(78px, 25vw, 112px);
    height: clamp(78px, 25vw, 112px);
  }
}

.turn-intro-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: min(820px, calc(100vw - 36px));
  color: #fff;
  text-shadow:
    0 4px 0 rgba(16, 18, 24, 0.76),
    0 14px 28px rgba(0, 0, 0, 0.74),
    0 0 24px rgba(239, 108, 174, 0.88);
}

.turn-intro-copy span {
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(16, 18, 24, 0.86),
    0 10px 20px rgba(0, 0, 0, 0.72),
    0 0 18px rgba(239, 108, 174, 0.9);
}

.turn-intro-copy strong {
  color: #fff;
  font-size: clamp(34px, 6vw, 76px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.turn-intro.self-turn .turn-intro-copy strong {
  color: #101218;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 -1px 0 rgba(255, 255, 255, 0.6),
    1px 0 0 rgba(255, 255, 255, 0.54),
    -1px 0 0 rgba(255, 255, 255, 0.54),
    0 8px 20px rgba(0, 0, 0, 0.62),
    0 0 22px rgba(246, 196, 69, 0.86),
    0 0 46px rgba(239, 108, 174, 0.48);
}

body.turn-intro-lock {
  cursor: wait;
}

@keyframes turn-intro-fade {
  0% {
    opacity: 0;
  }
  14%,
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes turn-intro-rise {
  0% {
    opacity: 0;
    transform: translateY(38px) scale(0.9);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  74% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
  }
}

@keyframes turn-intro-coin {
  0% {
    transform: rotateY(-92deg) rotateZ(-9deg) scale(0.72);
  }
  28% {
    transform: rotateY(24deg) rotateZ(5deg) scale(1.08);
  }
  44% {
    transform: rotateY(-10deg) rotateZ(-2deg) scale(1);
  }
  72% {
    transform: rotateY(0deg) rotateZ(0deg) scale(1);
  }
  100% {
    transform: rotateY(76deg) rotateZ(8deg) scale(0.86);
  }
}

@keyframes turn-intro-shadow {
  0% {
    opacity: 0;
    transform: rotateX(62deg) scaleX(0.52);
  }
  30%,
  74% {
    opacity: 1;
    transform: rotateX(62deg) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: rotateX(62deg) scaleX(0.7);
  }
}

@keyframes turn-intro-light-left {
  0% {
    opacity: 0;
    transform: translate(-82%, -50%) rotate(-10deg) scaleX(0.2);
  }
  42% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-18%, -50%) rotate(-10deg) scaleX(1.2);
  }
}

@keyframes turn-intro-light-right {
  0% {
    opacity: 0;
    transform: translate(-18%, -50%) rotate(9deg) scaleX(0.2);
  }
  42% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate(-82%, -50%) rotate(9deg) scaleX(1.18);
  }
}

.passive-turn-burst {
  position: fixed;
  inset: 0;
  z-index: 73;
  isolation: isolate;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 5, 8, 0.1), rgba(4, 5, 8, 0.34)),
    radial-gradient(circle at center, rgba(239, 108, 174, 0.2), rgba(220, 226, 238, 0.12) 28%, rgba(0, 0, 0, 0) 60%);
  animation: bonus-burst-in 2600ms ease both;
}

.passive-turn-burst::before,
.passive-turn-burst::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 136vw;
  height: 118px;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, rgba(239, 108, 174, 0), rgba(239, 108, 174, 0.28) 34%, rgba(255, 255, 255, 0.86) 50%, rgba(220, 226, 238, 0.24) 68%, rgba(220, 226, 238, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
  box-shadow:
    0 0 32px rgba(239, 108, 174, 0.48),
    0 0 78px rgba(220, 226, 238, 0.24);
  transform-origin: center;
  animation: bonus-light-left 1380ms cubic-bezier(0.18, 0.88, 0.28, 1) 70ms both;
}

.passive-turn-burst::after {
  height: 94px;
  animation-name: bonus-light-right;
  animation-delay: 140ms;
}

.passive-turn-burst-content {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 14px;
  color: #fff;
  text-align: center;
  animation: bonus-content-rise 3000ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.passive-turn-burst-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -72px -118px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.78), rgba(239, 108, 174, 0.34) 22%, rgba(220, 226, 238, 0.14) 46%, rgba(0, 0, 0, 0) 70%);
  filter: blur(3px);
  animation: bonus-center-flash 1450ms ease-out 200ms both;
}

.passive-turn-title {
  color: #fff;
  font-size: clamp(28px, 5vw, 66px);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(16, 18, 24, 0.76),
    0 10px 22px rgba(0, 0, 0, 0.72),
    0 0 18px rgba(239, 108, 174, 0.95),
    0 0 42px rgba(220, 226, 238, 0.56);
  animation: bonus-label-glow 920ms ease-in-out 220ms 2 both;
}

.passive-turn-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow:
    0 4px 12px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(239, 108, 174, 0.5);
}

.game-dialog-backdrop {
  --dialog-accent: var(--pink);
  --dialog-accent-soft: rgba(239, 108, 174, 0.18);
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, var(--dialog-accent-soft), rgba(0, 0, 0, 0) 38rem),
    rgba(0, 0, 0, 0.68);
}

.dialog-reroll {
  --dialog-accent: var(--line);
  --dialog-accent-soft: rgba(255, 255, 255, 0.08);
}

.dialog-neutral,
.dialog-plain {
  --dialog-accent: var(--line);
  --dialog-accent-soft: rgba(255, 255, 255, 0);
}

.dialog-blue {
  --dialog-accent: var(--blue);
  --dialog-accent-soft: rgba(63, 110, 232, 0.2);
}

.dialog-green {
  --dialog-accent: var(--green);
  --dialog-accent-soft: rgba(121, 201, 75, 0.18);
}

.dialog-pink {
  --dialog-accent: var(--pink);
  --dialog-accent-soft: rgba(239, 108, 174, 0.2);
}

.game-dialog {
  position: relative;
  width: min(430px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    #171a22;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.54),
    0 0 38px var(--dialog-accent-soft);
}

.game-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--modal-close-size);
  margin-bottom: 10px;
  padding-right: calc(var(--modal-close-size) + 12px);
}

.game-dialog h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.05;
}

.game-dialog-message {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.38;
}

.game-dialog-message:empty {
  display: none;
}

.game-dialog-value-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.game-dialog-value {
  display: grid;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #fff;
  background: var(--dialog-accent);
  font: inherit;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.24),
    0 8px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.dialog-green .game-dialog-value {
  color: #11200e;
}

.game-dialog-value:hover,
.game-dialog-value:focus-visible {
  outline: 0;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--dialog-accent-soft),
    0 12px 22px rgba(0, 0, 0, 0.34);
}

.game-dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 16px;
}

.game-dialog-actions .primary-button,
.game-dialog-actions .ghost-button {
  min-width: 112px;
}

.rule-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.rule-modal {
  position: relative;
  width: min(560px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  background: #171a22;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.rule-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--modal-close-size);
  margin-bottom: 12px;
  padding-right: calc(var(--modal-close-size) + 12px);
}

.rule-modal h3 {
  margin: 0;
  font-size: 22px;
}

.rule-close {
  position: relative;
  display: grid;
  width: var(--modal-close-size);
  height: var(--modal-close-size);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
}

.rule-close::before,
.rule-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 0;
  background: currentColor;
  transform-origin: center;
}

.rule-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.rule-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.avatar-modal > .rule-close,
.room-lobby-modal-head .rule-close,
.room-settings-modal-head .rule-close,
.game-dialog-head .rule-close,
.rule-modal-head .rule-close,
.setup-modal-head .rule-close,
.end-modal-head .rule-close {
  position: absolute;
  top: var(--modal-close-inset);
  right: var(--modal-close-inset);
  z-index: 3;
}

.rule-modal ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.42;
}

.setup-modal-backdrop[hidden] {
  display: none;
}

.setup-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.setup-modal {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  background: #171a22;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.setup-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--modal-close-size);
  margin-bottom: 16px;
  padding-right: calc(var(--modal-close-size) + 12px);
}

.setup-modal h3 {
  margin: 0;
  font-size: 22px;
}

.player-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.player-choice {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.player-choice:hover,
.player-choice.selected {
  border-color: var(--pink);
  background: rgba(239, 108, 174, 0.16);
}

.person-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.person-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 30px;
}

.person-icon::before,
.person-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #f7f8fb;
}

.person-icon::before {
  top: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.person-icon::after {
  bottom: 1px;
  width: 18px;
  height: 16px;
  border-radius: 9px 9px 4px 4px;
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.end-modal-backdrop[hidden] {
  display: none;
}

.end-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.avatar-modal-backdrop,
.room-lobby-modal-backdrop,
.room-settings-modal-backdrop,
.player-profile-modal-backdrop,
.game-dialog-backdrop,
.rule-modal-backdrop,
.setup-modal-backdrop,
.end-modal-backdrop {
  background: rgba(5, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.end-modal {
  position: relative;
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #151922;
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.62),
    0 0 60px rgba(246, 196, 69, 0.18);
}

.end-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--modal-close-size);
  margin-bottom: 14px;
  padding-right: calc(var(--modal-close-size) + 12px);
}

.end-modal-head h3 {
  margin: 0;
  font-size: 24px;
}

.end-game-results {
  display: grid;
  gap: 16px;
}

.end-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  background:
    linear-gradient(110deg, rgba(63, 110, 232, 0.12), rgba(239, 108, 174, 0.1) 44%, rgba(246, 196, 69, 0.14)),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.end-hero::before,
.end-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  width: 44%;
  height: 82%;
  opacity: 0.75;
  filter: blur(1px);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.52), transparent 8%),
    conic-gradient(from 0deg, rgba(246, 196, 69, 0), rgba(246, 196, 69, 0.45), rgba(239, 108, 174, 0), rgba(63, 110, 232, 0.35), rgba(246, 196, 69, 0));
}

.end-hero::before {
  left: -16%;
  transform: translateY(-50%) rotate(-18deg);
}

.end-hero::after {
  right: -16%;
  transform: translateY(-50%) rotate(18deg);
}

.end-kicker {
  margin: 0;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.end-hero h2 {
  margin: 0;
  color: #fff;
  font-size: 64px;
  line-height: 0.92;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.42),
    0 0 28px rgba(246, 196, 69, 0.72),
    0 0 42px rgba(239, 108, 174, 0.38);
}

.end-total {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.end-total strong {
  color: #fff;
  font-size: 70px;
  font-weight: 950;
  line-height: 0.9;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.46);
}

.end-total span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.end-rank {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.end-rank strong {
  color: #fff;
  font-size: 24px;
  font-weight: 950;
}

.end-rank span,
.end-rank em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-size: 23px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.42));
}

.rating-star {
  position: relative;
  display: inline-block;
  width: 1em;
  color: rgba(255, 255, 255, 0.36);
}

.rating-star.full {
  color: #fff;
}

.rating-star.half::before {
  content: "★";
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
  color: #fff;
}

.end-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.end-player-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.end-player-card.winner {
  border-color: rgba(246, 196, 69, 0.62);
  box-shadow: 0 0 28px rgba(246, 196, 69, 0.16);
}

.end-player-head,
.end-player-stars,
.end-player-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.end-player-head span {
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.end-player-head strong {
  color: var(--yellow);
  font-size: 28px;
  line-height: 1;
}

.end-player-rank b {
  color: #fff;
  font-size: 14px;
}

.end-player-rank span,
.end-player-stars span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.end-player-stars .star-rating {
  font-size: 18px;
}

.end-area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.end-area-chip {
  --area-color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--area-color);
  border-radius: 6px;
  padding: 5px 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.16);
  font-size: 13px;
  font-weight: 900;
}

.end-area-chip b {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

.end-area-chip .fox-icon {
  width: 16px;
  height: 16px;
}

.end-area-silver {
  --area-color: var(--silver);
}

.end-area-yellow {
  --area-color: var(--yellow);
}

.end-area-blue {
  --area-color: var(--blue);
}

.end-area-green {
  --area-color: var(--green);
}

.end-area-pink {
  --area-color: var(--pink);
}

.end-area-fox {
  --area-color: #fff;
}

@media (max-width: 1240px) {
  :root {
    --field-size: 36px;
    --field-height: 36px;
    --track-gap: 10px;
    --track-score-height: 34px;
  }

  .app-shell {
    width: min(100% - 24px, 1120px);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 250px;
    justify-content: stretch;
    gap: 14px;
  }

  .topbar-right {
    grid-column: 2;
  }

  .brand-block h1 {
    font-size: 30px;
  }

  .top-score-chip {
    min-width: 68px;
    padding-inline: 7px;
  }

  .play-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px;
  }

  .side-panel {
    position: static;
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .sheet-scroll {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
  }

  .turn-controls {
    grid-column: 2;
    grid-row: 2;
    top: 12px;
    width: 250px;
  }

  .field-card {
    padding: 10px;
  }
}

@media (max-width: 900px) {
  :root {
    --field-size: 32px;
    --field-height: 32px;
    --track-gap: 8px;
    --track-score-height: 32px;
    --sheet-card-width: calc(var(--sheet-track-width) + 24px);
  }

  .app-shell {
    width: calc(100% - 18px);
    padding-bottom: 120px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 10px;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .brand-block h1 {
    font-size: 28px;
  }

  .top-score-strip {
    justify-content: flex-end;
    min-width: 0;
  }

  .topbar-right {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .play-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .turn-controls {
    position: sticky;
    top: 8px;
    z-index: 24;
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    padding: 10px;
    background: rgba(15, 17, 23, 0.94);
    backdrop-filter: blur(12px);
  }

  .turn-bonus-panel,
  .spectator-profile-panel,
  .turn-controls .room-panel {
    grid-column: 1 / -1;
  }

  .side-panel {
    display: contents;
  }

  .side-panel .panel-block,
  .silver-tray-panel {
    min-width: 0;
  }

  .side-panel .panel-block:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .side-panel .panel-block:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
  }

  .side-panel .panel-block:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .side-panel .panel-block:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .silver-tray-panel {
    grid-column: 1 / -1;
    grid-row: 5;
  }

  .sheet-scroll {
    grid-column: 1 / -1;
    grid-row: 6;
    width: 100%;
    padding-bottom: 8px;
  }

  .sheet-grid {
    margin: 0 auto;
  }

  .round-chip {
    min-height: 48px;
  }

  .dice-tray {
    grid-template-columns: repeat(6, minmax(0, 56px));
    justify-content: start;
  }

  .silver-tray {
    width: min(220px, 100%);
    max-width: 220px;
    max-height: 220px;
    padding: 16px 22px;
  }

  .track-cell.number-filled .track-value {
    font-size: 19px;
  }

  .relation-mark {
    right: calc(-1 * (var(--track-gap) / 2 + 15px));
    font-size: 42px;
  }

  .green-minus::before {
    width: 15px;
  }
}

@media (max-width: 600px) {
  :root {
    --field-size: 30px;
    --field-height: 30px;
    --track-gap: 6px;
    --track-score-height: 30px;
    --sheet-card-width: calc(var(--sheet-track-width) + 20px);
  }

  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(239, 108, 174, 0.16), transparent 18rem),
      linear-gradient(135deg, #0b0d12 0%, #171b23 52%, #090b0f 100%);
  }

  .profile-editor-top {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .avatar-preview {
    width: 78px;
  }

  .avatar-preview::after {
    width: 26px;
    font-size: 13px;
  }

  .welcome-profile-avatar {
    width: 92px;
  }

  .welcome-profile-card {
    position: static;
  }

  .avatar-modal {
    width: min(100%, 460px);
    padding: 12px;
  }

  .avatar-modal-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .avatar-modal-aside {
    width: min(100%, 240px);
    justify-self: center;
  }

  .avatar-modal-preview {
    width: 98px;
  }

  .avatar-control-row {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 6px;
  }

  .avatar-control-row.group-start {
    margin-top: 6px;
  }

  .avatar-stepper {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    min-height: 31px;
  }

  .avatar-stepper-button {
    width: 26px;
    height: 29px;
    font-size: 21px;
  }

  .avatar-stepper-value {
    gap: 5px;
    font-size: 10px;
  }

  .avatar-swatch-picker {
    min-height: 31px;
    gap: 5px;
    padding: 3px 0;
  }

  .avatar-swatch-button {
    width: 22px;
  }

  .avatar-swatch {
    width: 16px;
  }

  .app-shell {
    width: calc(100% - 12px);
    padding-top: 6px;
    overflow-x: hidden;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-right {
    grid-row: 2;
  }

  .brand-block h1 {
    font-size: 24px;
  }

  .top-score-strip {
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .topbar-right {
    width: 100%;
  }

  .top-score-chip {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 34px;
    padding: 5px 7px;
  }

  .top-score-chip strong {
    font-size: 15px;
  }

  .top-score-chip span {
    font-size: 9px;
  }

  .turn-controls {
    top: 6px;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .turn-bonus-panel,
  .spectator-profile-panel,
  .turn-controls .room-panel,
  .turn-controls .primary-button,
  .turn-controls .ghost-button {
    grid-column: 1;
  }

  .play-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-panel .panel-block:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .side-panel .panel-block:nth-child(2) {
    grid-column: 1;
    grid-row: 3;
  }

  .side-panel .panel-block:nth-child(3) {
    grid-column: 1;
    grid-row: 4;
  }

  .side-panel .panel-block:nth-child(4) {
    grid-column: 1;
    grid-row: 5;
  }

  .sheet-scroll {
    grid-column: 1;
    grid-row: 7;
  }

  .silver-tray-panel {
    grid-column: 1;
    grid-row: 6;
  }

  .turn-controls .primary-button,
  .turn-controls .ghost-button {
    min-height: 40px;
    padding-inline: 8px;
  }

  .panel-block {
    max-width: 100%;
    padding: 10px;
  }

  .round-chip {
    min-width: 0;
  }

  .panel-title {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .panel-title-with-avatar {
    min-height: 26px;
  }

  .panel-owner-avatar {
    width: 24px;
    height: 24px;
  }

  .field-card {
    padding: 8px;
  }

  .field-title {
    align-items: center;
    margin-bottom: 8px;
  }

  .field-title span {
    font-size: 16px;
  }

  .field-title small {
    display: none;
  }

  .field-owner-avatar {
    width: 26px;
    height: 26px;
  }

  .rule-button {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .yellow-board {
    --yellow-map-pad: 6px;
    --yellow-play-gap: 4px;
    --yellow-board-gap: 6px;
  }

  .point-badge {
    min-width: 26px;
    min-height: 26px;
  }

  .point-badge-value {
    font-size: 10px;
  }

  .bonus-token {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
  }

  .small-token {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }

  .track-cell.number-filled .track-value {
    font-size: 18px;
  }

  .roll-stage-dice {
    width: calc(100vw - 20px);
    gap: 8px;
    padding: 18px 8px;
  }

  .roll-stage-die {
    width: clamp(42px, 14vw, 74px);
    height: clamp(42px, 14vw, 74px);
  }

  .roll-stage-die .die-face {
    width: 100%;
    height: 100%;
  }

  .spectator-silver-flight {
    max-width: 52vw;
  }

  .roll-stage-spectator .roll-stage-picked-die,
  .spectator-picked-die {
    width: clamp(72px, 22vw, 92px);
    height: clamp(72px, 22vw, 92px);
  }

  .spectator-tray-die {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 420px) {
  :root {
    --field-size: 28px;
    --field-height: 28px;
    --track-gap: 5px;
    --track-score-height: 28px;
    --sheet-card-width: calc(var(--sheet-track-width) + 18px);
  }

  .app-shell {
    width: calc(100% - 8px);
  }

  .brand-block h1 {
    font-size: 22px;
  }

  .side-panel {
    display: contents;
  }

  .side-panel .panel-block,
  .silver-tray-panel {
    grid-column: 1 / -1;
  }

  .dice-tray {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .field-card {
    padding: 7px;
  }

  .sheet-grid {
    gap: 10px;
  }

  .yellow-score-strip {
    gap: 4px 5px;
  }

  .yellow-board {
    --yellow-col-gap: 3px;
    --yellow-row-gap: 2px;
  }

  .relation-mark {
    right: calc(-1 * (var(--track-gap) / 2 + 13px));
    font-size: 36px;
  }

  .green-score-badge {
    min-width: 28px;
    min-height: 25px;
  }

  .green-minus::before {
    width: 12px;
    height: 3px;
  }

  .setup-modal,
  .rule-modal,
  .game-dialog,
  .room-lobby-modal,
  .end-modal {
    width: calc(100vw - 20px);
    padding: 14px;
  }

  .player-choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lobby-code-block strong {
    font-size: 28px;
  }

  .lobby-seat {
    grid-template-columns: 1fr;
  }

  .lobby-seat.with-order {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .lobby-seat.with-order .lobby-seat-actions {
    grid-column: 2;
  }

  .lobby-seat-actions {
    width: 100%;
  }

  .lobby-ai-selector {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .welcome-panel {
    width: min(100%, 920px);
  }

  .welcome-layout {
    grid-template-columns: minmax(230px, 280px) minmax(0, 620px);
  }

  .welcome-profile-card,
  .welcome-side-stack {
    position: static;
  }

  .welcome-side-stack {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .welcome-panel {
    width: min(100%, 620px);
  }

  .welcome-layout {
    grid-template-columns: 1fr;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
  }

  .welcome-brand h1,
  .modal-game-logo {
    font-size: 32px;
  }
}
