:root {
  --paper: #ffffff;
  --ink: #141414;
  --muted: #5c5c5c;
  --line: #141414;
  --tile: #ffffff;
  --amber: #fbab20;
  --amber-text: #8a5500;
  --track: #d9d9d9;
  --share: #1e1e1e;
  --red: #c41e34;
  --ready: #2f9e44;
  --font: "Inter", "Segoe UI", sans-serif;
  --logo: "Inter", "Segoe UI", sans-serif;
  --keys: "Inter", "Segoe UI", sans-serif;
  --col: 520px;
  --page-col: 426px;
  --page-block-top: max(1.5rem, calc(23.63vh - 70px));
  --label: clamp(0.75rem, 1.6vw, 1.25rem);
  --focus: var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

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

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

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

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  transform: none;
}

.sr-only,
.letter-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 1.5rem;
}

@media (min-width: 721px) {
  .app {
    height: 100vh;
    overflow: auto;
    padding-bottom: 5.5rem;
  }

  .game,
  .screen.is-active {
    min-height: 0;
  }

  #screen-play.is-active {
    margin-top: 0.5rem;
    gap: 0.7rem;
  }

  #screen-play.is-active .keyboard,
  #screen-join.is-active .keyboard {
    padding-top: 0.5rem;
    margin-bottom: 0;
  }
}

.game {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 28px clamp(1.25rem, 5vw, 69px) 0;
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.logo img {
  display: block;
  height: 32px;
  width: auto;
}

.mast-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1.35rem;
}

.nav-text {
  border: 0;
  background: transparent;
  padding: 8px 2px;
  min-height: 44px;
  font-family: var(--logo);
  font-weight: 700;
  font-size: 20px;
}

.nav-ppl {
  border: 0;
  background: transparent;
  color: #fbab20;
  font-family: var(--logo);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  height: 44px;
  min-width: 44px;
  padding: 0 2px;
}

.nav-ppl[aria-expanded="true"] {
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-restart {
  color: var(--amber-text);
}

.nav-restart:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-share {
  /* Hidden on all viewports. Restore with display: inline-flex. */
  display: none;
  align-items: center;
  gap: 0.55rem;
  height: 44px;
  min-width: 44px;
  padding: 0 14px 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--share);
  color: #fff;
  font-family: var(--logo);
  font-weight: 700;
  font-size: 17px;
}

.icon {
  display: grid;
  place-items: center;
  overflow: clip;
  flex-shrink: 0;
}

.icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-share {
  width: 16px;
  height: 14px;
}

.icon-shop {
  width: 20px;
  height: 20px;
}

.icon-arrow {
  width: 16px;
  height: 16px;
  overflow: visible;
}

.icon-arrow img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  transform: rotate(90deg);
}

.icon-badge {
  width: 25px;
  height: 25px;
}

.scoreboard {
  display: none;
  width: min(var(--page-col), calc(100% - 2.5rem));
  margin: var(--page-block-top) auto 0;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.scoreboard.is-on {
  display: flex;
  overflow: visible;
  padding-top: 1.1rem;
}

.score-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}

.pts-wrap {
  position: relative;
  display: inline-flex;
  align-items: baseline;
}

.score-gain {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--amber-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(6px) scale(0.5);
}

.score-gain.is-on {
  animation: score-gain-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.score-chip .name {
  font-size: var(--label);
  font-weight: 400;
  text-transform: lowercase;
  line-height: 1.25;
}

.score-chip .pts {
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.score-chip.is-current {
  color: var(--ink);
  border-bottom-color: var(--amber);
}

.score-chip.is-current .name {
  font-weight: 600;
}

.score-chip.is-current .pts {
  color: var(--amber-text);
}

.screen {
  width: min(var(--col), calc(100% - 2.5rem));
  margin: 2.4rem auto 0;
  flex-direction: column;
  gap: 1.15rem;
  flex: 1;
}

[hidden] {
  display: none !important;
}

.screen.is-active {
  display: flex;
}

#screen-setup.is-active,
#screen-mode.is-active,
#screen-online.is-active,
#screen-join.is-active,
#screen-kicked.is-active,
#screen-lobby.is-active {
  position: relative;
  width: min(var(--page-col), calc(100% - 2.5rem));
  gap: 0;
  justify-content: flex-start;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: var(--page-block-top);
}

#screen-play.is-active {
  width: min(640px, calc(100% - 2rem));
  align-items: center;
  margin-top: 1.5rem;
}

#screen-handoff.is-active {
  width: min(var(--page-col), calc(100% - 2.5rem));
  margin-top: 1.5rem;
}

#screen-results.is-active {
  margin-top: 1.5rem;
}

#setup-kicker {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  line-height: 15px;
}

