:root {
  color-scheme: light dark;
  --font-system: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --canvas: #f3f4f1;
  --surface: #ffffff;
  --surface-subtle: #f7f8f5;
  --surface-raised: #ffffff;
  --surface-input: #fbfcfa;
  --ink: #1d2522;
  --ink-muted: #68716d;
  --ink-faint: #68716d;
  --line: rgba(29, 37, 34, .12);
  --line-strong: rgba(29, 37, 34, .22);
  --accent: #287d68;
  --accent-strong: #1c6b58;
  --primary-foreground: #ffffff;
  --accent-soft: #dcefe7;
  --danger: #bd4a4e;
  --danger-soft: #f7e2e0;
  --world-accent: #c8754d;
  --world-accent-soft: #f2dfd5;
  --felt: #e7efea;
  --felt-deep: #d8e6de;
  --board-surface: #f8f8f3;
  --board-center: #edf3ee;
  --board-ink: #25302d;
  --board-line: rgba(37, 48, 45, .22);
  --shadow-soft: 0 14px 38px rgba(24, 34, 30, .08);
  --shadow-board: 0 24px 60px rgba(24, 34, 30, .16), 0 4px 12px rgba(24, 34, 30, .1);
  --radius-card: 24px;
  --radius-control: 13px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #151719;
    --surface: #202326;
    --surface-subtle: #1a1d1f;
    --surface-raised: #282c2f;
    --surface-input: #191c1e;
    --ink: #f3f5f2;
    --ink-muted: #aab3ae;
    --ink-faint: #a6b0ab;
    --line: rgba(243, 245, 242, .13);
    --line-strong: rgba(243, 245, 242, .25);
    --accent: #68c7a7;
    --accent-strong: #7dd7b8;
    --primary-foreground: #10241f;
    --accent-soft: #1e443b;
    --danger: #f0807c;
    --danger-soft: #4b2829;
    --world-accent-soft: #53372e;
    --felt: #1d3029;
    --felt-deep: #263d33;
    --board-surface: #29302d;
    --board-center: #202a26;
    --board-ink: #f3f5f2;
    --board-line: rgba(243, 245, 242, .2);
    --shadow-soft: 0 18px 42px rgba(0, 0, 0, .24);
    --shadow-board: 0 28px 64px rgba(0, 0, 0, .42), 0 4px 12px rgba(0, 0, 0, .25);
  }
}

body[data-theme="neonstadt"] {
  --world-accent: #c8754d;
  --world-accent-soft: #f2dfd5;
}

body[data-theme="alpenresort"] {
  --world-accent: #6c9b7b;
  --world-accent-soft: #deeee3;
}

body[data-theme="orbitalstation"] {
  --world-accent: #6f93b3;
  --world-accent-soft: #dfe9f2;
}

@media (prefers-color-scheme: dark) {
  body[data-theme="neonstadt"] { --world-accent-soft: #53372e; }
  body[data-theme="alpenresort"] { --world-accent-soft: #294534; }
  body[data-theme="orbitalstation"] { --world-accent-soft: #2f4050; }
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  font-family: var(--font-system);
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
  font-variant-numeric: tabular-nums;
}

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

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .52;
}

button:active:not(:disabled),
a:active {
  transform: scale(.985);
}

button,
a,
input,
select,
summary {
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.board-space:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
dl,
dd,
dt {
  margin: 0;
}

h1,
h2,
h3,
strong,
b {
  letter-spacing: -.025em;
}

h1,
h2,
h3,
p,
span,
button,
label,
small {
  overflow-wrap: anywhere;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

[hidden],
.is-hidden {
  display: none !important;
}

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

.eyebrow {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: calc(12px + var(--safe-top)) clamp(18px, 4vw, 64px) 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px) saturate(120%);
}

.brand-link,
.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
}

.brand-seal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(24, 34, 30, .06);
}

.brand-seal.small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 15px;
}

.brand-lockup,
.game-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.setup-brand-mobile {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.brand-lockup strong,
.game-brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand-lockup small,
.game-brand small {
  color: var(--ink-muted);
  font-size: 11px;
}

.header-actions,
.status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-caption {
  color: var(--ink-muted);
  font-size: 12px;
}

.icon-button,
.secondary-button,
.quiet-button,
.danger-button,
.primary-button,
.action-button,
.history-button,
.add-seat,
.remove-seat,
.world-choice,
.ruleset-choice,
.mode-choice,
.room-code,
.space-context-action,
.sheet-handle {
  border: 1px solid transparent;
}

.icon-button,
.secondary-button,
.quiet-button,
.danger-button,
.primary-button,
.action-button,
.history-button,
.add-seat,
.remove-seat,
.space-context-action,
.sheet-handle {
  min-height: 44px;
  border-radius: var(--radius-control);
}

.icon-button,
.secondary-button,
.quiet-button,
.history-button,
.space-context-action {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-weight: 650;
}

.button-symbol {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}

.primary-button,
.action-button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 0 17px;
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--primary-foreground);
  font-weight: 750;
  box-shadow: 0 7px 16px rgba(24, 34, 30, .18);
}

