:root {
  --ink: #172033;
  --muted: #5b6477;
  --paper: #fffaf0;
  --panel: #ffffff;
  --teal: #39c7d4;
  --blue: #4b7dff;
  --yellow: #ffe35e;
  --coral: #ff6f61;
  --green: #5ed17d;
  --shadow: 0 14px 0 rgba(23, 32, 51, 0.14);
  --border: 3px solid var(--ink);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 227, 94, 0.95), rgba(57, 199, 212, 0.88) 52%, rgba(255, 111, 97, 0.72)),
    var(--paper);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

img,
svg {
  -webkit-user-drag: none;
  user-select: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.app-shell {
  min-height: 100svh;
  padding: 18px;
}

.top-bar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 18px;
  max-width: 1120px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.brand small {
  color: rgba(23, 32, 51, 0.72);
  display: block;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.connection-pill,
.status-chip {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.14);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 7px 11px;
  text-transform: uppercase;
}

.connection-pill {
  appearance: none;
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.connection-pill .animal-avatar {
  height: 22px;
  width: 22px;
}

.connection-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-pill.is-online {
  background: var(--green);
}

.main-stage {
  margin: 0 auto;
  max-width: 1120px;
}

.screen {
  background: var(--panel);
  border: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.avatar-review-screen {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 4vw, 30px);
}

.avatar-review-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.avatar-review-head h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 0.95;
  margin: 0;
}

.avatar-review-head p {
  color: var(--muted);
  font-weight: 850;
  margin: 8px 0 0;
}

.avatar-review-back {
  flex: 0 0 auto;
}

.avatar-review-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.avatar-review-card {
  align-items: center;
  background: #f8fbff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 86px;
  padding: 10px;
}

.avatar-review-card .animal-avatar {
  height: 62px;
  width: 62px;
}

.avatar-review-meta {
  min-width: 0;
}

.avatar-review-name,
.avatar-review-animal {
  display: block;
}

.avatar-review-name {
  font-size: 1rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-review-animal {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-side {
  align-content: center;
  background:
    linear-gradient(180deg, rgba(75, 125, 255, 0.14), rgba(94, 209, 125, 0.2)),
    #ffffff;
  display: grid;
  min-height: 520px;
  padding: clamp(24px, 6vw, 58px);
  position: relative;
}

.hero-art {
  align-items: center;
  display: grid;
  gap: 18px;
  justify-items: start;
}

.hero-art img {
  height: min(42vw, 240px);
  width: min(42vw, 240px);
}

.hero-art h1,
.panel-title h1 {
  font-size: clamp(2.3rem, 8vw, 5rem);
  line-height: 0.94;
  margin: 0;
  max-width: 8ch;
}

.hero-art p,
.panel-title p {
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
  max-width: 34ch;
}

.form-side {
  background: #fff4c4;
  border-left: var(--border);
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.home-form-side {
  grid-template-rows: 1fr auto;
}

.home-form-side .choice-grid {
  min-height: 0;
}

.single-form-side {
  align-content: center;
}

.action-panel {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(23, 32, 51, 0.1);
  padding: 18px;
}

.choice-grid {
  align-content: center;
  display: grid;
  gap: 18px;
  min-height: 100%;
}

.choice-card {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  min-height: 128px;
  text-align: left;
  width: 100%;
}

.choice-card:hover {
  transform: translateY(-2px);
}

.choice-icon {
  align-items: center;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 1000;
  height: 58px;
  justify-content: center;
  line-height: 1;
  width: 58px;
}

.choice-title {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 1000;
  line-height: 1;
}

.copyright-line {
  align-items: center;
  align-self: end;
  color: rgba(23, 32, 51, 0.68);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 8px;
  justify-content: center;
  margin: 0;
  text-align: center;
}

.copyright-line a {
  color: inherit;
  text-decoration: none;
}

.copyright-line a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.github-link {
  align-items: center;
  display: inline-flex;
}

.github-icon {
  display: block;
  height: 14px;
  width: 14px;
}

.action-panel h2,
.compact-panel h2,
.dialog-head h2 {
  font-size: 1.2rem;
  margin: 0 0 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.toggle-field {
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr;
  padding: 12px;
  position: relative;
}

.toggle-field input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.toggle-control {
  align-self: center;
  background: #e6eefc;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  display: block;
  height: 30px;
  line-height: 0;
  position: relative;
  width: 54px;
}

.toggle-control::after {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  content: "";
  height: 22px;
  left: -1px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.16s ease;
  width: 22px;
}

.toggle-field input:checked + .toggle-control {
  background: linear-gradient(90deg, #ff4f5e 0 50%, #4b7dff 50% 100%);
}

.toggle-field input:checked + .toggle-control::after {
  transform: translate(27px, -50%);
}

.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field strong {
  font-weight: 950;
}

.toggle-field small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.text-input {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

.name-picker {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.name-random-button {
  align-items: center;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(23, 32, 51, 0.18);
  color: var(--ink);
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
  padding: 0;
  width: 46px;
}

.name-random-button svg {
  display: block;
  fill: none;
  height: 23px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3px;
  width: 23px;
}

.name-random-button circle {
  fill: currentColor;
  stroke: none;
}

.text-input.is-random-picked {
  animation: random-name-pop 0.28s ease;
}

@keyframes random-name-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025) rotate(-0.6deg);
  }
  100% {
    transform: scale(1);
  }
}

.word-list-input {
  line-height: 1.35;
  min-height: 120px;
  resize: vertical;
}

.game-id-field {
  gap: 8px;
}

.passcode-input {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto repeat(3, minmax(0, 1fr));
  max-width: 430px;
  position: relative;
  width: 100%;
}

.passcode-source {
  background: transparent;
  border: 0;
  caret-color: transparent;
  color: transparent;
  font-size: 16px;
  inset: 0;
  opacity: 0.01;
  padding: 0;
  position: absolute;
  width: 100%;
  z-index: 2;
}

.passcode-source:focus {
  outline: 0;
}

.passcode-cell {
  aspect-ratio: 1;
  background: #ffffff;
  border: 2px solid #cbd5ef;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(75, 125, 255, 0.08);
  color: var(--blue);
  display: grid;
  font-size: 40px;
  font-weight: 1000;
  line-height: 1;
  min-height: 58px;
  padding: 0;
  place-items: center;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  width: 100%;
}

.passcode-input:focus-within .passcode-cell.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(75, 125, 255, 0.16), inset 0 0 0 1px rgba(75, 125, 255, 0.1);
  outline: 0;
}

.passcode-separator {
  color: var(--blue);
  font-size: 1.5rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  width: 18px;
}

.field-hint {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 1em;
  text-transform: none;
}

.field-hint:not(.is-visible) {
  opacity: 0;
}

.primary-button,
.secondary-button,
.danger-button {
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(23, 32, 51, 0.18);
  color: var(--ink);
  display: inline-flex;
  font-weight: 950;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  text-decoration: none;
}

.primary-button {
  background: var(--yellow);
}

.secondary-button {
  background: #ffffff;
}

.danger-button {
  background: var(--coral);
  color: #ffffff;
}

.icon-button {
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.18);
  color: var(--ink);
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.game-layout,
.end-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 340px;
  padding: clamp(18px, 4vw, 30px);
}

.lobby-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  padding: clamp(18px, 4vw, 30px);
}

.panel-title {
  align-content: start;
  display: grid;
  gap: 14px;
}

.lobby-top-row {
  align-items: center;
  display: grid;
  gap: clamp(18px, 3vw, 36px);
  grid-template-columns: minmax(250px, 1fr) 460px;
}

.lobby-heading {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.lobby-heading h1 {
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 0.94;
  margin: 0;
}

.lobby-heading p {
  color: var(--muted);
  font-weight: 850;
  margin: 6px 0 0;
}

.lobby-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.join-reference-card {
  --join-qr-size: 96px;
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  justify-self: end;
  max-width: 460px;
  padding: 8px;
  width: 460px;
}

.join-reference-body {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: var(--join-qr-size) minmax(0, 1fr);
}

.join-reference-qr {
  align-content: center;
  align-self: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.join-reference-details {
  align-self: center;
  align-content: center;
  display: grid;
  gap: 6px;
  grid-template-rows: minmax(0, 1fr) 38px;
  height: var(--join-qr-size);
  min-width: 0;
}

.join-share-section {
  align-self: stretch;
}

.join-reference-section {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.join-reference-card .reference-label {
  font-size: 0.65rem;
  line-height: 1;
}

.reference-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.game-code {
  align-items: center;
  background: var(--yellow);
  border: var(--border);
  border-radius: 8px;
  display: inline-flex;
  font-size: clamp(2rem, 10vw, 4.4rem);
  font-weight: 1000;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  max-width: 100%;
  padding: 14px;
  width: fit-content;
  word-break: break-word;
}

.join-reference-card .game-code {
  font-size: clamp(1.35rem, 3vw, 1.5rem);
  min-height: 36px;
  padding: 3px 8px;
  width: 100%;
}

.qr-wrap {
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: grid;
  justify-items: center;
  padding: 12px;
}

.join-qr-wrap {
  background: transparent;
  border: 0;
  height: var(--join-qr-size);
  max-width: none;
  padding: 0;
  width: var(--join-qr-size);
}

.join-qr-wrap img {
  display: block;
  height: 100%;
  max-width: none;
  width: 100%;
}

.qr-wrap img {
  aspect-ratio: 1;
  max-width: 220px;
  width: 100%;
}

.copy-url-button {
  font-size: 0.86rem;
  line-height: 1;
  min-height: 38px;
  padding: 6px 10px;
  width: 100%;
}

.lobby-attendant-section {
  border-top: 2px solid rgba(23, 32, 51, 0.14);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

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

.lobby-attendant-count {
  align-items: center;
  background: #f8fbff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 950;
  min-height: 34px;
  padding: 5px 10px;
}

.lobby-setup-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.lobby-chip-button,
.lobby-language-control {
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.12);
  color: var(--ink);
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
}

.lobby-chip-button {
  cursor: pointer;
  font-weight: 950;
}

.lobby-chip-button.is-active {
  background: var(--green);
}

.lobby-chip-button.is-static,
.lobby-chip-button:disabled {
  cursor: default;
}

.lobby-control-label {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.lobby-language-control {
  position: relative;
}

.lobby-language-control::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink);
  content: "";
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-45%);
}

.lobby-language-select {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 950;
  max-width: 190px;
  min-width: 82px;
  outline: 0;
  padding: 0 14px 0 0;
}

.lobby-guide-dialog {
  background: #f8fbff;
  border: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  height: fit-content;
  max-height: min(640px, calc(100dvh - 32px));
  max-width: 620px;
  overflow: auto;
  padding: clamp(14px, 3vw, 22px);
  width: calc(100% - 28px);
}

.lobby-guide-dialog[open] {
  display: block;
}

.lobby-guide-dialog::backdrop {
  backdrop-filter: blur(3px);
  background: rgba(23, 32, 51, 0.48);
}

.lobby-guide-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lobby-guide-head h3,
.lobby-guide-head p {
  margin: 0;
}

.lobby-guide-head h3 {
  font-size: 1rem;
}

.lobby-guide-head p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  margin-top: 3px;
}

.lobby-guide-close {
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
}

.lobby-guide-form {
  align-content: start;
  display: grid;
  gap: 12px;
}

.lobby-guide-form .word-list-input {
  height: clamp(132px, 22dvh, 180px);
  max-height: 220px;
  min-height: 120px;
}

.lobby-guide-form .secondary-button {
  height: auto;
  min-height: 46px;
}

.lobby-guide-preview {
  background: #ffffff;
  border: 2px solid rgba(23, 32, 51, 0.14);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
}

.lobby-attendant-arena {
  background:
    linear-gradient(135deg, rgba(255, 227, 94, 0.36), rgba(57, 199, 212, 0.22) 56%, rgba(255, 111, 97, 0.22)),
    #f8fbff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  height: clamp(340px, calc(260px + var(--attendant-count, 1) * 8px), 640px);
  overflow: hidden;
  position: relative;
}

.lobby-attendant-arena.is-team-up {
  background:
    linear-gradient(
      90deg,
      rgba(255, 79, 94, 0.18) 0 calc(50% - 1px),
      rgba(23, 32, 51, 0.42) calc(50% - 1px) calc(50% + 1px),
      rgba(75, 125, 255, 0.18) calc(50% + 1px) 100%
    ),
    #f8fbff;
  height: clamp(460px, calc(340px + var(--attendant-count, 1) * 16px), 900px);
}

.lobby-attendant-arena.is-grid-layout {
  height: clamp(420px, calc(300px + var(--attendant-count, 1) * 16px), 1120px);
}

.lobby-attendant-arena.is-team-up.is-grid-layout {
  height: clamp(520px, calc(400px + var(--attendant-count, 1) * 15px), 1180px);
}

.lobby-attendant-arena.is-team-up::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(23, 32, 51, 0.78) 0 12px,
    rgba(23, 32, 51, 0.08) 12px 22px
  );
  content: "";
  height: 100%;
  left: calc(50% - 1px);
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 2px;
  z-index: 1;
}