.setup-roster {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 29px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.player-avatar {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  background: var(--track);
  user-select: none;
}

.player-colors {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.player-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.player-tools .player-colors {
  margin-top: 0;
}

.player-name-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.player-ai {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--ink);
  background: var(--tile);
  color: var(--ink);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
  text-align: center;
  white-space: pre-line;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.player-ai.is-on {
  background: var(--amber);
  color: var(--ink);
}

.player-ai:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ai-panel {
  width: min(626px, calc(100vw - 2rem));
  min-height: min(437px, calc(100vh - 2rem));
  background: #fff;
  border: 1px solid #000;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  font-family: "Montserrat", var(--font);
  overscroll-behavior: contain;
}

.ai-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.ai-kicker,
.ai-close {
  margin: 0;
  color: #c0c0c0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-close {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  cursor: pointer;
}

.ai-close:focus-visible,
.ai-choice:focus-visible,
.ai-remove:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.ai-remove {
  margin-top: auto;
  border: 0;
  background: transparent;
  padding: 0 4px;
  min-height: 44px;
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ai-remove[hidden] {
  display: none;
}

.ai-title {
  margin: 0;
  color: #000;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.ai-lede {
  margin: 0;
  width: min(367px, 100%);
  color: #c0c0c0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.ai-choices {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: min(522px, 100%);
  gap: 24px;
}

.ai-choice {
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.ai-choice-frame {
  width: 100%;
  max-width: 154px;
  aspect-ratio: 1;
  overflow: hidden;
}

.ai-choice-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-choice-frame-hard img {
  object-position: 40% 50%;
}

.ai-choice-year {
  color: #000;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.ai-choice.is-on .ai-choice-frame {
  outline: 4px solid var(--amber);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .ai-panel {
    min-height: 0;
    gap: 24px;
    padding: 16px;
  }

  .ai-title {
    font-size: 24px;
  }

  .ai-choices {
    gap: 12px;
  }

  .ai-kicker,
  .ai-close,
  .ai-lede,
  .ai-choice-year {
    font-size: 14px;
  }
}

.setup-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  padding: 0;
  flex-shrink: 0;
}

.color-swatch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.color-swatch.is-selected {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.color-swatch.is-taken {
  opacity: 0.35;
  cursor: not-allowed;
}

.color-swatch-custom {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  overflow: hidden;
  flex-shrink: 0;
}

.color-swatch-custom:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.color-swatch-custom input[type="color"] {
  position: absolute;
  inset: -6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.score-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.player-row .field {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.remove-player {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 8px;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center end;
}

.player-name-row .remove-player {
  align-self: stretch;
  margin-top: 0;
  height: 44px;
}

.remove-player:hover,
.remove-player:focus-visible {
  color: var(--red);
}

.player-name-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.player-row .field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}

.lobby-you {
  flex-shrink: 0;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.score-chip .lobby-you {
  margin-left: 6px;
  font-size: 10px;
}

.player-row .field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
}

.player-name-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--ink);
  background: var(--tile);
}

.player-name-wrap:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.player-name-edit {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0 10px 0 4px;
  color: var(--muted);
}

.player-name-edit:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.icon-pencil {
  width: 14px;
  height: 14px;
}

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

.player-row .field input::placeholder {
  color: var(--muted);
  text-transform: uppercase;
}

.setup-rounds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 28px;
}

.setup-rounds-copy {
  min-width: 0;
}

.setup-rounds-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.setup-rounds-hint {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
}

.setup-rounds-stepper {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  height: 44px;
  border: 1px solid var(--ink);
  background: var(--tile);
}

.setup-rounds-stepper button {
  width: 44px;
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.setup-rounds-stepper button:disabled {
  color: var(--muted);
  cursor: default;
}

.setup-rounds-stepper button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.setup-rounds-stepper span {
  min-width: 2.4rem;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 83px;
}

.add-player {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--ink);
  text-align: left;
}

.add-player:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.kicker {
  margin: 0;
  font-size: var(--label);
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
  letter-spacing: 0;
}

.headline {
  font-weight: 700;
  font-size: clamp(1.85rem, 6vw, 40px);
  line-height: 1.15;
  text-transform: lowercase;
  margin: 0;
  text-wrap: balance;
}

.headline-sm {
  font-size: clamp(1.6rem, 5vw, 32px);
}

.setup-title {
  text-transform: uppercase;
  font-size: 40px;
  line-height: 1;
  margin: 0;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 34rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: var(--tile);
}

.stepper button {
  width: 2.4rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  font-weight: 700;
}

.stepper .count {
  min-width: 2.2rem;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  font-weight: 700;
  font-size: 1.4rem;
}

.names {
  display: grid;
  gap: 0.55rem;
}

.field {
  display: grid;
  gap: 0.2rem;
}

.field label {
  font-size: var(--label);
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--tile);
  padding: 0.65rem 0.7rem;
  outline: none;
}

.field input:focus-visible {
  outline: none;
}

.player-name-wrap .player-name-input:focus-visible {
  outline: none;
}

.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  text-transform: lowercase;
  padding: 0 20px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  white-space: nowrap;
}

.btn:focus-visible,
.nav-text:focus-visible,
.nav-ppl:focus-visible,
.btn-share:focus-visible,
.shop-close:focus-visible,
.ppl-close:focus-visible,
.rules-view-pointsperletter:focus-visible,
.key:focus-visible,
.remove-player:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.headline:focus {
  outline: none;
}

.shop-close:focus-visible,
.shop-item-target select:focus-visible,
.shop-item-letter select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-amber {
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-shop {
  width: 173px;
  background: var(--ink);
  color: #fff;
}

.btn-shop.has-points {
  animation: shop-points-glow 1.7s ease-in-out infinite;
}

@keyframes shop-points-glow {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgb(251 171 32 / 0.22), 0 0 14px 4px rgb(251 171 32 / 0.32);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(251 171 32 / 0.2), 0 0 22px 8px rgb(251 171 32 / 0.48);
  }
}

.btn-ready {
  width: 173px;
  font-weight: 700;
}

.btn-begin {
  width: 173px;
  text-transform: uppercase;
  font-weight: 700;
}

.btn-wide {
  width: auto;
  min-width: 220px;
}

.btn-feedback {
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
}

.icon-feedback {
  width: 18px;
  height: 22px;
}

