:root {
  --bg: #23252b;
  --felt: #2c2f36;
  --panel: #343740;
  --panel-strong: #3c404a;
  --text: #f5f6f8;
  --muted: #aeb4c0;
  --line: rgba(255,255,255,.12);
  --tile: #ffffff;
  --ink: #20242c;
  --accent: #7ec85f;
  --danger: #e4555f;
  --gold: #f4c84f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  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;
}
html, body { min-height: 100%; }
body {
  margin: 0;
  background: #24262c;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.account-menu {
  position: fixed;
  z-index: 50;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.account-menu button {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(35, 39, 48, .86);
  color: #f7f8fb;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.account-menu button:hover {
  background: #313743;
}
body.in-game .account-menu {
  display: none;
}
body.room-subview .account-menu { display: none; }
body.in-game .players-panel {
  padding-top: 54px;
  padding-bottom: 140px;
}
body.in-game .connection-status { max-width: 220px; }
.connection-status {
  position: fixed;
  z-index: 110;
  top: 12px;
  left: 12px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(30,34,42,.9);
  color: #e9edf5;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(10px);
}
.connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f4c84f;
  box-shadow: 0 0 0 3px rgba(244,200,79,.14);
}
.connection-status.online .connection-dot {
  background: #7ed465;
  box-shadow: 0 0 0 3px rgba(126,212,101,.14);
}
.connection-status.reconnecting .connection-dot {
  background: #f4c84f;
  animation: connectionPulse 1.2s ease-in-out infinite;
}
.connection-status.local .connection-dot,
.connection-status.error .connection-dot {
  background: #ee7a82;
  box-shadow: 0 0 0 3px rgba(238,122,130,.14);
}
@keyframes connectionPulse { 50% { opacity: .4; transform: scale(.82); } }

button, input, select { font: inherit; }
button {
  min-height: 38px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  background: #4b505c;
  font-weight: 700;
  transition: transform .08s ease, filter .12s ease, opacity .12s ease, border-color .12s ease;
}
button:hover { filter: brightness(1.08); border-color: rgba(255,255,255,.22); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
.tile:focus-visible {
  outline: 3px solid #f4c84f;
  outline-offset: 2px;
}
.primary { background: #70bd57; color: #101613; border-color: #9be17d; }
.danger { background: #e4555f; color: #fff; border-color: #ff8992; }
.wide { width: 100%; }
.tiny { min-height: 28px; padding: 4px 8px; font-size: 12px; }

.room-screen {
  min-height: 100vh;
  display: grid;
  place-items: stretch center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(126,200,95,.18), transparent 36%),
    linear-gradient(315deg, rgba(78,154,241,.16), transparent 38%),
    #23252b;
}
.room-shell {
  width: min(1180px, 96vw);
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(380px, .92fr) minmax(360px, 1fr);
  grid-template-rows: 1fr auto;
  gap: 20px;
  align-items: center;
}
.room-brand,
.room-card {
  background: rgba(54,57,66,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 55px rgba(0,0,0,.32);
}
.room-brand {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  padding: 26px 32px 28px;
  overflow: hidden;
}
.room-brand h1 {
  margin: 28px 0 0;
  max-width: 100%;
  color: #f7f8fc;
  font-size: clamp(42px, 4.4vw, 64px);
  line-height: .9;
  overflow-wrap: normal;
  word-break: normal;
}
.room-brand p {
  margin: 0;
  color: var(--muted);
}
.room-description {
  max-width: 34ch;
  color: #d7dbe5 !important;
  line-height: 1.45;
  font-size: 15px;
}
.language-picker {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.language-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: rgba(245,246,248,.42);
}
.language-tabs button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #f5f6f8;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 950;
}
.language-tabs button.selected {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.language-tabs button:hover {
  filter: none;
  color: #fff;
}
.room-view {
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
}
.room-big-button {
  min-height: 84px;
  justify-content: flex-start;
  padding: 18px 22px;
  font-size: 26px;
  text-align: left;
}
.game-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}
.game-facts span {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.16);
  color: #d9deea;
  font-size: 12px;
  font-weight: 850;
}
.room-help-button {
  min-height: 46px;
  background: transparent;
  border-color: rgba(255,255,255,.18);
}
.room-notice {
  padding: 10px 12px;
  border: 1px solid rgba(244,200,79,.28);
  border-radius: 8px;
  background: rgba(244,200,79,.1);
  color: #f7dda0;
  font-size: 13px;
  line-height: 1.4;
}
.room-notice.error {
  border-color: rgba(228,85,95,.42);
  background: rgba(228,85,95,.12);
  color: #ffd6da;
}
.room-notice.success {
  border-color: rgba(126,200,95,.38);
  background: rgba(126,200,95,.11);
  color: #dff7d5;
}
.room-notice.compact { margin-top: 10px; }
.room-card {
  padding: 20px;
}
.room-footer {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(20,23,29,.58);
  color: #c9ced9;
  font-size: 12px;
}
.room-footer strong {
  color: #f7f8fc;
}
.room-footer a,
.room-footer button,
.site-footer a,
.site-footer button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9be17d;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
}
.room-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.room-card-head h2 {
  margin: 0;
  font-size: 30px;
}
.room-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.mode-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.mode-option {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  text-align: left;
}
.mode-option.selected {
  border-color: #9be17d;
  box-shadow: inset 0 0 0 1px rgba(155,225,125,.2);
}
.mode-option strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mode-option strong em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(126,200,95,.16);
  color: #c7f0b6;
  font-size: 10px;
  font-style: normal;
  letter-spacing: .02em;
}
.mode-option span {
  color: var(--muted);
}
.mode-option strong > span { color: inherit; }
.mode-helper {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.room-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.room-list-item {
  width: 100%;
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: rgba(0,0,0,.18);
}
.room-list-item span {
  display: grid;
  gap: 4px;
}
.room-list-item small,
.empty-room-list {
  color: var(--muted);
}
.empty-room-list {
  min-height: 76px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.join-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.join-code-row input,
.profile-grid input {
  width: 100%;
  border: 1px solid #656d7c;
  border-radius: 8px;
  padding: 10px;
  background: #20232a;
  color: var(--text);
}
.waiting-card {
  align-self: stretch;
}
.room-code-block > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.room-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.invite-hint {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(126,200,95,.08);
  color: #dce7d8;
  font-size: 13px;
  line-height: 1.4;
}
.profile-grid {
  display: grid;
  gap: 14px;
}
.profile-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.auth-modal form {
  display: grid;
  gap: 14px;
  padding: 28px;
}
.auth-modal h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
}
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(17,21,28,.32);
  border: 1px solid rgba(255,255,255,.12);
}
.auth-mode-tabs button {
  min-height: 42px;
  color: #d9deea;
  background: transparent;
  border-color: transparent;
}
.auth-mode-tabs button.selected {
  color: #11151c;
  background: #9be17d;
  border-color: #bdf5aa;
  box-shadow: 0 10px 24px rgba(112,189,87,.18);
}
.auth-note {
  margin: 0;
  color: #aeb6c6;
  font-size: 14px;
  line-height: 1.45;
}
.auth-modal label {
  display: grid;
  gap: 5px;
  color: #6f7786;
  font-size: 13px;
  font-weight: 900;
}
.auth-modal input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: #eef4ff;
  color: #10141b;
  font-size: 16px;
  font-weight: 800;
}
.auth-grid,
.profile-provider-actions,
.profile-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-grid button {
  width: min(340px, 100%);
  min-height: 46px;
}
.auth-grid #emailSignUpBtn:not([hidden]),
.auth-grid #emailSignInBtn:not([hidden]) {
  background: #70bd57;
  color: #101613;
  border-color: #9be17d;
}
.provider-button,
.profile-provider-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.provider-logo {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 950;
}
.google-logo {
  background: #fff;
  color: #4285f4;
  border: 1px solid #d9dee8;
}
.stat-tile {
  padding: 12px;
  border-radius: 8px;
  background: #f4f6fa;
  border: 1px solid #dfe4ee;
  color: #20242c;
}
.stat-tile strong,
.stat-tile span {
  display: block;
}
.stat-tile strong {
  margin-bottom: 7px;
  font-size: 14px;
}
.stat-tile span {
  color: #687182;
  font-size: 12px;
  font-weight: 800;
}
.color-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.color-choice {
  min-height: 34px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}