.lobby-team-labels {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  left: 10px;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 3;
}

.lobby-team-label {
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid var(--team-color);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 1000;
  justify-self: start;
  line-height: 1;
  padding: 4px 8px;
  text-transform: uppercase;
}

.lobby-team-label:last-child {
  justify-self: end;
}

.lobby-attendant-token {
  align-items: center;
  display: grid;
  gap: 3px;
  justify-items: center;
  left: 0;
  min-width: 62px;
  padding: 3px;
  position: absolute;
  top: 0;
  transform-origin: 50% 56%;
  will-change: transform;
  z-index: 2;
}

.lobby-attendant-token.is-me {
  cursor: pointer;
}

.lobby-attendant-token.is-me:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.lobby-attendant-token.is-offline {
  opacity: 0.58;
}

.lobby-attendant-avatar {
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.14);
  display: inline-flex;
  padding: 2px;
  position: relative;
}

.lobby-attendant-token.is-team-red .lobby-attendant-avatar,
.lobby-attendant-token.is-team-blue .lobby-attendant-avatar {
  border-color: var(--team-color);
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.14);
}

.lobby-avatar-honors {
  align-items: flex-end;
  display: inline-flex;
  gap: 3px;
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: -17px;
  transform: translateX(-50%);
  width: max-content;
  z-index: 5;
}

