:root {
  --bg: #f4f1e8;
  --ink: #1d2d35;
  --line: #d2ccb9;
  --muted: #5b6a6f;
  --accent: #0d7a5a;
  --warning: #a5630f;
  --danger: #b6432f;
  --info: #1a5ca1;
  --section-item-gap: 0.75rem;
  --history-entry-row-gap: 0.16rem;
  --history-entry-section-gap: 0.42rem;
  --history-marker-slot-width: 0.56rem;
  --history-marker-gap: 0.24rem;
  --shell-main-max-width: 1200px;
  --shell-flyout-wide-width: min(34rem, 36vw);
  --shell-flyout-content-gap: 1rem;
  --connection-status-connected-bg: #3ea76a;
  --connection-status-connected-ring: rgba(18, 77, 48, 0.18);
  --connection-status-disconnected-bg: #c8c4bc;
  --connection-status-disconnected-ring: rgba(84, 92, 96, 0.18);
  --connection-status-disconnected-strike: #6f767e;
  --connection-status-open-bg: #ddd9d0;
  --connection-status-open-ring: rgba(108, 116, 120, 0.14);
  --shell-mobile-tabbar-height: calc(4.4rem + env(safe-area-inset-bottom, 0px));
  --shell-mobile-panel-transition: 220ms cubic-bezier(0.22, 0.72, 0.2, 1);
  /* Shared with flyouts / cards so the narrow header menu feels like the same chrome. */
  --shell-elevated-surface: linear-gradient(180deg, #fffefb 0%, #f8f3e8 100%);
  --shell-elevated-border: #ddd5c4;
  --shell-elevated-shadow: 0 18px 44px rgba(29, 45, 53, 0.12);
}

body {
  background:
    radial-gradient(circle at 12% 8%, #fdf6e5 0%, transparent 30%),
    radial-gradient(circle at 88% 92%, #e8eef9 0%, transparent 36%),
    var(--bg);
  color: var(--ink);
}

.app-root {
  width: min(var(--shell-main-max-width), calc(100vw - 2rem));
  max-width: 100%;
  margin: 1rem auto 2rem;
  display: grid;
  gap: 0.75rem;
  position: relative;
  transition: padding-right 180ms ease;
}

.shell-page-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.shell-page-shell > * {
  min-width: 0;
}

.shell-main-content {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  transition:
    width 180ms ease,
    max-width 180ms ease;
}

.shell-route-transition-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.shell-route-transition-layer[data-active="true"] {
  opacity: 1;
  visibility: visible;
}

.shell-route-transition-layer-backdrop,
.shell-route-transition-layer-swipe {
  position: absolute;
  inset: 0;
}

.shell-route-transition-layer-backdrop {
  opacity: 0;
  background: linear-gradient(180deg, rgba(244, 241, 232, 0.05) 0%, rgba(244, 241, 232, 0.22) 100%);
  backdrop-filter: blur(0px);
}

.shell-route-transition-layer-swipe {
  top: -10%;
  bottom: -10%;
  left: -38%;
  width: 176%;
  inset-inline: auto;
  background:
    linear-gradient(
      100deg,
      color-mix(in srgb, var(--player-p1) 18%, transparent) 0%,
      color-mix(in srgb, var(--player-p1) 10%, transparent) 18%,
      color-mix(in srgb, #fff 4%, transparent) 36%,
      color-mix(in srgb, var(--player-p2) 10%, transparent) 58%,
      color-mix(in srgb, var(--player-p2) 18%, transparent) 100%
    ),
    radial-gradient(circle at 28% 58%, color-mix(in srgb, var(--player-p1) 6%, transparent) 0%, transparent 28%),
    radial-gradient(circle at 72% 42%, color-mix(in srgb, var(--player-p2) 6%, transparent) 0%, transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(244, 241, 232, 0.06) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 8px 18px rgba(29, 45, 53, 0.03);
  transform: translateX(-74%) skewX(-14deg);
}

.shell-route-transition-layer[data-phase="covering"] .shell-route-transition-layer-backdrop {
  animation: shell-game-entry-backdrop-in var(--shell-game-entry-cover-ms, 160ms) cubic-bezier(0.22, 0.72, 0.2, 1) forwards;
}

.shell-route-transition-layer[data-phase="covered"] .shell-route-transition-layer-backdrop {
  opacity: 0.26;
  backdrop-filter: blur(1.5px);
}

.shell-route-transition-layer[data-phase="revealing"] .shell-route-transition-layer-backdrop {
  animation: shell-game-entry-backdrop-out var(--shell-game-entry-reveal-ms, 200ms) cubic-bezier(0.18, 0.72, 0.24, 1) forwards;
}

.shell-route-transition-layer[data-phase="covering"] .shell-route-transition-layer-swipe {
  animation: shell-game-entry-swipe-in var(--shell-game-entry-cover-ms, 160ms) cubic-bezier(0.18, 0.72, 0.24, 1) forwards;
}

.shell-route-transition-layer[data-phase="covered"] .shell-route-transition-layer-swipe {
  transform: translateX(10%) skewX(-12deg);
}

.shell-route-transition-layer[data-phase="revealing"] .shell-route-transition-layer-swipe {
  animation: shell-game-entry-swipe-out var(--shell-game-entry-reveal-ms, 200ms) cubic-bezier(0.18, 0.72, 0.24, 1) forwards;
}

#app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .shell-main-content {
  animation: shell-game-entry-content-reveal var(--shell-game-entry-reveal-ms, 200ms) cubic-bezier(0.18, 0.72, 0.24, 1);
}

#app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .game-shell-frame,
#app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .layout-grid,
#app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .invite-gate {
  animation: shell-game-entry-content-reveal var(--shell-game-entry-reveal-ms, 200ms) cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes shell-game-entry-backdrop-in {
  0% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 0.26;
    backdrop-filter: blur(1.5px);
  }
}

@keyframes shell-game-entry-backdrop-out {
  0% {
    opacity: 0.26;
    backdrop-filter: blur(1.5px);
  }
  100% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

@keyframes shell-game-entry-swipe-in {
  0% {
    opacity: 0.3;
    transform: translateX(-74%) skewX(-14deg);
  }
  100% {
    opacity: 0.38;
    transform: translateX(10%) skewX(-12deg);
  }
}

@keyframes shell-game-entry-swipe-out {
  0% {
    opacity: 0.38;
    transform: translateX(10%) skewX(-12deg);
  }
  100% {
    opacity: 0.18;
    transform: translateX(84%) skewX(-10deg);
  }
}

@keyframes shell-game-entry-content-reveal {
  0% {
    opacity: 0.94;
    transform: translateX(3px) scale(0.999);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.shell-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 32rem) minmax(0, 1fr);
  column-gap: 1rem;
  align-items: center;
  max-width: 100%;
  position: relative;
  border-radius: 14px;
  padding: 0.9rem 1rem 0.9rem;
}

.shell-header h1 {
  margin: 0;
  font-size: 2rem;
}

.shell-header-title-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition:
    color 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.shell-header-title-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 122, 90, 0.18);
}

.shell-header-main,
.shell-header-status,
.shell-header-actions {
  min-width: 0;
  max-width: 100%;
}

.shell-header-main {
  grid-column: 1;
  position: relative;
  z-index: 1;
}

.shell-header-actions {
  grid-column: 3;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
  align-self: center;
  position: relative;
  z-index: 1;
}

.shell-header-status {
  position: absolute;
  top: 0.9rem;
  left: 50%;
  width: min(100%, 32rem);
  max-width: calc(100% - 2rem);
  min-height: var(--shell-alert-stack-height, 5.6rem);
  height: var(--shell-alert-stack-height, 5.6rem);
  display: flex;
  align-items: flex-start;
  transform: translateX(-50%);
  z-index: 2;
}

.shell-header-status[data-shell-alert-zone="idle"] {
  visibility: hidden;
  pointer-events: none;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
}

/* Button hierarchy:
   - base button / .button-link: primary action, strongest emphasis, accent fill
   - .secondary: lower-emphasis action on the same semantic button shape
   - .mini-button: size modifier for compact inline use; combine with primary or secondary when full-size buttons feel too heavy
*/
.nav-row-single {
  justify-content: flex-end;
  align-items: center;
}

.shell-header-menu-root {
  position: relative;
}

.shell-header-menu-button {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.55rem;
}

button.secondary.shell-header-menu-button {
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.shell-header-menu-icon {
  display: grid;
  gap: 0.26rem;
  width: 1.2rem;
}

.shell-header-menu-icon > span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.shell-header-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 5;
  width: min(17rem, calc(100vw - 3.5rem));
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--shell-elevated-border) 82%, var(--line));
  border-radius: 14px;
  background: var(--shell-elevated-surface);
  box-shadow: var(--shell-elevated-shadow);
  transform-origin: top right;
  transform: translateY(-0.35rem) scale(0.78);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.shell-header-menu-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.shell-header-menu-panel button.secondary.shell-header-menu-item {
  width: 100%;
  min-height: 3.75rem;
  border-radius: 0;
  justify-content: flex-start;
  padding: 1rem 1.1rem;
  background: transparent;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow: none;
  font-weight: 650;
}

.shell-header-menu-panel button.secondary.shell-header-menu-item:first-child {
  border-top-width: 0;
}

.shell-header-menu-panel button.secondary.shell-header-menu-item.is-active,
.shell-header-menu-panel button.secondary.shell-header-menu-item[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow:
    inset 4px 0 0 var(--accent),
    inset 0 -1px 0 color-mix(in srgb, var(--line) 45%, transparent);
}

.shell-header-menu-panel button.secondary.shell-header-menu-item.is-active:first-child,
.shell-header-menu-panel button.secondary.shell-header-menu-item[aria-pressed="true"]:first-child {
  border-top: none;
  box-shadow: inset 4px 0 0 var(--accent);
}

[data-hover-capability="hover"] .shell-header-menu-panel button.secondary.shell-header-menu-item:not(:disabled):hover {
  background: #fcf8ee;
}

button,
.button-link {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-weight: 650;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

button.secondary,
.button-link.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) button:not(:disabled):hover,
[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) .button-link:not([aria-disabled="true"]):hover {
  border-color: rgba(31, 59, 53, 0.38);
  box-shadow: 0 1px 0 rgba(17, 45, 39, 0.1);
}

[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) button:not(.secondary):not(.warn):not(.danger):not(:disabled):hover,
[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) .button-link:not(.secondary):not([aria-disabled="true"]):hover {
  background: #0b6f52;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 0 rgba(9, 55, 41, 0.26),
    0 2px 7px rgba(9, 55, 41, 0.14);
}

[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) button.secondary:not(:disabled):hover,
[data-hover-capability="hover"] :is(.shell-header, .shell-flyout, .panel:not([data-shell-panel="board"])) .button-link.secondary:not([aria-disabled="true"]):hover {
  border-color: #b8ae9d;
  background: #fcf8ee;
}

[data-hover-capability="hover"] .shell-header-title-link:hover {
  color: var(--accent);
  opacity: 0.92;
  cursor: pointer;
}

button.secondary.is-active,
.button-link.secondary.is-active,
button.secondary[aria-pressed="true"],
.button-link.secondary[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(13, 122, 90, 0.16),
    inset 0 0 0 1px rgba(13, 122, 90, 0.4);
}

button.secondary.is-active,
.button-link.secondary.is-active,
button.secondary[aria-pressed="true"],
.button-link.secondary[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

button.warn {
  background: var(--warning);
}

button.danger {
  background: var(--danger);
}

button:disabled,
.button-link[aria-disabled="true"] {
  background: #d7d2c6;
  border-color: #c3bcab;
  color: #7c7568;
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

button.secondary:disabled {
  background: #f1eee6;
  border-color: #d6d0c2;
  color: #8a8375;
}

@keyframes shell-button-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.58;
  }
}

button.button-pending,
.button-link.button-pending {
  animation: shell-button-pulse 1.15s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.96;
  }
  50% {
    opacity: 0.46;
  }
}