.color-choice.selected {
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 0 0 2px rgba(155,225,125,.35);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(230px, 270px);
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.players-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}
.players-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.right-panel {
  max-height: calc(100vh - 24px);
  overflow: hidden;
  padding-bottom: 146px;
}

.player-card,
.setup-card,
.property-card,
.rules-card,
.turn-card,
.log-card,
.brand {
  background: rgba(54,57,66,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}

.player-card {
  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 14px 14px 18px;
  overflow: hidden;
}
.player-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: currentColor;
}
.player-card.active {
  background: color-mix(in srgb, currentColor 18%, #363942 82%);
  border-color: currentColor;
}
.player-card.trade-target {
  cursor: pointer;
}
.player-card.trade-target:hover {
  border-color: currentColor;
  box-shadow: 0 14px 30px rgba(0,0,0,.24), 0 0 0 3px color-mix(in srgb, currentColor 34%, transparent);
}
.player-card.bankrupt { opacity: .45; }
.pause-control {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 54px;
  display: grid;
  gap: 3px;
  align-content: center;
  text-align: left;
  padding: 10px 12px;
  border-color: rgba(155,225,125,.42);
  background: rgba(54,57,66,.96);
  color: #f7fafc;
}
.pause-control.pending {
  border-color: #9be17d;
  background: rgba(112,189,87,.16);
}
.pause-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.player-avatar-stack {
  display: grid;
  justify-items: center;
  gap: 8px;
  align-self: start;
  margin-top: 4px;
}
.avatar {
  position: static;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: #24262c;
  border: 3px solid currentColor;
  box-shadow: 0 0 0 3px rgba(0,0,0,.18);
}
.player-name { font-weight: 800; color: #fff; }
.player-cash { margin: 8px 0 4px; font-size: 30px; line-height: 1; color: #f1f3f7; }
.player-assets { font-size: 12px; line-height: 1.35; color: var(--muted); }
.player-action-timer {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  color: #f7fafc;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.log-player-name {
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(0,0,0,.28);
}

.game-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.board {
  position: relative;
  width: min(100%, 1040px, calc(100vh - 24px));
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: 1.22fr repeat(9, .9fr) 1.22fr;
  grid-template-rows: 1.22fr repeat(9, .9fr) 1.22fr;
  gap: 0;
  background: #17191f;
  border: 1px solid #111318;
  box-shadow: 0 24px 55px rgba(0,0,0,.4);
  isolation: isolate;
}

.tile {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 7px 5px 7px;
  overflow: hidden;
  background: var(--tile);
  color: var(--ink);
  border: 1px solid #1a1e27;
  text-align: center;
  transition: background .24s ease, color .24s ease, box-shadow .18s ease, transform .18s ease;
}
.tile:hover {
  z-index: 15;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 10px 18px rgba(0,0,0,.26);
}
.tile.corner {
  justify-content: center;
  padding: 8px;
  font-weight: 900;
}
.tile.corner > div:first-child {
  font-size: 28px;
  line-height: 1;
}
.tile-name {
  position: relative;
  z-index: 2;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: clamp(8px, .72vw, 11px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.tile.corner .tile-name {
  font-size: clamp(9px, .82vw, 12px);
}
.tile.side-left .tile-name,
.tile.side-right .tile-name {
  font-size: clamp(8px, .66vw, 10px);
}
.tile-price {
  position: relative;
  z-index: 2;
  min-width: 42px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0,0,0,.08);
  font-size: 9px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}
.company-logo {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 2px solid var(--logo-ring);
  background: var(--logo-bg);
  color: var(--logo-fg);
  box-shadow: 0 2px 4px rgba(0,0,0,.24);
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: none;
}
.company-logo.mini {
  width: 34px;
  height: 34px;
  font-size: 11px;
}
.tile.owned {
  color: var(--tile-foreground, #fff);
  text-shadow: 0 1px 2px rgba(0,0,0,.42);
}
.tile.owned .tile-price {
  background: color-mix(in srgb, var(--tile-foreground, #fff) 13%, transparent);
  color: var(--tile-foreground, rgba(255,255,255,.94));
}
.tile.selected-info {
  z-index: 12;
  outline: 3px solid #f4c84f;
  outline-offset: -3px;
}
.tile-owner-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 7;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  background: rgba(20,23,29,.78);
  color: #fff;
  text-shadow: none;
  font-size: 10px;
  line-height: 1;
}
.tile.owned .sector-tab {
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.32);
}
.levels {
  position: absolute;
  left: 5px;
  top: 4px;
  z-index: 3;
  max-width: calc(100% - 24px);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.levels.corporation {
  top: 3px;
  color: #fff7b0;
  font-size: 18px;
}
.tokens {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-end;
}
.token {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.94);
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
  color: #111;
  text-shadow: none;
  font-size: 9px;
  line-height: 1;
}

.sector-tab {
  position: absolute;
  z-index: 9;
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.tile.side-bottom .sector-tab { left: 8px; right: 8px; bottom: 0; height: 7px; }
.tile.side-top .sector-tab { left: 8px; right: 8px; top: 0; height: 7px; }
.tile.side-left .sector-tab { top: 8px; bottom: 8px; left: 0; width: 7px; }
.tile.side-right .sector-tab { top: 8px; bottom: 8px; right: 0; width: 7px; }
.tile.monopoly-complete {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sector-color) 82%, #fff 18%);
}
.tile.monopoly-complete:hover {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sector-color) 82%, #fff 18%), 0 10px 18px rgba(0,0,0,.26);
}

.tile.mortgaged {
  filter: saturate(.55);
}
.tile.mortgaged::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(135deg, rgba(0,0,0,.18) 0 5px, transparent 5px 12px);
  pointer-events: none;
}
.mortgage-stamp {
  position: absolute;
  right: 5px;
  top: 5px;
  z-index: 4;
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.38);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}
.mortgage-timer {
  position: absolute;
  right: 5px;
  top: 27px;
  z-index: 4;
  min-width: 28px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.22);
}

.center-panel {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(250px, 1.1fr);
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
  background: rgba(35,37,43,.96);
  border: 1px solid rgba(255,255,255,.08);
}
.brand {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #30333b;
}
.brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0,0,0,.28), inset 0 -5px 0 rgba(0,0,0,.08);
}
.room-brand .brand-logo {
  width: 96px;
  height: 96px;
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0f3f8;
  color: #222831;
  font-weight: 950;
  font-size: 20px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.1);
}
.brand h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: .98;
  letter-spacing: 0;
}
.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.turn-card {
  min-width: 0;
  padding: 14px;
  background: #30333b;
}
.small-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.turn-card h2 {
  margin: 4px 0 10px;
  font-size: 26px;
}
.dice-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.dice {
  min-height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f3f7;
  color: #20242c;
  border: 1px solid rgba(0,0,0,.25);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), 0 10px 20px rgba(0,0,0,.22);
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}
.dice.rolling { animation: diceShake .085s linear infinite; }
@keyframes diceShake {
  0% { transform: rotate(-4deg) translateX(-2px); }
  50% { transform: rotate(4deg) translateX(2px); }
  100% { transform: rotate(-4deg) translateX(-2px); }
}
.status-text {
  min-height: 36px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  color: #dce1ea;
  font-size: 13px;
  line-height: 1.3;
}