.lobby-owner-crown,
.lobby-winner-trophy {
  filter: drop-shadow(0 2px 0 rgba(23, 32, 51, 0.26));
  overflow: visible;
  position: relative;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3px;
}

.lobby-honor-fill {
  fill: var(--yellow);
}

.lobby-honor-line {
  fill: none;
}

.lobby-owner-crown {
  height: 20px;
  transform: rotate(-6deg);
  width: 26px;
}

.lobby-winner-trophy {
  height: 21px;
  transform: rotate(7deg);
  width: 24px;
}

.lobby-avatar-honors .lobby-owner-crown:first-child:last-child,
.lobby-avatar-honors .lobby-winner-trophy:first-child:last-child {
  transform: rotate(0deg);
}

.lobby-attendant-avatar .animal-avatar {
  height: 40px;
  width: 40px;
}

.lobby-attendant-name {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(23, 32, 51, 0.2);
  border-radius: 8px;
  color: var(--ink);
  display: -webkit-box;
  font-size: 0.66rem;
  font-weight: 950;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.02;
  max-width: 86px;
  min-height: 24px;
  overflow: hidden;
  padding: 3px 6px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lobby-attendant-token.is-me .lobby-attendant-name {
  background: var(--yellow);
  border-color: var(--ink);
}

.lobby-ready-state,
.lobby-attendant-score {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(23, 32, 51, 0.18);
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  position: absolute;
  z-index: 3;
}

.lobby-ready-state {
  bottom: -5px;
  height: 20px;
  left: -6px;
  width: 20px;
}

.lobby-ready-icon {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6px;
  width: 16px;
}

.lobby-ready-icon.is-ready {
  color: #0b7a46;
}

.lobby-ready-icon.is-not-ready {
  color: #a06700;
}

.lobby-attendant-score {
  bottom: -5px;
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 1000;
  line-height: 1;
  min-width: 24px;
  padding: 4px 6px;
  right: -8px;
}

.lobby-attendant-token.is-team-red .lobby-attendant-score,
.lobby-attendant-token.is-team-blue .lobby-attendant-score {
  border-color: var(--team-color);
}

.lobby-attendant-arena.is-grid-layout .lobby-attendant-token {
  min-width: 54px;
  padding: 2px;
}

.lobby-attendant-arena.is-grid-layout .lobby-avatar-honors {
  gap: 2px;
  top: -15px;
}

.lobby-attendant-arena.is-grid-layout .lobby-owner-crown {
  height: 17px;
  width: 22px;
}

.lobby-attendant-arena.is-grid-layout .lobby-winner-trophy {
  height: 18px;
  width: 20px;
}

.lobby-attendant-arena.is-grid-layout .lobby-attendant-avatar .animal-avatar {
  height: 34px;
  width: 34px;
}

.lobby-attendant-arena.is-grid-layout .lobby-attendant-name {
  font-size: 0.58rem;
  max-width: 72px;
  min-height: 22px;
  padding: 3px 5px;
}

.lobby-attendant-arena.is-grid-layout .lobby-ready-state {
  height: 18px;
  width: 18px;
}

.lobby-attendant-arena.is-grid-layout .lobby-ready-icon {
  height: 14px;
  width: 14px;
}

.lobby-attendant-arena.is-grid-layout .lobby-attendant-score {
  font-size: 0.58rem;
  min-width: 22px;
  padding: 4px 5px;
}

.lobby-arena-action-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  box-shadow: 0 6px 0 rgba(23, 32, 51, 0.1);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px;
}