.skeleton-pulse {
  display: block;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(215, 210, 198, 0.7) 0%, rgba(255, 255, 255, 0.96) 50%, rgba(215, 210, 198, 0.7) 100%);
  background-size: 180% 100%;
  animation: pulse 1.35s ease-in-out infinite;
}

.skeleton-panel {
  overflow: hidden;
}

.skeleton-line {
  min-height: 0.95rem;
}

.skeleton-line + .skeleton-line {
  margin-top: 0.65rem;
}

.skeleton-line-title {
  width: 58%;
  min-height: 1.4rem;
}

.skeleton-line-kicker {
  width: 30%;
  min-height: 0.8rem;
}

.skeleton-line-short {
  width: 44%;
}

.skeleton-line-subtitle {
  width: 72%;
}

.skeleton-line-status {
  width: 48%;
}

.skeleton-button {
  min-height: 2.7rem;
  margin-top: 0.8rem;
}

.skeleton-board {
  min-height: min(28rem, 44vw);
  margin-top: 0.9rem;
  border-radius: 18px;
}

.mini-board-card-list-skeleton {
  display: grid;
  gap: 1rem;
}

.mini-board-card-skeleton {
  display: grid;
  gap: 0.85rem;
}

/* Compact size variant for dense inline actions; keep semantics on the base/secondary class. */
.mini-button {
  padding: 0.32rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.15;
}

