@font-face {
  font-family: "Hammersmith One";
  src: url("./HammersmithOne-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  color-scheme: light;
  --bg: #edf1ef;
  --panel: #fbfbf7;
  --ink: #20272b;
  --muted: #647278;
  --line: #b9c1bd;
  --board: #8f8068;
  --cell: #dfd7c5;
  --tile: #f2d27f;
  --tile-ink: #272019;
  --pending: #fff7b2;
  --locked: #f0c76f;
  --green: #117846;
  --green-bg: #dff3e5;
  --red: #b42c33;
  --red-bg: #f7dfe1;
  --blue: #246b9a;
  --blue-bg: #dcecf6;
  --shadow: 0 16px 36px rgb(36 45 48 / 16%);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  touch-action: auto;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.viewportSafeAreaProbe {
  position: fixed;
  z-index: -1;
  width: 0;
  height: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  visibility: hidden;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: #74817c;
}

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

.menuButton {
  z-index: 20;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-weight: 780;
  box-shadow: 0 8px 18px rgb(36 45 48 / 12%);
}

.menuButton span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 999px;
  background: currentColor;
}

.menuTileField {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: var(--board);
  contain: strict;
}

body:not(.menuAttractMode) .menuTileField {
  display: none;
}

.menuTileCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.menuTileField.revealing {
  pointer-events: none;
  background: transparent;
}

.attractMenuButton {
  position: fixed;
  z-index: 42;
}

.indexMenuButton {
  position: fixed;
  z-index: 42;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  padding: 20px 36px;
  border: 2px solid #86aeca;
  border-radius: 14px;
  background: var(--blue-bg);
  color: #12415f;
  box-shadow: var(--shadow);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 780;
  white-space: nowrap;
}

body.menuAttractMode .indexMenuButton,
.indexMenuButton[hidden],
body.menuDialogOpen .indexMenuButton {
  display: none;
}

body:not(.menuAttractMode) .attractMenuButton,
body.menuAttractRevealing .attractMenuButton {
  display: none;
}

body.menuAttractMode .appShell {
  opacity: 0;
  pointer-events: none;
}

body.menuAttractMode.menuAttractRevealing .appShell {
  opacity: 1;
  transition: opacity 180ms ease-out;
}

body.menuAttractMode #menuDialog::backdrop {
  background: rgb(20 28 27 / 16%);
}

.menuInteractionBackdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(25 32 35 / 42%);
}

body.menuAttractMode .menuInteractionBackdrop {
  background: rgb(20 28 27 / 16%);
}

.menuInteractionBackdrop[hidden] {
  display: none;
}

#menuDialog[open] {
  position: fixed;
  inset: 0;
  z-index: 90;
  margin: auto;
}

.appShell {
  height: var(--app-height, 100dvh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

.gameSwitchTransitionLayer {
  position: fixed;
  inset: 0;
  z-index: 30000;
  width: 100vw;
  max-width: none;
  height: var(--app-height, 100dvh);
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.gameSwitchTransitionLayer::backdrop {
  background: transparent;
}

.gameSwitchWash {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--bg);
  pointer-events: none;
  animation: gameSwitchWash var(--game-switch-total-duration, 1120ms) ease-in-out both;
}

.gameSwitchOldShell {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  animation: gameSwitchOldShellFade var(--game-switch-total-duration, 1120ms) ease-in-out both;
}

.gameSwitchHiddenRegion {
  visibility: hidden !important;
}

.gameSwitchTilesLayer {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  perspective: 1000px;
}

.gameSwitchTileCard {
  position: fixed;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  animation: gameSwitchTileFlip var(--game-switch-flip-duration, 820ms) cubic-bezier(.45, 0, .55, 1) var(--game-switch-delay, 0ms) both;
  will-change: transform;
}

.gameSwitchTileFace {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gameSwitchTileFront {
  transform: translateZ(calc(var(--game-switch-depth, 4px) / 2));
}

.gameSwitchTileBack {
  transform: rotateY(180deg) translateZ(calc(var(--game-switch-depth, 4px) / 2));
}

.gameSwitchFaceNode {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  animation: none !important;
  pointer-events: none !important;
}

.gameSwitchTileSide {
  position: absolute;
  top: 0;
  width: var(--game-switch-depth, 4px);
  height: 100%;
  background: #a57a32;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gameSwitchTileSideLeft {
  left: 50%;
  transform: translateX(calc(-1 * var(--game-switch-depth, 4px) / 2)) rotateY(90deg) translateZ(var(--game-switch-half-width, 20px));
}

.gameSwitchTileSideRight {
  left: 50%;
  transform: translateX(calc(-1 * var(--game-switch-depth, 4px) / 2)) rotateY(-90deg) translateZ(var(--game-switch-half-width, 20px));
}

@keyframes gameSwitchTileFlip {
  from {
    left: var(--game-switch-from-left);
    top: var(--game-switch-from-top);
    width: var(--game-switch-from-width);
    height: var(--game-switch-from-height);
    transform: rotateY(0deg);
  }

  to {
    left: var(--game-switch-to-left);
    top: var(--game-switch-to-top);
    width: var(--game-switch-to-width);
    height: var(--game-switch-to-height);
    transform: rotateY(180deg);
  }
}

@keyframes gameSwitchWash {
  0% { opacity: 0; }
  38%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes gameSwitchOldShellFade {
  0%, 34% { opacity: 1; }
  48%, 100% { opacity: 0; }
}

.orientationOverlay {
  display: none;
}

.orientationTiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
  width: min(520px, calc(100vw - 28px));
}

.orientationWord {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
}

.orientationTiles span {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #ae8b45;
  border-radius: 6px;
  background: var(--tile);
  color: var(--tile-ink);
  font-size: 25px;
  font-weight: 820;
  box-shadow: inset 0 -4px 0 rgb(93 67 24 / 13%);
}

body:not(.debugMode) .appShell {
  grid-template-columns: minmax(0, 1fr);
}

.playSurface {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  overflow: hidden;
}

.sidePanel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

body:not(.debugMode) .sidePanel {
  display: none;
}

.topBar {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 auto 10px;
}

.titleBlock {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.globalMyGamesNotificationPill {
  flex: 0 0 auto;
  min-width: 25px;
  min-height: 25px;
  padding: 1px 7px;
  border: 1px solid #a91f16;
  border-radius: 999px;
  background: #d92d20;
  box-shadow: 0 2px 7px rgba(130, 23, 16, 0.28);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
}

.globalMyGamesNotificationPill:hover,
.globalMyGamesNotificationPill:focus-visible {
  background: #b92318;
}

.globalMyGamesNotificationPill[hidden] {
  display: none;
}

.globalMyGamesNotificationPill.notificationCountUpdated {
  animation: notificationCountUpdated 280ms ease-out;
}

@keyframes notificationCountUpdated {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
  font-weight: 760;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

#statusLine {
  margin: 0 auto 8px;
  width: min(100%, 760px);
  height: 2.4em;
  min-height: 2.4em;
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (orientation: landscape) {
  .topBar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 2px;
  }

  .topBar > .menuButton {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .topBar > .titleBlock {
    grid-column: 2;
    grid-row: 1;
  }

  .topBar > .gameInfoBlock {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .topBar > .gameInfoBlock .difficultyStatus {
    text-align: left;
    white-space: nowrap;
  }

  .topBar > .scoreTools {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
  }
}

.scoreBadge {
  min-width: 104px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: right;
}

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

.scoreTools {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.spectatorBox {
  position: relative;
  width: 76px;
  min-width: 76px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  background-image: url("/sawbg.jpg?v=__ASSET_VERSION__");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 500ms linear;
}

.spectatorBox[hidden] {
  display: none;
}

.spectatorBox.isBoxVisible {
  opacity: 1;
}

.spectatorBox.hasSpectators {
  cursor: pointer;
}

.spectatorBox.hasSpectators:hover,
.spectatorBox.hasSpectators:focus-visible {
  outline: 3px solid rgb(139 92 246 / 22%);
  outline-offset: 2px;
}

.spectatorImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(108%);
  transition: transform 500ms cubic-bezier(0.22, 0.88, 0.34, 1);
  pointer-events: none;
  user-select: none;
}

.spectatorBox.isImageVisible .spectatorImage {
  transform: translateY(0);
}

.playerReactionBubble.spectatorReactionBubble {
  top: 35%;
  right: auto;
  left: 50%;
  z-index: 3;
  animation-name: spectatorReactionFloat;
}

@keyframes spectatorReactionFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px)) scale(0.82);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 5px)) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 14px)) scale(0.9);
  }
}

.spectatorDialog {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}

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

.spectatorListRow {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.spectatorListRow strong {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.spectatorListRow > span,
.spectatorListEmpty {
  color: var(--muted);
}

.spectatorListEmpty {
  margin: 4px 0 0;
}

.scoreBadge span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.scoreBadge strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  line-height: 1;
}

.scoreBadge.valid {
  border-color: #7fbd9b;
  background: var(--green-bg);
  color: var(--green);
}

.scoreBadge.invalid {
  border-color: #dda0a5;
  background: var(--red-bg);
  color: var(--red);
}

.scoreBadge.neutral {
  border-color: var(--line);
  background: #ecefed;
  color: #4e5960;
}

.scoreBadge.ghostValid {
  border-color: #c7ddd1;
  background: #fff;
  color: #72b18e;
}

.scoreBadge.ghostInvalid {
  border-color: #e3c8ca;
  background: #fff;
  color: #d08389;
}

.scoreBadge.ghostNeutral {
  border-color: #d3d8d6;
  background: #fff;
  color: #929a9e;
}

.scoreBadge[role="button"] {
  cursor: pointer;
}

.scoreBadge.ownerOverlayActive {
  border-color: #2f80ed;
  background: #dcebff;
}

.scoreBadge.idle strong {
  color: var(--muted);
}

.scoreStrip {
  width: min(100%, 760px);
  margin: 0 auto 5px;
  display: grid;
  grid-template-columns: repeat(var(--score-columns, 5), minmax(0, 1fr));
  gap: 7px;
}

.scoreStrip > div {
  position: relative;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 2px solid var(--player-color, var(--line));
  border-radius: 7px;
  background: #eef1ef;
}

.scoreStrip > div.activeTurn {
  background: var(--green-bg);
  box-shadow: 0 1px 7px rgb(25 35 32 / 14%);
}

.scoreStrip > div.assistRackBackground,
.scoreStrip > div.assistRackBackground.activeTurn {
  background: linear-gradient(rgb(255 255 255 / 48%), rgb(255 255 255 / 48%)), url("/tts.jpg?v=__ASSET_VERSION__") center / cover no-repeat;
}

.scoreStrip > div.scoreActionBox {
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  cursor: pointer;
}

.scoreStrip > div.scoreClickableBox {
  cursor: pointer;
}

.scoreStrip > div.scoreActionBox:hover,
.scoreStrip > div.scoreActionBox:focus-visible,
.scoreStrip > div.scoreClickableBox:hover,
.scoreStrip > div.scoreClickableBox:focus-visible {
  outline: 3px solid rgb(36 107 154 / 22%);
  outline-offset: 2px;
}

.scoreStrip > div.aiWorking::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 13px;
  height: 13px;
  border: 2px solid rgb(100 114 120 / 28%);
  border-top-color: var(--player-color, var(--blue));
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.playerReactionBubble {
  position: absolute;
  top: -19px;
  right: 8px;
  z-index: 8;
  display: block;
  font-size: 25px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgb(0 0 0 / 20%));
  animation: playerReactionFloat 3.6s ease-out forwards;
}

@keyframes playerReactionFloat {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.82);
  }

  16% {
    opacity: 1;
    transform: translateY(0) scale(1.12);
  }

  72% {
    opacity: 1;
    transform: translateY(-5px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.9);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.scoreStrip:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.scoreStrip span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.presenceDot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d33b3b;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 68%);
}

.presenceDot.online {
  background: #2f80ed;
}

.presenceDot.away {
  background: #e0a327;
}

.presenceDot.offline {
  background: #d33b3b;
}

.scoreStrip strong {
  display: inline-block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.1;
}

.scoreStrip .playerTurnPill {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px;
  border-radius: 0;
  background: var(--green);
  color: #fff;
  vertical-align: top;
  white-space: nowrap;
  overflow-wrap: normal;
}

.scoreStrip .playerTurnPill strong {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 9px;
  line-height: 1;
  overflow-wrap: normal;
}

.gameInfoBlock {
  min-width: 0;
  align-self: center;
  text-align: center;
}