.lobby-ready-copy {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

.lobby-ready-copy strong {
  font-size: 0.84rem;
  line-height: 1;
}

.lobby-ready-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.lobby-arena-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.lobby-camera-chip {
  background: #ffffff;
  border: 2px solid rgba(23, 32, 51, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  max-width: 210px;
  overflow: hidden;
  padding: 6px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-camera-chip.is-ready {
  background: rgba(94, 209, 125, 0.25);
  color: var(--ink);
}

.lobby-small-action {
  min-height: 36px;
  padding: 7px 12px;
}

.lobby-controls-panel {
  align-self: start;
}

.compact-panel {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(23, 32, 51, 0.1);
  padding: 16px;
}

.lobby-options {
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.lobby-options summary {
  background: #f8fbff;
  cursor: pointer;
  font-weight: 950;
  list-style-position: inside;
  padding: 12px;
}

.lobby-options-stack {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.lobby-option-card {
  border-top: 2px solid rgba(23, 32, 51, 0.14);
  padding-top: 12px;
}

.lobby-option-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.lobby-option-card h3 {
  font-size: 1rem;
  margin: 0;
}

.player-list,
.score-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.player-row,
.score-row {
  align-items: center;
  background: #f8fbff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
  min-height: 44px;
  padding: 8px 10px;
}

.score-rank {
  align-items: center;
  background: var(--teal);
  border: 2px solid var(--ink);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.player-avatar {
  align-items: center;
  display: inline-flex;
  min-height: 34px;
  justify-content: center;
  min-width: 34px;
}

.animal-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
}

.animal-avatar-wrap {
  display: inline-flex;
  flex: 0 0 auto;
}

.animal-avatar-ring {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid var(--avatar-ring-color, var(--ink));
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(23, 32, 51, 0.14);
  justify-content: center;
  padding: 2px;
}

.team-score-row .animal-avatar-ring,
.team-contributor-row .animal-avatar-ring {
  --avatar-ring-color: var(--team-color, var(--ink));
}

.animal-avatar.is-compact {
  height: 24px;
  width: 24px;
}

.animal-avatar-icon {
  display: block;
  height: 100%;
  overflow: visible;
  width: 100%;
}

.player-score-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.score-row .animal-avatar {
  height: 30px;
  width: 30px;
}

.score-row .animal-avatar.is-compact,
.team-contributor-row .animal-avatar {
  height: 24px;
  width: 24px;
}

.player-meta,
.score-name {
  min-width: 0;
}

.player-name,
.score-name {
  display: block;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-state {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
}

.score-value {
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 950;
  min-width: 44px;
  padding: 4px 8px;
  text-align: center;
}

.team-score-row {
  border-color: var(--team-color);
}

.team-score-row .score-rank,
.team-score-pill .team-badge-icon,
.team-badge-icon {
  background: var(--team-color);
  color: #ffffff;
}

.team-score-name,
.team-score-meta {
  display: block;
}

.team-score-name {
  font-weight: 950;
}

.team-score-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.final-team-score-row {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.final-team-main {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
}

.team-contributor-list {
  border-top: 1px solid rgba(23, 32, 51, 0.14);
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 2px 0 0;
  padding: 8px 0 0;
}

.team-contributor-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.team-contributor-name {
  font-size: 0.84rem;
  font-weight: 950;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-contributor-detail {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.team-contributor-score {
  background: #ffffff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 950;
  min-width: 38px;
  padding: 2px 6px;
  text-align: center;
}

.leaderboard-dialog .team-leaderboard-list {
  min-width: min(76vw, 420px);
}

.leaderboard-dialog .final-team-score-row {
  min-height: 0;
}

.team-badge {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  color: var(--ink);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 950;
  gap: 8px;
  min-height: 38px;
  padding: 5px 11px 5px 5px;
  text-transform: uppercase;
}

.team-badge.is-compact {
  min-height: 36px;
}

.team-badge-icon {
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 1000;
  height: 26px;
  justify-content: center;
  line-height: 1;
  width: 26px;
}

.target-panel {
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 227, 94, 0.55), rgba(255, 255, 255, 0.95)),
    #ffffff;
  border: var(--border);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  min-height: 330px;
  padding: clamp(18px, 4vw, 32px);
}

.target-kicker {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 950;
  text-transform: uppercase;
}

.target-word {
  font-size: clamp(2.7rem, 12vw, 7rem);
  font-weight: 1000;
  line-height: 0.95;
  margin: 0;
  overflow-wrap: anywhere;
}

.timer-bar {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  height: 20px;
  overflow: hidden;
}

.timer-fill {
  background: var(--green);
  height: 100%;
  transition: width 0.4s linear;
  width: 100%;
}

.capture-box {
  display: grid;
  gap: 12px;
}

.camera-lobby-status {
  display: grid;
  gap: 8px;
}

.camera-feed {
  aspect-ratio: 4 / 3;
  background: #172033;
  border: 2px solid var(--ink);
  border-radius: 8px;
  min-height: 180px;
  overflow: hidden;
  position: relative;
}

.camera-video {
  background: #172033;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.camera-shutter {
  bottom: 12px;
  left: 12px;
  position: absolute;
  right: 12px;
  width: calc(100% - 24px);
}

.camera-message {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  margin: 0;
}

body.is-game-active {
  background: #101827;
}

body.is-game-active .app-shell {
  padding: 0;
}

body.is-game-active .top-bar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 2px solid var(--ink);
  margin: 0;
  max-width: none;
  padding: 10px 14px;
}

body.is-game-active .main-stage {
  max-width: none;
}

.game-screen {
  background: #101827;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #ffffff;
  min-height: calc(100svh - 66px);
  position: relative;
}

.game-camera-video,
.game-camera-shade {
  inset: 0;
  position: absolute;
}

.game-camera-video {
  background: #101827;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.game-camera-shade {
  background:
    linear-gradient(180deg, rgba(10, 17, 31, 0.78), rgba(10, 17, 31, 0.28) 42%, rgba(10, 17, 31, 0.86)),
    linear-gradient(90deg, rgba(10, 17, 31, 0.45), rgba(10, 17, 31, 0.04) 48%, rgba(10, 17, 31, 0.45));
  pointer-events: none;
}

.urgency-alert {
  background: rgba(255, 22, 39, 0.55);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 2;
}

.urgency-alert.is-visible {
  animation: urgency-flash var(--alert-duration, 0.9s) linear infinite;
}

.game-overlay {
  display: grid;
  gap: 16px;
  grid-template-rows: auto 1fr auto;
  min-height: inherit;
  padding: 18px;
  position: relative;
  z-index: 3;
}

.game-exit-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  color: var(--ink);
  display: inline-flex;
  font-size: 1.18rem;
  font-weight: 1000;
  height: 34px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 18px;
  text-transform: uppercase;
  top: 18px;
  width: 34px;
  z-index: 4;
}

.game-exit-button:hover {
  background: var(--coral);
  color: #ffffff;
}

.game-hud {
  display: grid;
  gap: 12px;
  padding-right: 44px;
  max-width: 980px;
}

.game-hud-top,
.game-info-strip,
.game-action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-round-label,
.round-time,
.game-info-strip span {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  padding: 7px 11px;
  text-transform: uppercase;
}

.round-time {
  background: var(--yellow);
  font-family: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  text-align: center;
}

.game-target-word {
  color: #ffffff;
  font-size: 4.7rem;
  font-weight: 1000;
  line-height: 0.95;
  margin: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.22), 0 0 28px rgba(0, 0, 0, 0.42);
}

.target-word-row {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.18em;
}

.target-language-code {
  color: var(--yellow);
  font-family: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-size: 0.58em;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.22), 0 0 22px rgba(0, 0, 0, 0.42);
}

.target-object-text {
  overflow-wrap: anywhere;
}

.target-audio-button {
  align-items: center;
  appearance: none;
  background: var(--yellow);
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 0.76em;
  justify-content: center;
  margin-left: 0.08em;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  transform: translateY(-0.04em);
  width: 0.76em;
}

.target-audio-button:active {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  transform: translateY(0.02em);
}

.target-audio-icon {
  fill: none;
  height: 58%;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
  width: 58%;
}

.target-audio-icon path:first-child {
  fill: currentColor;
  stroke: currentColor;
}

.last-chance-warning {
  align-items: center;
  background: rgba(255, 22, 39, 0.92);
  border: 0 solid transparent;
  border-radius: 8px;
  box-shadow: none;
  color: #ffffff;
  display: inline-flex;
  font-weight: 1000;
  gap: 12px;
  height: 0;
  justify-content: center;
  max-width: 360px;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  text-transform: uppercase;
}

.last-chance-warning.is-visible {
  animation: last-chance-pulse var(--alert-duration, 0.9s) linear infinite;
  border-width: 2px;
  border-color: #ffffff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
  height: auto;
  min-height: 48px;
  opacity: 1;
  padding: 10px 14px;
}

.last-chance-time {
  font-family: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.game-hud .stack {
  max-width: 620px;
}

.global-toast-stack {
  align-content: start;
  display: grid;
  gap: 10px;
  justify-items: center;
  left: 50%;
  max-width: min(680px, calc(100vw - 24px));
  pointer-events: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  transform: translateX(-50%);
  width: calc(100vw - 24px);
  z-index: 80;
}

.game-toast {
  max-width: min(680px, 100%);
  width: fit-content;
  will-change: transform;
}

.game-toast-content {
  animation: toast-life 3s ease forwards;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-weight: 950;
  max-width: min(680px, 100%);
  padding: 12px 14px;
  text-align: center;
  will-change: opacity;
  width: fit-content;
}

.global-toast-stack .game-toast {
  max-width: 100%;
}

.global-toast-stack .game-toast-content {
  max-width: 100%;
}

.game-toast.is-success .game-toast-content {
  background: var(--green);
}

.game-toast.is-danger .game-toast-content {
  background: var(--coral);
  color: #ffffff;
}

.game-toast.is-warning .game-toast-content {
  background: var(--yellow);
}

.game-toast.is-target .game-toast-content {
  background: var(--teal);
}

.game-bottom-bar {
  align-self: end;
  display: grid;
  gap: 12px;
}

.game-score-strip {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  overflow-x: auto;
  padding: 5px 6px 8px;
}

.game-score-pill {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px 6px 12px;
}

.game-score-pill .animal-avatar {
  height: 24px;
  width: 24px;
}

.game-score-pill .animal-avatar-ring {
  margin-left: -4px;
}

.game-score-pill.is-me {
  background: var(--yellow);
}

.team-score-pill {
  border-color: var(--team-color);
}

.team-score-pill.is-me {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(255, 227, 94, 0.55), 0 4px 0 rgba(0, 0, 0, 0.18);
}

.game-score-name {
  font-weight: 950;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-score-value {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 1000;
  justify-content: center;
  min-width: 28px;
  padding: 3px 8px;
}

.game-shutter-button {
  flex: 1 1 280px;
  font-size: 1.2rem;
  min-height: 58px;
}

.game-flash-button {
  align-items: center;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 58px;
  min-width: 82px;
  overflow: visible;
  padding: 6px;
}

.game-flash-button.is-on {
  background: var(--yellow);
}

.game-skip-button {
  flex: 0 0 auto;
  min-height: 58px;
  min-width: 92px;
  padding-left: 12px;
  padding-right: 12px;
}

.game-skip-button.is-voted {
  background: #e6eefc;
}

.flashlight-icon {
  color: currentColor;
  flex: 0 0 auto;
  height: 42px;
  overflow: visible;
  width: 42px;
}

.flashlight-icon path {
  fill: currentColor;
}

@keyframes toast-life {
  0% {
    opacity: 0;
  }
  10%,
  84% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes urgency-flash {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.58;
  }
}

@keyframes last-chance-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.notice {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  padding: 10px 12px;
}

.winner-banner {
  align-items: start;
  background: var(--green);
  border: var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(23, 32, 51, 0.1);
  display: grid;
  gap: 12px;
  padding: clamp(18px, 4vw, 30px);
}

.winner-banner .status-chip {
  display: inline-flex;
  justify-self: start;
  line-height: 1;
}

.winner-banner h1 {
  font-size: clamp(2.4rem, 10vw, 5.5rem);
  line-height: 1;
  margin: 0;
  overflow-wrap: anywhere;
}

.leaderboard-dialog {
  border: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  max-width: 520px;
  width: calc(100% - 28px);
}

.leaderboard-dialog::backdrop {
  background: rgba(23, 32, 51, 0.45);
}

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

.leaderboard-content {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.leaderboard-game-id {
  align-items: center;
  background: #f8fbff;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 10px;
}

.leaderboard-game-id span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.leaderboard-game-id strong {
  font-size: 1.1rem;
  font-weight: 1000;
  letter-spacing: 0;
}

.game-menu-dialog {
  max-width: 420px;
}

.game-menu-content {
  margin-top: 14px;
}

.game-menu-stack {
  display: grid;
  gap: 12px;
}

.game-menu-summary {
  color: var(--muted);
  font-weight: 850;
  margin: 0;
}

.empty-state {
  color: var(--muted);
  font-weight: 850;
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .lobby-top-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .join-reference-card {
    justify-self: start;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 860px) {
  .screen-grid,
  .lobby-layout,
  .game-layout,
  .end-layout {
    grid-template-columns: 1fr;
  }

  .hero-side {
    min-height: 360px;
  }

  .form-side {
    border-left: 0;
    border-top: var(--border);
  }

  .lobby-heading {
    align-items: start;
    display: grid;
  }

  .lobby-status-row {
    justify-content: flex-start;
  }

  .join-reference-card {
    --join-qr-size: 96px;
  }

  .join-reference-body {
    grid-template-columns: var(--join-qr-size) minmax(0, 1fr);
  }

  .join-reference-card .game-code {
    font-size: clamp(1.65rem, 9vw, 2.6rem);
  }

  .game-screen {
    min-height: calc(100svh - 64px);
  }

  .game-target-word {
    font-size: 3.6rem;
  }

  .game-overlay {
    padding: 14px;
  }

  .game-exit-button {
    right: 14px;
    top: 14px;
  }

  .game-action-row {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
  }

  .avatar-review-head {
    align-items: start;
    display: grid;
  }

  .avatar-review-back {
    width: 100%;
  }

  .avatar-review-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    align-items: flex-start;
  }

  .brand img {
    height: 42px;
    width: 42px;
  }

  .connection-pill {
    max-width: 164px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.is-game-active .top-bar {
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
  }

  body.is-game-active .brand {
    flex: 0 1 auto;
    gap: 6px;
    min-width: 0;
  }

  body.is-game-active .brand img {
    height: 32px;
    width: 32px;
  }

  body.is-game-active .brand strong {
    font-size: 0.92rem;
    white-space: nowrap;
  }

  body.is-game-active .brand small {
    display: none;
  }

  body.is-game-active .top-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  body.is-game-active .top-actions .icon-button {
    font-size: 1rem;
    height: 38px;
    width: 38px;
  }

  body.is-game-active .connection-pill {
    font-size: 0.72rem;
    max-width: 136px;
    padding: 6px 8px;
  }

  body.is-game-active .game-screen {
    height: calc(100svh - 58px);
    min-height: 0;
  }

  body.is-game-active .game-overlay {
    min-height: 100%;
  }

  .hero-art img {
    height: 168px;
    width: 168px;
  }

  .passcode-input {
    gap: 6px;
  }

  .passcode-cell {
    font-size: 32px;
    min-height: 48px;
  }

  .passcode-separator {
    font-size: 1.25rem;
    width: 14px;
  }

  .join-reference-card {
    --join-qr-size: 96px;
    padding: 8px;
  }

  .join-reference-body {
    gap: 10px;
    grid-template-columns: var(--join-qr-size) minmax(0, 1fr);
  }

  .join-reference-qr {
    justify-items: center;
  }

  .join-reference-details {
    gap: 8px;
  }

  .join-reference-section {
    gap: 4px;
  }

  .join-reference-card .game-code {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
    min-height: 36px;
    padding: 3px 6px;
  }

  .copy-url-button {
    font-size: 0.78rem;
    line-height: 1;
    min-height: 38px;
    padding: 6px;
  }

  .lobby-attendant-head {
    align-items: flex-start;
    display: grid;
  }

  .lobby-setup-controls {
    justify-content: flex-start;
  }

  .lobby-language-select {
    max-width: 130px;
  }

  .lobby-guide-dialog {
    max-height: min(620px, calc(100dvh - 20px));
    padding: 12px;
    width: calc(100% - 20px);
  }

  .lobby-guide-form .word-list-input {
    height: clamp(124px, 24dvh, 168px);
  }

  .lobby-attendant-arena {
    height: clamp(390px, calc(300px + var(--attendant-count, 1) * 8px), 660px);
  }

  .lobby-attendant-arena.is-team-up {
    height: clamp(500px, calc(380px + var(--attendant-count, 1) * 18px), 980px);
  }

  .lobby-attendant-arena.is-grid-layout {
    height: clamp(520px, calc(360px + var(--attendant-count, 1) * 14px), 1120px);
  }

  .lobby-attendant-arena.is-team-up.is-grid-layout {
    height: clamp(620px, calc(420px + var(--attendant-count, 1) * 16px), 1280px);
  }

  .lobby-attendant-token {
    min-width: 56px;
  }

  .lobby-avatar-honors {
    gap: 2px;
    top: -15px;
  }

  .lobby-owner-crown {
    height: 17px;
    width: 22px;
  }

  .lobby-winner-trophy {
    height: 18px;
    width: 20px;
  }

  .lobby-attendant-avatar .animal-avatar {
    height: 34px;
    width: 34px;
  }

  .lobby-attendant-name {
    font-size: 0.56rem;
    max-width: 82px;
    min-height: 22px;
    padding: 3px 5px;
  }

  .lobby-ready-state {
    bottom: -5px;
    height: 18px;
    left: -6px;
    width: 18px;
  }

  .lobby-ready-icon {
    height: 14px;
    width: 14px;
  }

  .lobby-attendant-score {
    bottom: -5px;
    font-size: 0.58rem;
    min-width: 22px;
    padding: 4px 5px;
    right: -8px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-attendant-token {
    min-width: 48px;
    padding: 1px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-avatar-honors {
    top: -13px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-owner-crown {
    height: 15px;
    width: 19px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-winner-trophy {
    height: 16px;
    width: 18px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-attendant-avatar .animal-avatar {
    height: 30px;
    width: 30px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-attendant-name {
    font-size: 0.5rem;
    max-width: 64px;
    min-height: 20px;
    padding: 2px 4px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-ready-state {
    height: 16px;
    left: -5px;
    width: 16px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-ready-icon {
    height: 12px;
    width: 12px;
  }

  .lobby-attendant-arena.is-grid-layout .lobby-attendant-score {
    font-size: 0.52rem;
    min-width: 20px;
    padding: 3px 4px;
    right: -7px;
  }

  .lobby-arena-action-bar {
    align-items: stretch;
    display: grid;
  }

  .lobby-ready-copy {
    min-width: 0;
  }

  .lobby-arena-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .lobby-camera-chip {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
  }

  .lobby-small-action {
    width: 100%;
  }

  .lobby-team-labels {
    left: 8px;
    right: 8px;
    top: 7px;
  }

  .lobby-team-label {
    font-size: 0.54rem;
    padding: 4px 6px;
  }

  .game-target-word {
    font-size: 2.7rem;
  }

  .game-hud-top,
  .game-info-strip,
  .game-action-row {
    gap: 8px;
  }

  .game-action-row {
    flex-wrap: nowrap;
  }

  .game-info-strip span {
    font-size: 0.74rem;
  }

  .winner-banner {
    gap: 10px;
    padding: 18px;
  }

  .winner-banner h1 {
    font-size: clamp(2.1rem, 12vw, 3rem);
  }

  .team-badge {
    font-size: 0.72rem;
    gap: 5px;
    min-height: 32px;
    padding: 4px 8px 4px 4px;
  }

  .team-badge-icon {
    height: 22px;
    width: 22px;
  }

  .game-score-name {
    max-width: 104px;
  }

  .game-flash-button {
    flex: 0 0 64px;
    min-width: 0;
    padding: 5px;
  }

  .game-skip-button {
    flex: 0 0 78px;
    font-size: 0.82rem;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
  }

  .flashlight-icon {
    height: 40px;
    width: 40px;
  }

  .game-shutter-button {
    flex: 1 1 160px;
    font-size: 1rem;
    min-width: 0;
  }
}