.layout-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.05fr 1.9fr 1.05fr;
  align-items: start;
}

.stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

#app[data-shell-layout-mode="wide"] .layout-grid > [data-shell-sticky-target][data-sticky-enabled="true"] {
  position: sticky;
  top: 1rem;
  align-self: start;
}

#app[data-shell-layout-mode="narrow"] .layout-grid {
  grid-template-columns: 1fr;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .shell-main-content {
  min-height: calc(100dvh - 2rem);
  grid-template-rows: auto minmax(0, 1fr);
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .game-shell-frame {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.85rem;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .game-shell-track-wrap {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .game-shell-track {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-height: 100%;
  touch-action: pan-y;
  transform: translateX(calc(var(--shell-game-panel-index, 1) * -100%));
  transition: transform var(--shell-mobile-panel-transition);
  will-change: transform;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .game-shell-mobile-panel {
  flex: 0 0 100%;
  min-width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  padding-bottom: 0.25rem;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .shell-mobile-tabbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 0.75rem 0  calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0) 0%, rgba(244, 241, 232, 0.92) 22%, rgba(244, 241, 232, 0.98) 100%);
  backdrop-filter: blur(6px);
}

.shell-mobile-tabbar {
  display: none;
}

.shell-mobile-tab {
  min-height: 2.9rem;
}

#app[data-shell-route="game"][data-shell-layout-mode="narrow"] .shell-mobile-tab[aria-pressed="true"] {
  border-color: var(--accent);
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 0 0 2px rgba(13, 122, 90, 0.16),
    inset 0 0 0 1px rgba(13, 122, 90, 0.4);
}

/* Very small viewports: reclaim horizontal space for the main board (game + invite previews). */
@media (max-width: 480px) {
  #app[data-shell-route="home"],
  #app[data-shell-route="game"],
  #app[data-shell-route="invite"] {
    width: min(var(--shell-main-max-width), calc(100vw - 0.65rem));
  }

  #app[data-shell-route="home"] .shell-header,
  #app[data-shell-route="game"] .shell-header,
  #app[data-shell-route="invite"] .shell-header {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  #app[data-shell-layout-mode="narrow"][data-shell-route="game"] [data-shell-panel="board"],
  #app[data-shell-layout-mode="narrow"][data-shell-route="invite"] [data-shell-panel="board"] {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  #app[data-shell-route="game"] [data-shell-panel="board"] .axis-label,
  #app[data-shell-route="invite"] [data-shell-panel="board"] .axis-label {
    display: none;
  }

  #app[data-shell-route="game"] [data-shell-panel="board"] .board-wrap,
  #app[data-shell-route="invite"] [data-shell-panel="board"] .board-wrap {
    padding-bottom: 0.35rem;
  }

  #app[data-shell-route="game"] [data-shell-panel="board"] .overlay-lines,
  #app[data-shell-route="invite"] [data-shell-panel="board"] .overlay-lines {
    bottom: 0.35rem;
  }
}