.log-card {
  grid-column: 1 / 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(37,39,46,.98);
}
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-weight: 900;
}
.log-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-toggle-btn {
  min-width: 54px;
}
.log-card.collapsed {
  align-self: end;
  min-height: 0;
}
.log-card.collapsed .game-timers,
.log-card.collapsed .log,
.log-card.collapsed .chat-composer {
  display: none;
}
.log-card.collapsed .log-header {
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
}
.log-card.collapsed .log-header > span,
.log-card.collapsed #clearLogBtn {
  display: none;
}
.log-card.collapsed .log-toggle-btn {
  min-width: 116px;
}
.game-timers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.game-timers span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
.game-timers b {
  color: #fff;
}
.log {
  min-height: 0;
  max-height: 320px;
  padding: 12px;
  overflow: auto;
  color: #d7dbe5;
  font-size: 14px;
  line-height: 1.38;
}
.log p { margin: 0 0 8px; }
.log p.chat-message {
  color: #f2f6ff;
}
.log p.chat-message small {
  display: block;
  margin-bottom: 2px;
  color: #8fb8ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.chat-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.chat-composer input {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 9px 10px;
  color: #f5f6f8;
  background: #20232a;
}
.public-chat-label {
  color: #a9b4c7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.chat-composer button {
  min-width: 68px;
}