.primary-button b {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.primary-button:hover:not(:disabled),
.action-button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button,
.quiet-button {
  padding: 0 14px;
  font-weight: 650;
}

.secondary-button.small {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
}

.quiet-button {
  width: 100%;
  color: var(--accent);
}

.danger-button,
.action-button.danger {
  padding: 0 15px;
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

main {
  min-height: 100dvh;
}

.screen {
  display: none;
  min-height: 100dvh;
}

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

.setup-shell,
.lobby-shell,
.game-desk {
  width: min(100%, 1500px);
  margin: 0 auto;
}

.setup-shell {
  width: min(100%, 1320px);
  padding: clamp(30px, 5vw, 72px) clamp(18px, 4vw, 64px) calc(48px + var(--safe-bottom));
}

.setup-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: clamp(24px, 4vw, 42px);
}

.setup-intro-copy {
  max-width: 620px;
}

.setup-intro h1,
.lobby-hero h1 {
  max-width: 680px;
  margin-top: 10px;
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 760;
  letter-spacing: -.04em;
  line-height: .98;
}

.setup-intro h1 em {
  color: var(--accent);
  font-style: normal;
}

.setup-intro p,
.lobby-hero p {
  max-width: 540px;
  margin-top: 17px;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 18px);
}

.setup-intro-meta {
  display: flex;
  flex: 0 0 auto;
  gap: 26px;
  padding-bottom: 3px;
}

.setup-intro-meta span {
  display: grid;
  gap: 2px;
}

.setup-intro-meta strong {
  font-size: 22px;
  font-weight: 750;
}

.setup-intro-meta small,
.preview-card-footer,
.preview-card-footer span {
  color: var(--ink-muted);
  font-size: 11px;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, .82fr);
  align-items: start;
  gap: clamp(20px, 3vw, 38px);
}

.setup-preview-card,
.setup-workspace,
.lobby-card,
.action-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.setup-preview-card {
  min-width: 0;
  padding: clamp(18px, 2.3vw, 30px);
}

.preview-card-header,
.workspace-heading,
.panel-heading,
.board-heading,
.rail-section-heading,
.preview-card-footer,
.lobby-hero,
.game-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-card-header {
  margin-bottom: 20px;
}

.preview-card-header h2,
.workspace-heading h2,
.panel-heading h2,
.rail-section-heading h2 {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 750;
}

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.preview-status i,
.live-dot,
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.setup-board-preview {
  display: grid;
  grid-template: "top top top" 1.25fr "left center right" 8fr "bottom bottom bottom" 1.25fr / 1.25fr 8fr 1.25fr;
  aspect-ratio: 1.08 / 1;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--board-line);
  border-radius: 20px;
  background: var(--board-surface);
  color: var(--board-ink);
}

.preview-edge {
  min-width: 0;
  min-height: 0;
}

.preview-top,
.preview-bottom {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
}

.preview-left,
.preview-right {
  display: grid;
  grid-template-rows: repeat(9, minmax(0, 1fr));
}

.preview-top { grid-area: top; }
.preview-left { grid-area: left; }
.preview-board-center { grid-area: center; }
.preview-right { grid-area: right; }
.preview-bottom { grid-area: bottom; }

.preview-space,
.preview-corner {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: .5px solid var(--board-line);
  background: var(--board-surface);
}

.preview-space::before {
  position: absolute;
  inset: 0;
  content: "";
  box-shadow: inset 0 -5px var(--preview-color, transparent);
}

.preview-left .preview-space::before { box-shadow: inset -5px 0 var(--preview-color, transparent); }
.preview-right .preview-space::before { box-shadow: inset 5px 0 var(--preview-color, transparent); }
.preview-bottom .preview-space::before { box-shadow: inset 0 5px var(--preview-color, transparent); }

.preview-corner {
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 4px;
  font-size: clamp(7px, 1vw, 11px);
  font-weight: 750;
  text-align: center;
}

.preview-corner small {
  color: var(--ink-muted);
  font-size: .65em;
  font-weight: 550;
}