#app[data-shell-layout-mode="narrow"] [data-shell-panel="board"] .board > .cell {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  vertical-align: middle;
  line-height: 1.1;
}

.status-chip.live {
  color: #0d7a5a;
}

.status-chip.disconnected {
  color: var(--danger);
}

.alert {
  border-left: 4px solid var(--info);
  background: #f2f8ff;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.alert.warn {
  border-left-color: var(--warning);
  background: #fff5e9;
}

.alert.danger {
  border-left-color: var(--danger);
  background: #fff0ed;
}

/* Game route banners: single surface, full width — avoids panel + alert “double frame”. */
.shell-game-alerts,
#shell-game-alerts {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  pointer-events: auto;
}

.shell-game-alerts:empty,
#shell-game-alerts:empty {
  display: none;
}

.shell-game-alert {
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  border-left-width: 0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  box-sizing: border-box;
  animation: shell-game-alert-reveal 180ms ease;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.shell-game-alert-stack-card {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

.shell-game-alert-stack-card.is-active {
  z-index: 3;
}

.shell-game-alert-stack-card[data-stack-index="1"] {
  z-index: 2;
  transform: translateY(0.5rem) scale(0.982);
  opacity: 0.92;
}

.shell-game-alert-stack-card[data-stack-index="2"] {
  z-index: 1;
  transform: translateY(0.95rem) scale(0.964);
  opacity: 0.82;
}

.shell-game-alert-stack-card[data-stack-index]:not(.is-active):not([data-stack-index="1"]):not([data-stack-index="2"]) {
  z-index: 0;
  transform: translateY(1.2rem) scale(0.95);
  opacity: 0;
}

.shell-game-alert-stack-card.is-interactive {
  cursor: pointer;
}

.shell-game-alert-stack-card.is-interactive:focus-visible {
  outline: none;
}

.shell-game-alert-stack-card.is-interactive:focus-visible .shell-game-alert {
  box-shadow:
    0 0 0 3px rgba(13, 122, 90, 0.18),
    0 14px 28px rgba(27, 53, 79, 0.12);
}

.shell-game-alert-stack-card:not(.is-active) {
  pointer-events: none;
}

.shell-game-alert-copy {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@keyframes shell-game-alert-reveal {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.shell-game-alert.alert:not(.warn):not(.danger) {
  background: #f2f8ff;
  border-color: color-mix(in srgb, var(--info) 28%, var(--line));
}

.shell-game-alert.alert.warn {
  background: #fff5e9;
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
}

.shell-game-alert.alert.danger {
  background: #fff0ed;
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
}

.sync-failure-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.sync-failure-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.sync-failure-banner .mini-button {
  flex: 0 0 auto;
  align-self: center;
}

.history-mode-banner {
  margin-bottom: 0.6rem;
}

.history-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: var(--section-item-gap);
}

button.is-pressing,
.button-link.is-pressing {
  transform: translateY(1px) scale(0.985);
}

button.button-release-bounce,
.button-link.button-release-bounce {
  animation: history-item-release 140ms cubic-bezier(0.18, 0.72, 0.24, 1);
}

.participant-list,
.game-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.history-item {
  cursor: pointer;
  display: grid;
  grid-template-columns: var(--history-marker-slot-width) minmax(0, 1fr);
  column-gap: var(--history-marker-gap);
  gap: var(--history-entry-row-gap);
  transform-origin: 50% 50%;
}

.history-item.history-item-has-actions {
  gap: var(--history-entry-section-gap);
}

.history-item > * {
  grid-column: 2;
  min-width: 0;
}

.history-item-info,
.history-item-actions {
  display: grid;
  gap: var(--history-entry-row-gap);
}

.history-item-actions {
  justify-items: start;
}

.history-item::before {
  content: "\2022";
  color: currentColor;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  line-height: 1;
  transform: translateY(0.08rem);
}

.history-item:active {
  transform: translateY(1px) scale(0.985);
}

.history-item.is-pressing {
  transform: translateY(1px) scale(0.985);
}

.history-item.history-item-release {
  animation: history-item-release 140ms cubic-bezier(0.18, 0.72, 0.24, 1);
}

.history-item.history-item-pending {
  cursor: pointer;
  opacity: 0.52;
  animation: pulse 1.6s ease-in-out infinite;
}

.history-item.history-item-pending .history-move-line {
  font-weight: 500;
}

.history-item.history-item-pending .history-move-at {
  max-height: 1.2rem;
  opacity: 0.5;
  transform: translateY(0);
}

.history-item.is-undone .history-move-line {
  text-decoration: line-through;
  opacity: 0.65;
}

.history-item.is-undone .history-move-at {
  opacity: 0.45;
}

.history-item.history-item-waiting {
  cursor: default;
  pointer-events: none;
}

.history-item.history-item-waiting .history-move-line {
  font-weight: 500;
}

.history-item.history-item-undone-group {
  cursor: pointer;
  user-select: none;
}

.history-item.history-item-undone-group::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  width: 0.36rem;
  height: 0.36rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(0.42rem) rotate(-45deg);
  transform-origin: 58% 58%;
  transition: transform 170ms ease;
}

.history-item.history-item-undone-group .history-move-line {
  display: inline-block;
  font-weight: 500;
}

.history-item.history-item-undone-group[aria-disabled="true"] {
  opacity: 0.62;
  cursor: not-allowed;
}

.history-item.history-item-undone-group.is-expanded::before {
  transform: translateY(0.42rem) rotate(45deg);
}

.history-item.history-item-undone-group.is-undone .history-move-line {
  text-decoration: none;
  opacity: 0.65;
}

.history-undone-group-content {
  padding-left: 0.1rem;
  margin-top: -0.2rem;
  animation: history-undone-group-expand 170ms ease;
}

.history-list.history-list-nested {
  margin: 0;
  padding-left: 0.6rem;
  list-style: none;
  display: grid;
  gap: var(--section-item-gap);
}

.history-move-line {
  font-weight: 400;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.history-move-at {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-left: 0;
  transform: translateY(-0.15rem);
  transition:
    max-height 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.history-branch-button {
  margin-top: 0;
  justify-self: start;
}

/* Destruction sub-bullets — §t-001.04, RIGHELT_WEB_APP_SPEC §7 and §1.1.5 */
.history-destruction-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.1rem;
  display: grid;
  gap: var(--history-entry-row-gap);
}

.history-destruction-item {
  cursor: inherit;
  display: grid;
  grid-template-columns: var(--history-marker-slot-width) minmax(0, 1fr);
  column-gap: var(--history-marker-gap);
  align-items: center;
  font-size: 0.8em;
  opacity: 0.78;
  list-style: none;
}

.history-destruction-item::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  width: 0.5rem;
  height: 0.34rem;
  background: currentColor;
  opacity: 0.9;
  clip-path: polygon(0 32%, 52% 32%, 52% 8%, 100% 50%, 52% 92%, 52% 68%, 0 68%);
}

.history-destruction-label {
  grid-column: 2;
  min-width: 0;
}

.history-item.is-undone .history-destruction-item,
.history-destruction-item.is-undone {
  text-decoration: line-through;
  opacity: 0.65;
}

[data-hover-capability="hover"] .history-item:hover .history-move-at,
.history-item.is-selected .history-move-at {
  max-height: 1.2rem;
  opacity: 0.6;
  transform: translateY(0);
}

.history-item.is-deselecting .history-move-line {
  opacity: 0.78;
  transform: translateY(-0.05rem);
}

.history-item.is-deselecting .history-move-at,
[data-hover-capability="hover"] .history-item.is-deselecting:hover .history-move-at {
  max-height: 0;
  opacity: 0;
  transform: translateY(-0.18rem);
}

@keyframes history-item-release {
  0% {
    transform: translateY(1px) scale(0.985);
  }

  55% {
    transform: translateY(-2px) scale(1.008);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes history-undone-group-expand {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-item.is-selected .history-move-line {
  font-weight: 600;
}

[data-hover-capability="hover"] .history-item:hover .history-move-line {
  font-weight: 600;
}

.history-item.is-live-selected .history-move-line,
.history-empty-line.is-live-selected .history-move-line {
  font-weight: 600;
}

.history-empty-line,
.history-return-live {
  display: grid;
  gap: 0.08rem;
}

.history-return-live {
  align-items: start;
}

@media (prefers-reduced-motion: reduce) {
  .history-item.history-item-release {
    animation: none;
  }

  button.button-release-bounce,
  .button-link.button-release-bounce,
  .mini-board-card-link-surface.button-release-bounce {
    animation: none;
  }

  .history-item.is-pressing,
  button.is-pressing,
  .button-link.is-pressing,
  .mini-board-card-link-surface.is-pressing,
  .history-item:active {
    transform: none;
  }

  .history-move-line,
  .history-move-at {
    transition: none;
    transform: none;
  }

  .mini-board-card-link-surface {
    transition: none;
  }
}

.player-tone-p1 {
  color: #c2452f;
}

.player-tone-p2 {
  color: #2d67c7;
}

.player-tone-both {
  color: var(--player-both);
}

.mini-board-card-list {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: stretch;
}

.mini-board-card-list[data-game-count="1"] {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
}

.mini-board-card-list[data-game-count="1"] > .mini-board-card {
  width: min(100%, 26rem);
}

.mini-board-card {
  display: grid;
  width: 100%;
  gap: 0.65rem;
  border: 1px solid #ddd5c4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffefb 0%, #f8f3e8 100%);
  overflow: clip;
}

.mini-board-card-link-surface {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem;
  color: inherit;
  text-decoration: none;
  transform-origin: 50% 50%;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

[data-hover-capability="hover"] .mini-board-card:hover .mini-board-card-link-surface {
  transform: translateY(-1px);
}

[data-hover-capability="hover"] .mini-board-card:hover {
  border-color: #c8bea8;
  box-shadow: 0 10px 24px rgba(40, 54, 60, 0.08);
}

.mini-board-card-link-surface.is-pressing {
  transform: translateY(1px) scale(0.985);
}

.mini-board-card-link-surface.button-release-bounce {
  animation: history-item-release 140ms cubic-bezier(0.18, 0.72, 0.24, 1);
}

.home-games-section + .home-games-section {
  margin-top: 1.25rem;
}

.home-start-button {
  width: auto;
  min-height: 2.75rem;
  font-size: 0.98rem;
  padding-inline: 1.15rem;
}

.home-games-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.home-games-section-header[data-home-header-paging="true"] {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.home-games-section-heading {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.home-games-section-header-center {
  display: none;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

.home-games-section-header h2,
.home-games-section-header p {
  margin: 0;
}

.home-games-section-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  justify-self: end;
}

.home-games-section-header[data-home-header-paging="true"] .home-games-section-header-center {
  display: inline-flex;
  justify-content: center;
  justify-self: stretch;
}

.home-games-section-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.175rem;
}

.home-games-section-controls-footer {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.9rem;
}

.home-games-section-controls > button {
  min-width: 2.5rem;
  padding-inline: 0.75rem;
}

.home-games-section-page-label {
  min-width: 6.5rem;
  text-align: center;
}

.home-games-carousel {
  overflow: clip;
}

.home-games-carousel-track {
  will-change: transform, opacity;
}

.home-games-empty {
  margin: 0;
}


.mini-board-card-header,
.mini-board-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mini-board-card-copy {
  display: grid;
  gap: 0.24rem;
}

.mini-board-card-meta-primary {
  margin: 0;
  line-height: 1.2;
}

.mini-board-card-meta-primary strong,
.mini-board-card-meta-primary .small {
  line-height: inherit;
}

.mini-board-card-link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.mini-board-card-connection-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
}

.mini-board-card-connection-line.is-placeholder {
  visibility: hidden;
}

.mini-board-card-connection-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mini-board-card-connection-separator {
  color: var(--line);
}

.connection-status-icon {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.connection-status-icon.is-connected {
  background: var(--connection-status-connected-bg);
  box-shadow: inset 0 0 0 1px var(--connection-status-connected-ring);
}

.connection-status-icon.is-disconnected {
  background: var(--connection-status-disconnected-bg);
  box-shadow: inset 0 0 0 1px var(--connection-status-disconnected-ring);
}

.connection-status-icon.is-open {
  background: var(--connection-status-open-bg);
  box-shadow: inset 0 0 0 1px var(--connection-status-open-ring);
}

.connection-status-icon.is-disconnected::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.9rem;
  height: 1.5px;
  background: var(--connection-status-disconnected-strike);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 999px;
}

.mini-board-card-subtitle {
  margin: 0.18rem 0 0;
}

.mini-board-card-scenario {
  padding: 0.75rem;
}

.mini-board-preview-surface {
  min-width: 0;
}

.mini-board-preview-wrap {
  padding-bottom: 0.65rem;
}

.mini-board-preview-board {
  grid-template-columns: repeat(10, minmax(18px, 1fr));
  gap: 3px;
}

.mini-board-preview-board .cell {
  min-height: 28px;
  border-radius: 4px;
  padding: 2px;
}

.mini-board-preview-board .piece-token {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
  font-size: 0.45rem;
}

.mini-board-preview-board .piece-stack {
  width: 18px;
  height: 18px;
}

.mini-board-preview-board .piece-empty {
  width: 6px;
  height: 6px;
}

.mini-board-preview-board .piece-empty::before {
  width: 3px;
  height: 3px;
}

.mini-board-preview-board .axis-label {
  font-size: 0.52rem;
}

.mini-board-preview-board .axis-label.col-axis {
  bottom: -9px;
}

.mini-board-preview-board .axis-label.row-axis {
  left: -9px;
}

.mini-board-preview-status {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

select,
input,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

input,
textarea {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  font: inherit;
  line-height: 1.45;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(29, 45, 53, 0.04);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 6.5rem;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, white);
}

input:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--line) 55%, var(--accent));
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(13, 122, 90, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.scenario-save-panel,
.scenario-selected-summary {
  display: grid;
  gap: var(--section-item-gap);
}

.scenario-save-panel {
  padding-top: var(--section-item-gap);
  border-top: 1px solid rgba(210, 204, 185, 0.8);
}

.scenario-save-panel h3 {
  margin: 0;
  font-size: 0.98rem;
}

.scenario-save-panel .row {
  margin-top: 0;
}

.scenario-selected-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
}

.scenario-selected-title[contenteditable="plaintext-only"],
.scenario-selected-summary [data-scenario-editable="description"][contenteditable="plaintext-only"] {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 0.18rem 0.28rem;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.scenario-selected-title[contenteditable="plaintext-only"]:hover,
.scenario-selected-summary [data-scenario-editable="description"][contenteditable="plaintext-only"]:hover {
  border-color: rgba(210, 204, 185, 0.95);
  background: rgba(255, 255, 255, 0.82);
}

.scenario-selected-title[contenteditable="plaintext-only"]:focus-visible,
.scenario-selected-summary [data-scenario-editable="description"][contenteditable="plaintext-only"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fffefa;
  box-shadow: 0 0 0 3px rgba(13, 122, 90, 0.12);
}

.scenario-selected-summary [data-scenario-editable="description"] {
  margin: 0;
  line-height: 1.5;
}

.section-actions {
  margin-bottom: var(--section-item-gap);
}

.feedback-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-bottom: 0;
  transition:
    grid-template-rows 160ms ease,
    opacity 160ms ease,
    margin-bottom 160ms ease;
}

.feedback-reveal.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: var(--section-item-gap);
}

.feedback-reveal-body {
  overflow: hidden;
}

.feedback-reveal-body > * {
  margin: 0;
}

.section-stack {
  display: grid;
  gap: var(--section-item-gap);
}

.section-stack > * {
  margin: 0;
}

.section-followup {
  display: grid;
  gap: var(--section-item-gap);
}

.section-followup > * {
  margin: 0;
}

.shell-flyout-stack {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0;
  z-index: 10;
  pointer-events: none;
}

.shell-flyout {
  position: static;
  width: min(26rem, 100vw);
  height: 100vh;
  max-height: none;
  background: rgba(255, 253, 248, 0.98);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(29, 45, 53, 0.18);
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  z-index: 11;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  will-change: transform, opacity;
}

.shell-flyout.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.shell-flyout.is-closing {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.shell-flyout-scroll {
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.shell-flyout-scroll > *,
.debug-panel > * {
  min-width: 0;
  max-width: 100%;
  align-self: start;
}

.shell-flyout-header {
  padding: 1rem 1rem 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.98);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.shell-flyout-header h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.flyout-close-button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  line-height: 1;
  font-size: 1rem;
}

.flyout-close-button:hover,
.flyout-close-button:focus-visible {
  background: rgba(29, 45, 53, 0.08);
}

.debug-panel {
  margin: 0;
  display: grid;
  gap: var(--section-item-gap);
}

.debug-panel > h2 {
  margin: 0;
}

.debug-pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#app[data-shell-layout-mode="wide"][data-debug-open="true"],
#app[data-shell-layout-mode="wide"][data-scenarios-open="true"] {
  width: 100%;
  max-width: none;
  margin: 1rem 0 2rem;
  padding-left: 1rem;
  padding-right: calc(var(--shell-flyout-wide-width) + var(--shell-flyout-content-gap));
}

#app[data-shell-layout-mode="wide"][data-debug-open="true"][data-scenarios-open="true"] {
  padding-right: calc((var(--shell-flyout-wide-width) * 2) + var(--shell-flyout-content-gap));
}

#app[data-shell-layout-mode="wide"][data-debug-open="true"] .shell-main-content,
#app[data-shell-layout-mode="wide"][data-scenarios-open="true"] .shell-main-content {
  width: min(var(--shell-main-max-width), calc(100vw - var(--shell-flyout-wide-width) - var(--shell-flyout-content-gap) - 1rem));
  max-width: 100%;
  margin: 0 auto;
}

#app[data-shell-layout-mode="wide"][data-debug-open="true"][data-scenarios-open="true"] .shell-main-content {
  width: min(
    var(--shell-main-max-width),
    calc(100vw - (var(--shell-flyout-wide-width) * 2) - var(--shell-flyout-content-gap) - 1rem)
  );
}