.setup-card,
.property-card,
.rules-card {
  padding: 15px;
}
.right-panel .property-card {
  max-height: calc(100vh - 186px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.setup-card h2,
.property-card h3,
.rules-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}
.setup-card p,
.property-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.35;
}
.setup-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.setup-card input {
  width: 100%;
  border: 1px solid #656d7c;
  border-radius: 8px;
  padding: 10px;
  background: #20232a;
  color: var(--text);
}
.bank-launcher {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px;
  text-align: left;
  background: rgba(54,57,66,.96);
}
.utility-launcher {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  text-align: left;
  background: rgba(54,57,66,.96);
}
.utility-launcher > span:first-child {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(126,200,95,.16);
  color: #c9efb9;
  font-size: 19px;
  font-weight: 950;
}
.utility-launcher strong,
.utility-launcher small { display: block; }
.utility-launcher small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.bankrupt-launcher {
  width: 100%;
  min-height: 46px;
}
.game-action-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  width: min(270px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.game-action-dock > * {
  pointer-events: auto;
  box-shadow: 0 18px 42px rgba(0,0,0,.35);
}
.utility-action-dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  width: min(220px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.utility-action-dock > * {
  min-height: 56px;
  pointer-events: auto;
  box-shadow: 0 18px 42px rgba(0,0,0,.35);
}
.player-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  bottom: auto;
  z-index: 160;
  width: min(470px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(126,200,95,.55);
  border-radius: 12px;
  background: rgba(43,47,56,.97);
  color: var(--text);
  box-shadow: 0 20px 55px rgba(0,0,0,.48);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, -50%);
}
.player-notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}
.player-notice p {
  margin: 0;
  color: #d8dde7;
  line-height: 1.4;
}
.player-notice button {
  flex: 0 0 auto;
  min-width: 60px;
  background: var(--accent);
  color: #172014;
}
@media (max-width: 540px) {
  .player-notice {
    top: 50%;
    bottom: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .player-notice button { width: 100%; }
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(54,57,66,.86);
  color: var(--muted);
  font-size: 12px;
}
.bank-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f4c84f;
  color: #20242c;
  font-size: 24px;
}
.bank-launcher strong,
.bank-launcher small {
  display: block;
}
.bank-launcher small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.bank-modal {
  width: min(920px, 94vw);
  background: #f7f8fb;
  color: #5b606d;
}
.bank-modal h3 {
  margin: 0;
  color: #20242c;
  font-size: 28px;
}
.bank-modal-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #17202d;
  border: 1px solid #263447;
  box-shadow: 0 12px 24px rgba(15,23,42,.18);
}
.bank-modal-head p {
  grid-column: 1 / -1;
  margin: 0;
  color: #dbe5f3;
  line-height: 1.35;
}
.bank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bank-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin-top: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d8dce4;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}
.bank-section-title {
  color: #20242c;
  font-weight: 900;
  font-size: 18px;
}
.bank-section p {
  margin: 0;
  color: #4b5565;
  line-height: 1.35;
  font-size: 13px;
}
.bank-section label {
  display: grid;
  gap: 5px;
  color: #465264;
  font-size: 12px;
  font-weight: 800;
}
.bank-section input,
.bank-section select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d2d7e0;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: #20242c;
}
.native-hidden {
  position: absolute;
  width: 1px !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.segmented-options button {
  min-height: 58px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 10px;
  border: 1px solid #d2d7e0;
  background: #f7f8fb;
  color: #20242c;
  text-align: left;
}
.segmented-options.dynamic {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  max-height: 106px;
  overflow: auto;
  padding-right: 2px;
}
#dealDialog .segmented-options.dynamic {
  max-height: 92px;
}
.segmented-options.compact button,
.segmented-options.dynamic button {
  min-height: 38px;
  padding: 6px 8px;
}
.segmented-options button.selected {
  border-color: #70bd57;
  background: #eaf7e5;
  box-shadow: inset 0 0 0 1px rgba(112,189,87,.32);
}
.segmented-options button:disabled {
  background: #edf1f7;
  color: #8b95a4;
  border-color: #d9e0ea;
}
.segmented-options strong,
.segmented-options small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.segmented-options strong {
  line-height: 1.15;
}
.segmented-options small {
  color: #6d7482;
  font-size: 12px;
  line-height: 1.2;
}
.bank-positions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.bank-position {
  display: grid;
  gap: 4px;
  padding: 9px;
  border-radius: 8px;
  background: #f3f6fb;
  border: 1px solid #e3e6ed;
}
.bank-position strong {
  color: #20242c;
}
.bank-position small {
  color: #7a8290;
  line-height: 1.3;
}
.bank-position button {
  margin-top: 4px;
}
.bank-preview {
  margin: -2px 0 10px;
  padding: 8px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f6f8fc;
  color: #485163;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.icon-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.icon-choice {
  min-height: 42px;
  padding: 6px;
  font-size: 22px;
  background: #252932;
}
.icon-choice.selected {
  border-color: #9be17d;
  box-shadow: 0 0 0 2px rgba(155,225,125,.18);
}
.room-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0;
}
.room-status {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  color: #dce1ea;
  font-size: 13px;
  font-weight: 800;
}
.bot-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.bot-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.lobby-seats {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}
.lobby-seat {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  border: 1px solid color-mix(in srgb, var(--seat-color, #7ec85f) 42%, transparent);
}
.lobby-seat span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--seat-color, #24262c);
  font-size: 20px;
}
.lobby-seat strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lobby-seat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.lobby-roll {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.lobby-roll.tied {
  border-color: #f0c85b;
  color: #f7d36a;
}
.property-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.mobile-property-card { display: none; }
.property-line span:first-child { color: var(--muted); }
.property-line b { text-align: right; }
.property-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.property-actions button {
  width: 100%;
}
.rent-table {
  margin: 12px 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
}
.rent-table-title {
  padding: 8px 10px;
  background: rgba(0,0,0,.18);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.rent-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px;
}
.rent-row.current {
  background: rgba(112,189,87,.14);
  color: #dff8d7;
}
.rent-row span {
  color: var(--muted);
}
.rent-row.current span {
  color: #e9ffe3;
}

.modal {
  width: min(460px, 92vw);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: #2f333c;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  overflow: hidden;
}
.wide-modal {
  width: min(1080px, 94vw);
  max-width: 94vw;
}
#dealDialog.wide-modal {
  width: min(700px, 84vw);
}
.law-modal {
  width: min(900px, 92vw);
}
.conference-modal {
  width: min(460px, 92vw);
  background: #eef7f2;
  color: #20242c;
  border-color: rgba(0,0,0,.12);
}
.conference-modal form {
  padding: 22px;
}
.conference-modal h2 {
  margin-bottom: 8px;
  color: #20242c;
}
.conference-eyebrow {
  margin-bottom: 5px;
  color: #3f8f5a;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.conference-description {
  margin: 0 0 14px;
  color: #4b5d56;
  line-height: 1.45;
}
.conference-modal input {
  background: #fff;
  color: #20242c;
  border-color: #d2d7e0;
}
.conference-modal .input-suffix input {
  border: 0;
}
.conference-choice-btn {
  width: 100%;
  min-height: 54px;
  margin: 4px 0 2px;
}
.conference-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  color: #71817a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.conference-divider::before,
.conference-divider::after {
  content: "";
  height: 1px;
  background: #c8dbd1;
}
.conference-risk-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c8dbd1;
  border-radius: 8px;
  background: #ffffff;
}
.conference-risk-card label {
  margin: 0;
  color: #607068;
}
.conference-risk-card button {
  width: 100%;
  background: #2f333c;
  color: #f8fafc;
}
.modal::backdrop { background: rgba(15,16,20,.72); backdrop-filter: blur(4px); }
.modal form {
  max-height: calc(100vh - 32px);
  padding: 20px;
  overflow: auto;
}
.modal.bank-modal {
  width: min(920px, 94vw);
  background: #eef2f7;
  color: #20242c;
  border-color: #cbd5e1;
}
.modal.bank-modal form {
  background: #eef2f7;
}
.modal.bank-modal h3 {
  color: #f8fafc;
}
.modal h2 { margin: 0 0 10px; }
.rules-modal {
  width: min(640px, 94vw);
  background: #f4f7f3;
  color: #20242c;
  border-color: rgba(255,255,255,.28);
}
.rules-modal form { padding: 24px; }
.rules-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.rules-modal-head h2 { margin: 3px 0 0; }
.rules-modal .eyebrow {
  color: #397f4c;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rules-goal {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #e1f1df;
  color: #264d31;
  line-height: 1.45;
}
.rules-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: startupoly-step;
}
.rules-steps li {
  counter-increment: startupoly-step;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 3px 11px;
  align-items: start;
  padding: 10px;
  border: 1px solid #d9e0d8;
  border-radius: 8px;
  background: #fff;
}
.rules-steps li::before {
  content: counter(startupoly-step);
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #70bd57;
  color: #101613;
  font-weight: 950;
}
.rules-steps span {
  color: #59635c;
  font-size: 13px;
  line-height: 1.4;
}
.rules-tips {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: #4f5b52;
  font-size: 13px;
  line-height: 1.4;
}
.rules-tips p { margin: 0; }
.modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.modal input,
.modal select {
  width: 100%;
  border: 1px solid #656d7c;
  border-radius: 8px;
  padding: 10px;
  background: #20232a;
  color: var(--text);
}
.bank-modal .bank-section input,
.bank-modal .bank-section select,
.deal-shares-panel select,
.deal-shares-panel input {
  border: 1px solid #cbd2df;
  background: #fff;
  color: #20242c;
}
.bank-modal .bank-section button.wide {
  min-height: 44px;
  background: #20242c;
  color: #fff;
  border-color: #20242c;
}
.bank-modal .bank-section button.wide:disabled {
  background: #c2c7d0;
  border-color: #c2c7d0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.legal-modal {
  width: min(620px, 92vw);
  background: #f7f9fc;
  color: #20242c;
  border-color: #d7deea;
}
.legal-modal form {
  background: #f7f9fc;
}
.legal-copy {
  display: grid;
  gap: 10px;
  color: #4b5565;
  line-height: 1.45;
}
.legal-copy p {
  margin: 0;
}
.legal-copy a {
  color: #2563eb;
  font-weight: 800;
}
.cookie-choice-list {
  display: grid;
  gap: 10px;
}
.cookie-choice {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 6px 10px !important;
  align-items: start;
  margin: 0 !important;
  padding: 12px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  color: #20242c !important;
}
.cookie-choice input {
  width: 18px !important;
  height: 18px;
  margin-top: 2px;
}
.cookie-choice span {
  grid-column: 2;
  color: #667085;
  font-weight: 700;
}
.cookie-banner {
  position: fixed;
  z-index: 80;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: #2f333c;
  box-shadow: 0 20px 60px rgba(0,0,0,.42);
}
.cookie-banner p {
  margin: 4px 0 0;
  color: #c6cbd6;
  font-size: 13px;
}
.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.law-modal {
  width: min(900px, 92vw);
}
.law-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 14px;
}
.law-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #4b5565;
  font-weight: 900;
}
.law-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.law-option {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #fff;
  color: #20242c;
  text-align: left;
}
.law-option.selected {
  border-color: #70bd57;
  background: linear-gradient(135deg, #effbe9, #ffffff 72%);
  box-shadow: inset 0 0 0 2px rgba(112,189,87,.34), 0 0 0 3px rgba(112,189,87,.16);
}
.law-option.selected::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #70bd57;
  color: #0f1a12;
  font-size: 10px;
  font-weight: 950;
}
.law-option strong {
  font-size: 15px;
}
.law-option span {
  color: #667085;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}
.law-promote {
  display: grid;
  grid-template-columns: minmax(140px, 220px) auto;
  gap: 10px;
  margin-top: 14px;
}
.law-promote .input-suffix {
  height: 46px;
  background: #20232a;
  border-color: #656d7c;
}
.law-promote .input-suffix input {
  background: transparent;
  color: var(--text);
}
.law-promote .input-suffix b {
  color: #d4d9e4;
}

.legal-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(126,200,95,.18), transparent 34%),
    linear-gradient(315deg, rgba(78,154,241,.12), transparent 40%),
    #23252b;
  color: var(--text);
}
.legal-page-shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}
.legal-page-header,
.legal-page-card,
.legal-page-footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(54,57,66,.94);
  box-shadow: 0 24px 55px rgba(0,0,0,.28);
}
.legal-page-header {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  margin-bottom: 14px;
}
.legal-page-header img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.legal-page-header h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: .95;
}
.legal-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}
.legal-page-card {
  padding: clamp(18px, 4vw, 34px);
}
.legal-page-card h1 {
  margin: 28px 0 10px;
  font-size: 30px;
  line-height: 1.1;
}
.legal-page-card h1:first-child {
  margin-top: 0;
}
.legal-page-card h2 {
  margin: 28px 0 10px;
  font-size: 26px;
}
.legal-page-card h2:first-child {
  margin-top: 0;
}
.legal-page-card h3 {
  margin: 22px 0 8px;
  font-size: 19px;
}
.legal-page-card p,
.legal-page-card li {
  color: #d7dbe5;
  line-height: 1.6;
}
.legal-page-card a {
  color: #9be17d;
  font-weight: 850;
}
.legal-page-card ul,
.legal-page-card ol {
  padding-left: 22px;
}
.legal-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
}
.legal-page-card table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #f7f8fc;
}
.legal-page-card th,
.legal-page-card td {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.14);
  text-align: left;
  vertical-align: top;
}
.legal-page-card th {
  background: rgba(255,255,255,.08);
}
.legal-page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
}
.legal-page-footer nav,
.legal-page-footer .legal-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.legal-page-footer a,
.legal-page-footer button {
  color: #9be17d;
  font-weight: 850;
}