.icon-feedback img {
  width: 18px;
  height: 22px;
  object-fit: contain;
}

.handoff-actions {
  margin-top: 83px;
}

.play-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--page-col), 100%);
  min-width: 0;
}

.turn-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.turn-meta .who {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer {
  min-width: 8.5rem;
  flex: 0 0 auto;
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer .secs {
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: var(--amber-text);
}

.timer.is-idle,
.timer.is-hidden {
  visibility: hidden;
}

.timer-bar {
  width: 110px;
  height: 4px;
  background: var(--track);
}

.timer-bar span {
  display: block;
  height: 100%;
  background: var(--amber);
  width: 100%;
}

.timer.is-urgent .secs {
  color: var(--red);
}

.timer.is-urgent .timer-bar span {
  background: var(--red);
}

.timer.is-urgent .timer-bar {
  height: 8px;
}

.effects {
  display: grid;
  gap: 0.45rem;
  width: min(var(--page-col), 100%);
  overflow: visible;
}

.effects-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

/* Held at 13px so it stays on the label's line once --label scales up. */
.effects-hint {
  font-size: 13px;
  font-weight: 500;
}

.effects-hint-tap {
  display: none;
}

.effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  overflow: visible;
}

.effect-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  /* Left and bottom padding hold the avatar, which hangs off the skull. */
  padding: 0 0 9px 25px;
  overflow: visible;
  cursor: pointer;
}

.effect-icon {
  position: relative;
  width: 32px;
  height: 35px;
  flex-shrink: 0;
}

.effect-skull {
  display: block;
  width: 100%;
  height: 100%;
}

.effect-avatar {
  position: absolute;
  left: -25px;
  bottom: -9px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.effect-name {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  text-align: left;
}

.effect-miss {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--red);
}

.effect-name:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.effect-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 6;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.effect-tip::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

.effect-tip {
  pointer-events: auto;
}

.effect-name:hover .effect-tip,
.effect-name:focus-visible .effect-tip,
.effect-name.is-open .effect-tip,
.effect-chip.is-open .effect-tip,
.effect-tip:hover {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.last-word {
  display: grid;
  gap: 0.45rem;
}

.board-wrap {
  position: relative;
  width: max-content;
  margin: 0.2rem 0 0;
}

.letter-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, 65px);
  gap: 9px;
  width: max-content;
  position: relative;
  z-index: 1;
}

.board.is-scoring {
  padding-bottom: 8px;
}

.tile-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 65px;
}

.tile-stack .tile {
  width: 65px;
  height: 65px;
}

.board.is-scoring .tile.is-score-pop {
  animation: tile-score-pop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-stack:nth-child(even) .tile.is-score-pop {
  animation-name: tile-score-pop-alt;
}

.tile-points {
  min-height: 1rem;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--amber-text);
  opacity: 0;
  transform: translateY(-10px) scale(0.5);
}

.tile-points.is-hot {
  color: var(--red);
  font-size: 16px;
}

.board.is-scoring .tile-points.is-visible {
  animation: tile-points-in 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.tile-stack:nth-child(even) .tile-points.is-visible {
  animation-name: tile-points-in-alt;
}

.board-preview {
  grid-template-columns: repeat(5, 45px);
  gap: 6px;
}

.tile {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--tile);
  color: var(--ink);
  font-weight: 700;
  font-size: 24px;
  text-transform: uppercase;
  line-height: 1;
}

.tile-letter {
  display: block;
  line-height: 1;
}

.board-preview .tile {
  width: 45px;
  height: 45px;
}

.tile.is-frozen {
  background: #fbefd8;
  border-color: var(--amber);
  color: var(--ink);
}

.board-wrap.is-tunnel .tile:not(.is-frozen) .tile-letter {
  letter-spacing: 0.08em;
  font-weight: 700;
}

.board-wrap.is-reverse::before {
  content: "← type right to left";
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
  text-align: center;
}

.keyboard.is-reverse::before {
  content: "Letters fill right to left";
  display: block;
  width: 100%;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
  text-align: center;
}

.key.is-required {
  box-shadow: inset 0 0 0 2px var(--amber);
}

.key.is-disabled,
.key:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.shop-item-note {
  margin: 2px 0 0;
  grid-column: 1;
  grid-row: 3;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  max-width: 16rem;
}

.tile.is-scanning {
  background: #fff6e3;
  border-color: var(--amber);
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--amber);
}

.tile.is-scanning.is-settling {
  transform: scale(1.1);
  box-shadow: 0 0 0 5px var(--amber);
}