#app[data-shell-layout-mode="wide"][data-flyout-count="1"] .shell-flyout,
#app[data-shell-layout-mode="wide"][data-flyout-count="2"] .shell-flyout {
  width: var(--shell-flyout-wide-width);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: none;
}

#app[data-shell-layout-mode="wide"][data-flyout-count="1"] .shell-flyout-scroll,
#app[data-shell-layout-mode="wide"][data-flyout-count="2"] .shell-flyout-scroll {
  max-height: none;
}

@media (prefers-reduced-motion: reduce) {
  .shell-game-alert {
    animation: none;
  }

  .shell-game-alert-stack-card {
    transition: none;
  }

  .app-root,
  .shell-main-content,
  .feedback-reveal {
    transition: none;
  }

  .shell-flyout {
    transition: none;
  }

  .shell-header-menu-panel {
    transition: none;
  }

  .shell-route-transition-layer-backdrop,
  .shell-route-transition-layer-swipe,
  #app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .shell-main-content,
  #app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .game-shell-frame,
  #app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .layout-grid,
  #app[data-shell-transition-active="true"][data-shell-transition="game-entry"][data-shell-transition-phase="revealing"][data-shell-route="game"] .invite-gate {
    animation: none;
  }

  .shell-route-transition-layer {
    display: none;
  }
}