.logo-picker {
  margin: 0 0 12px;
}
.logo-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.logo-choice {
  min-height: 44px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
}
.logo-choice.selected {
  border-color: #9be17d;
  box-shadow: 0 0 0 2px rgba(155,225,125,.22);
}
.logo-choice:disabled {
  opacity: .34;
  cursor: not-allowed;
}
.logo-swatch {
  width: 100%;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 2px solid var(--logo-ring);
  background: var(--logo-bg);
  color: var(--logo-fg);
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
}

#dealDialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 60;
}
#dealDialog {
  background: #f7f8fb;
  color: #5b606d;
  border-color: rgba(0,0,0,.12);
}
#dealDialog form {
  max-height: min(78vh, 680px);
  padding: 10px 14px 10px;
}
.deal-title {
  text-align: center;
  margin-bottom: 6px;
}
#dealDialog .deal-title {
  position: relative;
}
#dealDialog .deal-title h2 {
  padding-inline: 110px;
}
.deal-action-timer {
  position: absolute;
  top: -2px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid #cfd5df;
  border-radius: 999px;
  background: #eef1f5;
  color: #707887;
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}
.deal-action-timer b {
  color: #3e4551;
  font-variant-numeric: tabular-nums;
}
.deal-title h2 {
  margin: 0;
  color: #5b606d;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}
.deal-title p {
  margin: 4px 0 0;
  color: #9aa2b0;
  font-size: 13px;
}
.deal-partner-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 6px;
}
.deal-partner-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 7px;
  padding: 6px;
  color: #5b606d;
  background: #fff;
  border: 1px solid #d5dae4;
  text-align: left;
}
.deal-partner-choice.selected {
  border-color: #70bd57;
  box-shadow: 0 0 0 2px rgba(112,189,87,.18);
}
.deal-partner-choice span:first-child {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--partner-color);
}
.deal-partner-choice strong,
.deal-partner-choice small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-partner-choice small {
  grid-column: 2;
  color: #9aa2b0;
  font-size: 12px;
}
.deal-top-row {
  max-width: 260px;
  margin: 0 auto 14px;
}
#dealDialog label { color: #727a88; }
#dealDialog input,
#dealDialog select {
  background: #fff;
  color: #20242c;
  border-color: #d2d7e0;
}
.trade-sheet {
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0 2px;
}
.trade-divider { background: #d8dce4; }
.trade-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.deal-player {
  grid-template-columns: 32px 1fr;
  gap: 7px;
  align-items: center;
  margin-bottom: 5px;
}
.deal-player h3 {
  margin: 0;
  color: #5b606d;
  font-size: 17px;
  line-height: 1.1;
}
.deal-player p {
  margin: 2px 0 0;
  color: #a2a8b4;
  font-size: 13px;
}
.deal-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  background: #70bd57;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.deal-avatar.partner { background: #b479e7; }
.selected-asset {
  min-height: 34px;
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 6px;
  margin-bottom: 6px;
  border: 2px dashed #c1c7d2;
  border-radius: 8px;
  background: #fff;
  color: #20242c;
  font-weight: 800;
}
.deal-shares-panel .selected-asset {
  min-height: 38px;
  border-style: solid;
  background: #f7f8fb;
}
.deal-asset-list {
  width: 100%;
  display: grid;
  gap: 8px;
}
.deal-asset-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}
.deal-asset-row strong {
  display: block;
  color: #20242c;
  overflow-wrap: anywhere;
}
.selected-asset small,
.selected-asset .asset-empty {
  display: block;
  color: #9ba3af;
  font-size: 12px;
  font-weight: 700;
}
.asset-chip {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,.15);
}
.deal-total {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  color: #5b606d;
  font-size: 15px;
}
.deal-total b {
  color: #5b606d;
  font-size: 18px;
}
.deal-extra-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}
.deal-shares-panel {
  display: grid;
  gap: 6px;
  padding: 7px;
  margin: 5px 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d8dce4;
}
.deal-term-title {
  color: #20242c;
  font-size: 13px;
  font-weight: 900;
}
.loan-term-note {
  margin: -2px 0 1px;
  color: #7a8290;
  font-size: 12px;
  font-weight: 700;
}
.share-control-rule {
  margin: 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f2f5f9;
  color: #5f6877;
  line-height: 1.35;
}
.share-control-rule.invalid {
  background: #fff0f0;
  color: #b42318;
}
.advanced-only-term[hidden] {
  display: none !important;
}
.law-modal::backdrop {
  background: rgba(15,16,20,.72);
  backdrop-filter: blur(4px);
}
.law-investment {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9ffe3;
  color: #2f7d32;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.deal-share-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}
.deal-share-controls select,
.deal-share-controls input {
  min-width: 0;
  border: 1px solid #d2d7e0;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
  color: #20242c;
}
#dealDialog .deal-share-controls > .segmented-options,
#dealDialog .deal-share-controls > .compact-field,
#dealDialog .deal-share-controls > button {
  align-self: stretch;
}
#dealDialog .deal-share-controls > button {
  min-height: 38px;
  padding: 6px 9px;
}
#dealDialog .deal-share-controls > button,
#dealDialog .deal-share-controls > .compact-field:last-of-type {
  grid-column: auto;
}
.deal-shares-panel #addShareDealBtn,
.deal-shares-panel #addLoanTermBtn,
.deal-shares-panel #addDiscountTermBtn,
.deal-shares-panel #addPromiseTermBtn {
  grid-column: auto;
}
#dealTermsPanel .deal-share-controls.promise-term .segmented-options.dynamic {
  grid-column: span 1;
}
#dealTermsPanel .deal-share-controls.promise-term #addPromiseTermBtn {
  grid-column: auto;
}
.promise-tap-helper {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px dashed #bcc6d4;
  border-radius: 8px;
  background: #f7f8fb;
  color: #5b606d;
}
.promise-tap-helper.active {
  border-color: #70bd57;
  background: #effbe9;
}
.promise-tap-helper strong,
.promise-tap-helper small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promise-tap-helper small {
  color: #8a92a0;
  font-size: 11px;
  font-weight: 850;
}
.deal-shares-panel .selected-asset {
  margin-top: 2px;
}
.deal-control-spacer {
  display: none;
}
.compact-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #7a8290;
  font-size: 10px;
  font-weight: 900;
}
.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  height: 38px;
  border: 1px solid #d2d7e0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.input-suffix input {
  border: 0;
  border-radius: 0;
  padding-right: 4px;
}
.input-suffix b {
  padding: 0 9px 0 2px;
  color: #5b606d;
  font-size: 12px;
  white-space: nowrap;
}
.deal-share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 5px 0;
  border-bottom: 1px solid #edf0f4;
}
.deal-share-row:last-child {
  border-bottom: 0;
}
.deal-share-row strong,
.deal-share-row small {
  display: block;
}
.deal-share-row small {
  color: #8a92a0;
  font-size: 12px;
}
.share-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
.hint {
  min-height: 18px;
  color: #747b87;
  font-size: 12px;
}