.bagStatus {
  min-width: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bagStatus strong {
  color: var(--ink);
}

.infiniboardExpandPill {
  min-height: 0;
  margin-left: 5px;
  padding: 1px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: .85em;
  font-weight: 780;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.infiniboardExpandPill:hover {
  border-color: transparent;
  background: #0c6339;
}

.infiniboardExpandPill[hidden] {
  display: none;
}

.difficultyStatus {
  min-width: 0;
  width: auto;
  max-height: 1.15em;
  min-height: 0;
  margin: 0;
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boardWrap {
  --board-visual-width: min(100%, var(--app-height-72, 72dvh), 760px);
  --board-grid-gap: 2px;
  --board-grid-padding: 8px;
  /* Keeps each of the 29 grid tracks identical to a 15-track board at this padding and gap. */
  --infiniboard-full-width-adjustment: -13.0666667px;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

.board {
  position: relative;
  width: var(--board-visual-width);
  max-height: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--board-size, 15), 1fr);
  grid-template-rows: repeat(var(--board-size, 15), 1fr);
  gap: var(--board-grid-gap);
  padding: var(--board-grid-padding);
  border-radius: 8px;
  background: var(--board);
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
  overflow: visible;
}

.boardWrap.infiniboardViewport {
  position: relative;
  width: var(--board-visual-width);
  max-height: 100%;
  aspect-ratio: 1;
  place-items: initial;
  overflow: hidden;
  border-radius: 8px;
  background: var(--board);
  box-shadow: var(--shadow);
  touch-action: none;
}

.infiniboardViewport .board.infiniboard {
  position: relative;
  width: calc(193.3333333% + var(--infiniboard-full-width-adjustment));
  min-width: 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: 1;
  grid-template-columns: repeat(var(--board-size, 29), minmax(0, 1fr));
  grid-template-rows: repeat(var(--board-size, 29), minmax(0, 1fr));
  align-self: start;
  justify-self: start;
  border-radius: 0;
  box-shadow: none;
  will-change: transform;
}

.infiniboardViewport.infiniboardFitExtent .board.infiniboard {
  transform-origin: 0 0;
}

.infiniboardViewport.infiniboardSnapping .board.infiniboard {
  transition: transform 180ms cubic-bezier(0.22, 0.75, 0.28, 1);
}

.cell {
  container-type: inline-size;
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: var(--cell);
  color: #4b422f;
  font-weight: 800;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.board .cell.playScorePillAnchor {
  z-index: 20000;
  overflow: visible;
}

.playScorePill {
  position: absolute;
  z-index: 20001;
  min-width: 1.65em;
  padding: 0.22em 0.46em;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(13.5px, calc(var(--board-visual-width) / 30), 24px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 5px rgb(25 32 35 / 28%);
}

.playScorePill.topLeft {
  top: -15%;
  left: 0;
  transform: translate(-50%, -50%);
}

.playScorePill.topRight {
  top: -15%;
  right: 0;
  transform: translate(50%, -50%);
}

.playScorePill.bottomLeft {
  bottom: -15%;
  left: 0;
  transform: translate(-50%, 50%);
}

.playScorePill.bottomRight {
  right: 0;
  bottom: -15%;
  transform: translate(50%, 50%);
}

.playScorePill.legal {
  background: #218c50;
}

.playScorePill.kundailyPartial,
.playScorePill.kundailyBlocked {
  background: #70797d;
  color: #fff;
}

.playScorePill.illegal {
  background: #bd3e48;
}

.playScorePill.hardcore {
  background: #70797d;
}

.playScorePill.ghostLegal {
  border: 1px solid rgb(255 255 255 / 42%);
  background: #86cfa2;
}

.playScorePill.ghostIllegal {
  border: 1px solid rgb(255 255 255 / 42%);
  background: #e3989e;
}

.playScorePill.hardcoreGhost {
  border: 1px solid #d5d9d7;
  background: #fff;
  color: #aab1b4;
  box-shadow: 0 2px 5px rgb(25 32 35 / 16%);
}

.cell.tw {
  background: #813e24;
  color: #fff8f3;
}

.cell.qw {
  background: #3b0718;
  color: #fff4f6;
}

.cell.dw {
  background: #d0927a;
  color: #3d2715;
}

.cell.tl {
  background: #578a19;
  color: #f5fbff;
}

.cell.ql {
  background: #0b3520;
  color: #f1fff6;
}

.cell.inactiveBoardCell {
  visibility: hidden;
  pointer-events: none;
}

.cell.infiniboardEntry {
  background: #286f9d;
  color: #fff;
}

.infiniboardOwnerEdge {
  position: absolute;
  z-index: 20;
  display: block;
  pointer-events: none;
}

.infiniboardOwnerEdge.top,
.infiniboardOwnerEdge.bottom {
  right: 0;
  left: 0;
  height: 0;
  border-top: 3px dashed var(--section-owner-color);
}

.infiniboardOwnerEdge.top {
  top: 0;
}

.infiniboardOwnerEdge.bottom {
  bottom: 0;
}

.infiniboardOwnerEdge.left,
.infiniboardOwnerEdge.right {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 3px dashed var(--section-owner-color);
}

.infiniboardOwnerEdge.left {
  left: 0;
}

.infiniboardOwnerEdge.right {
  right: 0;
}

.infiniboardEntryChevron {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: 24%;
  height: 24%;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  color: #fff;
  transform: translate(-50%, -50%) rotate(var(--entry-chevron-angle));
  pointer-events: none;
}

.infiniboardViewport.infiniboardPannable,
.infiniboardViewport.infiniboardPannable .board,
.infiniboardViewport.infiniboardPannable .cell:not(.pending) {
  cursor: grab;
}

.infiniboardViewport.infiniboardPannable:active,
.infiniboardViewport.infiniboardPannable .cell:not(.pending):active {
  cursor: grabbing;
}

.entry-left .infiniboardEntryChevron {
  --entry-chevron-angle: -135deg;
}

.entry-right .infiniboardEntryChevron {
  --entry-chevron-angle: 45deg;
}

.entry-top .infiniboardEntryChevron {
  --entry-chevron-angle: -45deg;
}

.entry-bottom .infiniboardEntryChevron {
  --entry-chevron-angle: 135deg;
}

.infiniboardExpansionDialog {
  width: min(540px, calc(100vw - 24px));
}

.infiniboardExpansionMap {
  position: relative;
  width: min(100%, 360px, 46dvh);
  margin: 14px auto 10px;
  aspect-ratio: 1;
  border: 5px solid var(--board);
  border-radius: 12px;
  overflow: hidden;
  background: var(--board);
  box-shadow: 0 12px 28px rgb(36 45 48 / 18%);
  isolation: isolate;
}

.infiniboardExpansionCanvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.infiniboardMapMain,
.infiniboardMapSection {
  position: absolute;
  margin: 0;
  border-radius: 2px;
}

.infiniboardMapMain {
  z-index: 1;
  left: calc(7 / 29 * 100%);
  top: calc(7 / 29 * 100%);
  width: calc(15 / 29 * 100%);
  height: calc(15 / 29 * 100%);
  border: 2px solid rgb(255 255 255 / 82%);
  box-shadow: 0 0 0 1px rgb(58 48 34 / 55%);
  pointer-events: none;
}

.infiniboardMapSection {
  z-index: 2;
  left: calc(var(--section-col) / 29 * 100%);
  top: calc(var(--section-row) / 29 * 100%);
  width: calc(var(--section-cols) / 29 * 100%);
  height: calc(var(--section-rows) / 29 * 100%);
  min-height: 0;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 44%);
  background: transparent;
  color: transparent;
  opacity: 1;
}

.infiniboardMapSection.owned {
  border-color: rgb(255 255 255 / 72%);
  background: color-mix(in srgb, var(--section-owner-color, transparent) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--section-owner-color, transparent) 38%, transparent);
  opacity: 1;
  pointer-events: none;
}

.infiniboardMapSection.available {
  cursor: pointer;
  border: 2px solid rgb(36 107 154 / 90%);
  background: rgb(36 107 154 / 9%);
  animation: infiniboardSectionPulse 1.25s ease-in-out infinite;
}

.infiniboardMapSection.lockedCorner {
  cursor: help;
  border: 2px dashed rgb(64 71 73 / 76%);
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgb(45 53 55 / 8%) 7px 12px);
}

.infiniboardMapSection.lockedCorner::after {
  content: "\1F512";
  position: absolute;
  left: 50%;
  top: 50%;
  color: #343b3d;
  font-size: clamp(11px, 3.2vw, 18px);
  filter: grayscale(1);
  transform: translate(-50%, -50%);
}

.infiniboardMapSection.available:hover,
.infiniboardMapSection.selected {
  z-index: 3;
  outline: 3px solid var(--blue);
  outline-offset: -3px;
  background: rgb(36 107 154 / 19%);
  animation: none;
}

.infiniboardMapSection.lockedCorner:hover {
  z-index: 3;
  border-color: #343b3d;
  background-color: rgb(255 255 255 / 12%);
}

.infiniboardMapLegend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 11px;
}