.p-blue { --preview-color: #6b9dc5; }
.p-cyan { --preview-color: #73b3b3; }
.p-green { --preview-color: #72a77f; }
.p-yellow { --preview-color: #d0ae57; }
.p-red { --preview-color: #c96e67; }
.p-orange { --preview-color: #d7975f; }
.p-purple { --preview-color: #a685b7; }
.p-rail { --preview-color: #8f9d9e; }
.p-community { --preview-color: #d8bf79; }
.p-event { --preview-color: #b59dce; }
.p-tax { --preview-color: #cf9b8b; }

.preview-space.is-current {
  z-index: 1;
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.preview-board-center {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(6px, 1vw, 14px);
  min-width: 0;
  padding: clamp(12px, 3vw, 34px);
  border: 1px solid var(--board-line);
  background: var(--board-center);
  text-align: center;
}

.preview-center-kicker {
  color: var(--ink-muted);
  font-size: clamp(7px, 1vw, 11px);
  font-weight: 750;
  letter-spacing: .1em;
}

.preview-board-center strong {
  font-size: clamp(25px, 5vw, 62px);
  font-weight: 800;
  letter-spacing: -.08em;
  line-height: .9;
}

.preview-board-center p {
  color: var(--ink-muted);
  font-size: clamp(10px, 1.4vw, 15px);
  line-height: 1.25;
}

.preview-center-markers {
  display: flex;
  gap: 7px;
}

.marker {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.marker-blue { background: #6b9dc5; }
.marker-orange { background: #d7975f; }
.marker-green { background: #72a77f; }

.preview-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 15px;
}

.preview-card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot,
.legend-line {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.legend-line {
  display: inline-block;
  border-radius: 2px;
  background: var(--world-accent);
}

.preview-footnote {
  margin-left: auto;
  color: var(--ink-faint) !important;
}

.setup-workspace {
  min-width: 0;
  padding: clamp(18px, 2.3vw, 30px);
}

.workspace-heading {
  align-items: end;
  margin-bottom: 18px;
}

.workspace-heading h2 {
  margin-top: 0;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -.05em;
}

.workspace-step,
.panel-heading > span,
.rail-section-heading > span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 650;
}

.mode-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}

.mode-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 11px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-muted);
  text-align: left;
}

.mode-choice.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 9px rgba(24, 34, 30, .07);
}

.mode-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 10px;
  color: var(--accent);
  line-height: 0;
}

.mode-icon svg,
.summary-symbol svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.mode-choice span:last-child,
.world-choice > span:last-child,
.ruleset-choice > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mode-choice strong {
  font-size: 13px;
}

.mode-choice small,
.world-choice small,
.ruleset-choice small {
  color: var(--ink-muted);
  font-size: 11px;
}

.setup-panel {
  padding-top: 22px;
}

.panel-heading {
  align-items: end;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 18px;
}

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

.seat-row {
  display: grid;
  grid-template-columns: 12px minmax(76px, .55fr) minmax(90px, 1fr) minmax(90px, .65fr);
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
}

.seat-dot {
  display: block;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px currentColor;
}

.seat-row select,
.seat-row input,
.lobby-seat select,
.lobby-seat input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.seat-row select:focus-visible,
.seat-row input:focus-visible,
.lobby-seat select:focus-visible,
.lobby-seat input:focus-visible {
  outline-offset: 0;
}

.seat-name-field {
  min-width: 0;
}

.name-input,
.lobby-name {
  padding: 0 8px;
  border-color: var(--line) !important;
  background: var(--surface-input) !important;
}

.add-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.add-seat span {
  font-size: 20px;
  font-weight: 400;
  line-height: .8;
}

.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 21px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.setup-step {
  min-width: 0;
}

.step-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.step-label h3 {
  font-size: 13px;
}

.step-label span {
  color: var(--ink-faint);
  font-size: 11px;
}

.world-picker,
.ruleset-picker {
  display: grid;
  gap: 7px;
}

.world-choice,
.ruleset-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 57px;
  padding: 8px 10px;
  border-color: var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
  color: var(--ink);
  text-align: left;
}

.world-choice:hover:not(:disabled),
.ruleset-choice:hover:not(:disabled),
.world-choice.is-active,
.ruleset-choice.is-active {
  border-color: color-mix(in srgb, var(--world-accent) 60%, var(--line));
  background: var(--world-accent-soft);
}

.world-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--theme-color, var(--world-accent));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.world-logo {
  display: block;
  width: 22px;
  height: 22px;
}

.world-choice strong,
.ruleset-choice strong {
  display: block;
  font-size: 12px;
}

.ruleset-choice {
  grid-template-columns: 1fr;
}

.ruleset-choice strong::after {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

.setup-panel > .primary-button,
.online-options > .primary-button,
.lobby-settings > .primary-button {
  margin-top: 18px;
}

.online-options {
  display: grid;
  gap: 14px;
}

.text-input,
.trade-cash,
select,
input[type="number"] {
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-input);
  color: var(--ink);
}

.field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 650;
}

.online-options .field-label {
  margin-top: 2px;
}

.join-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}

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

.code-input {
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.form-error {
  min-height: 21px;
  margin-top: 11px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.form-error:empty {
  display: none;
}

.loadout-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  min-height: 64px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--ink);
  text-align: left;
}

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

.loadout-copy small {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.25;
}

.loadout-copy strong {
  font-size: 13px;
}

.summary-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 10px;
  color: var(--accent);
  line-height: 1;
}

.loadout-launcher:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--surface);
}

.loadout-content {
  display: grid;
  gap: 17px;
  padding: 0 0 5px;
}

.cosmetic-preview {
  display: flex;
  gap: 10px;
}

.preview-item {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
}

.preview-item small,
.cosmetic-option small {
  color: var(--ink-muted);
  font-size: 11px;
}

.cosmetic-groups {
  display: grid;
  gap: 15px;
}

.cosmetic-group h3 {
  margin-bottom: 7px;
  font-size: 12px;
}

.cosmetic-options {
  display: grid;
  gap: 6px;
}

.cosmetic-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
  color: var(--ink);
  text-align: left;
}

.cosmetic-option.is-equipped {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cosmetic-option > span:last-child {
  display: grid;
  gap: 1px;
}

.cosmetic-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--world-accent-soft);
  color: var(--world-accent);
}

.lobby-shell {
  padding: clamp(30px, 5vw, 74px) clamp(18px, 4vw, 64px) calc(48px + var(--safe-bottom));
}

.lobby-hero {
  align-items: end;
  margin-bottom: 28px;
}

.lobby-hero h1 {
  font-size: clamp(34px, 5vw, 60px);
}

.room-code-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 145px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.room-code-wrap > span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.room-code-wrap small {
  color: var(--ink-muted);
  font-size: 10px;
}

.room-code {
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  color: var(--accent);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .16em;
}

.room-code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.room-code.is-copied,
.room-code-actions .secondary-button.is-copied,
.dialog-actions .secondary-button.is-copied {
  color: #2b9348;
  border-color: rgba(43, 147, 72, .35);
  background: rgba(43, 147, 72, .08);
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: clamp(20px, 2.5vw, 32px);
}

.lobby-card {
  min-width: 0;
  padding: clamp(22px, 2.5vw, 30px);
}

.lobby-card .panel-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.lobby-seat {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(82px, .45fr) minmax(100px, .55fr);
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-subtle);
}

.lobby-seat > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.seat-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-status {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.3;
}

.seat-status.connected {
  color: var(--accent);
}

.seat-index {
  color: var(--ink-muted);
  font-size: 11px;
  text-align: right;
}