#dealDialog .trade-side label {
  margin-bottom: 6px;
  font-size: 12px;
}
#dealDialog .trade-side input {
  padding: 7px 9px;
}
#dealDialog .modal-actions {
  position: sticky;
  bottom: -10px;
  z-index: 4;
  margin: 6px -14px -10px;
  padding: 8px 14px 10px;
  background: linear-gradient(180deg, rgba(247,248,251,0), #f7f8fb 28%);
}

.trade-response-modal {
  width: min(760px, 94vw);
  background: #f7f8fb;
  color: #5b606d;
}
.trade-response-modal h2 {
  text-align: center;
  color: #5b606d;
}
.trade-response-timer {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e9f5e5;
  border: 1px solid #8ac977;
  color: #415044;
  font-size: 13px;
  font-weight: 850;
}
.trade-response-timer b {
  margin-left: 6px;
  color: #1b241d;
}
.trade-response-body {
  color: #5b606d;
}
.trade-response-grid {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.trade-response-side {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d8dce4;
}
.trade-response-side h3 {
  margin: 0 0 12px;
  color: #5b606d;
}
.response-cash {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e3e6ed;
  color: #e24b5d;
  font-size: 22px;
  font-weight: 900;
}
.response-note {
  margin: 14px 0 0;
  color: #7a8290;
}
.response-terms {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d8dce4;
}
.response-terms h3 {
  margin: 0 0 8px;
  color: #5b606d;
}

.event-popover {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(420px, 92vw);
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: #f7f8fb;
  color: #20242c;
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  z-index: 55;
}
.event-popover::backdrop {
  background: rgba(15,16,20,.72);
  backdrop-filter: blur(4px);
}
.event-popover form {
  padding: 22px;
}
.event-popover h2 {
  margin: 0 0 10px;
  color: #20242c;
}
.event-popover p {
  margin: 0 0 18px;
  color: #5b606d;
  line-height: 1.42;
}
.event-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.event-actions button {
  width: 100%;
}
#eventBankruptBtn {
  background: #e4555f;
  color: #fff;
  border-color: #ff9aa2;
}