.infiniboardMapLegend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.infiniboardMapLegend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.infiniboardMapLegend i.active {
  border: 1px solid rgb(58 48 34 / 45%);
  background: linear-gradient(135deg, #dfd7c5 0 50%, #d0927a 50%);
}

.infiniboardMapLegend i.available {
  border: 2px solid var(--blue);
  background: #c8c8c8;
}

.infiniboardMapLegend i.locked {
  border: 1px dashed #454d4f;
  background: repeating-linear-gradient(135deg, #dedede 0 4px, #bdbdbd 4px 7px);
}

@keyframes infiniboardSectionPulse {
  50% {
    filter: brightness(1.12);
    box-shadow: inset 0 0 0 3px rgb(255 255 255 / 62%);
  }
}

.cell.dl {
  background: #9fbe79;
  color: #17303c;
}

.cell.center:not(.hasTile):not(.pending)::after {
  content: "";
  width: 12cqw;
  height: 12cqw;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.cell.hasTile {
  background: var(--locked);
  color: var(--tile-ink);
  box-shadow: inset 0 -3px 0 rgb(83 56 21 / 18%);
}

.tileFace {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
}

.cell > .tileFace {
  z-index: 1;
  background: inherit;
}

.boardEntranceLayer {
  position: absolute;
  inset: 0;
  /* The entire layer must also sit above score anchors (20000). */
  z-index: 30000;
  pointer-events: none;
  overflow: visible;
}

.boardEntranceTile {
  container-type: inline-size;
  position: absolute;
  z-index: 1;
  display: block;
  border-radius: 4px;
  pointer-events: none;
  animation: tileFloatIn var(--tile-enter-duration, 800ms) cubic-bezier(0.45, 0, 0.25, 1) var(--tile-enter-delay, 0ms) both;
  transform-origin: 50% 50%;
  will-change: opacity, transform;
}

.boardEntranceTile .tileFace {
  z-index: 1;
  background: var(--locked);
  color: var(--tile-ink);
  box-shadow: inset 0 -3px 0 rgb(83 56 21 / 18%);
}

.cell.hasTile.tileOwner {
  background: #dcecf6;
  background: color-mix(in srgb, var(--owner-color, #2f80ed) 34%, white);
  box-shadow: inset 0 -3px 0 rgb(35 50 54 / 16%);
}

.cell.pending {
  background: var(--pending);
  color: var(--tile-ink);
}

.cell.pending.ghostPending {
  background: #f1f3f3;
  color: #555d61;
  box-shadow: inset 0 -2px 0 rgb(56 65 69 / 10%);
}

.cell.pending.ghostPending .tilePoints,
.cell.pending.ghostPending .blankMark {
  color: #747c80;
}

.cell.pending.illegalPendingLetter .letter {
  color: var(--red);
}

.cell.pending.illegalPendingStructure::after,
.cell.hasTile.illegalCommittedWord::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 2px solid var(--red);
  border-radius: inherit;
  pointer-events: none;
}

.cell.phantom {
  background: #f1f3f3;
  color: #555d61;
  outline: 2px solid #5496bf;
  outline-offset: -2px;
  box-shadow: inset 0 -3px 0 rgb(35 80 109 / 16%);
}

.cell.lastPlayed {
  outline: 3px solid var(--player-color, #1684c4);
  outline-offset: -3px;
}

.cell.lastPlayed > .tileFace {
  outline: 3px solid var(--player-color, #1684c4);
  outline-offset: -3px;
}

.cell.assistBlue::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: rgb(112 198 241 / 38%);
  pointer-events: none;
}

.cell.assistPink {
  z-index: 3;
  outline: 3px solid #ea4c9b;
  outline-offset: -3px;
}

.cell.assistPink > .tileFace {
  outline: 3px solid #ea4c9b;
  outline-offset: -3px;
}

.cell.bingoGlow {
  z-index: 2;
  animation:
    bingoTilePop var(--bingo-pop-duration, 680ms) cubic-bezier(0.34, 1.56, 0.64, 1) var(--bingo-delay, 0ms) both,
    bingoGlowFade var(--bingo-glow-duration, 1520ms) ease-out both;
  transform-origin: 50% 50%;
  will-change: transform, box-shadow;
  box-shadow:
    inset 0 -3px 0 rgb(83 56 21 / 18%),
    0 0 0 5px var(--player-color, #1684c4),
    0 0 30px var(--player-color, #1684c4);
}

.cell.bingoGlow {
  box-shadow:
    inset 0 -3px 0 rgb(83 56 21 / 18%),
    0 0 0 5px color-mix(in srgb, var(--player-color, #1684c4) 76%, white),
    0 0 30px color-mix(in srgb, var(--player-color, #1684c4) 88%, transparent);
}

.cell.policyDisputed {
  animation:
    disputedTilePulse 960ms ease-in-out infinite,
    disputedTileShake 620ms ease-in-out infinite;
  transform-origin: 50% 55%;
  will-change: transform, background;
}

.cell.phantom .tilePoints,
.cell.phantom .blankMark {
  color: rgb(39 32 25 / 70%);
}

/* Every measurement is a fraction of the containing tile, not the viewport.
   Keep these profiles separate so their reference proportions can be tuned
   independently. Font weights stay fixed as the glyphs scale with font size. */
.cell,
.boardEntranceTile {
  --tile-letter-size: 70cqw;
  --tile-letter-weight: 400;
  --tile-points-size: 23cqw;
  --tile-points-weight: 400;
  --tile-points-inset-x: 8%;
  --tile-points-inset-y: 6%;
  --tile-premium-size: 24cqw;
  --tile-premium-weight: 400;
}

.letter,
.tilePoints,
.blankMark,
.premiumLabel {
  font-family: "Hammersmith One", sans-serif;
  /* Keep the supplied weight; played blanks may still use an italic slant. */
  font-synthesis: style;
}

.premiumLabel {
  font-size: var(--tile-premium-size);
  font-weight: var(--tile-premium-weight);
  line-height: 1;
}

.letter {
  font-size: var(--tile-letter-size);
  line-height: 1;
  font-weight: var(--tile-letter-weight);
  margin-top: 10%;
}

.rackTiles .letter, .blankLetterChoices .letter {
  margin-top: 4%;
}

.cell.blankPlayedTile .blankLetter,
.boardEntranceTile.blankPlayedTile .blankLetter {
  font-style: italic;
}

.cell.dropTarget,
.rackTile.dropTarget {
  outline: 3px solid #1f8bd3;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 72%), 0 0 0 2px rgb(31 139 211 / 18%);
}

.cell.dropTarget {
  background: #dff0ff;
}

.dragTargetGuide {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  background: var(--player-color);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 65%);
}

.dragTargetGuide-row {
  grid-column: 1 / -1;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
}

.dragTargetGuide-column {
  grid-row: 1 / -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
}

.tilePoints {
  position: absolute;
  right: var(--tile-points-inset-x);
  bottom: var(--tile-points-inset-y);
  color: rgb(39 32 25 / 70%);
  font-size: var(--tile-points-size);
  font-weight: var(--tile-points-weight);
  line-height: 1;
}

.blankMark {
  position: absolute;
  left: var(--tile-points-inset-x);
  bottom: var(--tile-points-inset-y);
  font-size: var(--tile-points-size);
  font-weight: var(--tile-points-weight);
  line-height: 1;
  color: rgb(39 32 25 / 65%);
}

@keyframes tileFloatIn {
  0% {
    opacity: 0;
    transform: translate3d(var(--tile-enter-x, 260%), var(--tile-enter-y, -260%), 0) rotate(var(--tile-enter-rotation, -20deg)) scale(0.94);
  }

  60% {
    opacity: 0.88;
    transform: translate3d(var(--tile-enter-near-x, 100%), var(--tile-enter-near-y, -100%), 0) rotate(var(--tile-enter-rotation, -20deg)) scale(0.98);
  }

  82% {
    opacity: 0.98;
    transform: translate3d(var(--tile-enter-settle-x, 32%), var(--tile-enter-settle-y, -32%), 0) rotate(var(--tile-enter-settle-rotation, -7deg)) scale(1);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes disputedTilePulse {
  0%,
  100% {
    background: var(--locked);
    box-shadow: inset 0 -3px 0 rgb(83 56 21 / 18%);
  }

  50% {
    background: #f0a33a;
    box-shadow: inset 0 -3px 0 rgb(103 61 4 / 20%), 0 0 0 2px rgb(240 132 32 / 30%);
  }
}

@keyframes disputedTileShake {
  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(2deg);
  }

  75% {
    transform: rotate(5deg);
  }
}

@keyframes bingoTilePop {
  0%,
  100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.12);
  }
}

@keyframes bingoGlowFade {
  0%,
  72% {
    box-shadow:
      inset 0 -3px 0 rgb(83 56 21 / 18%),
      0 0 0 5px var(--player-color, #1684c4),
      0 0 30px var(--player-color, #1684c4);
  }

  100% {
    box-shadow:
      inset 0 -3px 0 rgb(83 56 21 / 18%),
      0 0 0 0 rgb(22 132 196 / 0%),
      0 0 0 rgb(22 132 196 / 0%);
  }
}

.rackBand {
  width: min(100%, 760px);
  margin: 10px auto 0;
}

.playbackMode .rackBand,
.kundailyReviewMode .rackBand {
  position: relative;
}

.playbackRackLabel {
  margin: 0 0 4px;
  text-align: center;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}

.playbackScrubber {
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
  cursor: ew-resize;
  touch-action: none;
}

.playbackScrubber[hidden] {
  display: none;
}

.playbackMode #rackTiles .rackTile:disabled,
.kundailyReviewMode #rackTiles .rackTile:disabled {
  --rack-border-color: #ae8b45;
  opacity: 1;
  background: var(--tile);
  border-color: #ae8b45;
  cursor: default;
}

.playbackMode.playbackTileOwners #rackTiles .rackTile:disabled {
  --rack-border-color: var(--player-color);
  border-color: var(--player-color);
}

.playbackMode .gameControls .controlLabel,
.kundailyReviewMode .gameControls .controlLabel {
  font-size: clamp(9px, 1.6vw, 14px);
  white-space: nowrap;
  overflow-wrap: normal;
}

.playbackMode.playbackTileOwners .cell.phantom,
.playbackMode.playbackTileOwners .cell.phantom > .tileFace {
  outline: 2px solid;
  outline-color: var(--player-color);
  outline-offset: -2px;
}

.playScorePill.playbackGhost,
.playScorePill.playbackActual {
  background: var(--player-color);
  color: white;
  border-color: var(--player-color);
}

.playScorePill.playbackGhost {
  opacity: .72;
  border-style: dashed;
}

.rackTiles {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.rackTile {
  --tile-letter-size: 72cqw;
  --tile-letter-weight: 400;
  --tile-points-size: 22cqw;
  --tile-points-weight: 400;
  --tile-points-inset-x: 6%;
  --tile-points-inset-y: 6%;
  --tile-border-width: 1.32cqw;
  --tile-bevel-depth: 8cqw;
  --rack-border-color: #ae8b45;
  container-type: inline-size;
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  border-radius: 14%;
  padding: 0;
  background: var(--tile);
  color: var(--tile-ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.rackTile::after {
  /* A descendant can query this tile's width. Inset shadows also preserve
     fractional border widths instead of rounding CSS borders to whole pixels. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 var(--tile-border-width) var(--rack-border-color),
    inset 0 calc(-1 * var(--tile-bevel-depth)) 0 rgb(93 67 24 / 13%);
  pointer-events: none;
}

.rackTile:hover {
  --rack-border-color: #74817c;
}

.rackTile.assistRackLetter .letter {
  color: #1684c4;
}

.rackTile.selected {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.rackTile.used,
.dragSource {
  opacity: 0.35;
}

.rackTile.used {
  cursor: pointer;
}

.rackTile.used.illegalPendingRackShadow .letter {
  color: #d94f5b;
}

.rackTile.aiTile {
  --rack-border-color: #87aeca;
  background: var(--blue-bg);
  border-color: #87aeca;
}

.rackTiles.turnWave .rackTile.hasLetter {
  animation: rackTurnWave 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--wave-delay, 0ms);
}

@keyframes rackTurnWave {
  0%,
  100% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-5%);
  }
}

.compactRack {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gameControls {
  width: min(100%, 520px);
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.gameControls button {
  aspect-ratio: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 3px;
  padding: 7px 4px 6px;
  line-height: 1;
}

.controlIcon {
  display: grid;
  place-items: center;
  font-size: 48px;
  line-height: 1;
}

.controlLabel {
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.aiRackPanel,
.gameLogPanel,
.moveListPanel {
  min-width: 0;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  flex: 0 0 auto;
}

.metrics > div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 9px;
  align-items: baseline;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.errors {
  min-height: 38px;
  max-height: 54px;
  overflow: auto;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.listHeader,
.dialogHeader,
.wordPopoverHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dialogHeader {
  position: sticky;
  z-index: 4;
  top: 0;
  flex: 0 0 auto;
  background: var(--panel);
  box-shadow:
    0 -16px 0 var(--panel),
    0 8px 12px -11px rgb(20 28 32 / 70%);
}

.dialogHeader > h2 {
  min-width: 0;
  margin-right: auto;
}

.dialogHeaderActions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.dialogHeaderTextButton {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.dialogHeaderTextButton::after {
  content: "↗";
  font-size: 17px;
  font-weight: 760;
  line-height: 1;
}

.dialogHeaderToggleButton {
  flex: 0 1 auto;
  min-height: 32px;
  max-width: 150px;
  padding: 4px 9px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

.dialogHeaderToggleButton.active {
  border-color: #2f80ed;
  background: #dcebff;
  color: #12415f;
}

.modalScrollCue {
  display: none;
}

.modalScrollCueIndicator {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 25px;
  overflow: hidden;
  border: 1px solid #aeb8b5;
  border-radius: 999px;
  background: var(--panel);
  color: #52646b;
  box-shadow: 0 2px 7px rgb(35 50 54 / 18%);
  line-height: 0;
}

.modalScrollCueIcon {
  display: block;
  width: 16px;
  height: 10px;
}

@media (hover: none) and (pointer: coarse) {
  .modalScrollCue:not([hidden]) {
    position: fixed;
    z-index: 12;
    box-sizing: border-box;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 5px;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      rgb(251 251 247 / 0%) 0%,
      rgb(251 251 247 / 92%) 58%,
      var(--panel) 100%
    );
  }
}

.listHeader button {
  min-width: 94px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto;
}

.tabButton.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: #12415f;
  font-weight: 760;
}

.tabPanels {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
}

.tabPanel {
  min-width: 0;
  min-height: 0;
  display: none;
  overflow: hidden;
}

.tabPanel.active {
  display: flex;
  flex-direction: column;
}

.moveList {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.moveRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
  background: var(--panel);
  cursor: pointer;
}

.moveRow:hover,
.moveRow:focus-visible {
  border-color: #74817c;
  outline: none;
}

.moveRow.chosenMove {
  border-color: #70ae8f;
  background: #edf8f1;
}

.moveRow.phantomActive {
  border-color: var(--blue);
  background: #e5f0f8;
}

.moveRow strong {
  display: block;
  overflow-wrap: anywhere;
}

.moveRow span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.moveScore {
  min-width: 38px;
  color: var(--green);
  font-size: 19px;
  font-weight: 700;
  text-align: right;
}

.moveMain {
  min-width: 0;
}

.moveDebugLine {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.metricPill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 5px;
  border-radius: 5px;
  background: #e3e8e4;
  color: #4e5960;
  font-size: 11px;
  font-weight: 720;
}

.moveReason {
  display: block;
  margin-top: 4px;
  color: #4e5960;
  font-size: 11px;
  line-height: 1.25;
}

.logList {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.logList li {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.logList time {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.logList strong {
  display: block;
  font-size: 14px;
}

.logList span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.logWordPill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin: 1px 2px;
  padding: 2px 8px;
  border: 1px solid #86aeca;
  border-radius: 999px;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  vertical-align: middle;
}

.logWordPill:hover,
.logWordPill:focus-visible {
  border-color: #397ca4;
  background: #dceef8;
  outline: none;
}

.logReactions {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.logList .logReactions span {
  margin: 0;
  color: var(--ink);
  font-weight: 720;
}

.rackAnalysisLog,
.moveEfficiencyLog {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.logList .rackAnalysisSummary,
.logList .moveEfficiencySummary {
  color: #176b3a;
  font-size: 12px;
}

.logList .moveEfficiencyAlternatives {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

/* Both independent preferences may be on; show the turn efficiency just once. */
.moveEfficiencyLog + .rackAnalysisLog .rackAnalysisSummary {
  display: none;
}

.moveEfficiencyLog + .rackAnalysisLog {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.logList .rackAnalysisHeading {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.logList .rackAnalysisTurns {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logList .rackAnalysisTurns li {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 6px 7px;
  border: 1px solid #cdded3;
  border-radius: 7px;
  background: #f4faf6;
}

.logList .rackAnalysisTurnDescription {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.rackAnalysisTurnDescription .rackAnalysisWordPill {
  margin-block: 0;
}

.showRackTurnButton {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #78a98b;
  border-radius: 999px;
  background: #e5f4ea;
  color: #155d35;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.showRackTurnButton:hover,
.showRackTurnButton:focus-visible {
  border-color: #397b53;
  background: #d5eddd;
  outline: none;
}

.logList .policyVoteLogItem {
  display: grid;
  gap: 7px;
  border-color: #efad53;
  background: #fff6df;
  box-shadow: inset 3px 0 0 #f08a28;
}

.policyVoteStatus {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.policyVoteChip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #e7d3a7;
  border-radius: 999px;
  background: #fffaf0;
  color: #544537;
  font-size: 12px;
  font-weight: 760;
}

.policyVoteChip.yes {
  border-color: #9fc9a5;
  background: #e8f6e9;
}

.policyVoteChip.no {
  border-color: #eba5a5;
  background: #feeaea;
}

.policyVoteActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.policyVoteActions button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
}

.aiDebug {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.debugRackButton {
  min-height: 34px;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 13px;
  font-weight: 760;
}

body:not(.debugMode) .debugRackButton {
  display: none;
}

.debugRackRows {
  min-height: 0;
  display: grid;
  flex: 0 1 auto;
  gap: 8px;
  margin-top: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.debugRackRow {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 10px;
}

.debugRackRow span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debugRackRow input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.emptyList {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.swapDialog,
.blankLetterDialog,
.allowWordDialog,
.confirmDialog,
.privacyDialog,
.menuDialog,
.definitionDialog {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.swapDialog::backdrop,
.blankLetterDialog::backdrop,
.allowWordDialog::backdrop,
.confirmDialog::backdrop,
.privacyDialog::backdrop,
.menuDialog::backdrop,
.definitionDialog::backdrop {
  background: rgb(25 32 35 / 42%);
}

.confirmDialogText {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-line;
}

.swapDialog,
.blankLetterDialog,
.allowWordDialog,
.confirmDialog,
.definitionDialog,
.spectatorDialog {
  overflow: auto;
  overscroll-behavior: contain;
}

.blankLetterDialog {
  width: min(410px, calc(100vw - 24px));
  overflow: hidden;
}

.blankLetterHint {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.blankLetterChoices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-height: calc(100dvh - 150px);
  padding: 2px;
  overflow: auto;
  overscroll-behavior: contain;
}

.blankLetterChoice {
  width: 100%;
  min-width: 0;
  touch-action: manipulation;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.blankLetterChoice:hover,
.blankLetterChoice:focus-visible {
  --rack-border-color: var(--blue);
  z-index: 1;
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  box-shadow: 0 4px 10px rgb(35 50 54 / 18%);
  transform: translateY(-1px);
}

.confirmDialog .profileForm {
  margin-bottom: 14px;
}

.kickedFromGameDialog .dialogHeader {
  margin-bottom: 18px;
}

.kickedFromGameDialog h2 {
  margin: 0;
}

.kickedFromGameDialog .dialogActions {
  display: flex;
  justify-content: center;
}

.kickedFromGameDialog .dialogActions button {
  width: auto;
  max-width: 100%;
  padding-inline: 18px;
  white-space: nowrap;
}

.privacyDialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  overflow: hidden;
}

.privacyDialog[open] {
  display: flex;
  flex-direction: column;
}

.privacyDialogContent {
  min-height: 90px;
  overflow: auto;
  padding: 12px 2px 2px;
  color: var(--ink);
  line-height: 1.5;
}

.privacyPolicy {
  display: grid;
  gap: 10px;
}

.privacyPolicy h3 {
  margin: 4px 0 0;
}

.registrationPrivacyNotice {
  margin-top: 10px;
}

.registrationPrivacyNotice a {
  color: var(--accent);
  font-weight: 700;
}

.menuDialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 24px));
  overflow: hidden;
  touch-action: auto;
}

.menuDialog[open] {
  display: flex;
  flex-direction: column;
}

.menuDialog:not([open]) {
  display: none;
}

.waitingRoomDialog {
  position: fixed;
  inset: auto;
  z-index: 50;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 32px));
  margin: 0;
  overflow: auto;
  border: 2px solid #8a7653;
  border-radius: 10px;
  padding: 13px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 14px 40px rgb(38 30 18 / 34%);
}

.waitingRoomDialog::backdrop {
  background: rgb(25 32 35 / 30%);
}

.waitingRoomHeader {
  margin-bottom: 6px;
}

.waitingRoomHeader h2 {
  margin: 0;
  font-size: clamp(19px, 3vw, 26px);
}

.waitingRoomDialog > h3 {
  margin: 4px 0 8px;
  font-size: clamp(16px, 2.5vw, 21px);
}

body.waitingRoomOpen .boardWrap,
body.waitingRoomOpen .rackBand,
body.waitingRoomOpen .gameControls,
body.waitingRoomOpen .sidePanel {
  pointer-events: none;
}

body.waitingRoomOpen .scoreStrip > div {
  pointer-events: none;
}

.waitingRoomGameInfo {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.3;
}

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

.randomStartOrderOption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 32px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.randomStartOrderOption input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.randomStartOrderOption:has(input:disabled) {
  cursor: default;
}

.waitingRoomSlot {
  min-width: 0;
  border: 2px solid var(--player-color, var(--line));
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--panel);
}

.waitingRoomSlot.isEmpty {
  border-style: dashed;
  opacity: 0.72;
}

.waitingRoomSlot span,
.waitingRoomSlot strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waitingRoomSlot span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.waitingRoomSlot strong {
  margin-top: 2px;
  font-size: 14px;
}

.waitingRoomSlotAction {
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 4px 7px;
  font-size: 11px;
}

.waitingRoomSlot > .waitingRoomSlotAction {
  margin-top: 7px;
}

.waitingRoomSlotChoices {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  margin-top: 7px;
}

.waitingRoomSlot .waitingRoomSlotChoiceOr {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.waitingRoomAiSelect {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 5px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
}

.waitingRoomAiSelectWrap {
  position: relative;
  min-width: 0;
}

.waitingRoomSlot .waitingRoomAiPlaceholder {
  display: none;
}

@media (orientation: portrait) {
  .waitingRoomAiSelect.isPlaceholder {
    min-height: 38px;
    color: transparent;
  }

  .waitingRoomAiSelect.isPlaceholder option {
    color: var(--ink);
  }

  .waitingRoomSlot .waitingRoomAiSelect.isPlaceholder + .waitingRoomAiPlaceholder {
    position: absolute;
    inset: 1px 20px 1px 1px;
    display: grid;
    place-content: center;
    color: var(--ink);
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
    pointer-events: none;
  }
}

#waitingRoomStartButton.readyToStart {
  border-color: #7fbd9b;
  background: var(--green-bg);
  color: var(--green);
  font-weight: 800;
}

.waitingRoomInvitePanel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
}

.waitingRoomInvitePanel[hidden] {
  display: none;
}

.waitingRoomInvitePanel h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

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

.waitingRoomInviteBuddies button,
.waitingRoomInviteActions button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  white-space: normal;
}

.waitingRoomInviteEmpty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.waitingRoomInvitePanel > .waitingRoomInviteActions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
  padding: 0;
}

.waitingRoomInviteActions button {
  padding-inline: 4px;
  font-size: clamp(9px, 2.2vw, 12px);
  white-space: nowrap;
}

.waitingRoomInviteActions .waitingRoomCancelInviteAction {
  grid-column: 1 / -1;
}

.waitingRoomDialog > .waitingRoomActions {
  grid-template-columns: 1fr 1fr;
  margin: 20px 0 0;
}

.waitingRoomActions button {
  min-width: 0;
  white-space: normal;
}

.menuDialog.hardcoreMenu {
  border-color: #6f1015;
  box-shadow: 0 0 0 1px #ffbf38, 0 0 30px rgb(255 114 20 / 52%), var(--shadow);
}

@media (max-width: 430px), (max-height: 620px) {
  .waitingRoomDialog {
    padding: 9px;
  }

  .waitingRoomGameInfo {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .waitingRoomSlots {
    gap: 5px;
  }

  .waitingRoomSlot {
    padding: 5px 7px;
  }

  .waitingRoomSlot strong {
    font-size: 12px;
  }

  .waitingRoomSlotAction {
    min-height: 24px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .waitingRoomSlot > .waitingRoomSlotAction {
    margin-top: 5px;
  }

  .waitingRoomSlotChoices {
    gap: 3px;
    margin-top: 5px;
  }

  .waitingRoomAiSelect {
    min-height: 24px;
    padding: 3px 4px;
    font-size: 9px;
  }

  .waitingRoomInvitePanel {
    margin-top: 8px;
    padding: 7px;
  }

  .waitingRoomDialog > .waitingRoomActions {
    gap: 6px;
    margin: 12px 0 0;
  }

  .waitingRoomActions button {
    min-height: 34px;
    padding: 5px 7px;
    font-size: 11px;
  }
}

@media (orientation: portrait) and (max-width: 430px),
  (orientation: portrait) and (max-height: 620px) {
  .waitingRoomAiSelect.isPlaceholder {
    min-height: 34px;
  }

  .waitingRoomSlot .waitingRoomAiSelect.isPlaceholder + .waitingRoomAiPlaceholder {
    font-size: 9px;
  }
}

.menuDialog:has(.canonicalPolicyGrid),
.menuDialog:has(.gameArchiveDetail) {
  width: min(760px, calc(100vw - 24px));
}

.definitionDialog {
  width: min(520px, calc(100vw - 24px));
}

.definitionBody {
  min-height: 56px;
  margin: 12px 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.definitionBody strong,
.wordChoiceDefinition strong {
  display: inline;
  font-weight: 820;
}

.definitionBody .definitionGameIllegal,
.wordChoiceDefinition .definitionGameIllegal {
  display: block;
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 12px;
}

.definitionBaseLink {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.definitionReactions {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
}

.definitionReactions > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.definitionReactionButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.reactionButton {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 21px;
  line-height: 1;
}

.reactionButton:hover,
.reactionButton:focus-visible {
  border-color: #86aeca;
  background: var(--blue-bg);
}

.definitionInline {
  display: inline;
}

.definitionAttribution {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72em;
  opacity: 0.72;
}

.definitionActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

#finalChallengeDialog[data-mode="offender-waiting"] .definitionActions,
#finalChallengeDialog[data-mode="offender-waiting"] .finalChallengeWords {
  display: none;
}

.ospsStatus {
  min-height: 0;
  margin-top: 8px;
}

.ospsResultPill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.ospsResultPill.good {
  background: #dff3e8;
  color: #16633f;
}

.ospsResultPill.bad {
  background: #f9dddd;
  color: #971b1b;
}

.ospsResultPill.warn {
  background: #fff0bf;
  color: #7a5200;
}

.ospsResultPill.info,
.ospsAlreadyChecked {
  background: var(--bg);
  color: var(--muted);
}

.ospsAlreadyChecked {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.blockDefinitionButton {
  min-height: 36px;
  border-color: #dda0a5;
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 740;
}

.blockActionButton {
  border-color: #dda0a5;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 760;
}

.menuTopBar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin: -14px -14px 12px;
  padding: 10px 12px;
  border-radius: 8px 8px 0 0;
  background: #1e2728;
  color: #f6fbf8;
}

.menuDialog:has(.scrollableMenu) .menuTopBar {
  box-shadow: 0 8px 18px rgb(25 32 35 / 22%);
}

.menuTopBar.main {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.hardcoreMenu .menuTopBar {
  background: #24070a;
  box-shadow: inset 0 -1px 0 #ffb22e, 0 8px 22px rgb(255 96 18 / 22%);
}

.menuBrand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menuLogo {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
}

.menuTopBar h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menuTopBar h2.aboutReleaseTitle {
  overflow: visible;
  font-size: 17px;
  text-overflow: clip;
  white-space: normal;
}

.menuTopBar.submenu {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.menuTopBar.main .menuNavButton,
.menuTopBar.submenu .menuLogo,
.menuTopBar.submenu .menuIdentity,
.menuTopBar.submenu .menuActionButton {
  display: none;
}

.menuNavButton,
.menuActionButton,
.menuIdentity,
.menuCloseButton {
  min-height: 34px;
  border-color: rgb(255 255 255 / 20%);
  background: rgb(255 255 255 / 10%);
  color: inherit;
  font-weight: 820;
}

.menuNavButton {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.menuActionButton {
  padding: 0 10px;
  white-space: nowrap;
}

.menuCloseButton {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.menuIdentity {
  min-width: 0;
  width: max-content;
  max-width: 100%;
  justify-self: end;
  padding: 0 10px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menuIdentity:not(:disabled) {
  cursor: pointer;
}

.menuIdentity:disabled {
  border-color: transparent;
  background: transparent;
  color: #cfe2dc;
  opacity: 1;
}

.menuIdentity:not(:disabled):hover {
  background: rgb(255 255 255 / 16%);
  color: #ffffff;
}

body.hardcoreShake .appShell,
body.hardcoreShake .menuDialog[open] {
  animation: hardcoreShake 240ms ease-in-out both;
}

@keyframes hardcoreShake {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  18% {
    transform: translate3d(-2px, 1px, 0) rotate(-0.15deg);
  }

  38% {
    transform: translate3d(2px, -1px, 0) rotate(0.15deg);
  }

  58% {
    transform: translate3d(-1px, 1px, 0) rotate(-0.1deg);
  }

  78% {
    transform: translate3d(1px, 0, 0) rotate(0.08deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .infiniboardViewport.infiniboardSnapping .board.infiniboard {
    transition: none;
  }

  .infiniboardMapSection.available,
  .boardEntranceTile,
  .cell.bingoGlow,
  .cell.policyDisputed,
  .rackTiles.turnWave .rackTile.hasLetter,
  .turnCue.show .turnCueText,
  body.hardcoreShake .appShell,
  body.hardcoreShake .menuDialog[open],
  .challengePenaltyToggle.turnLossImpact,
  .turnLossSkull {
    animation: none;
  }

}

.menuContent {
  min-height: 0;
  width: 100%;
  flex: 0 1 auto;
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: min(640px, calc(100dvh - 112px));
  overflow: auto;
  padding: 0 2px 14px;
  overscroll-behavior: contain;
}

.menuContent.scrollableMenu {
  width: auto;
  margin: 0 -14px -14px;
  padding: 0 0 14px;
  gap: 0;
}

.scrollableMenuSection {
  padding: 12px 14px;
}

.scrollableMenuSection:first-child {
  padding-top: 12px;
}

.scrollableMenu .multiplayerGameList {
  max-height: none;
  overflow: visible;
  padding: 0;
}

.menuContent.maintenanceMenu {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: 8px 2px 18px;
}

.maintenanceSection {
  gap: 12px;
  text-align: left;
}

.maintenanceSection > h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.maintenanceMessage,
.maintenanceProgressText,
.maintenanceFailure {
  margin: 0;
  line-height: 1.45;
}

.maintenanceProgressText {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.maintenanceProgressTrack {
  height: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 75%, black);
  border-radius: 999px;
  background: #eee8dc;
  box-shadow: inset 0 1px 2px rgb(45 31 17 / 12%);
}

.maintenanceProgressTrack > span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #63b578);
  transition: width 240ms ease;
}

.maintenanceFailure {
  padding: 9px 10px;
  border: 1px solid #d99191;
  border-radius: 7px;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 760;
}

.maintenanceErrorDetail {
  overflow-wrap: anywhere;
}

.maintenanceFeatureSetting {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 70%);
}

.maintenanceDynamicAssistToggle,
.maintenanceInfiniboardToggle {
  width: 100%;
}

.maintenanceInfiniboardConfig {
  display: grid;
  gap: 7px;
}

.maintenanceInfiniboardConfig .settingsRow {
  min-height: 36px;
  padding: 5px 8px;
}

.maintenanceInfiniboardConfig input[type="number"] {
  width: 92px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: right;
}

.maintenanceActions {
  margin-top: 4px;
}

.maintenancePlayersSection {
  gap: 10px;
}

.maintenancePlayerList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.menuSection {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.menuSection:first-child {
  padding-top: 0;
  border-top: 0;
}

.menuActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.menuActions.single {
  grid-template-columns: 1fr;
}

.mainMenuActions {
  grid-template-columns: 1fr;
}

.myGamesMenuButton,
.waitingGamesMenuButton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.waitingGamesMenuButton {
  padding-inline: 48px;
}

.myGamesNotificationPill,
.waitingGamesInvitationPill {
  position: absolute;
  top: 50%;
  right: 12px;
  min-width: 24px;
  padding: 2px 7px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
  text-align: center;
}

.myGamesNotificationPill[hidden],
.waitingGamesInvitationPill[hidden] {
  display: none;
}

.profileForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.profileForm.registrationForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profileForm.registrationForm button {
  grid-column: 1 / -1;
}

.profileForm.accountSingleFieldForm {
  grid-template-columns: 1fr;
}

.settingsForm {
  display: grid;
  gap: 8px;
  touch-action: auto;
}

.gameRulesBox,
.playerSlotsSection {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f1;
}

.gameRulesBox h3,
.playerSlotsSection h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.gameRulesBox .settingsRow {
  border-color: #c8d4d0;
}

.settingsRowControls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ruleInfoButton {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.ruleInfoButton:hover,
.ruleInfoButton:focus-visible {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.gameRulesSummary {
  display: grid;
  gap: 5px;
}

.gameRulesSummary[hidden] {
  display: none;
}

.gameRulesSummaryRow[hidden],
.settingsRow[hidden] {
  display: none;
}

.gameRulesSummaryRow {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.gameRulesSummaryRow strong {
  font-weight: 750;
}

.gameRulesNewBadge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border: 1px solid #d6b958;
  border-radius: 999px;
  background: #fff2c2;
  color: #785100;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}

.gameRulesEditor {
  display: grid;
  gap: 8px;
}

.gameRulesEditor[hidden] {
  display: none;
}

.gameRulesToggleButton {
  width: 100%;
  min-height: 38px;
  border: 1px solid #9fb8af;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.gameRulesToggleButton:hover,
.gameRulesToggleButton:focus-visible {
  border-color: var(--blue);
  background: #f7fbfd;
}

.assistLevelControl {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #c8d4d0;
  border-radius: 7px;
  background: #fff;
}

.assistLevelControl::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: url("/tts.jpg?v=__ASSET_VERSION__") center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.assistLevelControl.isRackLettersEnabled::before {
  opacity: 1;
}

.assistLevelControl > * {
  position: relative;
  z-index: 1;
}

.assistLevelLabel {
  min-height: 34px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}

.assistSliderWrap {
  position: relative;
  height: 42px;
  margin: 0 4px;
}

.assistRange {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 42px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: grab;
}

.assistRange:active {
  cursor: grabbing;
}

.assistLevelControl.isDragging .assistRange {
  cursor: grabbing;
}

.assistRange::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #b9d9e9;
}

.assistRange::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #b9d9e9;
}

.assistRange::-webkit-slider-thumb {
  width: 38px;
  height: 38px;
  margin-top: -15px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.assistRange::-moz-range-thumb {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.assistRange:focus-visible {
  outline: 0;
}

.assistRange:focus-visible + .assistThumb {
  outline: 3px solid #1f8bd3;
  outline-offset: 3px;
}

.assistMarkers {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.assistMarker {
  position: absolute;
  top: 50%;
  left: calc(19px + (100% - 38px) * var(--assist-stop));
  width: 10px;
  height: 10px;
  border: 2px solid #5ea5c8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(30 78 104 / 18%);
  transform: translate(-50%, -50%);
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.assistMarker.isActive {
  border-color: #1684c4;
  background: #1684c4;
  transform: translate(-50%, -50%) scale(1.18);
}

.assistThumb {
  position: absolute;
  z-index: 4;
  top: 2px;
  left: calc(19px + (100% - 38px) * var(--assist-progress, 0));
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1684c4;
  box-shadow: 0 3px 9px rgb(22 132 196 / 34%);
  font-size: 21px;
  line-height: 1;
  pointer-events: none;
  transform: translateX(-19px);
  transition:
    left 140ms cubic-bezier(.2, .85, .3, 1),
    transform 120ms ease,
    box-shadow 120ms ease;
}

.assistLevelControl.isDragging .assistThumb {
  box-shadow:
    0 4px 12px rgb(22 132 196 / 42%),
    0 0 0 7px rgb(31 139 211 / 18%);
  transform: translateX(-19px) scale(1.14);
  transition-duration: 55ms, 90ms, 90ms;
}

.assistLevelControl.isDragging .assistMarker {
  border-color: #3c94bc;
}

.assistRackLettersRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-top: 9px;
  border-top: 1px solid rgb(79 109 121 / 42%);
  color: var(--ink);
  font-size: 13px;
}

.assistRackLettersToggle {
  min-width: min(230px, 48vw);
}

.assistRackLettersToggle.isDisabled {
  border-color: #b8c0bd;
  background: #e7ebe9;
}

.assistDynamicRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-top: 9px;
  border-top: 1px solid rgb(79 109 121 / 42%);
  color: var(--ink);
  font-size: 13px;
}

.assistDynamicToggle {
  min-width: min(230px, 48vw);
}

.assistDynamicDescription {
  margin: -2px 0 0;
}

.assistLevelControl.isDynamicAssistEnabled .assistLevelLabel,
.assistLevelControl.isDynamicAssistEnabled .assistSliderWrap,
.assistLevelControl.isDynamicAssistEnabled .assistRackLettersRow {
  opacity: .44;
  filter: grayscale(.65);
}

.assistLevelControl.isDynamicAssistEnabled .assistRange {
  cursor: not-allowed;
}

.assistStatisticsNotice {
  margin-top: 0;
}

.handicapMarker {
  color: #126da4;
  font-weight: 850;
}

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

.playerSlotCard {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.playerSlotCard select {
  width: 100%;
  min-width: 0;
}

.playerSlotCard.isLocked {
  background: #e3e7e5;
  color: var(--muted);
}

.guestSlotsGate,
.lobbyAccountGate {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inlineAccountButton {
  display: inline-flex;
  min-height: 30px;
  padding: 3px 8px;
  vertical-align: middle;
}

.startGameButton {
  min-height: 46px;
  border-color: #075e57;
  background: #08736a;
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 6px 16px rgb(8 115 106 / 24%);
}

.startGameButton:disabled {
  box-shadow: none;
}

.settingsRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  touch-action: auto;
}

.settingsRow select {
  min-height: 34px;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--panel);
  color: var(--ink);
  touch-action: manipulation;
  user-select: auto;
  -webkit-user-select: auto;
}

.premiumLabelStyleToggle {
  min-width: min(230px, 48vw);
}

.gameplayLanguageEditButton {
  min-width: 148px;
  min-height: 34px;
  white-space: nowrap;
}

.gameplayLanguageDialog {
  width: min(500px, calc(100vw - 24px));
}

.gameplayLanguageDialogBody {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 10px 0 14px;
  overflow: auto;
}

.gameplayLanguageDialogDescription {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.gameplayLanguageSettingsLink {
  display: inline;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  box-shadow: none;
}

.gameplayLanguageDialogActions {
  grid-template-columns: 1fr;
}

.aiDifficultyControls {
  display: grid;
  gap: 5px;
}

.aiDifficultyControls select[hidden] {
  display: none;
}

.settingsRow input[type="checkbox"] {
  width: 22px;
  height: 22px;
  touch-action: manipulation;
  user-select: auto;
  -webkit-user-select: auto;
}

.notificationSettingsRow {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: stretch;
}

.notificationSettingsRow > button {
  width: 100%;
  padding: 6px 10px;
  overflow-wrap: anywhere;
  line-height: 1.25;
  white-space: normal;
}

@media (max-width: 420px) {
  .notificationSettingsRow {
    grid-template-columns: 1fr;
  }
}

.modeToggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  min-width: min(260px, 54vw);
  padding: 3px;
  border: 1px solid #7fb3aa;
  border-radius: 7px;
  background: #dfeeea;
}

.modeToggle button {
  min-height: 30px;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.modeToggle button.active {
  background: #08736a;
  color: #fff;
  box-shadow: 0 2px 8px rgb(8 115 106 / 28%);
}

.playerAssistPanel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #bfd0ca;
  border-radius: 8px;
  background: #f6faf8;
}

.playerAssistSummary {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.playerInfiniboardSummary {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #c8bca2;
  border-radius: 8px;
  background: #faf7ef;
}

.playerInfiniboardSummary p {
  margin: 0;
  color: var(--ink);
  line-height: 1.35;
}

.playerAssistVisibilityToggle {
  width: 100%;
}

.maintenanceAssistDashboard,
.maintenanceAssistLanguage,
.maintenanceAssistList {
  display: grid;
  gap: 12px;
}

.maintenanceAssistLanguage > h2 {
  margin: 8px 0 0;
}

.maintenanceAssistPanel {
  margin: 0;
}

.maintenanceAssistItem {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #c8d4d0;
  border-radius: 8px;
  background: #fff;
}

.maintenanceAssistItem p {
  margin: 0;
  line-height: 1.35;
}

.maintenanceAssistNormalStats > summary {
  cursor: pointer;
  font-weight: 750;
}

.maintenanceAssistNormalStats[open] > summary {
  margin-bottom: 12px;
}

.challengePenaltyToggle {
  position: relative;
}

.challengePenaltyToggle button {
  white-space: normal;
}

.challengePenaltyToggle.isForced {
  border-color: #9ba3a1;
  background: #e4e7e6;
}

.challengePenaltyToggle.isForced button {
  color: #777f7d;
  cursor: not-allowed;
}

.challengePenaltyToggle.isForced button.active {
  background: #777f7d;
  color: #fff;
  box-shadow: none;
}

.challengePenaltyToggle.turnLossImpact {
  animation: turnLossImpact 420ms cubic-bezier(.2, .9, .2, 1) both;
}

.turnLossSkull {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 20%;
  pointer-events: none;
  font-size: 34px;
  filter: drop-shadow(0 4px 7px rgb(75 6 10 / 45%));
  animation: skullThump 760ms cubic-bezier(.18, .9, .25, 1) both;
}

@keyframes turnLossImpact {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(.97); }
  62% { transform: scale(1.025); }
}

@keyframes skullThump {
  0% { opacity: 0; transform: translate(50%, -50%) scale(.25) rotate(-18deg); }
  35% { opacity: 1; transform: translate(50%, -50%) scale(1.25) rotate(7deg); }
  58% { transform: translate(50%, -50%) scale(.95) rotate(-3deg); }
  100% { opacity: 0; transform: translate(50%, -88%) scale(1.05) rotate(0); }
}

.realismToggle.hardcoreActive {
  border-color: #5d1016;
  background: #2b0d10;
  box-shadow: 0 0 16px rgb(255 155 24 / 44%);
}

.realismToggle.hardcoreActive button {
  color: #ffd089;
}

.realismToggle.hardcoreActive button.active {
  background: #6f1015;
  color: #ffe6aa;
  text-shadow: 0 0 6px rgb(255 190 46 / 80%);
  box-shadow: 0 0 0 1px #ffbb38, 0 0 18px rgb(255 99 18 / 72%);
}

.modeDescription {
  margin: -2px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.profileForm input,
.wordListEditor input {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
}

.menuMeta,
.saveMeta,
.statsGrid,
.wordListEditor,
.canonicalPolicyGrid,
.multiplayerGameList {
  color: var(--muted);
  font-size: 13px;
}

.menuMeta.accountFormError {
  margin: 0;
  color: var(--red);
  font-weight: 680;
}

.multiplayerGameList {
  display: grid;
  gap: 7px;
  max-height: min(34dvh, 280px);
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 10px;
  overscroll-behavior: contain;
}

.multiplayerGameRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.multiplayerGameInfo {
  min-width: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.lobbyPlayerPill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  margin: 1px 2px;
  padding: 2px 7px;
  border: 2px solid var(--player-color, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--player-color, var(--blue)) 8%, white);
  color: var(--ink);
  font-weight: 780;
  line-height: 1.1;
  white-space: nowrap;
}

.lobbyOpenSeat {
  color: var(--muted);
  font-weight: 760;
  white-space: nowrap;
}

button.multiplayerGameInfo {
  cursor: pointer;
}

button.multiplayerGameInfo:hover,
button.multiplayerGameInfo:focus-visible {
  background: #f7fcff;
  outline: 2px solid #86aeca;
  outline-offset: 3px;
}

.multiplayerGameActions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.multiplayerRowAction,
.multiplayerRowSecondary {
  width: 100%;
  min-width: 0;
  align-self: stretch;
  white-space: normal;
}

.emptyGameList {
  padding: 12px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: rgb(255 255 255 / 55%);
}

.multiplayerGameButton {
  min-width: 0;
  text-align: left;
  white-space: normal;
}

.multiplayerGameRow.isYourTurn {
  border-color: #d9a8a8;
  background: #fff8f8;
}

.multiplayerGameRow.isYourTurn .multiplayerGameButton {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.policyVoteBanner,
.turnNotification,
.appToast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 18px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.turnNotification {
  z-index: 40000;
  bottom: max(72px, calc(env(safe-area-inset-bottom, 0px) + 72px));
}

.turnNotificationTransfer {
  position: fixed;
  z-index: 50000;
  pointer-events: none;
  overflow: hidden;
  will-change: transform, opacity;
}

.appToast {
  z-index: 60;
  bottom: max(92px, calc(env(safe-area-inset-bottom, 0px) + 92px));
  width: auto;
  max-width: min(420px, calc(100vw - 28px));
  padding: 11px 14px;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 14px;
  font-weight: 760;
}

.policyVoteBanner[hidden],
.turnNotification[hidden],
.appToast[hidden] {
  display: none;
}

.gameBoardLoadingToast {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: var(--app-height, 100dvh);
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  place-items: center;
}

.gameBoardLoadingToast[open] {
  display: grid;
}

.gameBoardLoadingToast::backdrop {
  background: rgb(25 32 35 / 38%);
}

.gameBoardLoadingToastMessage {
  max-width: min(420px, calc(100vw - 28px));
  padding: 13px 18px;
  border: 1px solid #86aeca;
  border-radius: 8px;
  background: var(--blue-bg);
  box-shadow: var(--shadow);
  color: #12415f;
  font-size: 15px;
  font-weight: 780;
  text-align: center;
}

.turnCue {
  position: fixed;
  z-index: 55;
  left: var(--app-viewport-left, 0px);
  top: var(--app-viewport-top, 0px);
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.turnCue[hidden] {
  display: none;
}

.turnCueText {
  padding: 16px 24px;
  border: 2px solid #8fd0a9;
  border-radius: 12px;
  background: rgb(223 243 229 / 92%);
  color: var(--green);
  box-shadow: var(--shadow);
  font-size: clamp(34px, 8vw, 72px);
  font-weight: 860;
  line-height: 1;
  text-align: center;
}

.turnCue.show .turnCueText {
  animation: turnCueFade 1800ms ease-out both;
}

@keyframes turnCueFade {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }

  18% {
    opacity: 1;
    transform: scale(1);
  }

  64% {
    opacity: 0.95;
    transform: scale(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.policyVoteBanner strong,
.turnNotification strong {
  min-width: 0;
  flex: 1;
  font-size: 13px;
}

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

.gameArchiveList {
  display: grid;
  gap: 7px;
  max-height: min(54dvh, 480px);
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 12px;
  overscroll-behavior: contain;
}

.gameArchiveItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.gameArchiveItem strong,
.gameArchiveItem span {
  display: block;
  min-width: 0;
}

.gameArchiveItem strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

.gameArchiveItem span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.gameArchiveModeBadge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid #86aeca;
  border-radius: 999px;
  background: #dcebff;
  color: #12415f;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.2;
}

.gameArchiveItem .gameArchiveModeBadge {
  display: inline-flex;
  margin-top: 4px;
  color: #12415f;
}

.maintenanceGameList {
  max-height: none;
  overflow: visible;
  padding: 0;
}

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

.maintenanceGameActions button {
  white-space: nowrap;
}

.myGamesList {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
}

.myGamesPageStatus {
  margin: 0 0 8px;
}

.myGamesMoreButton {
  width: min(100%, 220px);
  margin: 0 auto;
}

.myGameRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  align-items: stretch;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.myGameRow.actionNeeded {
  border-color: #e39a94;
  background: #fff8f8;
}

.myGameRow.unseenActivity:not(.actionNeeded),
.myGameRow.newlyFinished:not(.actionNeeded) {
  border-color: #86aeca;
  background: #f7fcff;
}

.myGameBody {
  min-width: 0;
}

.myGameHeading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.myGameHeading > strong:first-child {
  overflow-wrap: anywhere;
}

.myGameStatus,
.myGameNotice {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.2;
}

.myGameStatus {
  background: #e8efec;
  color: #3c4b46;
}

.myGameStatus-finished {
  background: #e8edf2;
  color: #40505d;
}

.myGameStatus-active {
  background: #def3e5;
  color: #17603a;
}

.myGameNotice {
  background: #dcebff;
  color: #12415f;
}

.actionNeeded .myGameNotice {
  background: #ffe0de;
  color: #8d1f17;
}

.myGameSettings,
.myGamePlayers,
.myGameTurn,
.myGameActivity {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.myGameSettings {
  color: var(--ink);
  font-weight: 680;
}

.myGameTurn {
  color: var(--ink);
  font-weight: 760;
}

.myGameActions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 6px;
}

.myGameActions button {
  white-space: nowrap;
}

.gameArchiveDetail {
  display: grid;
  gap: 10px;
}

.gameArchiveRaw {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.gameArchiveRaw summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.gameArchiveJson {
  max-height: min(46dvh, 420px);
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 7px;
  background: #182124;
  color: #e8f4ef;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.canonicalPolicyGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.canonicalPolicyColumn {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.canonicalPolicyColumn h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.canonicalPolicySourceColumn {
  min-height: 0;
}

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

.canonicalPolicyTabs button {
  min-height: 34px;
  padding: 5px 7px;
  font-size: 12px;
}

.canonicalPolicyTabs button.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: #12415f;
  font-weight: 760;
}

.canonicalPolicyTabPanel[hidden] {
  display: none;
}

.canonicalDictionarySearchPanel {
  display: grid;
  min-height: 0;
  gap: 6px;
}

.canonicalDictionarySearchForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.canonicalDictionarySearchForm input {
  min-width: 0;
}

.canonicalDictionarySearchForm button {
  min-height: 36px;
  padding: 5px 9px;
}

.canonicalDictionarySearchHint {
  margin: 0;
}

.canonicalDictionarySearchStatus:empty,
.canonicalCandidateStatus:empty {
  display: none;
}

.canonicalDictionaryResults {
  max-height: min(40dvh, 360px);
}

.canonicalCandidateActions {
  display: flex;
  max-width: 225px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.canonicalCandidateStatus {
  display: flex;
  max-width: 100%;
}

.canonicalCandidateStatus .ospsResultPill {
  white-space: normal;
}

.canonicalDictionaryMoreButton {
  width: 100%;
  color: var(--ink) !important;
}

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

.canonicalWordMeta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.canonicalPolicyGrid .wordItem button {
  color: inherit;
}

.saveMeta {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.resumeSaveButton {
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.resumeSaveButton:hover {
  border-color: #8ac1da;
  background: #f7fcff;
}

.resumeSaveButton strong {
  color: var(--ink);
}

.aboutSection {
  justify-items: center;
  text-align: center;
}

.aboutLogo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 18px;
}

.aboutSection h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.aboutVersion,
.aboutContactTitle,
.aboutLinks p,
.aboutDictionary {
  margin: 0;
}

.aboutContactTitle {
  margin-top: 12px;
  color: var(--ink);
  font-weight: 800;
}

.aboutLinks {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.aboutDictionary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.aboutSection a {
  color: #12669a;
  font-weight: 780;
}

.aboutWhatsNewButton {
  min-width: min(240px, 100%);
  margin-top: 8px;
}

.aboutChangelog {
  width: 100%;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.changelogDocument {
  display: grid;
  gap: 9px;
  line-height: 1.45;
}

.changelogDocument h3,
.changelogDocument p,
.changelogDocument ul {
  margin: 0;
}

.changelogDocument h3 {
  font-size: 18px;
}

.changelogDocument ul {
  display: grid;
  gap: 6px;
  padding-left: 22px;
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.statsGrid > div,
.wordItem {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.statsGrid > .wideStats {
  grid-column: 1 / -1;
}

.statsGrid strong,
.wordItem strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
}

.statisticsMenuSection {
  gap: 12px;
}

.statisticsTabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(var(--statistics-tab-columns, 2), minmax(0, 1fr));
  gap: 6px;
  margin: -12px -14px 0;
  padding: 12px 14px 10px;
  background: var(--bg);
  box-shadow: 0 8px 12px -12px rgba(45, 31, 17, 0.55);
}

.statisticsTabs:has(button:only-child) {
  grid-template-columns: 1fr;
}

.statisticsTabs button.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: #12415f;
  font-weight: 780;
}

.playerStatisticsTabsPanel {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.statisticsTabs.statisticsSecondaryTabs {
  position: static;
  z-index: auto;
  margin: 0;
  padding: 0 0 6px;
  background: transparent;
  box-shadow: none;
}

.statisticsContent,
.statisticsDashboard {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.statisticsLanguageSections,
.statisticsLanguageSection {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.statisticsLanguageSection + .statisticsLanguageSection {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.statisticsLanguageTitle {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
}

.statisticsModeSection {
  display: grid;
  gap: 10px;
}

.statisticsModeSection + .statisticsModeSection {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.statisticsModeTitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.25;
}

.statisticsDashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.statisticsSummaryGrid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.statisticsValue,
.statisticsPanel,
.statisticsGraphItem {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.statisticsValue {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 10px;
}

.statisticsValue strong {
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.statisticsValue small,
.statisticsRankLine small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.statisticsPanel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.statisticsPanel > h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.statisticsPanel:has(.statisticsGraphList),
.statisticsPanel:has(.statisticsResultGraph),
.statisticsPanel:has(.statisticsHierarchy) {
  grid-column: 1 / -1;
}

.statisticsHierarchy,
.statisticsHierarchy ul {
  min-width: 0;
}

.statisticsHierarchy > strong {
  color: var(--ink);
  font-size: 15px;
}

.statisticsHierarchy ul {
  display: grid;
  gap: 5px;
  margin: 5px 0 0;
  padding-left: 21px;
}

.statisticsHierarchy li {
  color: var(--ink);
  line-height: 1.4;
}

.statisticsHierarchy li::marker {
  color: var(--muted);
}

.statisticsHierarchyValues {
  font-size: 12px;
}

.statisticsRankList {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 24px;
}

.statisticsRankList li {
  min-width: 0;
  color: var(--muted);
}

.statisticsRankLine {
  min-width: 0;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.statisticsRankLine > strong {
  color: var(--ink);
}

.statisticsRankLine .logWordPill {
  vertical-align: middle;
}

.statisticsGraphList {
  display: grid;
  gap: 8px;
}

.statisticsGraphItem {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.statisticsGraphItem > strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.statisticsResultGraph {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.statisticsResultLabels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  font-size: 11px;
  font-weight: 760;
}

.statisticsResultLabels span:nth-child(2) {
  text-align: center;
}

.statisticsResultLabels span:nth-child(3) {
  text-align: right;
}

.statisticsResultLabels .wins {
  color: #227a3c;
}

.statisticsResultLabels .draws {
  color: #24669a;
}

.statisticsResultLabels .losses {
  color: #a85012;
}

.statisticsResultBars {
  display: flex;
  width: 100%;
  height: 13px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 75%, black);
  border-radius: 999px;
  background: #f1ece3;
}

.statisticsResultBars span {
  flex-basis: 0;
  min-width: 0;
  transition: flex-grow 220ms ease;
}

.statisticsResultBars .wins {
  background: #45a85e;
}

.statisticsResultBars .draws {
  background: #4b91c8;
}

.statisticsResultBars .losses {
  background: #df832f;
}

.statisticsResultBars span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.75);
}

.wordListEditor {
  display: grid;
  gap: 8px;
}

.wordEditorForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.wordItems {
  display: grid;
  gap: 6px;
  max-height: min(46dvh, 420px);
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 12px;
  overscroll-behavior: contain;
}

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

.wordItem button {
  min-height: 32px;
  padding: 3px 8px;
  color: var(--red);
}

.scrollableMenu .buddyListSection {
  padding: 10px 14px 0;
}

.scrollableMenu .buddyListSection:first-child {
  padding-top: 12px;
}

.wordItem .addBuddyButton {
  border-color: #7fbd9b;
  background: var(--green-bg);
  color: var(--green);
  font-weight: 760;
}

.moveRowActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.blockMoveButton,
.definitionMoveButton {
  display: none;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 760;
}

.blockMoveButton {
  border-color: #dda0a5;
  background: var(--red-bg);
  color: var(--red);
}

.definitionMoveButton {
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
}

.moveRow:hover .blockMoveButton,
.moveRow:focus-within .blockMoveButton,
.moveRow:hover .definitionMoveButton,
.moveRow:focus-within .definitionMoveButton {
  display: inline-grid;
  place-items: center;
}

.moveHeaderLine {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.swapTiles {
  margin: 12px 0;
}

.dialogActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.allowWordText {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 15px;
}

.allowWordText strong {
  color: var(--ink);
  font-size: 18px;
}

.gameOverBody {
  display: grid;
  gap: 0;
  margin: 0 0 12px;
}

.gameOverDialog {
  position: fixed;
  inset: auto;
  z-index: 12000;
  margin: 0;
  min-height: 0;
  overflow: auto;
  box-sizing: border-box;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 14px 42px rgb(24 31 35 / 38%);
}

.gameOverDialog > .dialogActions {
  display: flex;
  gap: 6px;
}

.gameOverDialog > .dialogActions > button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 6px;
  font-size: 12px;
}

.gameStatsDialog {
  width: min(680px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  overflow: hidden;
}

.gameStatsContent {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}

.gameStatsSection,
.gameStatsCounts {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 92%, var(--blue-bg));
}

.gameStatsSection h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.gameStatsList {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 22px;
}

.gameStatsList li,
.gameStatsValue,
.gameStatsCounts p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.gameStatsCounts {
  display: grid;
  align-content: center;
  gap: 6px;
}

@media (max-width: 620px) {
  .gameStatsContent {
    grid-template-columns: 1fr;
  }
}

.gameOverHeader {
  justify-content: flex-start;
  margin-bottom: 0;
}

.gameOverHeader h2 {
  margin-right: 2px;
}

.gameOverHeader #gameOverCloseButton {
  margin-left: auto;
}

.gameOverDialog .gameOverGgButton {
  min-width: 52px;
  min-height: 32px;
  padding: 3px 10px;
  border: 2px solid #7756d8;
  background: linear-gradient(135deg, #fff3a8 0%, #ff9bd2 48%, #91dfff 100%);
  color: #2c1748;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 0 #6040bd, 0 8px 18px rgb(96 64 189 / 28%);
  transform: translateY(-2px);
}

.gameOverDialog .gameOverGgButton:active {
  box-shadow: 0 1px 0 #6040bd, 0 4px 10px rgb(96 64 189 / 24%);
  transform: translateY(1px);
}

.gameGgLayer {
  position: absolute;
  inset: 0;
  z-index: 11000;
  pointer-events: none;
  overflow: visible;
}

.gameGgPill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 72%;
  min-height: 23px;
  padding: 3px 8px;
  border: 2px solid var(--player-color, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--player-color, var(--blue)) 8%, white);
  color: var(--ink);
  font-size: clamp(12px, 2.3vw, 17px);
  font-weight: 780;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgb(12 18 21 / 22%);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.gameGgPlayerName {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
}

.gameGgEmoji {
  flex: 0 0 auto;
}

.gameGgPill.isSpectator {
  border-color: var(--board);
  background: var(--cell);
  color: #4a3928;
  box-shadow: 0 4px 12px rgb(74 57 40 / 24%);
}

.gameGgPill.isPoppingOut {
  animation: gameGgPopOut 300ms cubic-bezier(0.55, -0.25, 0.8, 0.35) both;
}

.gameGgPill.isFireworkBurst {
  animation: gameGgFireworkCollapse 280ms cubic-bezier(0.55, 0, 0.9, 0.45) both;
}

.gameGgPill.isFireworkBurst .gameGgPlayerName {
  animation: gameGgPlayerNameCollapse 230ms ease-in both;
}

@keyframes gameGgPopOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.22);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18);
  }
}

@keyframes gameGgFireworkCollapse {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.92);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58);
  }
}

@keyframes gameGgPlayerNameCollapse {
  0% {
    opacity: 1;
    max-width: 220px;
  }
  100% {
    opacity: 0;
    max-width: 0;
  }
}

.gameOverSummary {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.gameOverSummary strong {
  font-weight: 820;
}

.finalChallengeWords {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.finalChallengeWord {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  border: 1px solid var(--line, #d7d7d7);
  border-radius: 0.65rem;
}

.googleWordButton {
  width: 100%;
  min-height: 38px;
  margin-bottom: 10px;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 13px;
  font-weight: 740;
}

.wordPopover {
  position: fixed;
  z-index: 30;
  inset: auto;
  margin: 0;
  width: min(380px, calc(100vw - 16px));
  max-height: min(420px, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.wordPopover::backdrop {
  background: rgb(25 32 35 / 42%);
}

.wordPopover[hidden] {
  display: none;
}

.wordPopoverHeader button {
  min-height: 30px;
  padding: 0 9px;
}

.wordPopoverHeader {
  position: sticky;
  z-index: 2;
  top: -10px;
  margin: -10px -10px 8px;
  padding: 10px;
  background: var(--panel);
  box-shadow: 0 8px 12px -11px rgb(20 28 32 / 70%);
}

.wordChoice {
  display: grid;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.wordChoiceLabel strong,
.wordChoiceLabel span {
  display: block;
}

.wordChoiceLabel .illegalWordLabel {
  width: fit-content;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.wordChoiceLabel span {
  color: var(--muted);
  font-size: 12px;
}

.wordChoiceDefinition {
  margin-top: 6px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.wordChoiceOspsNotice {
  margin: 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: var(--blue-bg);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.42;
}

.wordChoiceOspsNotice em {
  font-weight: 820;
}

.wordChoiceLabel .wordChoiceDefinition .definitionInline,
.wordChoiceLabel .wordChoiceDefinition .definitionInline strong {
  display: inline;
}

.wordChoiceActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.wordChoicePrivatePolicy {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.wordChoicePrivatePolicy[hidden] {
  display: none;
}

.wordChoicePrivatePolicy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.wordChoicePrivatePolicy button {
  width: 100%;
}

.wordChoiceActions button {
  min-height: 36px;
  font-size: 13px;
}

.dragGhost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 48px;
  height: 48px;
  pointer-events: none;
  opacity: 0.72;
  box-shadow: 0 12px 24px rgb(20 28 32 / 28%);
}

.gameLogDialog {
  width: min(560px, calc(100vw - 24px));
}

.modalLogList {
  max-height: min(62dvh, 520px);
}

@media (max-width: 980px) {
  .appShell {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 12px;
    padding: 12px;
  }

  .boardWrap {
    --board-visual-width: min(100%, var(--app-height-70, 70dvh), 720px);
  }
}

@media (orientation: portrait) {
  .playScorePill {
    font-size: clamp(10.8px, calc(var(--board-visual-width) / 37.5), 19.2px);
  }
}

@media (orientation: portrait) {
  .appShell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .sidePanel {
    display: none;
  }

  .topBar {
    width: calc(100% - 16px);
    margin-bottom: 7px;
  }

  h1 {
    font-size: 21px;
  }

  #statusLine {
    width: calc(100% - 16px);
    margin-bottom: 5px;
    font-size: 12px;
  }

  .scoreBadge {
    min-width: 82px;
    padding: 6px 8px;
  }

  .scoreTools {
    gap: 5px;
  }

  .spectatorBox {
    width: 72px;
    min-width: 72px;
    height: 50px;
  }

  .scoreBadge strong {
    font-size: 23px;
  }

  .scoreStrip {
    width: calc(100% - 16px);
    grid-template-columns: repeat(var(--score-columns, 5), minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 3px;
  }

  .scoreStrip > div {
    min-height: 30px;
    padding: 4px 3px;
  }

  .scoreStrip span {
    font-size: 8px;
  }

  .scoreStrip strong {
    font-size: 12px;
  }

  .difficultyStatus {
    width: auto;
    margin: 0;
    font-size: 12px;
  }

  .boardWrap {
    --board-visual-width: min(100vw, var(--app-height-minus-220, calc(100dvh - 220px)));
    --board-grid-gap: 1px;
    --board-grid-padding: 0px;
    --infiniboard-full-width-adjustment: 0.9333333px;
  }

  .board {
    border-radius: 0;
    background: var(--board);
    box-shadow: none;
  }

  .boardWrap.infiniboardViewport {
    border-radius: 0;
    box-shadow: none;
  }

  .cell {
    border-radius: 3px;
  }

  .rackBand {
    width: calc(100% - 16px);
    margin-top: 7px;
  }

  .rackTiles {
    gap: 5px;
  }

	.gameControls {
    width: calc(100% - 16px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin-top: 7px;
    margin-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .gameControls button {
    min-height: 0;
    padding: 6px 2px 5px;
  }

  .controlIcon {
    font-size: 44px;
  }

  .controlLabel {
    font-size: 10px;
    line-height: 1.05;
  }

  .wordPopover {
    width: min(292px, calc(100vw - 16px));
    max-height: 42dvh;
  }

  .menuButton {
    width: 34px;
    min-width: 34px;
    min-height: 32px;
  }

  .menuButton span {
    width: 16px;
  }

  .menuActions,
  .canonicalPolicyChooser,
  .canonicalPolicyGrid,
  .profileForm,
  .wordEditorForm,
  .statsGrid {
    grid-template-columns: 1fr;
  }

  .maintenancePlayerList {
    grid-template-columns: 1fr;
  }

  .maintenanceGameItem {
    grid-template-columns: 1fr;
  }

  .maintenanceGameActions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statisticsDashboard {
    grid-template-columns: 1fr;
  }

  .statisticsSummaryGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statisticsPanel {
    grid-column: 1 / -1;
  }

  .gameRulesBox .settingsRow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    font-size: clamp(10px, 3vw, 13px);
    line-height: 1.25;
  }

  .gameRulesBox .settingsRow > span {
    text-wrap: balance;
  }

  .gameRulesBox .settingsRowControls {
    gap: 3px;
  }

  .gameRulesBox .ruleInfoButton {
    width: 24px;
  }

  .gameRulesBox .gameplayLanguageEditButton {
    min-width: 0;
  }

  .gameRulesBox .modeToggle {
    width: 100%;
    min-width: 0;
  }

  .gameRulesBox .settingsRowControls .modeToggle {
    padding: 2px;
  }

  .gameRulesBox .settingsRowControls .modeToggle button {
    min-width: 0;
    padding-inline: 1px;
    font-size: clamp(9px, 2.8vw, 12px);
  }

  .myGameRow {
    grid-template-columns: 1fr;
  }

  .myGameActions {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  }

  .menuTopBar {
    gap: 6px;
    padding: 9px 10px;
  }

  .menuActionButton {
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (orientation: portrait) and (pointer: fine) {
  .appShell {
    padding: 8px 0 16px;
  }

  .topBar,
  .scoreStrip,
  #statusLine,
  .rackBand {
    width: min(calc(100% - 16px), 430px);
  }

  .boardWrap {
    --board-visual-width: min(calc(100% - 16px), var(--app-height-minus-240, calc(100dvh - 240px)), 430px);
    --board-grid-padding: 4px;
    --infiniboard-full-width-adjustment: -6.5333333px;
  }

  .board {
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .boardWrap.infiniboardViewport {
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .gameControls {
    width: min(calc(100% - 16px), 360px);
  }
}

@media (max-width: 980px) and (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
  html.physical-landscape:not(.text-entry-active) .orientationOverlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    background: var(--bg);
  }

  html.physical-landscape:not(.text-entry-active) #menuDialog[open],
  html.physical-landscape:not(.text-entry-active) #menuDialog[open]::backdrop {
    display: none !important;
  }

  html.physical-landscape:not(.text-entry-active) .appShell {
    height: var(--app-height, 100svh);
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  }

  html.physical-landscape:not(.text-entry-active) .playSurface {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  }

  html.physical-landscape:not(.text-entry-active) .topBar {
    width: min(100%, 720px);
    margin-bottom: 3px;
    gap: 6px;
  }

  html.physical-landscape:not(.text-entry-active) .menuButton {
    width: 32px;
    min-width: 32px;
    min-height: 30px;
  }

  html.physical-landscape:not(.text-entry-active) h1 {
    font-size: 18px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreBadge {
    min-width: 70px;
    padding: 4px 7px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreBadge span {
    font-size: 10px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreBadge strong {
    font-size: 20px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreStrip {
    width: min(100%, 720px);
    gap: 3px;
    margin-bottom: 2px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreStrip > div {
    min-height: 28px;
    padding: 3px 4px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreStrip span {
    font-size: 8px;
  }

  html.physical-landscape:not(.text-entry-active) .scoreStrip strong {
    margin-top: 1px;
    font-size: 12px;
  }

  html.physical-landscape:not(.text-entry-active) #statusLine {
    width: min(100%, 720px);
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1.1;
  }

  html.physical-landscape:not(.text-entry-active) .difficultyStatus {
    margin: 0;
    font-size: 10px;
    line-height: 1.1;
  }

  html.physical-landscape:not(.text-entry-active) .boardWrap {
    --board-visual-width: min(calc(100vw - 12px), var(--app-height-minus-128, calc(100svh - 128px)), 720px);
  }

  html.physical-landscape:not(.text-entry-active) .rackBand {
    width: min(100%, 720px);
    margin-top: 4px;
  }

  html.physical-landscape:not(.text-entry-active) .rackTiles {
    gap: 4px;
  }

  html.physical-landscape:not(.text-entry-active) .gameControls {
    width: min(100%, 420px);
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 0;
  }

  html.physical-landscape:not(.text-entry-active) .gameControls button {
    padding: 4px 2px;
  }

  html.physical-landscape:not(.text-entry-active) .controlIcon {
    font-size: 36px;
  }

  html.physical-landscape:not(.text-entry-active) .controlLabel {
    font-size: 9px;
  }
}

@media (max-height: 680px) and (orientation: landscape) {
  .boardWrap {
    --board-visual-width: min(100%, var(--app-height-66, 66dvh), 680px);
  }

  .topBar,
  .scoreStrip,
  #statusLine,
  .rackBand,
  .gameControls {
    width: min(100%, 680px);
  }

}

@media (min-height: 540px) and (orientation: landscape) {
  body:not(.debugMode) .appShell {
    grid-template-columns: minmax(0, 1fr);
    padding: clamp(3px, 0.45vw, 6px) clamp(12px, 1.8vw, 24px) clamp(12px, 1.8vw, 24px);
  }

  body:not(.debugMode) .playSurface {
    width: min(100%, 1320px);
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(220px, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    column-gap: clamp(14px, 2vw, 28px);
    row-gap: 8px;
    align-items: stretch;
  }

  body:not(.debugMode) .topBar {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    margin: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-self: start;
    row-gap: 8px;
  }

  body:not(.debugMode) .menuButton {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  body:not(.debugMode) .scoreTools {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: stretch;
    justify-self: end;
  }

  body:not(.debugMode) .scoreBadge {
    width: max-content;
    min-width: 72px;
    justify-self: end;
  }

  body:not(.debugMode) .titleBlock {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  body:not(.debugMode) h1 {
    font-size: clamp(20px, 2vw, 26px);
  }

  body:not(.debugMode) .scoreStrip {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    margin: 0;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 6px;
    align-self: start;
  }

  body:not(.debugMode) .scoreStrip > div {
    min-height: 42px;
    padding: 5px 7px;
  }

  body:not(.debugMode) .scoreStrip span {
    font-size: 10px;
  }

  body:not(.debugMode) .scoreStrip strong {
    font-size: 15px;
  }

  body:not(.debugMode) .scoreStrip .playerTurnPill strong {
    font-size: 11px;
  }

  body:not(.debugMode) .gameInfoBlock {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    text-align: left;
    align-self: center;
  }

  body:not(.debugMode) .gameInfoBlock .difficultyStatus {
    display: block;
    white-space: nowrap;
  }

  body:not(.debugMode) #statusLine {
    grid-column: 2;
    grid-row: 3;
    width: 100%;
    height: 2.4em;
    min-height: 2.4em;
    margin: 0;
    display: -webkit-box;
    white-space: normal;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body:not(.debugMode) .boardWrap {
    grid-column: 1;
    grid-row: 1 / 5;
    min-height: 0;
    align-self: stretch;
    justify-self: stretch;
  }

  body:not(.debugMode) .boardWrap {
    --board-visual-width: min(100%, var(--app-height-minus-160, calc(100dvh - 160px)), 760px);
  }

  body:not(.debugMode) .rackBand {
    width: min(100%, var(--app-height-minus-160, calc(100dvh - 160px)), 760px);
  }

  body:not(.debugMode) .rackBand {
    grid-column: 1;
    grid-row: 5;
    margin: 8px auto 0;
    align-self: end;
  }

  body.playbackMode:not(.debugMode) .boardWrap,
  body.kundailyReviewMode:not(.debugMode) .boardWrap {
    --board-visual-width: min(100%, calc(var(--app-height, 100dvh) - 208px), 760px);
  }

  body.playbackMode:not(.debugMode) .rackBand,
  body.kundailyReviewMode:not(.debugMode) .rackBand {
    width: min(100%, calc(var(--app-height, 100dvh) - 208px), 760px);
  }

  body:not(.debugMode) .gameControls {
    grid-column: 2;
    grid-row: 4;
    width: 100%;
    max-width: 320px;
    margin: 8px 0 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: start;
    justify-self: stretch;
  }

  body:not(.debugMode) .gameControls button {
    padding: 6px 4px;
  }

  body:not(.debugMode) #gameLogButton {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectatorImage {
    opacity: 0;
    transition: opacity 100ms linear;
    transform: none;
  }

  .spectatorBox.isImageVisible .spectatorImage {
    opacity: 1;
  }
}

body .boardWrap.infiniboardViewport {
  height: auto;
  align-self: center;
  justify-self: center;
}

.gameTopRegion,
.gameStatusRegion,
.gameControlRegion {
  display: contents;
}

.infiniboardMinimap {
  display: none;
  box-sizing: border-box;
  aspect-ratio: 1;
  border: 2px solid #746750;
  border-radius: 8px;
  background: var(--board);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

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

.infiniboardFitBoardButton {
  display: none;
  width: 100%;
  min-height: 0;
  padding: 3px 7px;
  border-color: #86aeca;
  background: var(--blue-bg);
  color: #12415f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

.infiniboardFitBoardButton.active {
  border-color: #2f80ed;
  background: #dcebff;
}

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

/* Portrait is a measured five-row layout: fixed header, fixed two-line status,
   the largest available square board, fixed rack, and fixed controls. */
@media (orientation: portrait) {
  .appShell {
    position: fixed;
    left: var(--app-viewport-left, 0px);
    top: var(--app-viewport-top, 0px);
    width: var(--app-width, 100vw);
    height: var(--app-height, 100dvh);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
  }

  .playSurface {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    align-content: stretch;
    align-items: start;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .gameTopRegion {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, var(--portrait-board-size, 100%));
    margin: 0 auto;
    padding: .2rem .5rem 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: .4rem;
    row-gap: .2rem;
    align-items: start;
  }

  .gameStatusRegion {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, var(--portrait-board-size, 100%));
    height: calc(.72rem * 2.3);
    min-height: calc(.72rem * 2.3);
    margin: 0 auto;
    padding: 0 .5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: .4rem;
    align-items: stretch;
  }

  body.infiniboardGame .gameStatusRegion {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .topBar {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 4rem;
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1.8rem 1.2rem 1rem;
    gap: 0 .35rem;
    align-items: center;
  }

  .topBar > .menuButton {
    grid-column: 1;
    grid-row: 1;
  }

  .topBar > .titleBlock {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .topBar h1 {
    overflow: hidden;
    font-size: clamp(1rem, 5vw, 1.3rem);
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topBar > .gameInfoBlock {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    align-self: center;
    text-align: left;
	padding-top: 1.3em;
  }

  .difficultyStatus {
    max-height: 1.1em;
    display: block;
    overflow: hidden;
    font-size: .7rem;
    line-height: 1.1;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bagStatus {
    margin-top: 0;
    font-size: .7rem;
    line-height: 1.6;
  }

  .topBar > .scoreTools {
    grid-column: 1 / -1;
    grid-row: 3;
    /*height: 1.65rem;*/
    min-width: 0;
    gap: .25rem;
    align-self: stretch;
    justify-self: start;
  }

  body.playScorePillEnabled .topBar > .scoreTools {
    grid-column: 3;
    grid-row: 1 / span 2;
    /*height: 1.8rem;*/
    justify-self: end;
  }

  .scoreTools .scoreBadge {
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: baseline;
    gap: .2rem;
    padding: 2px .35rem;
    white-space: nowrap;
  }

  .scoreTools .scoreBadge span,
  .scoreTools .scoreBadge strong {
    display: inline;
    margin: 0;
    font-size: .72rem;
    line-height: 1;
  }

  .scoreTools .spectatorBox {
    /*width: 2.25rem;*/
    min-width: 2.25rem;
    height: 100%;
    border-radius: .35rem;
  }

  .scoreStrip {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    /*height: 3.45rem;*/
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 3px;
    align-self: start;
  }

  .scoreStrip > div {
    /*min-height: 0;*/
    display: grid;
    /*grid-template-columns: minmax(0, 1fr) auto;*/
    /*grid-template-rows: minmax(0, 1fr);*/
    align-items: center;
    /*gap: 3px;*/
    padding: 2px;
    /*overflow: hidden;*/
  }

  .scoreStrip > div.activeTurn {
    overflow: visible;
  }

  .scoreStrip span {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    overflow: hidden;
    font-size: .55rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scoreStrip strong {
    display: inline;
    margin: 0;
    overflow-wrap: normal;
    font-size: .72rem;
    line-height: 1;
  }

  .scoreStrip .playerTurnPill {
    padding: 3px;
  }

  body.infiniboardGame .gameTopRegion {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  body.infiniboardGame .infiniboardPortraitMinimap {
    grid-column: 2;
    grid-row: 1 / 3;
    width: min(100%, 8.1rem, calc(var(--app-height, 100dvh) * .19));
    max-height: none;
    display: block;
    align-self: start;
    justify-self: end;
  }

  #statusLine {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: .72rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.infiniboardGame .infiniboardPortraitFitBoardButton {
    grid-column: 2;
    grid-row: 1;
    width: min(100%, 8.1rem, calc(var(--app-height, 100dvh) * .19));
    height: 100%;
    max-height: 100%;
    display: block;
    align-self: stretch;
    justify-self: end;
    font-size: clamp(.55rem, 2.5vw, .68rem);
  }

  .boardWrap {
    --board-visual-width: var(--portrait-board-size, min(100%, calc(var(--app-height, 100dvh) - 18rem)));
    --board-grid-gap: 1px;
    --board-grid-padding: 0px;
    --infiniboard-full-width-adjustment: 0.9333333px;
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    justify-self: stretch;
    place-items: center;
    overflow: visible;
  }

  .board {
    width: var(--board-visual-width);
    max-height: none;
    border-radius: 0;
    background: var(--board);
    box-shadow: none;
  }

  body .boardWrap.infiniboardViewport {
    width: var(--board-visual-width);
    height: var(--board-visual-width);
    max-width: 100%;
    max-height: none;
    align-self: center;
    justify-self: center;
    border-radius: 0;
    box-shadow: none;
  }

  .rackBand {
    grid-column: 1;
    grid-row: 4;
    width: min(calc(100% - 16px), 27rem);
    margin: 0 auto;
    padding-top: .25rem;
  }

  .rackTiles {
    gap: .3rem;
  }

  .gameControlRegion {
    grid-column: 1;
    grid-row: 5;
    width: 100%;
    margin: 0;
    padding: .3rem .5rem .25rem;
    display: block;
  }

  .gameControls {
    width: min(100%, 27rem);
    margin: 0 auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .3rem;
  }

  .gameControls button {
    aspect-ratio: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 2px;
    padding: .3rem .12rem .2rem;
  }

  .controlIcon {
    font-size: clamp(1.8rem, 11vw, 2.75rem);
  }

  .controlLabel {
    font-size: .62rem;
    line-height: 1;
  }
}

@media (min-height: 540px) and (orientation: landscape) {
  body.infiniboardGame:not(.debugMode) .gameControlRegion {
    grid-column: 2;
    grid-row: 4;
    min-width: 0;
    min-height: 0;
    width: 100%;
    max-width: 320px;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    align-self: start;
    justify-self: stretch;
    align-items: stretch;
    gap: clamp(8px, 1.4dvh, 14px);
  }

  body.infiniboardGame:not(.debugMode) .gameControlRegion > .gameControls {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.infiniboardGame:not(.debugMode) .infiniboardLandscapeMinimap {
    width: 100%;
    display: block;
    align-self: center;
  }

  body.infiniboardGame:not(.debugMode) .infiniboardLandscapeFitBoardButton {
    display: block;
    align-self: stretch;
  }
}

@media (max-width: 430px) {
  .gameLogDialog .dialogHeader {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
  }

  .gameLogDialog .dialogHeaderActions {
    flex: 1 1 220px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }

  .gameLogDialog .dialogHeader > h2 {
    flex: 1 1 60px;
  }

  .gameLogDialog .dialogHeaderToggleButton {
    max-width: 120px;
    padding-inline: 6px;
    font-size: 9px;
  }

  .gameLogDialog .dialogHeaderTextButton {
    max-width: 86px;
    padding-inline: 6px;
    font-size: 9px;
    white-space: normal;
  }
}
.kundailyMenuButton { position: relative; display: flex; align-items: center; justify-content: center; padding-inline: 12px; overflow: hidden; isolation: isolate; }
.kundailyMenuButton { gap: 8px; }
.kundailyMenuLabel { flex: none; margin-inline: 36px; }
.kundailyMenuPet { position: absolute; top: 50%; width: 32px; height: 32px; margin-top: -16px; pointer-events: none; user-select: none; image-rendering: pixelated; }
.kundailyMenuPet img { display: block; width: 32px; height: 32px; }
.kundailyMenuPet[hidden], .kundailyMenuPet img[hidden], .kundailyBadge:empty { display: none !important; }
.kundailyBadge[data-timer="true"] { background: #dcebf8; color: #245d92; border-radius: 999px; padding: 3px 9px; }
.kundailyBadge { font-variant-numeric: tabular-nums; }
.kundailyDreamDot { display: none; }
.kundailyMenuButton[data-pet-mode="complete"] .kundailyMenuLabel { margin-inline: 0 100px; }
.kundailyMenuButton[data-pet-mode="complete"] .kundailyMenuPet { top: auto; bottom: 4px; margin-top: 0; }
.kundailyMenuButton[data-pet-mode="complete"] .kundailyBadge {
  position: absolute; left: calc(var(--kundaily-menu-pet-left) + 42px); top: 50%; transform: translateY(-50%);
  border: 1px solid #000; border-radius: 5px; background: #fff; color: #000;
  padding: 3px 8px; font-size: 12px; line-height: 1.15; white-space: nowrap;
}
.kundailyMenuButton[data-pet-mode="complete"] .kundailyDreamDot {
  display: block; position: absolute; left: calc(var(--kundaily-menu-pet-left) + 35px); top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border: 1px solid #000; border-radius: 50%; background: #fff; pointer-events: none;
}
.menuDialog:has(.kundailyScreen) { width: min(760px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }
.menuContent:has(.kundailyScreen) { overflow-y: auto; }
.kundailyScreen { display: grid; gap: 12px; min-width: 0; padding: 4px; }
.kundailyScreen p { margin: 0; }
.kundailyAdminControls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.kundailyImport { flex-basis: 100%; width: 100%; }
.kundailyImport > button { width: 100%; }
.kundailyAdminControls label { display: flex; align-items: center; gap: 8px; }
.kundailyRackRange { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kundailyRackRange[hidden] { display: none; }
.kundailyRackRange input { width: 4.5em; min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; background: var(--panel); color: var(--ink); }
.kundailyAdminControls .kundailyToggle { flex-basis: 100%; padding: 12px 0; }
.kundailyToggle input { width: 20px; height: 20px; }
.kundailyBatch { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line, #c8c9b4); border-radius: 12px; }
.kundailyBatch h3 { margin: 0; }
.kundailyQueueRow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid #bbb6; }
.kundailyQueueRow > span { flex: 1 1 240px; font-size: .85rem; }
.kundailyQueueRow button, .kundailyBatch > button { font-size: .8rem; padding: 8px 12px; }
.kundailyActions, .kundailyEnding { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.kundailyPrimary { background: #3e603c; color: #fff; border-color: #3e603c; }
.kundailyFeedback { text-align: center; min-height: 1.3em; }
.kundailyHistory { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: .85rem; margin: 0; padding-left: 24px; }
.kundailyNext { font-variant-numeric: tabular-nums; }
.kundailyEnding > p { flex-basis: 100%; text-align: center; }
.kundailyResult { width: min(420px, calc(100vw - 36px)); max-height: calc(100dvh - 36px); overflow-y: auto; box-sizing: border-box; border: 1px solid #aaa; border-radius: 16px; padding: 22px; color: #263022; background: #faf8ee; }
.kundailyResult::backdrop { background: #182113aa; }
.kundailyResult h2 { margin-top: 0; }
.kundailyExpectedPlay { padding: 12px; border: 1px solid #648251; border-radius: 8px; background: #f7f8ed; overflow-wrap: anywhere; }
.kundailyExpectedPlay h3 { margin: 0 0 8px; }
.kundailyExpectedPlay p { margin: 0; }
.kundailyResult textarea { display: block; box-sizing: border-box; width: 100%; min-height: 145px; resize: none; padding: 12px; margin-bottom: 16px; font: inherit; line-height: 1.65; border: 1px solid #c9c7b9; border-radius: 8px; color: #263022; background: #fff; }
.kundailyResult button { margin: 0 8px 8px 0; }
.kundailyError { color: #a02b23; }
@media (max-width: 480px) {
  .kundailyScreen { gap: 9px; }
  .kundailyActions button { padding: 9px; font-size: .85rem; }
}

body.kundailyMode #bagStatus, body.kundailyMode .sidePanel, body.kundailyMode #globalMyGamesNotificationPill { display: none !important; }
body.kundailyMode #rackTiles { display: flex; justify-content: center; }
body.kundailyMode #rackTiles .rackTile { flex: 0 0 calc((100% - 48px) / 7); }
body.kundailyMode #scoreStrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kundailyGuessList { list-style: none; padding: 0; display: grid; gap: 8px; }
.kundailyGuessList li { padding: 10px 12px; border-radius: 8px; background: #ecebdc; }
.kundailyGuessList .kundailyTargetRow { min-height: 40px; display: flex; align-items: center; border: 2px dashed #648251; background: #f7f8ed; font-weight: 700; }
body.kundailyMode #definitionOspsButton, body.kundailyMode .ospsCheckButton { display: none !important; }