.remove-seat {
  min-height: 44px;
  min-width: 82px;
  padding: 0 10px;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  white-space: nowrap;
}

.lobby-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-settings > .panel-heading {
  margin-bottom: 0;
}

.lobby-settings .world-picker,
.lobby-settings .ruleset-picker {
  margin-bottom: 0;
}

.lobby-settings .world-picker.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.lobby-settings .ruleset-picker.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lobby-settings .world-choice,
.lobby-settings .ruleset-choice {
  min-height: 68px;
  align-items: start;
  padding: 10px;
}

.lobby-settings .world-choice {
  gap: 8px;
}

.lobby-settings .world-choice strong,
.lobby-settings .ruleset-choice strong {
  line-height: 1.2;
}

.lobby-settings .world-choice small,
.lobby-settings .ruleset-choice small {
  line-height: 1.3;
}

.lobby-settings > .primary-button {
  min-height: 52px;
  margin-top: 0;
}

.lobby-hint {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.game-screen,
#game-screen {
  min-height: calc(100dvh - 72px);
  background: var(--canvas);
}

#game-screen.is-active {
  display: block;
}

.game-shell {
  min-height: 100dvh;
}

.game-desk {
  min-height: 100dvh;
  padding: 16px clamp(14px, 3vw, 48px) calc(24px + var(--safe-bottom));
}

.game-statusbar {
  min-height: 48px;
  margin-bottom: 14px;
}

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

.turn-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.turn-status > span:last-child {
  display: grid;
  gap: 1px;
}

.turn-status strong {
  font-size: 12px;
}

.turn-status small {
  color: var(--ink-muted);
  font-size: 10px;
}

.live-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  grid-template-areas: "board rail";
  align-items: start;
  gap: clamp(24px, 3vw, 42px);
}

.board-column {
  display: grid;
  grid-area: board;
  align-content: start;
  min-width: 0;
}

.board-heading {
  align-items: baseline;
  margin: 0 auto 10px;
  width: min(100%, calc(100dvh - 102px));
  color: var(--ink-muted);
}

.board-heading strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.board-hint {
  font-size: 11px;
}

.board-stage {
  position: relative;
  display: grid;
  width: min(100%, calc(100dvh - 102px));
  max-width: none;
  aspect-ratio: 1;
  min-height: 0;
  margin: 0 auto;
  container-type: size;
  place-items: center;
}

.board {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--board-line);
  border-radius: 24px;
  background: var(--board-surface);
  box-shadow: var(--shadow-board);
  color: var(--board-ink);
  container-type: size;
}

.board::before {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: inherit;
  content: "";
}

.board-center {
  position: relative;
  z-index: 0;
  display: grid;
  grid-area: 2 / 2 / 11 / 11;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border: 1px solid var(--board-line);
  background: var(--board-center);
}

.board-center::before,
.board-center::after {
  position: absolute;
  inset: 8%;
  border: 1px solid var(--board-line);
  border-radius: 18px;
  content: "";
  opacity: .65;
  pointer-events: none;
}

.board-center::after {
  inset: 16%;
  border-style: dashed;
  opacity: .35;
}

.board-center-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: clamp(4px, 1.15cqw, 13px);
  width: min(78%, 420px);
  text-align: center;
}