.game-over-modal {
  width: min(520px, 92vw);
  background: #f7f8fb;
  color: #20242c;
}
.confirm-modal {
  width: min(500px, 92vw);
  background: #f7f8fb;
  color: #20242c;
}
.game-over-modal h2 {
  margin: 0 0 10px;
  color: #20242c;
}
.game-over-modal p {
  margin: 0;
  color: #5b606d;
  line-height: 1.45;
}
.confirm-modal h2 {
  margin: 0 0 10px;
  color: #20242c;
}
.confirm-modal p {
  margin: 0;
  color: #5b606d;
  line-height: 1.45;
}
#eventBankruptBtn[hidden] {
  display: none;
}
.event-actions:has(#eventBankruptBtn[hidden]) {
  grid-template-columns: 1fr;
}

.auction-modal {
  width: min(460px, 94vw);
}
.auction-title {
  text-align: center;
  margin-bottom: 16px;
}
.auction-title h2 {
  margin: 0;
  font-size: 32px;
}
.auction-title p {
  margin: 6px 0 0;
  color: var(--muted);
}
.auction-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.auction-summary div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.auction-summary span,
.auction-summary b {
  display: block;
}
.auction-summary span {
  color: var(--muted);
  font-size: 12px;
}
.auction-summary b {
  margin-top: 4px;
  font-size: 24px;
}
.auction-turn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
}
.auction-turn span {
  min-width: 0;
  color: #dfe5ef;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auction-turn b {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #70bd57;
  color: #101613;
  text-align: center;
}

.moving-token {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  z-index: 50;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.95);
  box-shadow: 0 13px 26px rgba(0,0,0,.5);
  font-size: 20px;
  pointer-events: none;
  will-change: transform;
}

.deal-selected-give,
.deal-selected-receive {
  z-index: 20;
  transform: translateY(-2px);
}
.deal-selected-give { box-shadow: inset 0 0 0 4px #70bd57, 0 0 0 3px rgba(112,189,87,.45); }
.deal-selected-receive { box-shadow: inset 0 0 0 4px #4e9af1, 0 0 0 3px rgba(78,154,241,.45); }
.tile.promise-pickable {
  box-shadow: inset 0 0 0 4px #70bd57, 0 0 0 3px rgba(112,189,87,.38);
}
.tile.promise-pickable::after {
  content: "+";
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: #70bd57;
  color: #10210d;
  font-size: 12px;
  font-weight: 950;
  pointer-events: none;
}

#foundNowBtn,
#declineNowBtn {
  animation: softPop .18s ease-out;
}
@keyframes softPop {
  from { transform: scale(.96); opacity: .4; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 1400px) {
  #dealDialog.wide-modal {
    width: min(620px, 84vw);
  }
  .deal-partner-picker,
  .deal-share-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .room-shell {
    grid-template-columns: 1fr;
  }
  .room-footer {
    grid-column: auto;
  }
  .room-brand,
  .room-view {
    min-height: auto;
  }
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .players-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .right-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }
  .right-panel .property-card {
    max-height: none;
    overflow: visible;
  }
  body.in-game .players-panel { padding-bottom: 0; }
  .game-action-dock,
  .utility-action-dock {
    position: static;
    z-index: auto;
    width: 100%;
    max-width: 960px;
    justify-self: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    pointer-events: auto;
  }
  .board { width: min(98vw, 960px); }
}