.board.is-spinning .tile {
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.board.is-spinning .tile.is-settling {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s ease,
    background-color 0.4s ease,
    border-color 0.4s ease;
}

.board.is-shaking .tile {
  animation: shake 0.38s ease-in-out;
}

.board.is-revealing .tile.is-vanishing {
  overflow: hidden;
}

.board.is-revealing .tile.is-vanishing .tile-letter {
  animation: vanish 0.55s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.board.is-revealing .tile.is-vanishing:nth-child(1) .tile-letter { animation-delay: 0.02s; }
.board.is-revealing .tile.is-vanishing:nth-child(2) .tile-letter { animation-delay: 0.08s; }
.board.is-revealing .tile.is-vanishing:nth-child(3) .tile-letter { animation-delay: 0.14s; }
.board.is-revealing .tile.is-vanishing:nth-child(4) .tile-letter { animation-delay: 0.2s; }
.board.is-revealing .tile.is-vanishing:nth-child(5) .tile-letter { animation-delay: 0.26s; }

.board.is-revealing .tile.is-locked {
  animation: freeze-lock 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.flash {
  min-height: 1.4rem;
  font-weight: 600;
  font-size: 14px;
  width: min(var(--col), 100%);
  text-align: center;
}

.flash.is-bad {
  color: var(--red);
}

.flash.is-good {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  animation: score-celebrate 0.72s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flash.is-tally {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.flash.is-tally.is-bump {
  animation: score-tally-bump 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flash.is-tally.is-multiply {
  color: var(--amber);
  animation: score-multiply-wiggle 0.55s ease-in-out;
}

.flash.is-timeout {
  color: var(--red);
  font-size: 24px;
  font-weight: 700;
}

.keyboard {
  display: grid;
  gap: 5.6px;
  margin-top: auto;
  width: 100%;
  padding-top: 2rem;
  position: relative;
  z-index: 3;
}

body.ai-turn .keyboard {
  pointer-events: none;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 4.48px;
}

.key {
  position: relative;
  flex: 1 1 0;
  border: 2px solid var(--ink);
  background: var(--tile);
  min-width: 26px;
  max-width: 42px;
  height: 48px;
  padding: 2px 9px 10px;
  font-family: var(--keys);
  font-weight: 700;
  font-size: 16.8px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.key-letter {
  display: block;
  line-height: 1;
}

.key-pts {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: var(--amber-text);
  pointer-events: none;
}

.key-wide {
  flex: 1.7 1 0;
  min-width: 64px;
  max-width: 88px;
  font-size: 13.6px;
  letter-spacing: 0.08em;
}

.key:active {
  background: var(--ink);
  color: var(--paper);
}

.key:active .key-pts {
  color: var(--amber);
}

.handoff {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}

.handoff > .kicker {
  line-height: 15px;
  margin-bottom: 4px;
}

#handoff-name {
  text-transform: uppercase;
  margin: 0;
}

.handoff .effects,
.handoff .last-word {
  margin-top: 1.15rem;
}

.sudden {
  align-self: start;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--amber-text);
}

.rank-list,
.play-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  width: 100%;
}

.rank-list {
  gap: 0.85rem;
}

.rank-list li,
.play-list li {
  display: grid;
  width: 100%;
  column-gap: 0.6rem;
  align-items: center;
}

.rank-list li {
  grid-template-columns: 2rem minmax(0, 1fr) 3.25rem;
}

.rank-list .place,
.rank-list .pts,
.play-list .word,
.play-list .pts {
  font-weight: 700;
  font-size: 20px;
}

.rank-list .pts,
.play-list .pts {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-list .who {
  font-size: var(--label);
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
}

.rank-list li.is-winner .who,
.rank-list li.is-winner .pts {
  color: var(--amber-text);
}

.results-plays {
  margin-top: 2rem;
}

.results-plays .kicker {
  margin-bottom: 0.85rem;
}

.play-list {
  --play-row: 24px;
  --play-gap: 1rem;
  --play-visible: 6;
  gap: var(--play-gap);
  /* Show six words, then scroll. Rows are pinned so the cut lands on a row. */
  grid-auto-rows: var(--play-row);
  max-height: calc(
    var(--play-visible) * var(--play-row) +
      (var(--play-visible) - 1) * var(--play-gap)
  );
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--track) transparent;
}

@media (max-width: 720px) {
  .play-list {
    --play-visible: 4;
  }
}

.play-list:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.play-list li {
  grid-template-columns: max-content max-content minmax(3.25rem, 1fr);
}

.play-list .word,
.play-list .pts {
  line-height: var(--play-row);
}

.play-list .word {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-list .pts.is-start {
  font-size: var(--label);
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

#screen-results .actions {
  margin-top: 48px;
}

/* Keep feedback and play again side by side on phones, where two 220px
   buttons would otherwise wrap onto separate lines. */
@media (max-width: 720px) {
  #screen-results .actions {
    flex-wrap: nowrap;
    gap: 12px;
  }

  #screen-results .actions .btn {
    flex: 1 1 0;
    min-width: 0;
    font-size: 16px;
    padding: 0 14px;
    gap: 0.5rem;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgb(20 20 20 / 0.45);
  overscroll-behavior: contain;
}

.overlay:not([hidden]) {
  display: flex;
}

.overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.shop-overlay {
  background: rgb(20 20 20 / 0.45);
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.shop-shell {
  width: min(1188px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-scores {
  display: none;
}

.shop-score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.shop-score-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c0c0c0;
  text-transform: uppercase;
}

.shop-score-points {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #c0c0c0;
}

.shop-score.is-active .shop-score-name,
.shop-score.is-active .shop-score-points {
  color: #141414;
}

.shop-score.is-active .shop-score-points {
  color: #fbab20;
}

.shop-score.is-active::after {
  content: "";
  display: block;
  width: 85px;
  max-width: 100%;
  height: 2px;
  background: #fbab20;
}

.shop-panel {
  width: 100%;
  min-height: min(735px, calc(100vh - 8rem));
  margin: 0 auto;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 34px 43px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.shop-head {
  display: flex;
  align-items: center;
  gap: 12px 40px;
  min-height: 44px;
  overflow: visible;
}

.shop-title {
  margin: 0;
  flex: 0 0 auto;
  text-align: left;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  text-transform: lowercase;
  color: var(--ink);
}

.shop-points {
  margin: 0;
  flex: 0 0 auto;
  padding-top: 1rem;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: visible;
}

.shop-points-value {
  color: var(--amber-text);
  font-weight: 700;
}

.shop-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  text-transform: lowercase;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  margin-left: auto;
  cursor: pointer;
}

.shop-flash {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--muted);
}

.shop-flash-item,
.shop-flash-target {
  color: var(--ink);
  font-weight: 600;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 56px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
}

.shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
}

.shop-item-main {
  display: contents;
}

.shop-item-name {
  margin: 0;
  grid-column: 1;
  grid-row: 1;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.shop-item-desc {
  margin: 0;
  grid-column: 1;
  grid-row: 2;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  max-width: 16rem;
}

.shop-item-target {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.shop-item-target-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.shop-item-target select {
  appearance: none;
  background-color: #fbab20;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7' viewBox='0 0 8 7'%3E%3Cpath d='M0 0h8L4 7z' fill='%23141414'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px 7px;
  border: 0;
  min-width: 90px;
  height: 22px;
  padding: 0 22px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.shop-buy {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: center;
  appearance: none;
  border: 1px solid var(--ink);
  background: #fbab20;
  color: var(--ink);
  min-height: 41px;
  padding: 9px 20px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.shop-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shop-buy:focus-visible,
.shop-close:focus-visible,
.shop-item-target select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.panel {
  width: min(42rem, calc(100% - 2.5rem));
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 1.5rem 1.4rem;
  display: grid;
  gap: 0.85rem;
  overscroll-behavior: contain;
}

.rules-list {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.75rem;
  font-size: clamp(0.875rem, 1.8vw, 1.375rem);
  line-height: 1.5;
  color: #3a3a3a;
}

.rules-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
}

.rules-panel-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
}

.rules-view-pointsperletter {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  color: var(--amber);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  text-transform: lowercase;
}

.ppl-panel {
  --ppl-tile: 44px;
  --ppl-gap: 6px;
  width: min(440px, calc(100vw - 2rem));
  min-height: 560px;
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 24px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}

.ppl-title {
  margin: 0 0 4px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
  color: var(--ink);
  text-transform: lowercase;
}

.ppl-title-per {
  color: var(--amber);
}

.ppl-label {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  color: var(--amber);
  text-transform: lowercase;
}

.ppl-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.ppl-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ppl-band {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.ppl-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ppl-gap);
  max-width: calc(7 * var(--ppl-tile) + 6 * var(--ppl-gap));
}

.ppl-cell {
  width: var(--ppl-tile);
  height: var(--ppl-tile);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  background: var(--paper);
}

.ppl-close {
  border: 0;
  background: transparent;
  margin: 8px auto 0;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  font-weight: 700;
  font-size: 16px;
  text-transform: lowercase;
  color: var(--ink);
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes vanish {
  to {
    transform: translateY(48px) rotate(10deg);
    opacity: 0;
  }
}

@keyframes freeze-lock {
  0% { transform: scale(1.1); box-shadow: 0 0 0 5px var(--amber); }
  40% { transform: scale(1.06); box-shadow: 0 0 0 4px var(--amber); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

@keyframes score-pop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes score-celebrate {
  0% {
    transform: scale(0.4) rotate(-8deg);
    opacity: 0;
  }
  45% {
    transform: scale(1.22) rotate(4deg);
    opacity: 1;
  }
  70% {
    transform: scale(0.94) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes score-tally-bump {
  0% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.2) rotate(-2deg); }
  65% { transform: scale(0.96) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes score-multiply-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-3deg) scale(1.06); }
  75% { transform: rotate(3deg) scale(1.06); }
}

@keyframes tile-score-pop {
  0% { transform: scale(1) rotate(0deg); }
  35% {
    transform: scale(1.14) rotate(-4deg);
    box-shadow: 0 0 0 3px var(--amber);
  }
  65% { transform: scale(0.97) rotate(2deg); }
  100% {
    transform: scale(1) rotate(0deg);
    box-shadow: none;
  }
}

@keyframes tile-score-pop-alt {
  0% { transform: scale(1) rotate(0deg); }
  35% {
    transform: scale(1.14) rotate(4deg);
    box-shadow: 0 0 0 3px var(--amber);
  }
  65% { transform: scale(0.97) rotate(-2deg); }
  100% {
    transform: scale(1) rotate(0deg);
    box-shadow: none;
  }
}

@keyframes tile-points-in {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.2) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: translateY(3px) scale(1.2) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes tile-points-in-alt {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.2) rotate(12deg);
  }
  55% {
    opacity: 1;
    transform: translateY(3px) scale(1.2) rotate(-4deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes score-gain-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.4);
  }
  55% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px) scale(1.14);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px) scale(1);
  }
}

[data-tip] {
  position: relative;
}

[data-tip]::before,
[data-tip]::after {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 12;
  width: max-content;
  max-width: 200px;
  padding: 7px 9px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  text-align: center;
  text-transform: none;
  white-space: normal;
  transform: translate(-50%, -4px);
}

[data-tip]::after {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  z-index: 12;
  border: 5px solid transparent;
  border-bottom-color: var(--ink);
  transform: translate(-50%, -4px);
}

[data-tip-align="end"]::before {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}

[data-tip-align="end"]::after {
  left: auto;
  right: 12px;
  transform: translateY(-4px);
}

[data-tip]:hover::before,
[data-tip]:hover::after,
[data-tip]:focus-visible::before,
[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

[data-tip-align="end"]:hover::before,
[data-tip-align="end"]:hover::after,
[data-tip-align="end"]:focus-visible::before,
[data-tip-align="end"]:focus-visible::after {
  transform: translateY(0);
}

@media (hover: none) {
  [data-tip]:hover::before,
  [data-tip]:hover::after {
    opacity: 0;
    visibility: hidden;
  }

  .effects-hint-hover {
    display: none;
  }

  .effects-hint-tap {
    display: inline;
  }

  .effect-name:hover .effect-tip,
  .effect-tip:hover {
    opacity: 0;
    transform: translateY(4px);
    visibility: hidden;
    pointer-events: none;
  }

  .effect-chip.is-open .effect-tip,
  .effect-name.is-open .effect-tip {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board.is-shaking .tile,
  .board.is-revealing .tile.is-vanishing .tile-letter,
  .board.is-revealing .tile.is-locked,
  .board.is-scoring .tile-points.is-visible,
  .board.is-scoring .tile.is-score-pop,
  .tile.is-scanning,
  .flash.is-good,
  .flash.is-tally.is-bump,
  .flash.is-tally.is-multiply,
  .score-gain.is-on {
    animation: none;
  }

  .board.is-spinning .tile {
    transition: none;
  }

  .effect-tip {
    transition: none;
  }

  [data-tip]::before,
  [data-tip]::after {
    transition: none;
  }

  .tile-points.is-visible {
    opacity: 1;
    transform: none;
  }

  .score-gain.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
  }

  .tile.is-scanning {
    transform: none;
  }

  .btn:active {
    transform: none;
  }

  .btn-shop.has-points {
    animation: none;
    box-shadow: 0 0 0 3px rgb(251 171 32 / 0.45), 0 0 16px 6px rgb(251 171 32 / 0.35);
  }
}

@media (max-width: 720px) {
  :root {
    --col: 367px;
  }

  .masthead {
    padding-top: 1.1rem;
  }

  .nav-text {
    font-size: 16px;
  }

  .nav-ppl {
    height: 36px;
    font-size: 14px;
    padding: 0 2px;
  }

  .ppl-panel {
    --ppl-tile: 36px;
    --ppl-gap: 5px;
    min-height: 0;
    padding: 20px 18px 10px;
    gap: 10px;
  }

  .ppl-title {
    font-size: 16px;
  }

  .ppl-cell {
    font-size: 16px;
  }

  .ppl-band {
    gap: 16px;
  }

  .shop-overlay {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .shop-shell {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    gap: 8px;
  }

  .shop-scores {
    flex-shrink: 0;
    gap: 12px;
    min-height: 0;
    overflow-x: auto;
    justify-content: space-around;
    -webkit-overflow-scrolling: touch;
  }

  .shop-score-name {
    font-size: 11px;
  }

  .shop-score-points {
    font-size: 18px;
  }

  .shop-panel {
    flex: 1;
    min-height: 0;
    padding: 16px 16px 20px;
    gap: 14px;
  }

  .shop-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title close"
      "points points"
      "flash flash";
    align-items: start;
    gap: 6px 12px;
    flex-shrink: 0;
    min-height: 0;
  }

  .shop-title {
    grid-area: title;
    font-size: 32px;
    min-width: 0;
    line-height: 1.1;
  }

  .shop-points {
    grid-area: points;
    font-size: 20px;
  }

  .shop-close {
    grid-area: close;
    margin-left: 0;
    justify-self: end;
    order: unset;
  }

  .shop-flash {
    grid-area: flash;
    flex: unset;
    order: unset;
    min-width: 0;
  }

  .shop-items {
    grid-template-columns: 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
  }

  .shop-item {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .shop-item-name,
  .shop-item-desc,
  .shop-item-target,
  .shop-item-note,
  .shop-buy {
    grid-column: 1;
  }

  .shop-item-desc,
  .shop-item-note {
    max-width: none;
  }

  .shop-item-target,
  .shop-item-note {
    grid-row: auto;
  }

  .shop-item-target select {
    flex: 1;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    padding-right: 28px;
  }

  .shop-buy {
    grid-row: auto;
    grid-column: 1;
    width: 100%;
    min-height: 44px;
    justify-self: stretch;
  }

  .board-wrap {
    width: min(var(--col), 100%);
  }

  .board,
  .board-preview {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(var(--col), 100%);
  }

  .tile,
  .board-preview .tile {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .tile-stack {
    width: 100%;
  }

  .tile-stack .tile {
    width: 100%;
    height: auto;
  }

  .setup-title {
    font-size: 32px;
  }

  .player-avatar {
    width: 56px;
    height: 56px;
    font-size: 16px;
  }

  .setup-actions {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-bottom: 5.75rem;
  }

  .btn-begin {
    position: fixed;
    z-index: 6;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .setup-rounds {
    flex-wrap: wrap;
    margin-top: 1.5rem;
  }

  .btn-shop,
  .btn-ready {
    width: calc(50% - 9px);
    min-width: 0;
  }

  .btn-wide {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .key {
    min-width: 24px;
    max-width: 38px;
    height: 44px;
    font-size: 14px;
    padding: 2px 7px 8px;
  }

  .key-wide {
    min-width: 3.4rem;
    max-width: 4.6rem;
    font-size: 12px;
  }

  .mast-nav {
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .key-pts {
    font-size: 8px;
    right: 2px;
    bottom: 2px;
  }

  .mode-card {
    max-width: none;
    min-height: 0;
    gap: 10px;
    padding: 12px 8px 14px;
  }

  .mode-card-icon,
  .mode-card-icon img {
    width: 40px;
    height: 40px;
  }

  .mode-card-label {
    font-size: 16px;
  }
}

@media (max-height: 700px) {
  .shop-overlay {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 12px;
    overflow: hidden;
  }

  .shop-shell {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    gap: 8px;
  }

  .shop-panel {
    flex: 1;
    min-height: 0;
  }

  .shop-items {
    flex: 1;
    min-height: 0;
  }
}

/* --- Rules guide (Figma) --- */

.onboarding-overlay {
  background: rgb(20 20 20 / 0.55);
}

.onboarding-panel {
  width: min(459px, calc(100% - 2rem));
  height: 437px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font);
  box-sizing: border-box;
}

.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  height: 20px;
  flex-shrink: 0;
}

.onboarding-kicker {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #c0c0c0;
  text-transform: lowercase;
  line-height: normal;
}

.onboarding-page {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fbab20;
  text-transform: lowercase;
  line-height: normal;
}

.onboarding-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  height: 139px;
  flex-shrink: 0;
  background: transparent;
}

.onboarding-visual.is-logo {
  width: 282px;
}

.onboarding-visual.is-tiles {
  width: 282px;
}

.onboarding-visual.is-shop {
  width: 173px;
}

.onboarding-visual.is-image {
  width: 131px;
}

.onboarding-visual img,
.onboarding-visual-img {
  display: block;
  width: 131px;
  height: 139px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.onboarding-accent {
  font-weight: 700;
  color: #fbab20;
}

.onboarding-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 100%;
}

.onboarding-logo-letter {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: #1e1e1e;
  text-transform: lowercase;
}

.onboarding-logo-tile {
  position: relative;
  width: 63px;
  height: 64px;
  margin: 0 2px;
  background: #fbefd8;
  border: 1.73px solid #ffa426;
  display: grid;
  place-items: center;
}

.onboarding-logo-tile-letter {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: #1e1e1e;
}

.onboarding-logo-tile-pts {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #1e1e1e;
}

.onboarding-tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
}

.onboarding-tile {
  width: 50px;
  height: 50px;
  border: 1px solid #000;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #000;
  line-height: 1;
}

.onboarding-tile.is-frozen {
  background: #fbefd8;
  border-color: #fbab20;
}

.onboarding-shop {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 173px;
  height: 41px;
  padding: 0 20px;
  background: #141414;
  border: 1px solid #141414;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.onboarding-shop img {
  width: 20px;
  height: 20px;
  border: 0;
  max-width: none;
  filter: none;
}

.onboarding-next.is-play {
  background: #ffa426;
  color: #141414;
}

.onboarding-next.is-play .onboarding-next-arrow {
  filter: brightness(0);
}

.onboarding-title {
  margin: 0;
  height: 39px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  line-height: normal;
  color: var(--ink);
  text-transform: lowercase;
  text-align: center;
  text-wrap: balance;
}

.onboarding-body {
  margin: 0;
  width: min(367px, 100%);
  height: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  color: #c0c0c0;
  text-align: center;
}

.onboarding-body p {
  margin: 0;
}

.onboarding-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 112px;
  height: 12px;
  flex-shrink: 0;
}

.onboarding-dot {
  appearance: none;
  border: 0;
  width: 12px;
  height: 12px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.onboarding-dot img {
  display: block;
  width: 12px;
  height: 12px;
}

.onboarding-dot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 50%;
}

.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  height: 36px;
  flex-shrink: 0;
  margin-top: auto;
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.onboarding-actions:has(.onboarding-back:not([hidden])) {
  justify-content: space-between;
  width: 164px;
}

.onboarding-skip {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 0;
  min-height: 36px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  text-transform: lowercase;
  color: #c0c0c0;
  cursor: pointer;
  line-height: normal;
}

.onboarding-skip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.onboarding-back,
.onboarding-next {
  appearance: none;
  border: 0;
  background: #141414;
  color: #fff;
  min-height: 36px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  text-transform: lowercase;
  line-height: normal;
  cursor: pointer;
}

.onboarding-back:focus-visible,
.onboarding-next:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.onboarding-back-arrow {
  transform: rotate(-90deg);
}

.onboarding-next-arrow {
  transform: rotate(90deg);
}

.onboarding-back[hidden],
.onboarding-next[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .onboarding-panel {
    height: auto;
    min-height: 437px;
    padding: 20px 18px;
  }

  .onboarding-title {
    height: auto;
    min-height: 39px;
    font-size: clamp(1.5rem, 7vw, 32px);
  }

  .onboarding-body {
    height: auto;
    min-height: 80px;
    font-size: clamp(0.875rem, 3.8vw, 16px);
  }
}

/* --- Landing page --- */

.landing {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 48px clamp(1.25rem, 5vw, 69px) 32px;
  overflow: auto;
}

.landing[hidden] {
  display: none !important;
}

.landing-top {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
  min-height: 0;
  padding: 2rem 0;
}

.landing-logo {
  position: relative;
  width: min(720px, 88vw);
  line-height: 0;
}

.landing-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.landing-typewriter {
  position: absolute;
  left: 52.4%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  height: 78%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(2.6rem, 10vw, 7rem);
  line-height: 1;
  color: #1a1a1a;
  text-transform: uppercase;
  pointer-events: none;
}

.landing-type-char {
  display: inline-block;
  min-width: 0;
  text-align: center;
}

.landing-type-caret {
  display: inline-block;
  width: 0.08em;
  height: 0.78em;
  background: #1a1a1a;
  animation: landing-caret-blink 1s steps(1, end) infinite;
}

.landing-typewriter.has-letter .landing-type-char {
  min-width: 0.55em;
}

.landing-typewriter.has-letter .landing-type-caret {
  display: none;
}

@keyframes landing-caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.landing-tagline {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 18px);
  font-weight: 400;
  color: #000;
  line-height: 1.35;
}

.landing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-btn {
  appearance: none;
  border: 1px solid #141414;
  width: 173px;
  height: 41px;
  min-height: 41px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.landing-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.landing-btn-rules {
  background: #141414;
  color: #fff;
}

.landing-btn-rules img {
  width: 22px;
  height: 17px;
  flex-shrink: 0;
}

.landing-btn-ready {
  background: #fbab20;
  color: #141414;
}

.landing-ready-arrow {
  width: 16px;
  height: 12px;
  transform: rotate(90deg);
  flex-shrink: 0;
}

.site-credit {
  position: fixed;
  right: clamp(1.25rem, 5vw, 69px);
  bottom: 32px;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  pointer-events: none;
}

.site-credit a {
  pointer-events: auto;
}

.site-credit p {
  margin: 0;
  font-size: clamp(0.875rem, 1.6vw, 18px);
  font-weight: 400;
  color: #2b2b2b;
  line-height: 1.3;
  text-align: right;
}

.landing-human {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.landing-human:hover,
.landing-human:focus-visible {
  text-decoration: underline;
}

.landing-credit-logo {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.landing-credit-logo img {
  display: block;
  width: 48px;
  height: auto;
}

.landing-human:focus-visible,
.landing-credit-logo:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .landing {
    padding: 24px 1rem 20px;
  }

  .landing-main {
    gap: 22px;
  }

  .landing-btn {
    width: min(173px, calc(50vw - 1.5rem));
    font-size: 16px;
    padding: 0 14px;
  }

  .site-credit {
    left: 1rem;
    right: 1rem;
    bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .site-credit p {
    text-align: center;
  }
}

@media (max-width: 720px) {
  body:has(#landing[hidden]) .site-credit {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-type-caret {
    animation: none;
    opacity: 1;
  }
}

#screen-mode.is-active,
#screen-online.is-active {
  align-items: stretch;
}

#screen-mode .kicker,
#screen-online .kicker,
#screen-join .kicker,
#screen-setup .kicker {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 15px;
}

#screen-mode .setup-title,
#screen-online .setup-title,
#screen-join .setup-title,
#screen-setup .setup-title {
  margin-top: 10px;
  line-height: 1.05;
}

#screen-mode .setup-hint,
#screen-online .setup-hint,
#screen-join .setup-hint,
#screen-setup .setup-hint {
  margin-top: 10px;
  max-width: 20rem;
}

.mode-setup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.mode-pick {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
  width: 100%;
}

.mode-card {
  appearance: none;
  box-sizing: border-box;
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  padding: 24px 16px 28px;
  border: 3px solid #efc35a;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: background-color 0.15s ease;
}

.mode-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.mode-card:hover,
.mode-card:focus-visible {
  background: #fff6df;
  border-color: var(--amber);
}

.mode-card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
}