.board-kicker {
  color: var(--ink-muted);
  font-size: clamp(7px, 1.25cqw, 13px);
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.board-monogram {
  display: grid;
  width: clamp(38px, 12cqw, 120px);
  height: clamp(38px, 12cqw, 120px);
  place-items: center;
  border: 1px solid var(--board-line);
  border-radius: 28%;
  color: var(--world-accent);
  font-size: clamp(24px, 7cqw, 76px);
  font-weight: 800;
  letter-spacing: -.08em;
  line-height: 1;
}

.board-dice-display {
  display: flex;
  gap: clamp(3px, .8cqw, 9px);
}

.board-focus,
.board-active,
.board-turn {
  display: grid;
  gap: 2px;
  max-width: 100%;
}

.board-focus {
  padding: clamp(6px, 1.2cqw, 13px) clamp(9px, 2cqw, 20px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
}

.board-focus small,
.board-active span,
.board-turn small {
  color: var(--ink-muted);
  font-size: clamp(6px, .95cqw, 10px);
}

.board-focus strong {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(9px, 1.55cqw, 17px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-focus > span {
  color: var(--ink-muted);
  font-size: clamp(6px, 1cqw, 11px);
}

.board-active {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  padding-top: clamp(4px, .8cqw, 8px);
  border-top: 1px solid var(--board-line);
  text-align: left;
}

.board-active i {
  display: block;
  width: clamp(8px, 1.4cqw, 14px);
  height: clamp(8px, 1.4cqw, 14px);
  margin-right: 6px;
  border-radius: 50%;
  background: var(--active-color, var(--accent));
}

.board-active span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-active strong {
  font-size: clamp(8px, 1.2cqw, 13px);
}

.board-turn {
  grid-template-columns: 1fr auto;
  width: 100%;
  padding-top: 2px;
  text-align: left;
}

.board-turn em {
  color: var(--world-accent);
  font-size: clamp(7px, 1.1cqw, 12px);
  font-style: normal;
  font-weight: 700;
}

.board-space-cell {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  min-height: 0;
}

.board-space {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--board-line);
  border-bottom: 1px solid var(--board-line);
  background: var(--board-surface);
  color: var(--board-ink);
  text-align: center;
}

.board-space-cell.side-right .board-space {
  border-right: 0;
}

.board-space:hover {
  background: var(--surface);
}

.space-inner {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1px, .35cqw, 5px);
  padding: clamp(3px, .6cqw, 8px) clamp(2px, .5cqw, 7px);
}

.group-band {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 18%;
  min-height: 3px;
  background: var(--group-color);
}

.board-space.side-top .group-band {
  top: auto;
  bottom: 0;
}

.board-space.side-right .group-band {
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 18%;
  height: auto;
}

.board-space.side-bottom .group-band {
  top: 0;
  bottom: auto;
}

.board-space.side-left .group-band {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 18%;
  height: auto;
}

.space-icon {
  color: var(--ink-muted);
  font-size: clamp(.72rem, 1.8cqw, 24px);
  line-height: 1;
}

.space-kind {
  color: var(--ink-muted);
  font-size: clamp(.55rem, .75cqw, 9px);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.space-name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(.62rem, 1.1cqw, 13px);
  font-weight: 750;
  line-height: 1.08;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.space-price {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: clamp(.5rem, .78cqw, 9px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-space.is-special .space-inner {
  padding-top: clamp(5px, 1cqw, 12px);
}

.board-space.is-owned {
  box-shadow: inset 0 0 0 2px var(--owner-color, transparent);
}

.board-space.is-mortgaged {
  opacity: .58;
}

.board-space.is-focused {
  z-index: 5;
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  background: var(--accent-soft);
}

.board-space.is-landing {
  z-index: 6;
  outline: 4px solid var(--world-accent);
  outline-offset: -4px;
  animation: board-land .38s ease-out both;
}

.board-space.is-acquired,
.board-space.is-built {
  z-index: 6;
  animation: board-acquire .42s ease-out both;
}

.token-stack {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 1px;
  min-height: 0;
}

.game-token {
  display: grid;
  width: clamp(12px, 3cqw, 29px);
  height: clamp(12px, 3cqw, 29px);
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 50%;
  background: var(--token-color, var(--accent));
  color: #fff;
  font-size: clamp(6px, 1.15cqw, 12px);
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
}

.game-token.is-motion-target {
  opacity: .18;
}

.building-stack {
  position: absolute;
  top: 20%;
  right: 3px;
  z-index: 3;
  display: flex;
  gap: 2px;
  max-width: calc(100% - 6px);
}

.owner-marker {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 4;
  display: grid;
  min-width: clamp(12px, 2.4cqw, 22px);
  height: clamp(12px, 2.4cqw, 22px);
  padding: 0 2px;
  place-items: center;
  border: 1px solid var(--owner-color, var(--board-line));
  border-radius: 5px;
  background: var(--board-surface);
  color: var(--board-ink);
  font-size: clamp(.45rem, .72cqw, 9px);
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1;
  pointer-events: none;
}

.building {
  display: block;
  width: clamp(4px, 1cqw, 10px);
  height: clamp(7px, 1.9cqw, 18px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 2px;
  background: var(--building-color, var(--accent));
}

.building.hotel {
  width: clamp(8px, 2cqw, 20px);
  height: clamp(6px, 1.35cqw, 13px);
}

.motion-canvas {
  position: absolute;
  z-index: 7;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.game-moment {
  position: absolute;
  z-index: 9;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(76%, 430px);
  gap: 5px;
  padding: clamp(15px, 3cqw, 30px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -46%) scale(.98);
  transition: opacity .18s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.game-moment.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.moment-kicker {
  color: var(--world-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.moment-title {
  font-size: clamp(18px, 3cqw, 32px);
  line-height: 1.05;
}

.moment-copy {
  color: var(--ink-muted);
  font-size: clamp(11px, 1.4cqw, 14px);
}

.command-rail {
  display: grid;
  grid-area: rail;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.rail-section-heading {
  align-items: end;
  padding: 2px 2px 3px;
}

.rail-section-heading h2 {
  font-size: 18px;
}

.player-strip {
  display: grid;
  gap: 8px;
}

.player-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.player-card.is-active {
  border-color: var(--player-color, var(--accent));
  background: var(--surface-raised);
  box-shadow: 0 5px 15px rgba(24, 34, 30, .08);
}

.player-card.is-bankrupt {
  opacity: .55;
}

.player-token {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 11px;
  background: var(--player-color, var(--accent));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.player-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.player-heading,
.player-economy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.player-heading strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-money {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.player-status {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-badge {
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 3px 5px;
  white-space: nowrap;
}

.property-pips {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 2px;
  max-width: 52px;
  flex-wrap: wrap;
}

.property-pip {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--pip-color, var(--accent));
}

.player-delta {
  position: absolute;
  top: 5px;
  right: 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  animation: delta-in .45s ease both;
}

.player-delta.is-negative {
  color: var(--danger);
}

.action-sheet {
  min-width: 0;
  overflow: hidden;
}

.sheet-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 68px;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.sheet-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sheet-title b {
  font-size: 14px;
  line-height: 1.15;
}

.sheet-title small {
  color: var(--ink-muted);
  font-size: 10px;
}

.sheet-chevron {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-muted);
  font-size: 16px;
}

.action-sheet.is-collapsed .sheet-chevron {
  transform: rotate(180deg);
}

.action-sheet.is-collapsed .sheet-body {
  display: none;
}

.sheet-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dice-display {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.die {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(24, 34, 30, .08);
}

.die.is-rolling {
  animation: die-roll .4s ease-in-out infinite alternate;
}

.die.is-settling {
  animation: die-settle .35s cubic-bezier(.22, 1, .36, 1) both;
}

.space-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
}

.space-context-swatch {
  display: block;
  width: 6px;
  min-height: 36px;
  border-radius: 5px;
  background: var(--context-color, var(--accent));
}

.space-context-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.space-context-copy small {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.space-context-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-context-copy > span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-context-action {
  min-height: 44px;
  padding: 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

#action-content {
  display: grid;
  gap: 14px;
}

.action-title {
  max-width: 100%;
  font-size: clamp(19px, 2.4vw, 27px);
  line-height: 1.05;
}

.action-copy,
.dialog-copy {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 8px;
}

.action-button {
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.action-button.wide {
  grid-column: 1 / -1;
}

.action-button small {
  display: block;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 550;
}

.decision-metrics,
.trade-preview,
.portfolio-balance,
.manage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.decision-metrics span,
.trade-preview > span,
.portfolio-balance > span,
.manage-summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
}

.decision-metrics small,
.trade-preview small,
.portfolio-balance small {
  color: var(--ink-muted);
  font-size: 10px;
}

.decision-metrics strong,
.trade-preview strong,
.portfolio-balance strong {
  font-size: 13px;
}

.manage-summary {
  color: var(--ink-muted);
  font-size: 11px;
}

.manage-summary span {
  display: block;
}

.primary-actions {
  margin-top: 2px;
}

.coach-tip {
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--world-accent) 42%, var(--line));
  border-radius: 12px;
  background: var(--world-accent-soft);
}

.coach-tip > span {
  color: var(--world-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.coach-tip p {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 12px;
}

.asset-actions {
  display: grid;
  gap: 7px;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.asset-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row small {
  color: var(--ink-muted);
  font-size: 10px;
}

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

.asset-buttons .action-button {
  min-height: 44px;
  padding: 6px 8px;
  font-size: 10px;
}

.waiting-card,
.compact-action,
.winner-card {
  display: grid;
  gap: 9px;
}

.waiting-card {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-subtle);
}

.waiting-card > div:last-child {
  display: grid;
  gap: 2px;
}

.waiting-card strong {
  font-size: 12px;
}

.waiting-card small {
  color: var(--ink-muted);
  font-size: 10px;
}

.waiting-pulse {
  width: 25px;
  height: 25px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.compact-action {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
}

.compact-action > span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.compact-action strong {
  font-size: 16px;
}

.compact-action .action-button {
  width: 100%;
}

.winner-card {
  padding: 2px;
}

.winner-crown {
  color: var(--world-accent);
  font-size: 26px;
}

.winner-ranking {
  display: grid;
  gap: 5px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ranking-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ranking-row small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auction-track {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.auction-bidder {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-muted);
  font-size: 10px;
}

.auction-bidder.is-current {
  border-color: var(--bidder-color);
  color: var(--ink);
}

.auction-bidder.is-leading {
  background: var(--accent-soft);
  color: var(--accent);
}

.auction-bidder.is-passed {
  opacity: .45;
  text-decoration: line-through;
}

.bid-shortcuts {
  display: flex;
  gap: 5px;
}

.bid-shortcuts button {
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

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

.bid-row .action-button {
  min-width: 90px;
}

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

.last-event small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
}

.last-event span {
  color: var(--ink-muted);
  font-size: 11px;
}

.round-log {
  border-top: 1px solid var(--line);
}

.round-log summary {
  min-height: 44px;
  padding-top: 10px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.round-log ol,
.history-list {
  display: grid;
  gap: 5px;
  padding: 0 0 0 17px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.round-log li::marker,
.history-list li::marker {
  color: var(--world-accent);
}

.history-button {
  width: 100%;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
}

.game-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: 640px;
  max-height: min(88dvh, 820px);
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .26);
}

.game-dialog::backdrop {
  background: rgba(12, 17, 15, .42);
  backdrop-filter: blur(10px);
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
}

.dialog-title {
  max-width: calc(100% - 40px);
  margin-bottom: 10px;
  font-size: clamp(23px, 4vw, 34px);
  letter-spacing: -.035em;
  line-height: 1.02;
}

.dialog-copy {
  margin-bottom: 17px;
}

.rent-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.rent-table span {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.rent-table span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.rent-table span:nth-child(even) {
  color: var(--ink-muted);
  text-align: right;
}

.portfolio-balance {
  margin: 16px 0;
}

.portfolio-groups {
  display: flex;
  gap: 6px;
  margin-bottom: 15px;
}

.portfolio-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

.portfolio-group i,
.trade-property-color {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--portfolio-color, var(--trade-color, var(--accent)));
}

.portfolio-group.is-complete {
  color: var(--accent);
  font-weight: 750;
}

.portfolio-assets {
  display: grid;
  gap: 6px;
}

.portfolio-asset {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
  color: var(--ink);
  text-align: left;
}

.portfolio-asset > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portfolio-asset strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-asset small {
  color: var(--ink-muted);
  font-size: 10px;
}

.portfolio-asset > b {
  font-size: 11px;
}

.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 15px;
  color: var(--ink-muted);
  font-size: 10px;
  text-align: center;
}

.portfolio-stats span {
  display: grid;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.portfolio-stats b {
  color: var(--ink);
  font-size: 12px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.dialog-actions > * {
  width: 100%;
}

.invite-dialog {
  max-width: 480px;
}

.invite-dialog-body {
  margin: 18px 0;
  max-height: min(50dvh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.friends-invite-list {
  display: grid;
  gap: 8px;
}

.friend-invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-card);
}

.friend-invite-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 36px;
}

.friend-invite-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-send-btn {
  flex: 0 0 auto;
}

.friend-send-btn.is-sent {
  color: #2b9348;
  border-color: rgba(43, 147, 72, .35);
  background: rgba(43, 147, 72, .08);
  cursor: default;
}

.invite-unauthed,
.invite-empty,
.invite-loading {
  padding: 24px 12px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

.invite-unauthed p,
.invite-empty p {
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

.invite-unauthed .dialog-copy-sub,
.invite-empty .dialog-copy-sub {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: normal;
}

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

.coach-setting {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink-muted);
  font-size: 12px;
}

.coach-setting input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.rule-card {
  display: grid;
  gap: 7px;
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
}

.rule-card > b {
  color: var(--world-accent);
  font-size: 12px;
}

.rule-card strong {
  font-size: 13px;
}

.rule-card p {
  color: var(--ink-muted);
  font-size: 11px;
}

.trade-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.trade-side {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
}

.trade-side h3 {
  font-size: 13px;
}

.trade-group {
  display: grid;
  gap: 5px;
}

.trade-group > small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.trade-property {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 5px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
}

.trade-property input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.trade-property span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.trade-property strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-property small {
  color: var(--ink-muted);
  font-size: 9px;
}

.trade-preview {
  margin: 13px 0;
}

.trade-preview p {
  grid-column: 1 / -1;
  color: var(--ink-muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, calc(16px + var(--safe-bottom)));
  z-index: 100;
  width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes board-land {
  0% { box-shadow: inset 0 0 0 0 var(--world-accent); }
  50% { box-shadow: inset 0 0 0 6px var(--world-accent); }
  100% { box-shadow: inset 0 0 0 0 var(--world-accent); }
}

@keyframes board-acquire {
  0% { filter: brightness(1); }
  45% { filter: brightness(1.16); }
  100% { filter: brightness(1); }
}

@keyframes delta-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes die-roll {
  from { transform: rotate(-4deg) translateY(1px); }
  to { transform: rotate(4deg) translateY(-1px); }
}

@keyframes die-settle {
  from { opacity: .45; transform: scale(.9) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

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

@media (min-width: 981px) {
  main {
    height: 100dvh;
    overflow: hidden;
  }

  .screen {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .setup-shell,
  .lobby-shell,
  .game-shell {
    height: 100%;
    min-height: 0;
  }

  .setup-shell {
    display: flex;
    flex-direction: column;
    padding-top: clamp(18px, 4vh, 36px);
    padding-bottom: max(18px, var(--safe-bottom));
    overflow: hidden;
  }

  .setup-layout {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }

  .setup-preview-card,
  .setup-workspace {
    min-height: 0;
  }

  .setup-preview-card {
    display: grid;
    place-items: center;
  }

  .setup-board-preview {
    width: min(100%, calc(100dvh - 120px));
  }

  .setup-workspace {
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .lobby-shell {
    display: flex;
    flex-direction: column;
    padding-top: clamp(18px, 4vh, 40px);
    padding-bottom: max(18px, var(--safe-bottom));
    overflow: hidden;
  }

  .lobby-grid {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }

  .lobby-card {
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .game-desk {
    display: grid;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    max-height: 100dvh;
    overflow: hidden;
  }

  .game-statusbar {
    margin-bottom: 14px;
  }

  .game-layout {
    min-height: 0;
    height: 100%;
    align-items: stretch;
    overflow: hidden;
  }

  .board-column {
    min-height: 0;
  }

  .command-rail {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    align-self: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  .action-sheet {
    overflow: visible;
  }

  .cosmetic-dialog {
    width: min(760px, calc(100vw - 48px));
    max-width: 760px;
  }

  .cosmetic-dialog .cosmetic-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 1180px) {
  .setup-layout {
    grid-template-columns: minmax(0, 1fr) minmax(350px, .8fr);
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 344px);
    gap: 24px;
  }

  .game-desk {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 980px) {
  .setup-intro {
    align-items: start;
    flex-direction: column;
  }

  .setup-intro-meta {
    padding-bottom: 0;
  }

  .setup-layout,
  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .setup-preview-card {
    max-width: 820px;
  }

  .lobby-hero {
    align-items: start;
    flex-wrap: wrap;
  }

  .lobby-hero > div:first-child {
    flex: 1 1 100%;
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "board" "rail";
  }

  .board-stage,
  .board-heading {
    width: min(100%, 720px);
  }

  .command-rail {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    grid-template-areas: "heading heading" "players actions";
    align-items: start;
    column-gap: 18px;
  }

  .rail-section-heading { grid-area: heading; }
  .player-strip { grid-area: players; }
  .action-sheet { grid-area: actions; }
}

@media (max-width: 700px) {
  .app-header {
    min-height: 62px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .header-caption {
    display: none;
  }

  .icon-button {
    padding: 0 10px;
    font-size: 12px;
  }

  main,
  .screen,
  .game-shell,
  .game-desk {
    min-height: 100dvh;
  }

  .setup-shell,
  .lobby-shell {
    padding: 28px 14px calc(36px + var(--safe-bottom));
  }

  .setup-layout {
    gap: 0;
  }

  .setup-preview-card {
    display: none;
  }

  .setup-workspace {
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .setup-brand-mobile {
    display: flex;
  }

  .workspace-heading .icon-button {
    white-space: nowrap;
  }

  .setup-intro h1,
  .lobby-hero h1 {
    font-size: clamp(35px, 12vw, 52px);
  }

  .setup-intro p,
  .lobby-hero p {
    margin-top: 13px;
    font-size: 14px;
  }

  .setup-intro-meta {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .setup-preview-card,
  .setup-workspace,
  .lobby-card,
  .action-sheet {
    border-radius: 20px;
  }

  .setup-preview-card,
  .setup-workspace,
  .lobby-card {
    padding: 16px;
  }

  .lobby-grid {
    gap: 14px;
  }

  .setup-board-preview {
    aspect-ratio: .98 / 1;
  }

  .preview-card-footer {
    gap: 9px 13px;
  }

  .preview-footnote {
    width: 100%;
    margin-left: 0;
  }

  .setup-choice-grid,
  .trade-columns,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .setup-choice-grid {
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
  }

  .setup-step + .setup-step {
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .workspace-heading h2 {
    font-size: 25px;
  }

  .seat-row {
    grid-template-columns: 12px minmax(70px, .6fr) minmax(100px, 1fr);
  }

  .seat-row .difficulty-select {
    grid-column: 2 / -1;
    min-height: 44px;
    margin-top: -4px;
  }

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

  .room-code-wrap {
    min-width: 130px;
  }

  .lobby-hero > .secondary-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

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

  .lobby-seat .lobby-kind,
  .lobby-seat .lobby-difficulty {
    grid-column: 2 / -1;
  }

  .seat-index {
    grid-column: 3;
    grid-row: 1;
  }

  .game-desk {
    padding: 10px 10px calc(14px + var(--safe-bottom));
  }

  .game-layout {
    gap: 16px;
  }

  .game-statusbar {
    align-items: start;
    margin-bottom: 10px;
  }

  .game-brand small {
    display: none;
  }

  .turn-status {
    justify-self: start;
  }

  .status-actions {
    gap: 5px;
  }

  .status-actions .secondary-button.small:first-child {
    display: none;
  }

  .board-heading {
    width: 100%;
    margin-bottom: 7px;
    padding: 0 2px;
  }

  .board-hint {
    display: none;
  }

  .board-stage {
    width: min(100%, calc(100dvh - 230px));
    max-width: 100%;
  }

  .board {
    border-radius: 18px;
  }

  .command-rail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .rail-section-heading {
    order: 1;
    padding: 2px 2px 0;
  }

  .player-strip {
    order: 2;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .player-card {
    grid-template-columns: auto minmax(0, 1fr);
    width: min(78vw, 260px);
    min-width: min(78vw, 260px);
    flex: 0 0 min(78vw, 260px);
    min-height: 66px;
    padding: 9px;
    gap: 8px;
    scroll-snap-align: start;
  }

  .player-token {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 13px;
  }

  .player-copy {
    gap: 4px;
  }

  .player-heading strong,
  .player-money {
    font-size: 11px;
  }

  .player-economy {
    display: grid;
    justify-content: start;
    gap: 2px;
  }

  .player-status {
    font-size: 9px;
    text-align: left;
  }

  .property-pips {
    position: absolute;
    top: 9px;
    right: 9px;
    max-width: 30px;
  }

  .action-sheet {
    order: 3;
    position: static;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
  }

  .sheet-body {
    max-height: min(45dvh, 420px);
    overflow-y: auto;
    padding: 16px 16px max(16px, var(--safe-bottom));
  }

  .space-context {
    padding: 2px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .game-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    padding: 26px 18px max(22px, var(--safe-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 12px;
    bottom: max(12px, calc(12px + var(--safe-bottom)));
    width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  .space-kind,
  .space-price {
    display: none;
  }

  .space-inner {
    gap: 2px;
  }

  .lobby-settings .world-picker.compact,
  .lobby-settings .ruleset-picker.compact {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 420px) {
  .space-kind,
  .space-price {
    display: none;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .app-header {
    min-height: 52px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  main,
  .screen,
  .game-shell,
  .game-desk {
    min-height: 100dvh;
  }

  .game-desk {
    padding-top: 7px;
  }

  .game-statusbar {
    min-height: 36px;
    margin-bottom: 5px;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 36vw);
    grid-template-areas: "board rail";
    align-items: start;
  }

  .board-stage,
  .board-heading {
    width: min(100%, calc(100dvh - 100px));
  }

  .command-rail {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "heading" "players" "actions";
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
  }

  .player-strip {
    display: flex;
    max-height: 166px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .player-card {
    width: min(100%, 220px);
    min-width: 220px;
    flex: 0 0 220px;
  }

  .action-sheet {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-property: opacity, color, background-color, border-color, box-shadow, outline-color !important;
    transition-duration: .16s !important;
    transition-timing-function: ease-out !important;
  }
}

html.no-animations *,
html.no-animations *::before,
html.no-animations *::after {
  animation: none !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-property: opacity, color, background-color, border-color, box-shadow, outline-color !important;
  transition-duration: .16s !important;
  transition-timing-function: ease-out !important;
}

@media (prefers-reduced-transparency: reduce) {
  .app-header,
  .game-moment {
    background: var(--surface);
    backdrop-filter: none;
  }

  .game-dialog::backdrop {
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: currentColor;
    --line-strong: currentColor;
  }

  .setup-preview-card,
  .setup-workspace,
  .lobby-card,
  .action-sheet,
  .board,
  .game-dialog {
    box-shadow: none;
  }

  .board-space.is-focused,
  .board-space:focus-visible {
    outline-width: 4px;
  }
}

@media (forced-colors: active) {
  * {
    forced-color-adjust: auto;
  }

  .board-space.is-focused,
  .board-space:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible {
    outline: 3px solid Highlight;
  }

  .primary-button,
  .action-button.primary {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .world-mark,
  .player-token,
  .game-token {
    border: 1px solid CanvasText;
  }
}