@media (max-width: 760px) {
  .room-screen { padding: 10px; }
  .room-brand,
  .room-card {
    padding: 16px;
  }
  .room-brand h1 { font-size: 44px; }
  .room-screen:not([data-view="home"]) .room-shell {
    align-content: start;
    min-height: calc(100vh - 20px);
    gap: 10px;
  }
  .room-screen:not([data-view="home"]) .room-brand {
    min-height: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
  }
  .room-screen:not([data-view="home"]) .room-brand .brand-logo {
    width: 56px;
    height: 56px;
    grid-row: 1;
  }
  .room-screen:not([data-view="home"]) .room-brand h1 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: 28px;
    line-height: 1;
  }
  .room-screen:not([data-view="home"]) .room-brand > p,
  .room-screen:not([data-view="home"]) .room-brand .language-picker {
    display: none;
  }
  .room-screen:not([data-view="home"]) .room-view { min-height: 0; }
  .room-screen:not([data-view="home"]) .room-footer { margin-top: 2px; }
  .room-big-button {
    min-height: 64px;
    font-size: 22px;
  }
  .join-code-row,
  .bot-row {
    grid-template-columns: 1fr;
  }
  .color-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .app-shell { padding: 8px; }
  .players-panel,
  .right-panel {
    grid-template-columns: 1fr;
  }
  .player-card { min-height: 112px; }
  .center-panel {
    grid-template-columns: 1fr;
    overflow: auto;
    padding: 10px;
  }
  .brand,
  .log-card {
    grid-column: auto;
  }
  .chat-composer {
    grid-template-columns: 1fr;
  }
  .public-chat-label { padding: 0 2px; }
  .room-head-actions { max-width: 150px; }
  .room-head-actions .tiny { min-height: 38px; }
  .language-tabs button {
    min-width: 36px;
    min-height: 40px;
    padding: 7px 3px;
  }
  .brand { grid-template-columns: 44px 1fr; }
  .brand-logo,
  .brand-mark { width: 44px; height: 44px; }
  .dice-row { grid-template-columns: 1fr; }
  .dice { min-height: 72px; }
  .tile { padding: 5px 3px; }
  .tile-name { font-size: 8px; }
  .tile-price { font-size: 8px; min-width: 34px; }
  .deal-partner-picker {
    grid-template-columns: 1fr;
  }
  .deal-extra-grid {
    grid-template-columns: 1fr;
  }
  .deal-share-controls,
  .bank-grid {
    grid-template-columns: 1fr;
  }
  .cookie-banner {
    grid-template-columns: 1fr;
  }
  .cookie-actions {
    justify-content: stretch;
  }
  .cookie-actions button {
    flex: 1 1 140px;
  }
  .law-options,
  .law-promote {
    grid-template-columns: 1fr;
  }
  .legal-page-header {
    grid-template-columns: 56px 1fr;
  }
  .legal-page-header img {
    width: 56px;
    height: 56px;
  }
  .legal-page-header .top-back {
    grid-column: 1 / -1;
    width: 100%;
  }
  .trade-sheet {
    min-height: auto;
    grid-template-columns: 1fr;
  }
  .trade-divider { height: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 900px) {
  .game-wrap {
    width: 100%;
    overflow-x: auto;
    justify-content: start;
    padding-bottom: 8px;
  }
  .deal-extra-grid {
    grid-template-columns: 1fr;
  }
  .board {
    width: 820px;
    max-width: none;
  }
  .tile {
    padding: 7px 4px 7px;
    gap: 3px;
  }
  .tile-name {
    font-size: 10px;
    line-height: 1.08;
  }
  .tile.corner .tile-name {
    font-size: 11px;
  }
  .company-logo {
    width: 25px;
    height: 25px;
    font-size: 9px;
  }
}

@media (max-width: 540px) {
  .app-shell {
    padding: 6px;
    gap: 8px;
  }
  .players-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pause-control { grid-column: 1 / -1; }
  .player-card {
    min-height: 88px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 8px 9px 11px;
  }
  .avatar {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  .player-cash {
    margin: 5px 0 3px;
    font-size: 20px;
  }
  .player-name { font-size: 13px; }
  .player-assets { font-size: 10px; }
  .game-wrap {
    overflow: visible;
    padding: 0;
  }
  .board {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 3px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .center-panel {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    overflow: visible;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .mobile-property-card {
    display: block;
    grid-column: 1 / -1;
    max-height: 280px;
    overflow: auto;
  }
  .center-panel .brand {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 10px;
  }
  .center-panel .brand-logo {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
  }
  .center-panel .brand h1 { font-size: 25px; }
  .center-panel .brand p { font-size: 11px; }
  .turn-card { padding: 12px; }
  .dice-row {
    grid-template-columns: minmax(0, 1fr) minmax(104px, .75fr);
  }
  .dice {
    min-height: 64px;
    font-size: 43px;
  }
  .board > .tile {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 82px;
    padding: 5px 3px;
  }
  .board > .tile .tile-name,
  .board > .tile .tile-price { font-size: 9px; }
  .board > .tile.corner > div:first-child { font-size: 22px; }
  .board > .tile .company-logo {
    width: 23px;
    height: 23px;
  }
  .right-panel {
    display: none;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }
  .right-panel .property-card {
    max-height: none;
    overflow: visible;
  }
  .game-action-dock {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
  }
  .utility-action-dock {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal,
  .event-popover {
    width: min(96vw, 520px);
  }
  .modal form {
    padding: 14px;
  }
  #dealDialog .deal-title h2 {
    padding-inline: 96px;
  }
  .deal-action-timer {
    padding: 5px 7px;
    font-size: 11px;
  }
}