.mode-card-icon img {
  width: 52px;
  height: 52px;
}

.mode-card-label {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  white-space: normal;
}

.mode-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 36px;
}

.mode-actions .btn {
  width: 100%;
  justify-content: center;
}

.setup-back {
  appearance: none;
  border: 0;
  background: transparent;
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  min-height: 44px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
}

.setup-back:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.setup-back-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.setup-back-icon img {
  display: block;
  width: 16px;
  height: 16px;
}

.mode-back {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mode-back:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#join-board .tile-stack {
  width: auto;
}

.join-board-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  width: 100%;
}

#screen-join.is-active {
  width: min(640px, calc(100% - 2rem));
  align-items: center;
}

#screen-join .mode-setup {
  width: min(var(--page-col), 100%);
}

#screen-join .keyboard {
  margin-top: auto;
  width: 100%;
}

.lobby-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 8px;
  width: 100%;
}

.lobby-code {
  margin: 0;
  flex: 0 0 auto;
  width: auto;
}

.lobby-copy {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: right;
  white-space: nowrap;
}

.lobby-copy:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#screen-wait.is-active {
  width: min(var(--page-col), calc(100% - 2.5rem));
  margin-top: 1.5rem;
}

.player-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
}

.lobby-ready-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 1;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lobby-ready-badge svg {
  display: block;
}

.lobby-ready-badge.is-ready {
  background: var(--ready);
}

.lobby-ready-badge.is-wait {
  background: var(--red);
}

.lobby-status {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.lobby-status.is-ready {
  color: var(--ready);
}

.lobby-status.is-wait {
  color: var(--red);
}

.lobby-status.is-reconnect {
  color: var(--muted);
}

#lobby-ready-btn {
  width: auto;
  min-width: 120px;
  justify-content: center;
}

.lobby-leave {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  font-weight: 700;
  font-size: 16px;
  color: var(--red);
}

.lobby-leave:hover,
.lobby-leave:focus-visible {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lobby-leave:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

#screen-lobby .setup-actions {
  width: 100%;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}

@media (max-width: 720px) {
  #screen-lobby.is-active {
    padding-top: 1rem;
  }

  #screen-setup.is-active {
    padding-top: 3.25rem;
  }

  #screen-lobby .setup-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  #screen-lobby .lobby-leave {
    margin-left: auto;
  }

  #screen-lobby .lobby-code {
    grid-template-columns: repeat(5, 40px);
    gap: 5px;
    width: auto;
  }

  #screen-lobby .lobby-code .tile {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}