.invite-gate {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.invite-gate-modal {
  position: sticky;
  top: 1rem;
  z-index: 2;
  box-shadow: 0 18px 40px rgba(29, 45, 53, 0.12);
}

.invite-gate-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.invite-choice-list {
  display: grid;
  gap: 0.75rem;
}

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

.invite-choice-note {
  min-width: min(100%, 18rem);
}

.invite-gate-content {
  filter: grayscale(0.4);
  opacity: 0.48;
  pointer-events: none;
  user-select: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.shell-header .small,
.shell-header .mono {
  max-width: 100%;
}

.shell-header .mono {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .shell-header {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding-top: 0.9rem;
  }

  .shell-header-status {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 1rem;
    width: auto;
    max-width: none;
    transform: none;
    z-index: 20;
    min-height: var(--shell-alert-stack-height-narrow, 6.2rem);
    height: var(--shell-alert-stack-height-narrow, 6.2rem);
  }

  .shell-header {
    align-items: center;
  }

  .shell-header-main,
  .shell-header-status,
  .shell-header-actions {
    flex: 0 1 auto;
  }

  .shell-header-main {
    flex: 1 1 auto;
  }

  .shell-header-actions {
    justify-self: end;
  }

  .shell-flyout-stack {
    left: 0;
    flex-direction: column;
    justify-content: flex-end;
  }

  .shell-flyout {
    width: 100%;
    height: auto;
    max-height: 50vh;
    flex: 0 1 50vh;
    min-height: 0;
    transform: translateY(calc(100% + 1rem));
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
  }

  .shell-flyout.is-open {
    transform: translateY(0);
  }

  .shell-flyout.is-closing {
    transform: translateY(100%);
  }

  .shell-header-menu-root {
    display: block;
  }

  .shell-header-menu-panel {
    width: calc(100vw - 3.5rem);
    max-width: calc(100vw - 3.5rem);
  }
}
