:root {
  --bg: #eef2f0;
  --panel: #fffdf7;
  --panel-strong: #ffffff;
  --ink: #18201d;
  --muted: #65706b;
  --line: #d7ddd7;
  --line-strong: #9aa79f;
  --accent: #c62828;
  --accent-dark: #8f1d1d;
  --gold: #d6a536;
  --good: #247a4a;
  --danger: #a02727;
  --board-border: #2d3430;
  --shadow: 0 22px 60px rgba(18, 31, 27, 0.18);
  --soft-shadow: 0 8px 24px rgba(18, 31, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 1080px;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, rgba(198, 40, 40, 0.08), transparent 28%),
    linear-gradient(135deg, #f7f1df 0%, #eef2f0 44%, #e7eee8 100%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: 0 4px 14px rgba(18, 31, 27, 0.1);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  color: #9aa4a0;
  cursor: not-allowed;
  opacity: 0.58;
}

button.primary {
  border-color: var(--accent-dark);
  background: linear-gradient(180deg, #d94242, var(--accent));
  color: #fff;
  font-weight: 800;
}

button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px 4px;
  position: relative;
  z-index: 40;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.app-menu {
  position: relative;
}

.app-menu summary {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(126, 143, 132, 0.65);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  list-style: none;
  user-select: none;
}

.app-menu summary::-webkit-details-marker {
  display: none;
}

.app-menu[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  border: 1px solid rgba(126, 143, 132, 0.62);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.menu-panel button {
  width: 100%;
  text-align: left;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(560px, 620px) minmax(620px, 1fr);
  gap: 12px;
  min-height: 0;
  height: 100%;
  padding: 8px 14px 14px;
  overflow: hidden;
}

.players-rail {
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  border: 1px solid rgba(126, 143, 132, 0.6);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.players-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: minmax(148px, auto);
  align-content: start;
  align-items: start;
  gap: 8px;
  padding: 10px;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.player-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--token);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #fbfaf4);
  box-shadow: 0 2px 10px rgba(18, 31, 27, 0.06);
  padding: 8px;
  min-height: 148px;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-rows: auto auto auto;
}

.player-card.current {
  border-color: rgba(198, 40, 40, 0.45);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1), 0 8px 18px rgba(18, 31, 27, 0.1);
}

.player-card.bankrupt {
  opacity: 0.58;
  filter: grayscale(0.45);
}

.player-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.player-token-small {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.24));
  user-select: none;
}

.player-name-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-name-button:hover {
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.cash {
  color: var(--good);
  font-weight: 900;
  font-size: 13px;
}

.player-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  display: grid;
  gap: 2px;
}

.property-strip-list {
  margin-top: 6px;
  display: grid;
  align-content: start;
  grid-auto-rows: 22px;
  gap: 4px;
  max-height: none;
  overflow: visible;
}

.mini-deed {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  height: 22px;
  min-height: 22px;
  padding: 4px 6px 3px;
  color: #111;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-deed.group-railway {
  color: #e8e8e8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.mini-deed.mortgaged {
  filter: grayscale(0.5);
  background-image: linear-gradient(rgba(95, 95, 95, 0.26), rgba(95, 95, 95, 0.26));
}

.mini-buildings {
  position: absolute;
  right: 4px;
  top: 2px;
  display: flex;
  gap: 2px;
}

.mini-house,
.mini-hotel {
  width: 9px;
  height: 9px;
  object-fit: contain;
  clip-path: inset(2px);
  filter: none;
}

.mini-hotel {
  width: 13px;
}

.board-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  justify-items: center;
}

.board-stage {
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: auto;
  height: 100%;
  max-width: 1160px;
  max-height: 100%;
  aspect-ratio: 2940 / 2928;
  border: 8px solid var(--board-border);
  border-radius: 16px;
  overflow: hidden;
  background: #d9e7dd;
  box-shadow: 0 26px 70px rgba(18, 31, 27, 0.24);
}

.board-image,
.ownership-layer,
.hotspot-layer,
.token-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.board-image {
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  border-radius: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hotspot:hover {
  outline: 2px solid rgba(198, 40, 40, 0.42);
  outline-offset: -2px;
  box-shadow: none;
  transform: none;
}

.owner-pill {
  position: absolute;
  min-height: 15px;
  border-radius: 999px;
  background: var(--owner);
  border: 1px solid rgba(0, 0, 0, 0.36);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  opacity: 0.92;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: clamp(7px, 1.02vw, 11px);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  padding: 0 5px;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.owner-pill.mortgaged {
  background: #747b78;
  opacity: 0.78;
}

.buildings {
  position: absolute;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.building {
  width: 13px;
  height: 13px;
  object-fit: contain;
  clip-path: inset(2px);
  filter: none;
}

.building.hotel {
  width: 19px;
  transform: rotate(90deg);
  transform-origin: center center;
}

.token-ground-shadow {
  position: absolute;
  width: clamp(42px, 9.8%, 70px);
  height: clamp(42px, 9.8%, 70px);
  object-fit: contain;
  filter: brightness(0) saturate(0) blur(2.4px);
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) rotate(var(--shadow-rotation, 0deg)) scale(var(--shadow-scale, 1));
  opacity: 0.54;
  z-index: 8;
  will-change: left, top, transform, opacity;
  pointer-events: none;
  user-select: none;
}

.token {
  position: absolute;
  width: clamp(40px, 9.4%, 68px);
  height: clamp(40px, 9.4%, 68px);
  object-fit: contain;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.62))
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.74))
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.42))
    drop-shadow(0 5px 7px rgba(0, 0, 0, 0.24));
  transform: translate(-50%, -50%) rotate(var(--token-rotation, 0deg)) scale(var(--token-scale, 1));
  z-index: 10;
  will-change: left, top, transform;
  pointer-events: none;
  user-select: none;
}

.token.current-token {
  z-index: 14;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72))
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.86))
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.48))
    drop-shadow(0 6px 8px rgba(0, 0, 0, 0.26));
}

.play-controls {
  width: min(640px, 100%);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "turn turn"
    "dice actions";
  align-items: center;
  justify-items: center;
  justify-content: center;
  gap: 6px 10px;
}

.turn-card {
  display: contents;
}

.turn-name {
  grid-area: turn;
  min-width: 0;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.dice-button {
  grid-area: dice;
  min-width: 132px;
  min-height: 60px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-width: 2px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 5px 16px rgba(18, 31, 27, 0.1);
  padding: 7px 11px;
}

.dice-row {
  display: flex;
  gap: 8px;
}

.die {
  width: 36px;
  height: 36px;
  border: 2px solid #202622;
  border-radius: 8px;
  background: #fffef9;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
  position: relative;
}

.die.blank::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 16px;
  height: 3px;
  border-radius: 3px;
  background: #202622;
}

.pip {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #202622;
}

.pip.tl { left: 7px; top: 7px; }
.pip.tc { left: 50%; top: 7px; transform: translateX(-50%); }
.pip.tr { right: 7px; top: 7px; }
.pip.ml { left: 7px; top: 50%; transform: translateY(-50%); }
.pip.mc { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pip.mr { right: 7px; top: 50%; transform: translateY(-50%); }
.pip.bl { left: 7px; bottom: 7px; }
.pip.bc { left: 50%; bottom: 7px; transform: translateX(-50%); }
.pip.br { right: 7px; bottom: 7px; }

.dice-rolling .die {
  animation: diceShake 110ms linear infinite;
}

@keyframes diceShake {
  0% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-2px); }
  100% { transform: rotate(-2deg) translateY(1px); }
}

.context-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
}

.context-actions:empty {
  display: none;
}

.context-actions button {
  min-height: 36px;
  padding: 7px 10px;
}

.modal h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.modal {
  width: min(720px, calc(100vw - 40px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(18, 31, 27, 0.52);
  backdrop-filter: blur(5px);
}

.wide-modal {
  width: min(1040px, calc(100vw - 40px));
}

.auction-modal {
  width: min(960px, calc(100vw - 40px));
}

.modal-card {
  border: 1px solid rgba(126, 143, 132, 0.62);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.modal-head.compact {
  align-items: center;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.alert-body,
.property-body,
.history-list,
.rules-list,
.player-modal-body,
.trade-body,
.auction-body {
  padding: 18px;
}

.alert-card-image,
.deed-image {
  display: block;
  max-width: min(420px, 100%);
  max-height: 58vh;
  object-fit: contain;
  margin: 0 auto 16px;
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(18, 31, 27, 0.18);
}

.card-flip {
  appearance: none;
  display: block;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  outline: 0;
  perspective: 1200px;
  cursor: grab;
  touch-action: none;
  transition: none;
}

button.card-flip:hover:not(:disabled),
button.card-flip:focus:not(:disabled),
button.card-flip:focus-visible:not(:disabled),
button.card-flip:active:not(:disabled),
.card-flip:hover,
.card-flip:focus,
.card-flip:focus-visible,
.card-flip:active {
  border-color: transparent;
  background: transparent;
  transform: none;
  box-shadow: none;
  outline: 0;
}

.card-flip.dragging {
  cursor: grabbing;
}

.card-flip-inner {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  animation: cardFlip 720ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.card-face {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 9px;
  box-shadow: none;
  backface-visibility: hidden;
}

.card-front {
  transform: rotateY(180deg);
}

@keyframes cardFlip {
  0% {
    transform: rotateY(0deg) scale(0.96);
  }
  100% {
    transform: rotateY(180deg) scale(1);
  }
}

.property-modal .deed-image,
.manage-detail .deed-image {
  max-width: min(520px, 100%);
  max-height: 66vh;
  margin-bottom: 0;
}

.alert-card-image:only-child {
  margin-bottom: 0;
}

.alert-text {
  white-space: pre-line;
  line-height: 1.45;
}

.card-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
}

.card-thumb {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 31, 27, 0.16);
}

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

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

.detail-cell strong {
  display: block;
  margin-bottom: 2px;
}

.setup-toolbar {
  display: flex;
  gap: 12px;
  padding: 18px 18px 0;
}

.setup-toolbar label,
.setup-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.setup-grid {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.setup-row {
  display: grid;
  grid-template-columns: 80px minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 12px;
  align-items: end;
}

.setup-token-select {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.setup-token-preview {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.24));
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.portfolio-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
}

.manage-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.manage-list {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 56vh;
  overflow: auto;
}

.manage-row {
  text-align: left;
}

.manage-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.manage-detail {
  min-height: 300px;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.trade-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trade-column {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.check-list {
  display: grid;
  gap: 7px;
  max-height: 240px;
  overflow: auto;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-list {
  max-height: 62vh;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.history-line {
  border-left: 3px solid var(--line-strong);
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 0 8px 8px 0;
}

.rules-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.auction-current {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 12px;
}

.auction-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.auction-deed-image {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(18, 31, 27, 0.18);
}

.auction-panel {
  display: grid;
  gap: 12px;
}

.auction-bid-list {
  display: grid;
  gap: 8px;
}

.auction-bid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px 11px;
  box-shadow: 0 3px 10px rgba(18, 31, 27, 0.06);
}

.auction-bid-row.moved {
  animation: auctionSwap 260ms ease both;
}

.auction-bid-row.current {
  border-color: rgba(198, 40, 40, 0.5);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.auction-bid-row.passed {
  opacity: 0.58;
}

.auction-bid-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.auction-bid-amount {
  color: var(--good);
  font-weight: 900;
}

.auction-entry {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auction-entry input {
  width: 100%;
}

.auction-result .auction-current {
  align-self: center;
  font-size: 22px;
  line-height: 1.35;
}

@keyframes auctionSwap {
  0% {
    opacity: 0.65;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1220px) {
  body {
    min-width: 1240px;
  }

  .app-shell {
    grid-template-columns: minmax(540px, 560px) minmax(620px, 1fr);
  }

  .players-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .player-card {
    min-height: 112px;
  }

  .auction-layout {
    grid-template-columns: 1fr;
  }
}

/* Release-style UI pass */
html {
  scrollbar-gutter: stable;
}

body {
  --surface-glass: rgba(255, 253, 247, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.74);
  --field-bg: #fffef9;
  --button-bg: #fffdf7;
  --button-bg-hover: #ffffff;
  min-width: 1220px;
  background:
    radial-gradient(circle at 12% 12%, rgba(198, 40, 40, 0.1), transparent 25%),
    radial-gradient(circle at 85% 18%, rgba(36, 122, 74, 0.08), transparent 28%),
    linear-gradient(135deg, #f8f1dd 0%, #eef2f0 42%, #e5eee8 100%);
}

body[data-theme="dark"] {
  --bg: #222a27;
  --panel: #2f3834;
  --panel-strong: #38433e;
  --ink: #f2f4ed;
  --muted: #bac4bc;
  --line: #52605a;
  --line-strong: #829188;
  --accent: #d84b4b;
  --accent-dark: #a52b2b;
  --gold: #e0b452;
  --good: #74d69a;
  --danger: #ef7777;
  --board-border: #18201d;
  --surface-glass: rgba(47, 56, 52, 0.9);
  --surface-soft: rgba(56, 67, 62, 0.72);
  --field-bg: #26302c;
  --button-bg: #38433e;
  --button-bg-hover: #42504a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
  background:
    radial-gradient(circle at 10% 12%, rgba(216, 75, 75, 0.16), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(116, 214, 154, 0.12), transparent 28%),
    linear-gradient(135deg, #1e2623 0%, #29332f 48%, #222b27 100%);
}

.app-header {
  min-height: 58px;
  padding: 10px 16px 8px;
  gap: 12px;
}

.app-header h1 {
  font-size: 32px;
  font-weight: 950;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 143, 132, 0.65);
  border-radius: 14px;
  background: var(--surface-glass);
  color: var(--ink);
  box-shadow: var(--soft-shadow);
}

.icon-toggle:hover:not(:disabled),
.icon-toggle:focus:not(:disabled),
.icon-toggle:focus-visible:not(:disabled),
.icon-toggle:active:not(:disabled) {
  background: rgba(198, 40, 40, 0.08);
  border-color: rgba(198, 40, 40, 0.42);
  transform: none;
}

.sound-control {
  --volume-percent: 70%;
  position: relative;
  display: flex;
  align-items: center;
}

.sound-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 160px;
  padding: 14px 16px;
  border: 1px solid rgba(126, 143, 132, 0.65);
  border-radius: 16px;
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 140ms ease, transform 140ms ease;
}

.sound-control.open .sound-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.sound-icon,
.bulb-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-icon .speaker-body {
  fill: currentColor;
  stroke: currentColor;
}

.bulb-icon .bulb-glow {
  fill: var(--gold);
  stroke: #8a671a;
  filter: drop-shadow(0 0 5px rgba(214, 165, 54, 0.48));
}

.bulb-icon .bulb-base,
.bulb-icon .bulb-ray {
  stroke: currentColor;
}

.theme-toggle[data-theme-state="dark"] .bulb-glow {
  fill: transparent;
  stroke: currentColor;
  filter: none;
  opacity: 0.72;
}

.theme-toggle[data-theme-state="dark"] .bulb-ray {
  opacity: 0;
}

.sound-wave,
.mute-slash {
  transition: opacity 140ms ease;
}

.sound-toggle[data-volume-state="muted"] .sound-wave,
.sound-toggle[data-volume-state="low"] .sound-wave-two {
  opacity: 0;
}

.sound-toggle:not([data-volume-state="muted"]) .mute-slash {
  opacity: 0;
}

.sound-slider {
  width: 128px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) var(--volume-percent), rgba(126, 143, 132, 0.28) var(--volume-percent));
  accent-color: var(--accent);
  cursor: pointer;
}

.sound-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
}

.card-open-trigger {
  cursor: pointer;
}

.card-open-trigger:focus-visible {
  outline: 3px solid rgba(198, 40, 40, 0.55);
  outline-offset: 4px;
}

.app-menu summary {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-glass);
  color: transparent;
  font-size: 0;
}

.app-menu summary::before {
  content: "\2630";
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.menu-panel {
  min-width: 210px;
  border-radius: 16px;
  background: var(--panel);
}

.menu-panel button:disabled {
  opacity: 0.42;
}

button {
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--ink);
}

button:hover:not(:disabled) {
  background: var(--button-bg-hover);
}

input,
select {
  background: var(--field-bg);
  color: var(--ink);
  min-height: 42px;
}

.app-shell {
  grid-template-columns: clamp(680px, 52vw, 820px) minmax(520px, 1fr);
  gap: 14px;
  padding: 8px 14px 14px;
}

.players-rail {
  border-radius: 18px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--soft-shadow);
}

.players-list {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  grid-auto-rows: minmax(212px, auto);
  gap: 10px;
  padding: 14px;
  scrollbar-width: none;
}

.players-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.player-card {
  min-height: 212px;
  padding: 11px;
  border-radius: 15px;
  border: 1px solid rgba(126, 143, 132, 0.46);
  border-left: 7px solid var(--token);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 253, 247, 0.9));
  box-shadow: 0 8px 22px rgba(18, 31, 27, 0.08);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

body[data-theme="dark"] .player-card {
  background:
    linear-gradient(180deg, rgba(65, 78, 72, 0.94), rgba(48, 58, 54, 0.94));
  border-color: rgba(130, 145, 136, 0.44);
}

.player-card.current {
  border-left-color: var(--token);
  border-top-color: rgba(198, 40, 40, 0.55);
  border-right-color: rgba(198, 40, 40, 0.55);
  border-bottom-color: rgba(198, 40, 40, 0.55);
  box-shadow:
    0 0 0 3px rgba(198, 40, 40, 0.12),
    0 12px 28px rgba(18, 31, 27, 0.14);
}

.player-head {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 7px;
}

.player-identity {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.player-token-small {
  width: 42px;
  height: 42px;
}

.player-name-button {
  font-size: 15px;
  line-height: 1.16;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.cash {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(36, 122, 74, 0.11);
  color: var(--good);
  font-size: 15px;
}

.player-meta {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.25;
  gap: 3px;
}

.property-strip-list {
  margin-top: 0;
  grid-auto-rows: 27px;
  gap: 5px;
}

.mini-deed {
  min-height: 27px;
  height: 27px;
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.1;
  display: flex;
  align-items: center;
}

.mini-buildings {
  right: 5px;
  top: 3px;
}

.mini-house,
.mini-hotel {
  transform: rotate(90deg) scale(1.8);
  transform-origin: center;
}

.board-area {
  grid-template-rows: minmax(0, 1fr) 150px;
  gap: 10px;
  overflow: hidden;
}

.board-stage {
  align-self: center;
  width: min(100%, calc(100vh - 232px));
  height: auto;
  max-height: 100%;
  border-width: 9px;
  border-radius: 20px;
  box-shadow: 0 28px 78px rgba(18, 31, 27, 0.26);
}

.play-controls {
  width: min(760px, 100%);
  min-height: 142px;
  padding: 12px 16px;
  border: 1px solid rgba(126, 143, 132, 0.42);
  border-radius: 20px;
  background: var(--surface-glass);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
  grid-template-columns: minmax(220px, auto) minmax(150px, auto) minmax(0, 1fr);
  grid-template-areas:
    "turn turn turn"
    "dice shortcuts actions";
  justify-content: center;
  gap: 10px 14px;
}

.turn-name {
  font-size: 19px;
  line-height: 1.1;
}

.dice-button {
  min-width: 226px;
  min-height: 94px;
  border-radius: 18px;
  gap: 8px;
  padding: 11px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 238, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(18, 31, 27, 0.14);
}

body[data-theme="dark"] .dice-button {
  background: linear-gradient(180deg, #46534d, #35403b);
}

.dice-row {
  gap: 14px;
}

.die {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border-width: 3px;
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.09),
    0 4px 10px rgba(18, 31, 27, 0.14);
}

.die.blank::after {
  left: 17px;
  right: 17px;
  top: 26px;
  height: 5px;
}

.pip {
  width: 10px;
  height: 10px;
}

.pip.tl { left: 12px; top: 12px; }
.pip.tc { left: 50%; top: 12px; transform: translateX(-50%); }
.pip.tr { right: 12px; top: 12px; }
.pip.ml { left: 12px; top: 50%; transform: translateY(-50%); }
.pip.mc { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pip.mr { right: 12px; top: 50%; transform: translateY(-50%); }
.pip.bl { left: 12px; bottom: 12px; }
.pip.bc { left: 50%; bottom: 12px; transform: translateX(-50%); }
.pip.br { right: 12px; bottom: 12px; }

#primaryLabel {
  font-weight: 950;
  letter-spacing: 0;
}

.turn-shortcuts {
  grid-area: shortcuts;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 142px;
}

.turn-shortcuts button,
.context-actions button {
  min-height: 42px;
  font-weight: 850;
}

.context-actions {
  justify-content: flex-start;
  align-content: center;
  gap: 8px;
}

.context-actions:empty {
  display: flex;
}

.buildings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.building {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.building.hotel {
  width: 57px;
  height: 39px;
}

.buildings:has(.building:nth-child(2):last-child) .building:first-child {
  transform: translateX(3px);
}

.buildings:has(.building:nth-child(2):last-child) .building:last-child {
  transform: translateX(-3px);
}

.buildings:has(.building:nth-child(3):last-child) .building:nth-child(1) {
  transform: translateX(6px);
}

.buildings:has(.building:nth-child(3):last-child) .building:nth-child(3) {
  transform: translateX(-6px);
}

.buildings:has(.building:nth-child(4):last-child) .building:nth-child(1) {
  transform: translateX(9px);
}

.buildings:has(.building:nth-child(4):last-child) .building:nth-child(2) {
  transform: translateX(3px);
}

.buildings:has(.building:nth-child(4):last-child) .building:nth-child(3) {
  transform: translateX(-3px);
}

.buildings:has(.building:nth-child(4):last-child) .building:nth-child(4) {
  transform: translateX(-9px);
}

.modal {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: min(88vh, 900px);
}

.modal-card {
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.modal-head {
  background: var(--surface-soft);
}

.alert-body,
.property-body,
.history-list,
.rules-list,
.player-modal-body,
.trade-body,
.auction-body {
  overflow: auto;
}

.setup-modal {
  width: min(980px, calc(100vw - 48px));
}

.setup-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px 22px 0;
  align-items: center;
}

.setup-toolbar label,
.setup-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.setup-online {
  margin: 18px 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(260px, 1.2fr) auto;
  gap: 14px;
  align-items: end;
}

.setup-online h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.setup-online p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.setup-online label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.setup-grid {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
}

.setup-row {
  display: grid;
  grid-template-columns: 70px minmax(170px, 1fr) minmax(210px, 0.85fr) auto;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  align-items: center;
}

.setup-row strong {
  align-self: center;
  font-size: 14px;
  line-height: 1;
}

.setup-seat-summary {
  justify-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.setup-seat-note {
  align-self: center;
  grid-column: span 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.setup-seat-actions {
  align-self: center;
  display: flex;
  justify-content: flex-end;
}

.setup-remove {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
}

.setup-token-select {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.setup-token-preview {
  width: 38px;
  height: 38px;
}

.setup-name-input,
.setup-token-select select {
  width: 100%;
  min-height: 38px;
}

.setup-name-input[readonly] {
  cursor: default;
}

.trade-modal {
  width: min(1120px, calc(100vw - 48px));
}

.trade-body {
  display: grid;
  gap: 16px;
}

.trade-partner-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.trade-partner-card strong {
  display: block;
  font-size: 17px;
}

.trade-partner-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.trade-columns {
  gap: 16px;
}

.trade-column {
  border-radius: 18px;
  border-left: 7px solid var(--token);
  background: var(--surface-soft);
  padding: 16px;
  display: grid;
  gap: 14px;
  min-height: 450px;
}

.trade-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trade-player {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.trade-player h3 {
  margin: 0;
  font-size: 18px;
}

.trade-player span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.trade-money {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trade-list-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.check-list {
  gap: 8px;
  max-height: 310px;
  padding-right: 4px;
}

.trade-property-row {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--group);
  border-radius: 12px;
  background: var(--button-bg);
  font-weight: 800;
}

.trade-property-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-cell,
.portfolio-item,
.rule-card,
.auction-bid-row,
.history-line {
  background: var(--surface-soft);
}

body[data-theme="dark"] .mini-deed:not(.group-railway),
body[data-theme="dark"] .trade-property-row {
  color: #111;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: minmax(640px, 680px) minmax(500px, 1fr);
  }

  .players-list {
    grid-template-columns: repeat(4, minmax(142px, 1fr));
  }

  .player-card {
    min-height: 206px;
  }
}

/* Width-first player cards: readable on normal screens, 4-column on large displays. */
.app-shell {
  grid-template-columns: clamp(600px, 48vw, 720px) minmax(520px, 1fr);
}

.players-list {
  grid-template-columns: repeat(2, minmax(270px, 1fr));
  grid-auto-rows: minmax(190px, auto);
}

.player-card {
  min-height: 190px;
}

@media (min-width: 1500px) {
  body {
    min-width: 1440px;
  }

  .app-shell {
    grid-template-columns: clamp(840px, 42vw, 1040px) minmax(620px, 1fr);
  }

  .players-list {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    grid-auto-rows: minmax(212px, auto);
  }

  .player-card {
    min-height: 212px;
  }
}

/* Focused cleanup after the product pass */
.players-list {
  grid-auto-rows: 236px;
  align-items: stretch;
}

.player-card {
  height: 236px;
  min-height: 0;
  max-height: 236px;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-left-color: var(--token) !important;
}

.player-name-button,
.player-name-button:hover,
.player-name-button:focus,
.player-name-button:focus-visible,
.player-name-button:active {
  color: var(--ink);
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  transform: none;
  cursor: pointer;
}

button.player-name-button:hover:not(:disabled),
button.player-name-button:focus:not(:disabled),
button.player-name-button:focus-visible:not(:disabled),
button.player-name-button:active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.token {
  pointer-events: auto;
  cursor: help;
}

.token-layer {
  pointer-events: auto;
}

.cash {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
}

.player-meta {
  min-height: 16px;
}

.property-strip-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
}

.property-strip-list .player-meta {
  margin: 0;
  align-self: start;
}

.mini-deed {
  flex: 0 0 27px;
}

.play-controls {
  width: min(780px, 100%);
  min-height: 136px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  grid-template-columns: minmax(120px, 1fr) auto minmax(260px, 1fr);
  grid-template-areas:
    ". turn ."
    ". dice actions"
    ". dice context";
  align-items: center;
}

.turn-shortcuts {
  grid-area: actions;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  align-self: end;
}

.context-actions {
  grid-area: context;
  align-self: start;
}

.context-actions:empty {
  display: none;
}

.dice-button {
  min-width: 238px;
}

.trade-column {
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

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

.trade-money input {
  width: 100%;
}

.check-list {
  height: 300px;
  max-height: 300px;
  overflow-y: auto;
}

.trade-property-row,
body[data-theme="dark"] .trade-property-row {
  min-height: 40px;
  height: 40px;
  background: #ffffff !important;
  color: #111111 !important;
}

body[data-theme="dark"] .player-card {
  border-left-color: var(--token) !important;
}

body[data-theme="dark"] .mini-deed {
  filter: none;
}

@media (min-width: 1500px) {
  .players-list {
    grid-auto-rows: 236px;
  }

  .player-card {
    height: 236px;
    max-height: 236px;
    min-height: 0;
  }
}

/* Tightened board/list/modal refinements */
.app-shell {
  grid-template-columns: clamp(720px, 54vw, 940px) minmax(480px, 1fr);
}

.players-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-items: stretch;
}

.player-card {
  height: 100%;
  max-height: none;
  min-height: 0;
}

.player-meta {
  min-height: 15px;
}

.hotspot:hover {
  outline: 0;
  box-shadow: none;
  transform: none;
}

.mortgage-overlay {
  position: absolute;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  pointer-events: none;
}

.owner-pill {
  z-index: 2;
}

.owner-pill.mortgaged {
  background: var(--owner);
  opacity: 0.92;
}

.buildings {
  z-index: 3;
}

.card-image-grid {
  align-items: start;
}

.card-thumb-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.card-thumb-button:hover:not(:disabled),
.card-thumb-button:focus:not(:disabled),
.card-thumb-button:active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.alert-modal.card-viewer {
  width: min(440px, calc(100vw - 40px));
}

.alert-modal.card-viewer .modal-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.alert-modal.card-viewer .modal-head,
.alert-modal.card-viewer .modal-actions {
  display: none;
}

.alert-modal.card-viewer .alert-body {
  padding: 0;
  overflow: visible;
}

.check-list {
  display: grid;
  align-content: start;
  grid-auto-rows: 40px;
  gap: 4px;
  height: 300px;
  max-height: 300px;
  overflow-y: auto;
}

.trade-property-row,
body[data-theme="dark"] .trade-property-row {
  height: 40px;
  min-height: 40px;
  padding: 8px 10px;
}

.manage-layout {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
}

.manage-list {
  gap: 4px;
  align-content: start;
}

.manage-row {
  min-height: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--group);
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  font-weight: 800;
  text-align: left;
  padding: 8px 10px;
}

.manage-row:hover:not(:disabled),
.manage-row:focus:not(:disabled),
.manage-row:active:not(:disabled) {
  background: #ffffff;
  color: #111111;
  transform: none;
}

.manage-row.selected {
  border-color: var(--line);
  border-left-color: var(--group);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.14);
}

.manage-detail {
  display: grid;
  justify-items: center;
  align-content: start;
}

.manage-actions {
  justify-content: center;
  width: min(520px, 100%);
  margin: 14px auto 0;
}

button.primary:hover:not(:disabled),
#propertyActions button.primary:hover:not(:disabled),
#sendTradeButton:hover:not(:disabled),
.manage-actions button.primary:hover:not(:disabled),
.modal-actions button:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: linear-gradient(180deg, #d94242, var(--accent));
  color: #ffffff;
  box-shadow: none;
}

.modal-actions button:not(.primary):hover:not(:disabled) {
  background: var(--button-bg);
  color: var(--ink);
  box-shadow: none;
}

.manage-actions button:not(.primary):hover:not(:disabled) {
  background: var(--button-bg);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

@media (min-width: 1500px) {
  .players-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
  }

  .player-card {
    height: 100%;
    max-height: none;
    min-height: 0;
  }
}

/* Interaction polish */
.player-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.player-summary-button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

.player-summary-button:hover:not(:disabled),
.player-summary-button:focus:not(:disabled),
.player-summary-button:focus-visible:not(:disabled),
.player-summary-button:active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  transform: none;
}

.player-card.inactive {
  border-left-color: color-mix(in srgb, var(--token) 28%, #c8d0cb) !important;
}

body[data-theme="dark"] .player-card.inactive {
  border-left-color: color-mix(in srgb, var(--token) 28%, #4f5b56) !important;
}

.player-card.inactive .player-token-small {
  opacity: 0.58;
  filter: grayscale(0.45) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.player-card.current .player-token-small {
  opacity: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.24));
}

.hotspot,
.hotspot:hover,
.hotspot:focus,
.hotspot:focus-visible,
.hotspot:active,
button.hotspot:hover:not(:disabled),
button.hotspot:focus:not(:disabled),
button.hotspot:focus-visible:not(:disabled),
button.hotspot:active:not(:disabled) {
  border-color: transparent;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  transform: none !important;
  cursor: pointer;
}

.alert-modal.card-viewer {
  width: min(620px, calc(100vw - 80px));
  border: 0;
  outline: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.alert-modal.card-viewer .modal-card,
.alert-modal.card-viewer .alert-body,
.alert-modal.card-viewer .card-flip,
.alert-modal.card-viewer .card-flip-inner {
  overflow: visible;
  outline: 0;
}

.alert-modal.card-viewer .card-flip {
  width: min(540px, 100%);
  max-width: none;
}

.alert-modal.card-viewer .card-face {
  max-height: 82vh;
  outline: 0;
}

/* Larger, cleaner card viewer field */
.alert-modal.card-viewer {
  width: min(760px, calc(100vw - 48px));
  height: min(88vh, 760px);
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.alert-modal.card-viewer::backdrop {
  background: rgba(18, 31, 27, 0.58);
  backdrop-filter: blur(5px);
}

.alert-modal.card-viewer .modal-card {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.alert-modal.card-viewer .alert-body {
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

.alert-modal.card-viewer .card-flip {
  width: min(620px, 82%);
  max-width: none;
  overflow: visible;
  filter: none;
}

.alert-modal.card-viewer .card-flip-inner {
  overflow: visible;
  will-change: transform;
  transform-style: preserve-3d;
  transform: translateZ(0);
}

.alert-modal.card-viewer .card-face {
  max-height: 78vh;
  image-rendering: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.alert-modal.card-viewer .card-back {
  transform: translateZ(0.2px);
}

.alert-modal.card-viewer .card-front {
  transform: rotateY(180deg) translateZ(0.2px);
}

/* Professional tabletop rebuild */
:root {
  --table-felt: #24513f;
  --table-felt-dark: #17382d;
  --table-edge: #6f4a27;
  --ivory: #fff8e8;
  --ivory-strong: #fffdf4;
  --ink-soft: #34413b;
  --glass: rgba(255, 248, 232, 0.88);
  --glass-strong: rgba(255, 253, 244, 0.96);
  --card-line: rgba(51, 63, 57, 0.18);
  --game-shadow: 0 22px 70px rgba(20, 32, 27, 0.28);
  --tight-shadow: 0 10px 26px rgba(20, 32, 27, 0.18);
}

body {
  min-width: 1180px;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 248, 232, 0.22), transparent 22%),
    radial-gradient(circle at 84% 12%, rgba(214, 165, 54, 0.14), transparent 26%),
    linear-gradient(135deg, var(--table-felt-dark), var(--table-felt) 48%, #1d4234);
  color: var(--ink);
}

body[data-theme="dark"] {
  --glass: rgba(32, 43, 38, 0.9);
  --glass-strong: rgba(41, 55, 49, 0.96);
  --card-line: rgba(235, 239, 226, 0.16);
  --ink-soft: #d6ded6;
  background:
    radial-gradient(circle at 14% 12%, rgba(216, 75, 75, 0.14), transparent 22%),
    radial-gradient(circle at 84% 10%, rgba(224, 180, 82, 0.1), transparent 26%),
    linear-gradient(135deg, #111f1a, #1f342d 50%, #162821);
}

[hidden] {
  display: none !important;
}

.home-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 48px;
  background:
    linear-gradient(135deg, rgba(17, 43, 33, 0.9), rgba(31, 78, 59, 0.72)),
    radial-gradient(circle at 30% 20%, rgba(255, 248, 232, 0.22), transparent 30%);
}

.home-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-board {
  position: absolute;
  right: -9vmin;
  top: 50%;
  width: min(82vw, 1120px);
  aspect-ratio: 1;
  opacity: 0.36;
  transform: translateY(-50%) rotate(-8deg);
  filter: saturate(1.08) contrast(1.08) drop-shadow(0 40px 80px rgba(0, 0, 0, 0.32));
}

.home-card,
.home-token {
  position: absolute;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.34));
}

.home-card {
  width: clamp(130px, 16vw, 250px);
  border-radius: 10px;
}

.home-card-chance {
  left: 8vw;
  top: 12vh;
  transform: rotate(-12deg);
}

.home-card-chest {
  right: 19vw;
  bottom: 8vh;
  transform: rotate(10deg);
}

.home-token {
  width: clamp(70px, 8vw, 120px);
}

.home-token-car {
  left: 18vw;
  bottom: 18vh;
  transform: rotate(18deg);
}

.home-token-hat {
  right: 8vw;
  top: 16vh;
  transform: rotate(-24deg);
}

.home-token-ship {
  left: 7vw;
  bottom: 8vh;
  transform: rotate(42deg);
}

.home-panel {
  position: relative;
  width: min(520px, 92vw);
  margin-right: min(34vw, 440px);
  padding: 38px;
  border: 1px solid rgba(255, 248, 232, 0.38);
  border-radius: 28px;
  background: rgba(255, 248, 232, 0.92);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  color: #18201d;
}

.home-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-panel h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 92px);
  line-height: 0.92;
  font-weight: 950;
  letter-spacing: 0;
}

.home-copy {
  margin: 18px 0 26px;
  max-width: 34rem;
  color: #3c4b44;
  font-size: 18px;
  line-height: 1.5;
}

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

.home-actions button {
  min-height: 48px;
  font-weight: 900;
}

.home-actions .home-primary {
  grid-column: 1 / -1;
  font-size: 18px;
}

.home-room {
  margin-top: 18px;
  display: grid;
  gap: 6px;
  color: #536258;
  font-size: 13px;
}

.home-room code {
  padding: 9px 10px;
  border: 1px solid rgba(24, 32, 29, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  color: #29342f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-screen {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px 14px 14px;
  gap: 10px;
}

.app-header {
  min-height: 58px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  border-radius: 18px;
  background: rgba(255, 248, 232, 0.88);
  box-shadow: var(--tight-shadow);
  backdrop-filter: blur(14px);
}

body[data-theme="dark"] .app-header {
  background: rgba(32, 43, 38, 0.92);
}

.app-header h1 {
  color: var(--ink);
  font-size: 30px;
  letter-spacing: 0;
}

.app-menu summary,
.icon-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--glass-strong);
  border-color: var(--card-line);
  box-shadow: none;
}

.menu-panel {
  top: calc(100% + 10px);
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--card-line);
  box-shadow: var(--game-shadow);
}

.sound-popover {
  background: var(--glass-strong);
}

.app-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(340px, 27vw, 430px) minmax(0, 1fr);
  gap: 14px;
  padding: 0;
}

.players-rail {
  width: auto;
  min-width: 0;
  height: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.94), rgba(247, 239, 216, 0.9)),
    radial-gradient(circle at 16% 0, rgba(198, 40, 40, 0.1), transparent 30%);
  box-shadow: var(--game-shadow);
  overflow: hidden;
}

body[data-theme="dark"] .players-rail {
  background: linear-gradient(180deg, rgba(36, 49, 43, 0.96), rgba(27, 39, 34, 0.94));
}

.players-list {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.player-card {
  min-height: 0;
  height: 100%;
  padding: 8px;
  border: 1px solid var(--card-line);
  border-left: 6px solid var(--token);
  border-radius: 16px;
  background:
    linear-gradient(180deg, var(--glass-strong), rgba(255, 248, 232, 0.76));
  box-shadow: 0 8px 20px rgba(20, 32, 27, 0.1);
  overflow: hidden;
}

body[data-theme="dark"] .player-card {
  background: linear-gradient(180deg, rgba(46, 61, 54, 0.98), rgba(34, 47, 41, 0.86));
}

.player-card.current {
  opacity: 1;
  border-color: color-mix(in srgb, var(--token), white 24%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--token), transparent 58%),
    0 12px 28px rgba(20, 32, 27, 0.18);
}

.player-card.inactive {
  opacity: 0.58;
  filter: saturate(0.82);
}

.player-summary-button {
  min-height: 54px;
  padding: 0;
}

.player-head {
  gap: 8px;
}

.player-identity {
  min-width: 0;
}

.player-token-small {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.22));
}

.player-name-button {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 950;
}

.cash {
  font-size: 15px;
  font-weight: 950;
  color: var(--good);
}

.player-meta {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.property-strip-list {
  margin-top: 8px;
  max-height: calc(100% - 72px);
  display: grid;
  grid-auto-rows: 26px;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.mini-deed {
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #171d1a;
  font-size: 11px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

.mini-deed.group-railway {
  color: #f3f1e6;
}

.mini-deed.mortgaged {
  filter: grayscale(0.4) brightness(0.72);
}

.board-area {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) clamp(250px, 21vw, 330px);
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.board-stage {
  place-self: center;
  width: min(100%, calc(100vh - 98px));
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 98px);
  border: 12px solid #282f2b;
  border-radius: 24px;
  background: #d8e6dc;
  box-shadow:
    0 0 0 6px rgba(255, 248, 232, 0.24),
    0 30px 80px rgba(0, 0, 0, 0.34);
}

.board-image {
  filter: saturate(1.04) contrast(1.02);
}

.owner-pill {
  font-size: 10px;
  font-weight: 950;
  opacity: 0.96;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.play-controls {
  width: 100%;
  height: 100%;
  align-self: stretch;
  display: grid;
  grid-template-areas:
    "turn"
    "shortcuts"
    "context";
  grid-template-columns: 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.94), rgba(240, 229, 201, 0.9)),
    radial-gradient(circle at 100% 0, rgba(214, 165, 54, 0.16), transparent 28%);
  box-shadow: var(--game-shadow);
}

body[data-theme="dark"] .play-controls {
  background: linear-gradient(180deg, rgba(42, 55, 49, 0.96), rgba(26, 39, 34, 0.92));
}

.turn-card {
  display: grid;
  gap: 12px;
  place-items: stretch;
  padding: 0;
}

.turn-name {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--card-line);
  font-size: 20px;
  font-weight: 950;
  text-align: center;
}

body[data-theme="dark"] .turn-name {
  background: rgba(255, 255, 255, 0.06);
}

.dice-button {
  width: 100%;
  min-width: 0;
  min-height: 168px;
  border-radius: 22px;
  display: grid;
  gap: 12px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.56), transparent 42%),
    linear-gradient(180deg, #f8f0d5, #dcc38a);
  border: 1px solid rgba(77, 56, 26, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 16px 30px rgba(20, 32, 27, 0.18);
}

body[data-theme="dark"] .dice-button {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #41534b, #2b3b35);
}

.dice-row {
  gap: 16px;
}

.die {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 18px rgba(0, 0, 0, 0.2);
}

#primaryLabel {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.turn-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.turn-shortcuts button,
.context-actions button {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 950;
}

.context-actions {
  align-self: stretch;
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
}

.context-actions:not(:empty)::before {
  content: "Available actions";
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.modal::backdrop {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 248, 232, 0.18), transparent 26%),
    rgba(12, 26, 20, 0.64);
  backdrop-filter: blur(5px);
}

.modal-card {
  border: 1px solid rgba(255, 248, 232, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(180deg, var(--glass-strong), rgba(244, 232, 204, 0.96));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] .modal-card {
  background: linear-gradient(180deg, rgba(45, 59, 52, 0.98), rgba(28, 40, 35, 0.98));
}

.modal-head {
  border-bottom: 1px solid var(--card-line);
}

.setup-modal {
  width: min(980px, calc(100vw - 48px));
}

.setup-toolbar,
.setup-online,
.setup-row,
.trade-partner-card,
.trade-column,
.manage-list,
.manage-detail,
.auction-panel {
  border-color: var(--card-line);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 18px;
}

body[data-theme="dark"] .setup-toolbar,
body[data-theme="dark"] .setup-online,
body[data-theme="dark"] .setup-row,
body[data-theme="dark"] .trade-partner-card,
body[data-theme="dark"] .trade-column,
body[data-theme="dark"] .manage-list,
body[data-theme="dark"] .manage-detail,
body[data-theme="dark"] .auction-panel {
  background: rgba(255, 255, 255, 0.06);
}

.trade-modal {
  width: min(1180px, calc(100vw - 42px));
}

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

.trade-column {
  height: min(66vh, 620px);
  max-height: none;
  padding: 14px;
}

.trade-player h3 {
  font-size: 18px;
}

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

.check-list {
  height: auto;
  max-height: none;
  min-height: 0;
}

.trade-property-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border-left: 7px solid var(--group);
  background: #fff;
}

body[data-theme="dark"] .trade-property-row {
  background: #fff;
  color: #18201d;
}

.trade-deed-thumb {
  width: 48px;
  height: 62px;
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #f7f0da;
}

.trade-deed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trade-property-pick {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-weight: 950;
}

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

.manage-layout {
  grid-template-columns: minmax(260px, 0.92fr) minmax(340px, 1.08fr);
}

.manage-row {
  min-height: 48px;
  border-left-width: 8px;
  font-weight: 950;
}

.manage-detail .deed-image,
.property-modal .deed-image,
.auction-deed-image {
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.manage-actions {
  justify-content: center;
}

.auction-modal {
  width: min(980px, calc(100vw - 42px));
}

.auction-layout {
  grid-template-columns: minmax(240px, 0.86fr) minmax(360px, 1.14fr);
}

.auction-bid-row {
  min-height: 48px;
  border-radius: 12px;
}

.history-list,
.rules-list {
  border-radius: 18px;
}

.card-image-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.card-thumb-button {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.alert-modal.card-viewer .card-flip {
  width: min(700px, 86%);
}

@media (max-width: 1280px) {
  body {
    min-width: 1080px;
  }

  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .players-list {
    grid-template-columns: 1fr;
  }

  .board-area {
    grid-template-columns: minmax(560px, 1fr) 240px;
  }

  .die {
    width: 60px;
    height: 60px;
  }
}

/* Tabletop product UI rebuild */
:root {
  --felt-a: #183e30;
  --felt-b: #24624a;
  --felt-c: #2d7357;
  --paper: #fff7e6;
  --paper-2: #efe3c6;
  --mahogany: #6f3f23;
  --mahogany-dark: #321b10;
  --gold: #d8a741;
  --panel-shadow: 0 20px 46px rgba(12, 23, 18, 0.32);
  --board-shadow: 0 18px 38px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 248, 232, 0.2);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-width: 1120px;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 245, 212, 0.2), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(216, 167, 65, 0.16), transparent 30%),
    linear-gradient(145deg, var(--felt-a), var(--felt-b) 45%, #173b2d);
}

body[data-theme="dark"] {
  --paper: #292f2b;
  --paper-2: #1f2823;
  --glass: rgba(34, 46, 40, 0.9);
  --glass-strong: rgba(42, 54, 48, 0.96);
  --ink: #f7f0db;
  --muted: #c8c0a9;
  background:
    radial-gradient(circle at 16% 14%, rgba(219, 175, 84, 0.11), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(70, 158, 117, 0.12), transparent 30%),
    linear-gradient(145deg, #111d18, #1f372d 46%, #13241e);
}

.home-screen {
  padding: clamp(26px, 5vw, 64px);
  background:
    radial-gradient(circle at 78% 24%, rgba(216, 167, 65, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(12, 32, 24, 0.94), rgba(26, 86, 61, 0.82));
}

.home-board {
  right: -6vmin;
  width: min(76vw, 1060px);
  opacity: 0.45;
  transform: translateY(-50%) rotate(-7deg);
}

.home-card {
  border-radius: 14px;
}

.home-panel {
  width: min(560px, 92vw);
  margin-right: min(36vw, 470px);
  border-radius: 30px;
  border: 1px solid rgba(255, 248, 232, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.97), rgba(242, 226, 190, 0.94));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
}

.home-panel h1 {
  color: #c62828;
  text-shadow: 0 2px 0 #fff5d3, 0 8px 26px rgba(0, 0, 0, 0.22);
}

.home-copy {
  color: #2f4139;
}

.home-actions button {
  border-radius: 16px;
  border-color: rgba(37, 43, 39, 0.14);
  box-shadow: 0 8px 16px rgba(31, 43, 37, 0.12);
}

.home-actions button:disabled {
  background: rgba(255, 255, 255, 0.5);
  color: #8e8778;
}

.game-screen {
  height: 100vh;
  grid-template-rows: 52px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px 10px;
}

.app-header {
  min-height: 0;
  height: 52px;
  padding: 6px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 248, 232, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.95), rgba(232, 221, 194, 0.92));
  box-shadow: 0 10px 24px rgba(12, 23, 18, 0.24);
}

body[data-theme="dark"] .app-header {
  background:
    linear-gradient(180deg, rgba(45, 58, 51, 0.96), rgba(28, 39, 34, 0.94));
}

.app-header h1 {
  font-size: 28px;
  font-weight: 950;
  color: #c62828;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] .app-header h1 {
  color: #f2d36b;
  text-shadow: 0 2px 14px rgba(242, 211, 107, 0.16);
}

.app-menu summary,
.icon-toggle {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.app-menu summary {
  font-size: 0;
}

.app-menu summary::before {
  content: "\2630";
  font-size: 21px;
  line-height: 1;
}

.menu-panel {
  min-width: 190px;
  padding: 8px;
  border-radius: 18px;
}

.menu-panel button {
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 12px;
}

.app-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(390px, 32vw, 500px) minmax(0, 1fr);
  gap: 10px;
}

.players-rail {
  height: 100%;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 248, 232, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.96), rgba(231, 218, 185, 0.9));
  box-shadow: var(--panel-shadow);
}

body[data-theme="dark"] .players-rail {
  background:
    linear-gradient(180deg, rgba(44, 57, 50, 0.97), rgba(29, 42, 36, 0.94));
}

.players-list {
  height: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 9px;
  overflow: hidden;
}

.player-card {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px;
  border-radius: 17px;
  border: 1px solid rgba(43, 52, 47, 0.14);
  border-left: 7px solid var(--token);
  background:
    linear-gradient(180deg, rgba(255, 252, 240, 0.97), rgba(246, 237, 214, 0.9));
  box-shadow: 0 8px 18px rgba(12, 23, 18, 0.14);
  overflow: hidden;
}

body[data-theme="dark"] .player-card {
  border-color: rgba(255, 248, 232, 0.11);
  border-left-color: var(--token);
  background:
    linear-gradient(180deg, rgba(53, 67, 60, 0.97), rgba(34, 47, 41, 0.92));
}

.player-card.inactive {
  opacity: 0.72;
  filter: saturate(0.72) brightness(0.93);
}

.player-card.current {
  opacity: 1;
  filter: none;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--token), white 20%),
    0 0 0 2px rgba(255, 248, 232, 0.6),
    0 12px 26px color-mix(in srgb, var(--token), transparent 72%);
}

.player-summary-button {
  min-height: 0;
  padding: 0 0 7px;
  border-bottom: 1px solid rgba(43, 52, 47, 0.12);
}

body[data-theme="dark"] .player-summary-button {
  border-bottom-color: rgba(255, 248, 232, 0.1);
}

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

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

.player-token-small {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.28));
}

.player-name-button {
  max-width: 100%;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash {
  color: #10733f;
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

body[data-theme="dark"] .cash {
  color: #78dda4;
}

.player-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.property-strip-list {
  min-height: 0;
  max-height: none;
  margin-top: 7px;
  display: grid;
  grid-auto-rows: 24px;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
}

.property-strip-list .player-meta {
  align-self: center;
  justify-self: center;
  margin: 12px 0 0;
  color: color-mix(in srgb, var(--muted), transparent 6%);
}

.mini-deed {
  height: 24px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #151915;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mini-deed.group-railway,
.mini-deed.group-dark_blue,
.mini-deed.group-brown,
.mini-deed.group-green,
.mini-deed.group-red,
.mini-deed.group-pink {
  color: #fff5df;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.58);
}

.mini-buildings {
  position: absolute;
  right: 4px;
  top: 2px;
  display: flex;
  gap: 1px;
}

.mini-house,
.mini-hotel {
  width: 12px;
  height: 12px;
  object-fit: contain;
  transform: rotate(90deg) scale(1.15);
}

.board-area {
  position: relative;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(180px, 15vw, 220px);
  gap: 10px;
  align-items: center;
}

.board-stage {
  align-self: center;
  justify-self: center;
  width: min(100%, calc(100vh - 78px));
  max-width: 100%;
  max-height: calc(100vh - 78px);
  border: 12px solid #1d2923;
  border-radius: 26px;
  box-shadow: var(--board-shadow);
  background: #d5e5d7;
}

.board-stage::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 30px;
  background: linear-gradient(145deg, #7d5230, #3f2415 58%, #8b6339);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.34);
}

.board-image {
  filter: saturate(1.07) contrast(1.03);
}

.owner-pill {
  border: 1px solid rgba(255, 255, 255, 0.46);
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.54);
}

.buildings {
  gap: 1px;
}

.building {
  transform: rotate(90deg) scale(3);
  transform-origin: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.building.hotel {
  transform: rotate(90deg) scale(3);
}

.token {
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.38));
}

.token-ground-shadow {
  opacity: 0.62 !important;
}

.play-controls {
  align-self: center;
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 9px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.96), rgba(233, 217, 180, 0.92));
  box-shadow: var(--panel-shadow);
}

body[data-theme="dark"] .play-controls {
  background:
    linear-gradient(180deg, rgba(43, 57, 50, 0.97), rgba(28, 40, 35, 0.94));
}

.turn-card {
  display: grid;
  gap: 8px;
}

.turn-name {
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.28));
  font-size: 19px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-theme="dark"] .turn-name {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
}

.dice-button {
  width: 100%;
  min-width: 0;
  min-height: 128px;
  border-radius: 21px;
  display: grid;
  gap: 9px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, #fff2ca, #d7b263);
  border: 1px solid rgba(83, 58, 20, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 26px rgba(41, 32, 16, 0.2);
}

.dice-button:hover:not(:disabled),
.dice-button:focus-visible:not(:disabled) {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.74), transparent 38%),
    linear-gradient(180deg, #fff2ca, #d7b263);
}

body[data-theme="dark"] .dice-button {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(180deg, #3f554b, #293930);
}

.dice-row {
  gap: 12px;
}

.die {
  width: 62px;
  height: 62px;
  border-radius: 15px;
}

.pip {
  width: 8px;
  height: 8px;
}

#primaryLabel {
  font-size: 20px;
  font-weight: 950;
}

.turn-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.turn-shortcuts button,
.context-actions button {
  min-height: 38px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 950;
}

.context-actions {
  display: grid;
  gap: 7px;
  align-content: start;
}

.context-actions:not(:empty)::before {
  content: "Actions";
  font-size: 11px;
}

.modal::backdrop {
  background:
    radial-gradient(circle at 50% 42%, rgba(251, 238, 191, 0.18), transparent 28%),
    rgba(8, 22, 16, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  border-radius: 26px;
  border: 1px solid rgba(255, 248, 232, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.98), rgba(231, 216, 179, 0.97));
  box-shadow: 0 32px 92px rgba(0, 0, 0, 0.44);
}

body[data-theme="dark"] .modal-card {
  background:
    linear-gradient(180deg, rgba(48, 62, 55, 0.99), rgba(27, 39, 34, 0.99));
}

.setup-modal .modal-card,
.trade-modal .modal-card,
.wide-modal .modal-card,
.auction-modal .modal-card {
  max-height: min(92vh, 820px);
}

.setup-toolbar,
.setup-online,
.setup-row,
.trade-partner-card,
.trade-column,
.manage-list,
.manage-detail,
.auction-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28));
  border-color: rgba(43, 52, 47, 0.14);
}

body[data-theme="dark"] .setup-toolbar,
body[data-theme="dark"] .setup-online,
body[data-theme="dark"] .setup-row,
body[data-theme="dark"] .trade-partner-card,
body[data-theme="dark"] .trade-column,
body[data-theme="dark"] .manage-list,
body[data-theme="dark"] .manage-detail,
body[data-theme="dark"] .auction-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 248, 232, 0.12);
}

.trade-body {
  gap: 14px;
}

.trade-partner-card {
  padding: 12px;
}

.trade-partner-card select,
.trade-input-row input,
.setup-modal input,
.sound-slider {
  border-radius: 12px;
}

.trade-columns {
  gap: 14px;
}

.trade-column {
  height: min(68vh, 620px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.trade-column-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(43, 52, 47, 0.12);
}

body[data-theme="dark"] .trade-column-head {
  border-bottom-color: rgba(255, 248, 232, 0.1);
}

.check-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-auto-rows: 78px;
  gap: 7px;
  padding-right: 2px;
}

.trade-property-row {
  min-height: 78px;
  height: 78px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(28, 35, 31, 0.08);
}

.trade-deed-thumb {
  width: 48px;
  height: 62px;
}

.manage-layout {
  gap: 14px;
}

.manage-list {
  padding: 10px;
}

.manage-detail {
  padding: 14px;
}

.manage-row {
  border-radius: 12px;
}

.manage-detail .deed-image,
.property-modal .deed-image,
.auction-deed-image {
  max-height: min(54vh, 460px);
  object-fit: contain;
}

.auction-layout {
  gap: 16px;
}

.auction-board {
  gap: 7px;
}

.auction-bid-row {
  min-height: 46px;
  border-radius: 14px;
}

.alert-modal.card-viewer .modal-card {
  background: transparent;
  box-shadow: none;
}

.alert-modal.card-viewer .card-flip {
  width: min(780px, 88vw);
  max-height: 88vh;
}

@media (max-width: 1280px) {
  body {
    min-width: 1120px;
  }

  .app-shell {
    grid-template-columns: 390px minmax(0, 1fr);
  }

  .players-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .player-token-small {
    width: 38px;
    height: 38px;
  }

  .player-name-button,
  .cash {
    font-size: 14px;
  }

  .board-area {
    grid-template-columns: minmax(0, 1fr) 184px;
  }

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

  .play-controls {
    padding: 9px;
  }

  .dice-button {
    min-height: 116px;
  }

  .die {
    width: 56px;
    height: 56px;
  }
}

/* Final table card tuning */
.turn-name,
.dice-button,
.turn-shortcuts,
.context-actions {
  grid-area: auto;
}

.turn-card {
  grid-template-rows: auto auto;
}

.player-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.player-identity {
  gap: 6px;
}

.player-token-small {
  width: 28px;
  height: 28px;
}

.player-name-button {
  font-size: 13.5px;
}

.cash {
  justify-self: end;
  margin-top: 0;
  font-size: 13.5px;
}

.property-strip-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 21px;
  gap: 4px;
}

.mini-deed {
  height: 21px;
  min-height: 21px;
  padding: 0 5px;
  font-size: 8.8px;
}

.mini-buildings {
  right: 2px;
  top: 1px;
}

.mini-house,
.mini-hotel {
  width: 9px;
  height: 9px;
}

@media (max-width: 1280px) {
  .player-token-small {
    width: 28px;
    height: 28px;
  }

  .property-strip-list {
    grid-auto-rows: 20px;
  }

  .mini-deed {
    height: 20px;
    min-height: 20px;
    font-size: 8.4px;
  }
}

/* Requested gameplay surface refinements */
.app-header {
  height: 46px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .app-header {
  background: transparent;
}

.game-screen {
  grid-template-rows: 46px minmax(0, 1fr);
}

.app-menu summary,
.icon-toggle {
  box-shadow: 0 8px 18px rgba(12, 23, 18, 0.18);
}

.player-card.inactive,
body[data-theme="dark"] .player-card.inactive {
  opacity: 1;
  filter: none;
}

.player-card.inactive .player-token-small {
  opacity: 1;
}

.property-strip-list {
  grid-template-columns: 1fr;
  grid-auto-rows: 22px;
  gap: 4px;
}

.mini-deed,
body[data-theme="dark"] .mini-deed,
.mini-deed.group-railway,
.mini-deed.group-dark_blue,
.mini-deed.group-brown,
.mini-deed.group-green,
.mini-deed.group-red,
.mini-deed.group-pink,
body[data-theme="dark"] .mini-deed:not(.group-railway) {
  color: #101410;
  text-shadow: none;
}

.mini-deed.group-railway {
  background-color: #d8d4c8 !important;
}

.mini-deed.group-utility {
  background-color: #dce6e9 !important;
}

.mini-deed.group-dark_blue {
  background-color: #aebff4 !important;
}

.mini-deed.group-brown {
  background-color: #cfa077 !important;
}

.mini-deed.group-green {
  background-color: #9fd3ad !important;
}

.mini-deed.group-red {
  background-color: #efaaa5 !important;
}

.mini-deed.group-pink {
  background-color: #e7a4c9 !important;
}

.buildings {
  gap: 0;
  overflow: visible;
}

.buildings .building,
.buildings:has(.building:nth-child(2):last-child) .building:first-child,
.buildings:has(.building:nth-child(2):last-child) .building:last-child,
.buildings:has(.building:nth-child(3):last-child) .building:nth-child(1),
.buildings:has(.building:nth-child(3):last-child) .building:nth-child(3),
.buildings:has(.building:nth-child(4):last-child) .building:nth-child(1),
.buildings:has(.building:nth-child(4):last-child) .building:nth-child(2),
.buildings:has(.building:nth-child(4):last-child) .building:nth-child(3),
.buildings:has(.building:nth-child(4):last-child) .building:nth-child(4) {
  width: 25px;
  height: 25px;
  flex: 0 0 9px;
  max-width: none;
  object-fit: contain;
  transform: rotate(90deg);
  transform-origin: center;
}

.buildings .building.hotel {
  width: 30px;
  height: 30px;
  flex-basis: 18px;
}

.alert-modal.card-viewer {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  inset: 0;
  display: grid;
  place-items: center;
  transform: none;
}

.alert-modal.card-viewer .card-flip {
  width: min(420px, 78vw);
  max-height: 78vh;
}

.alert-modal.card-viewer .card-face {
  max-height: 78vh;
}

.alert-modal.card-viewer.title-deed-viewer {
  width: 100vw;
}

.alert-modal.card-viewer.title-deed-viewer .card-flip {
  width: min(300px, 68vw);
  max-height: 72vh;
}

.alert-modal.card-viewer.title-deed-viewer .card-face {
  max-height: 72vh;
}

@media (max-width: 1280px) {
  .property-strip-list {
    grid-auto-rows: 22px;
  }

  .mini-deed {
    height: 22px;
    min-height: 22px;
    font-size: 9px;
  }
}

/* Trade card grid rebuild */
.trade-partner-card {
  display: grid;
  grid-template-columns: 1fr;
  padding: 10px;
}

.trade-partner-card select {
  width: 100%;
}

.trade-analysis {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(28, 35, 31, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.trade-analysis strong {
  font-size: 13.5px;
}

.trade-analysis.accepted {
  border-color: rgba(21, 148, 95, 0.34);
  background: rgba(186, 237, 204, 0.58);
}

.trade-analysis.rejected {
  border-color: rgba(198, 40, 40, 0.28);
  background: rgba(255, 220, 214, 0.58);
}

body[data-theme="dark"] .trade-analysis {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f4f6ed;
}

body[data-theme="dark"] .trade-analysis.accepted {
  background: rgba(21, 148, 95, 0.22);
}

body[data-theme="dark"] .trade-analysis.rejected {
  background: rgba(198, 40, 40, 0.22);
}

.trade-column {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.trade-input-row {
  grid-template-columns: 1fr;
}

.trade-column .check-list {
  min-height: 0;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  grid-auto-rows: minmax(170px, auto);
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
}

.trade-card-option {
  position: relative;
  min-width: 0;
  min-height: 170px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(28, 35, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(12, 23, 18, 0.1);
  cursor: pointer;
}

body[data-theme="dark"] .trade-card-option {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.2);
}

.trade-card-image {
  width: 100%;
  height: 154px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  user-select: none;
}

.trade-card-check {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.trade-checkmark {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(18, 26, 22, 0.72);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.trade-card-check:checked + .trade-checkmark {
  border-color: #c62828;
  background: #d7282f;
}

.trade-card-check:checked + .trade-checkmark::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 13px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.trade-card-option:has(.trade-card-check:checked) {
  border-color: rgba(198, 40, 40, 0.65);
  box-shadow:
    0 0 0 2px rgba(198, 40, 40, 0.18),
    0 10px 24px rgba(12, 23, 18, 0.16);
}

.trade-empty {
  grid-column: 1 / -1;
  align-self: start;
  margin: 0;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

body[data-theme="dark"] .dice-button:hover:not(:disabled),
body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(180deg, #3f554b, #293930);
}

/* Readability and tabletop layout refresh */
:root {
  --brand-gold: #f2d36b;
  --brand-gold-dark: #b98124;
  --felt-a: #23383c;
  --felt-b: #2f5556;
  --felt-c: #3e6b63;
  --panel-light: rgba(246, 248, 240, 0.94);
  --panel-light-strong: rgba(252, 253, 247, 0.98);
  --panel-line: rgba(29, 40, 39, 0.16);
}

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(242, 211, 107, 0.18), transparent 26%),
    radial-gradient(circle at 86% 16%, rgba(102, 162, 150, 0.16), transparent 30%),
    linear-gradient(145deg, #1c3034, var(--felt-b) 48%, #203a39);
}

body[data-theme="dark"] {
  --ink: #f4f6ed;
  --muted: #d3d8cc;
  --panel-line: rgba(230, 236, 226, 0.18);
  background:
    radial-gradient(circle at 12% 10%, rgba(242, 211, 107, 0.12), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(95, 162, 154, 0.1), transparent 30%),
    linear-gradient(145deg, #11181d, #1d2b31 46%, #172327);
}

.home-panel,
.players-rail,
.play-controls,
.modal-card {
  background:
    linear-gradient(180deg, var(--panel-light-strong), var(--panel-light));
}

body[data-theme="dark"] .home-panel,
body[data-theme="dark"] .players-rail,
body[data-theme="dark"] .play-controls,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .trade-column,
body[data-theme="dark"] .manage-list,
body[data-theme="dark"] .manage-detail,
body[data-theme="dark"] .auction-panel {
  background:
    linear-gradient(180deg, rgba(42, 52, 57, 0.98), rgba(28, 37, 42, 0.98));
  color: #f4f6ed;
  border-color: var(--panel-line);
}

.home-panel h1,
.app-header h1,
body[data-theme="dark"] .app-header h1 {
  color: var(--brand-gold);
  text-shadow:
    0 2px 0 #7d2a22,
    0 8px 20px rgba(0, 0, 0, 0.28);
}

.app-header h1 {
  font-size: 31px;
}

.home-copy {
  color: #243532;
}

body[data-theme="dark"] .home-copy {
  color: #e7ecdf;
}

body[data-theme="dark"] .player-card {
  background:
    linear-gradient(180deg, rgba(55, 67, 72, 0.98), rgba(37, 47, 52, 0.96));
}

.player-name-button,
.cash {
  font-size: 15.5px;
}

.player-meta {
  font-size: 12px;
}

.mini-deed {
  min-height: 24px;
  height: 24px;
  font-size: 10.5px;
}

.modal-card,
.trade-column,
.manage-detail,
.manage-list,
.auction-panel {
  font-size: 15px;
}

.trade-money,
.trade-list-head,
.setup-toolbar label,
.setup-row label {
  font-size: 13px;
}

.app-shell {
  grid-template-columns: clamp(410px, 29vw, 520px) minmax(0, 1fr);
}

.board-area {
  --chat-width: clamp(220px, 18vw, 310px);
  grid-template-columns: minmax(0, 1fr) var(--chat-width);
  align-items: stretch;
  position: relative;
}

.board-area::after {
  content: "Chat\A reserved for online play";
  white-space: pre-line;
  grid-column: 2;
  align-self: stretch;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(242, 211, 107, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(243, 247, 240, 0.12), rgba(243, 247, 240, 0.06));
  color: rgba(244, 246, 237, 0.68);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body:not([data-theme="dark"]) .board-area::after {
  background:
    linear-gradient(180deg, rgba(248, 250, 244, 0.76), rgba(235, 240, 230, 0.48));
  color: rgba(28, 43, 42, 0.56);
  border-color: rgba(28, 43, 42, 0.12);
}

.board-stage {
  grid-column: 1;
  align-self: center;
  width: min(100%, calc(100vh - 70px));
}

.play-controls {
  position: absolute;
  z-index: 8;
  left: calc((100% - var(--chat-width)) / 2);
  top: 50%;
  width: clamp(220px, 16vw, 285px);
  height: auto;
  transform: translate(-50%, -50%);
  padding: 12px;
  border: 1px solid rgba(242, 211, 107, 0.26);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(249, 251, 242, 0.68), rgba(232, 238, 228, 0.48));
  box-shadow: 0 18px 44px rgba(8, 17, 17, 0.24);
  backdrop-filter: blur(9px) saturate(1.15);
}

body[data-theme="dark"] .play-controls {
  background:
    linear-gradient(180deg, rgba(33, 43, 48, 0.72), rgba(20, 30, 35, 0.56));
  border-color: rgba(242, 211, 107, 0.24);
}

.turn-name {
  min-height: 42px;
  font-size: 21px;
}

.dice-button {
  min-height: 142px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.62), transparent 38%),
    linear-gradient(180deg, rgba(255, 241, 194, 0.82), rgba(206, 166, 76, 0.72));
}

.dice-button:hover:not(:disabled),
.dice-button:focus-visible:not(:disabled) {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, rgba(255, 241, 194, 0.86), rgba(206, 166, 76, 0.78));
}

body[data-theme="dark"] .dice-button,
body[data-theme="dark"] .dice-button:hover:not(:disabled),
body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(58, 74, 76, 0.86), rgba(31, 43, 48, 0.78));
}

.trade-column {
  position: relative;
  border-left: 10px solid var(--token) !important;
  box-shadow:
    inset 6px 0 0 color-mix(in srgb, var(--token), transparent 62%),
    0 14px 34px rgba(12, 23, 18, 0.12);
}

.trade-column-head {
  border-top: 5px solid var(--token);
  border-radius: 14px 14px 0 0;
  padding-top: 8px;
}

.trade-card-check:checked + .trade-checkmark {
  border-color: #19704f;
  background: #fff;
}

.trade-card-check:checked + .trade-checkmark::after {
  border-color: #15945f;
}

.trade-card-option:has(.trade-card-check:checked) {
  border-color: rgba(21, 148, 95, 0.64);
  box-shadow:
    0 0 0 2px rgba(21, 148, 95, 0.16),
    0 10px 24px rgba(12, 23, 18, 0.16);
}

.embedded-card.card-flip {
  width: min(320px, 100%);
  max-width: 100%;
  margin: 0 auto 14px;
  cursor: grab;
}

.embedded-card.card-flip .card-face {
  max-height: 58vh;
  border-radius: 10px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.2));
}

.property-modal .embedded-card.deed-image,
.manage-detail .embedded-card.deed-image {
  width: min(310px, 100%);
}

.auction-layout .embedded-card.auction-deed-image {
  width: min(300px, 100%);
  align-self: center;
}

.alert-body .embedded-card.alert-card-image {
  width: min(360px, 100%);
}

.manage-card-slot {
  display: grid;
  place-items: center;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 390px minmax(0, 1fr);
  }

  .board-area {
    --chat-width: 210px;
  }

  .play-controls {
    width: 210px;
  }

  .dice-button {
    min-height: 128px;
  }
}

/* Compact board overlay and home dark-mode cleanup */
body[data-theme="dark"] .home-kicker {
  color: #fff;
}

body[data-theme="dark"] .home-actions button:disabled {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.board-area {
  --chat-width: clamp(280px, 22vw, 390px);
}

.play-controls {
  width: clamp(176px, 13vw, 220px);
  padding: 10px;
  gap: 7px;
  border: 1px solid rgba(242, 211, 107, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(247, 250, 240, 0.54), rgba(231, 238, 229, 0.34));
  box-shadow: 0 12px 28px rgba(8, 17, 17, 0.16);
  backdrop-filter: blur(5px) saturate(1.05);
}

body[data-theme="dark"] .play-controls {
  background:
    linear-gradient(180deg, rgba(30, 39, 43, 0.58), rgba(18, 28, 33, 0.42));
  border-color: rgba(242, 211, 107, 0.18);
}

.turn-card {
  gap: 5px;
}

.turn-name {
  min-height: 30px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  color: var(--ink);
}

body[data-theme="dark"] .turn-name {
  background: transparent;
  color: #fff;
}

.dice-button,
.dice-button:hover:not(:disabled),
.dice-button:focus-visible:not(:disabled),
body[data-theme="dark"] .dice-button,
body[data-theme="dark"] .dice-button:hover:not(:disabled),
body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
  min-height: 78px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dice-row {
  gap: 10px;
}

.die {
  width: 50px;
  height: 50px;
  border-radius: 13px;
}

.pip {
  width: 7px;
  height: 7px;
}

#primaryLabel {
  font-size: 17px;
}

.turn-shortcuts {
  gap: 6px;
}

.turn-shortcuts button,
.context-actions button {
  min-height: 31px;
  border-radius: 11px;
  font-size: 12px;
}

.context-actions {
  gap: 6px;
}

.context-actions:not(:empty)::before {
  display: none;
}

.board-area::after {
  padding: 20px;
  font-size: 16px;
}

@media (max-width: 1280px) {
  .board-area {
    --chat-width: 250px;
  }

  .play-controls {
    width: 180px;
  }

  .dice-button,
  .dice-button:hover:not(:disabled),
  .dice-button:focus-visible:not(:disabled),
  body[data-theme="dark"] .dice-button,
  body[data-theme="dark"] .dice-button:hover:not(:disabled),
  body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
    min-height: 74px;
  }

  .die {
    width: 48px;
    height: 48px;
  }
}

/* Focused tabletop cleanup: lighter controls, wider chat, stable manage/trade cards */
.app-menu summary {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.app-menu summary::before {
  content: none;
}

.board-area {
  --chat-width: clamp(360px, 29vw, 520px);
  grid-template-columns: minmax(0, 1fr) var(--chat-width);
  justify-items: stretch;
  gap: 10px;
}

.board-area::after {
  justify-self: stretch;
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 243, 229, 0.62));
  box-shadow:
    0 8px 24px rgba(18, 31, 27, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .board-area::after {
  background:
    linear-gradient(180deg, rgba(49, 61, 66, 0.94), rgba(32, 43, 49, 0.92));
  color: rgba(244, 246, 237, 0.72);
}

.play-controls {
  width: clamp(230px, 17vw, 300px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  backdrop-filter: none;
  filter:
    drop-shadow(0 15px 28px rgba(7, 15, 15, 0.34))
    drop-shadow(0 2px 3px rgba(255, 255, 255, 0.16));
}

body[data-theme="dark"] .play-controls {
  border-color: rgba(242, 211, 107, 0.28);
  background: rgba(18, 28, 33, 0.34);
}

.turn-name {
  color: #12221e;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 14px rgba(255, 255, 255, 0.42);
}

body[data-theme="dark"] .turn-name {
  color: #fff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.72),
    0 0 16px rgba(242, 211, 107, 0.14);
}

.dice-button,
.dice-button:hover:not(:disabled),
.dice-button:focus-visible:not(:disabled),
body[data-theme="dark"] .dice-button,
body[data-theme="dark"] .dice-button:hover:not(:disabled),
body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
  min-height: 74px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
}

body[data-theme="dark"] .dice-button,
body[data-theme="dark"] .dice-button:hover:not(:disabled),
body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
  background: transparent;
}

.turn-shortcuts button,
.context-actions button {
  box-shadow: 0 7px 18px rgba(7, 15, 15, 0.2);
}

.token-layer {
  pointer-events: auto;
}

.token {
  pointer-events: none;
  cursor: default;
}

.token-ground-shadow {
  pointer-events: none;
}

.trade-column-head {
  border-top: 0 !important;
  border-radius: 0;
  padding-top: 0;
}

.trade-card-option.mortgaged::after,
.manage-row.mortgaged::after {
  content: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.trade-card-option.mortgaged .trade-checkmark,
.trade-card-option.mortgaged input {
  z-index: 3;
}

.manage-layout {
  align-items: stretch;
}

.manage-list {
  align-content: start;
}

.manage-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  text-align: left;
  overflow: hidden;
  border-left: 8px solid var(--group);
}

.manage-row:hover:not(:disabled),
.manage-row:focus:not(:disabled),
.manage-row:active:not(:disabled) {
  border-color: var(--line) !important;
  border-left-color: var(--group) !important;
  background: var(--button-bg) !important;
  transform: translateY(-1px) scale(1.006);
  box-shadow: none !important;
}

.manage-row.selected {
  border-color: var(--line) !important;
  border-left-color: var(--group) !important;
  background: var(--button-bg) !important;
  box-shadow: none !important;
  transform: none;
}

.manage-row.selected:hover:not(:disabled),
.manage-row.selected:focus:not(:disabled),
.manage-row.selected:active:not(:disabled) {
  border-color: var(--line) !important;
  border-left-color: var(--group) !important;
  background: var(--button-bg) !important;
  box-shadow: none !important;
  transform: translateY(-1px) scale(1.006);
}

.manage-row > * {
  position: relative;
  z-index: 2;
}

.manage-row.mortgaged {
  background:
    linear-gradient(180deg, #9ca29e, #858c88);
  color: #151a17;
}

body[data-theme="dark"] .manage-row.mortgaged {
  background:
    linear-gradient(180deg, #767e7a, #606965);
  color: #f4f6ed;
}

.manage-row.mortgaged:hover:not(:disabled),
.manage-row.mortgaged:focus:not(:disabled),
.manage-row.mortgaged:active:not(:disabled),
.manage-row.mortgaged.selected,
.manage-row.mortgaged.selected:hover:not(:disabled),
.manage-row.mortgaged.selected:focus:not(:disabled),
.manage-row.mortgaged.selected:active:not(:disabled) {
  background:
    linear-gradient(180deg, #9ca29e, #858c88) !important;
  border-color: var(--line) !important;
  border-left-color: var(--group) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .manage-row.mortgaged:hover:not(:disabled),
body[data-theme="dark"] .manage-row.mortgaged:focus:not(:disabled),
body[data-theme="dark"] .manage-row.mortgaged:active:not(:disabled),
body[data-theme="dark"] .manage-row.mortgaged.selected,
body[data-theme="dark"] .manage-row.mortgaged.selected:hover:not(:disabled),
body[data-theme="dark"] .manage-row.mortgaged.selected:focus:not(:disabled),
body[data-theme="dark"] .manage-row.mortgaged.selected:active:not(:disabled) {
  background:
    linear-gradient(180deg, #767e7a, #606965) !important;
}

.manage-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.manage-row .mini-buildings {
  position: static;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

.manage-detail {
  min-height: 560px;
}

.manage-wallet {
  justify-self: center;
  width: auto;
  margin: 0 auto 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--good);
  font-weight: 950;
  font-size: 20px;
  text-align: center;
}

body[data-theme="dark"] .manage-wallet {
  background: transparent;
  color: #8fe3b0;
}

.manage-card-slot {
  min-height: 430px;
}

.manage-detail .card-flip:hover,
.manage-detail .card-flip:focus,
.manage-detail .card-flip:focus-visible,
.manage-detail .card-flip:active {
  box-shadow: none;
  transform: none;
}

.card-flip.no-entry-flip .card-flip-inner {
  animation: none;
  transform: rotateY(180deg) scale(1);
}

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

.auction-wallet,
.auction-bid-cash {
  color: var(--muted);
  font-weight: 850;
}

.auction-wallet {
  margin-top: -8px;
  font-size: 18px;
  color: var(--good);
}

.player-card.bankrupt {
  filter: grayscale(0.75);
  opacity: 0.62;
}

.player-bankrupt-label {
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 1px dashed rgba(160, 39, 39, 0.42);
  border-radius: 10px;
  color: var(--danger);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cash-delta {
  position: fixed;
  z-index: 250;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  font-weight: 950;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 7px 16px rgba(18, 31, 27, 0.24);
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(calc(-50% + var(--cash-float-x, 0px)), 0, 0);
  animation: cashFloat 3000ms linear forwards;
}

.cash-delta.gain {
  color: var(--good);
}

.cash-delta.loss {
  color: var(--danger);
}

@keyframes cashFloat {
  0% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--cash-float-x, 0px)), 0, 0);
  }
  10% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--cash-float-x, 0px)), var(--cash-float-y, -34px), 0);
  }
}

@media (max-width: 1280px) {
  .board-area {
    --chat-width: 340px;
  }

  .play-controls {
    width: 170px;
  }
}

/* Mobile-only table layout. Desktop rules above remain untouched. */
@media (max-width: 820px), (max-height: 520px) and (pointer: coarse) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    min-width: 0;
    height: 100dvh;
    display: block;
    touch-action: manipulation;
    background:
      radial-gradient(circle at 18% 8%, rgba(242, 211, 107, 0.2), transparent 30%),
      linear-gradient(145deg, #1d3336, #2f5556 52%, #203a39);
  }

  body[data-theme="dark"] {
    background:
      radial-gradient(circle at 18% 8%, rgba(242, 211, 107, 0.12), transparent 30%),
      linear-gradient(145deg, #11191d, #1d2c31 52%, #172327);
  }

  button {
    min-height: 36px;
    padding: 7px 10px;
  }

  .home-screen {
    min-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    display: grid;
    place-items: center;
  }

  .home-board {
    right: auto;
    left: 50%;
    top: 50%;
    width: min(118vw, 680px);
    opacity: 0.24;
    transform: translate(-50%, -50%) rotate(-8deg);
  }

  .home-card,
  .home-token {
    opacity: 0.55;
  }

  .home-panel {
    width: min(100%, 430px);
    margin: 0;
    border-radius: 22px;
  }

  .home-panel h1 {
    font-size: clamp(40px, 14vw, 64px);
  }

  .home-copy,
  .home-room {
    font-size: 13px;
  }

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

  .game-screen {
    width: 100dvw;
    height: 100dvh;
    grid-template-rows: 40px minmax(0, 1fr);
    gap: 6px;
    padding: max(5px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .app-header {
    height: 40px;
    min-height: 40px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
  }

  .app-header h1 {
    min-width: 0;
    font-size: 22px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    gap: 5px;
  }

  .app-menu summary,
  .icon-toggle {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .app-menu summary::before {
    font-size: 19px;
  }

  .menu-panel {
    min-width: 164px;
    max-width: calc(100dvw - 18px);
    max-height: calc(100dvh - 58px);
    overflow: auto;
  }

  .sound-popover {
    right: 0;
  }

  .app-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 84px minmax(0, 1fr);
    gap: 6px;
    padding: 0;
    overflow: hidden;
  }

  .players-rail {
    min-width: 0;
    height: 100%;
    padding: 5px;
    border-radius: 14px;
    border: 1px solid rgba(255, 248, 232, 0.24);
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(8, 18, 16, 0.22);
  }

  .players-list {
    height: 100%;
    min-height: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 4px;
    padding: 0;
    overflow: hidden;
  }

  .player-card {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 1fr;
    padding: 4px;
    border-radius: 10px;
    border-left-width: 4px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(8, 18, 16, 0.14);
  }

  .player-card.current {
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--token), white 15%),
      0 0 0 2px color-mix(in srgb, var(--token), transparent 58%),
      0 6px 14px rgba(8, 18, 16, 0.22);
  }

  .player-summary-button {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    border-bottom: 0 !important;
    display: grid;
    align-content: center;
    gap: 1px;
  }

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

  .player-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 4px;
    align-items: center;
  }

  .player-token-small {
    width: 22px;
    height: 22px;
  }

  .player-name-button {
    font-size: clamp(9px, 2.75vw, 11px);
    line-height: 1.05;
  }

  .cash {
    justify-self: start;
    padding-left: 26px;
    font-size: clamp(9px, 2.8vw, 11px);
    line-height: 1;
  }

  .player-meta {
    display: none;
  }

  .property-strip-list {
    display: none;
  }

  .board-area {
    --chat-width: 0px;
    position: relative;
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    place-items: center;
    gap: 0;
    overflow: hidden;
  }

  .board-area::after {
    display: none;
    content: none;
  }

  .board-stage {
    grid-column: 1;
    place-self: center;
    width: min(calc(100dvw - 14px), calc(100dvh - 154px));
    height: auto;
    max-width: calc(100dvw - 14px);
    max-height: calc(100dvh - 154px);
    border-width: 5px;
    border-radius: 15px;
    box-shadow:
      0 0 0 2px rgba(255, 248, 232, 0.24),
      0 14px 32px rgba(0, 0, 0, 0.34);
    overflow: visible;
    z-index: 1;
    transform: none;
  }

  .board-stage::before {
    inset: -5px;
    border-radius: 18px;
  }

  .board-image {
    border-radius: 10px;
  }

  .ownership-layer,
  .hotspot-layer {
    overflow: hidden;
    border-radius: 10px;
  }

  .token-layer {
    z-index: 30;
    overflow: visible;
  }

  .owner-pill {
    min-height: 8px;
    padding: 0 2px;
    font-size: clamp(4px, 1.65vw, 7px);
  }

  .buildings {
    gap: 0;
  }

  .buildings .building,
  .buildings:has(.building:nth-child(2):last-child) .building:first-child,
  .buildings:has(.building:nth-child(2):last-child) .building:last-child,
  .buildings:has(.building:nth-child(3):last-child) .building:nth-child(1),
  .buildings:has(.building:nth-child(3):last-child) .building:nth-child(3),
  .buildings:has(.building:nth-child(4):last-child) .building:nth-child(1),
  .buildings:has(.building:nth-child(4):last-child) .building:nth-child(2),
  .buildings:has(.building:nth-child(4):last-child) .building:nth-child(3),
  .buildings:has(.building:nth-child(4):last-child) .building:nth-child(4) {
    width: 12px;
    height: 12px;
    flex-basis: 4px;
    transform: rotate(90deg);
  }

  .buildings .building.hotel {
    width: 16px;
    height: 16px;
    flex-basis: 9px;
  }

  .token,
  .token-ground-shadow {
    width: clamp(24px, 7.6%, 36px);
    height: clamp(24px, 7.6%, 36px);
  }

  .play-controls {
    position: absolute;
    z-index: 22;
    left: 50%;
    right: auto;
    top: auto;
    bottom: max(2px, env(safe-area-inset-bottom));
    width: min(326px, calc(100dvw - 22px));
    height: auto;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "turn turn"
      "dice shortcuts"
      "context context";
    gap: 5px 7px;
    padding: 6px;
    border-radius: 15px;
    background: rgba(255, 249, 232, 0.72);
    border: 1px solid rgba(255, 248, 232, 0.48);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
  }

  body[data-theme="dark"] .play-controls {
    background: rgba(24, 35, 40, 0.72);
  }

  .turn-card {
    display: contents;
  }

  .turn-name {
    grid-area: turn;
    min-height: 22px;
    padding: 2px 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    line-height: 1.05;
  }

  .dice-button,
  .dice-button:hover:not(:disabled),
  .dice-button:focus-visible:not(:disabled),
  body[data-theme="dark"] .dice-button,
  body[data-theme="dark"] .dice-button:hover:not(:disabled),
  body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
    grid-area: dice;
    min-width: 0;
    min-height: 52px;
    display: grid;
    gap: 1px;
    padding: 2px 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .dice-row {
    gap: 7px;
  }

  .die {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border-width: 2px;
  }

  .pip {
    width: 5px;
    height: 5px;
  }

  .pip.tl { left: 5px; top: 5px; }
  .pip.tc { top: 5px; }
  .pip.tr { right: 5px; top: 5px; }
  .pip.ml { left: 5px; }
  .pip.mr { right: 5px; }
  .pip.bl { left: 5px; bottom: 5px; }
  .pip.bc { bottom: 5px; }
  .pip.br { right: 5px; bottom: 5px; }

  .die.blank::after {
    left: 8px;
    right: 8px;
    top: 13px;
    height: 3px;
  }

  #primaryLabel {
    font-size: 12px;
    line-height: 1;
  }

  .turn-shortcuts {
    grid-area: shortcuts;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-self: center;
  }

  .turn-shortcuts button,
  .context-actions button {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 11px;
  }

  .context-actions {
    grid-area: context;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    gap: 4px;
    max-height: 64px;
    overflow: hidden;
  }

  .context-actions:not(:empty)::before {
    display: none;
  }

  .cash-delta {
    font-size: 14px;
  }

  .modal,
  .wide-modal,
  .trade-modal,
  .auction-modal,
  .setup-modal {
    width: calc(100dvw - 12px);
    max-width: none;
    max-height: calc(100dvh - 12px);
  }

  .modal-card {
    max-height: calc(100dvh - 12px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
  }

  .modal-head {
    flex: 0 0 auto;
    gap: 8px;
    padding: 10px;
  }

  .modal h2 {
    font-size: 16px;
  }

  .modal-head p {
    font-size: 12px;
  }

  .alert-body,
  .property-body,
  .history-list,
  .rules-list,
  .player-modal-body,
  .trade-body,
  .auction-body {
    min-height: 0;
    padding: 10px;
    overflow: auto;
  }

  .modal-actions {
    flex: 0 0 auto;
    padding: 8px 10px 10px;
    gap: 6px;
  }

  .setup-toolbar,
  .setup-online,
  .setup-row,
  .manage-layout,
  .auction-layout,
  .trade-columns {
    grid-template-columns: 1fr !important;
  }

  .setup-toolbar {
    display: grid;
    padding: 10px 10px 0;
  }

  .setup-grid {
    padding: 10px;
    overflow: auto;
  }

  .setup-row {
    gap: 8px;
  }

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

  .manage-layout {
    min-height: 0;
    gap: 8px;
    padding: 10px;
    overflow: auto;
  }

  .manage-list {
    max-height: 25dvh;
  }

  .manage-detail {
    min-height: 0;
  }

  .manage-card-slot {
    min-height: 210px;
  }

  .manage-detail .embedded-card.card-flip,
  .manage-detail .deed-image {
    width: min(210px, 70vw);
    max-height: 34dvh;
  }

  .manage-actions {
    justify-content: center;
  }

  .trade-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 8px;
  }

  .trade-modal .modal-card {
    height: calc(100dvh - 12px);
  }

  .trade-modal .modal-actions {
    position: relative;
    z-index: 2;
    background: inherit;
  }

  .trade-column {
    min-height: 0;
    padding: 9px;
  }

  .trade-column .check-list {
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    grid-auto-rows: minmax(122px, auto);
    max-height: 28dvh;
    gap: 7px;
  }

  .trade-card-option {
    min-height: 122px;
    padding: 6px;
    border-radius: 11px;
  }

  .trade-card-image {
    height: 108px;
  }

  .trade-card-check,
  .trade-checkmark {
    width: 22px;
    height: 22px;
  }

  .trade-card-check:checked + .trade-checkmark::after {
    left: 6px;
    top: 2px;
  }

  .auction-layout {
    gap: 9px;
  }

  .auction-deed-image,
  .auction-layout .embedded-card.auction-deed-image {
    width: min(220px, 62vw);
    max-height: 32dvh;
    justify-self: center;
  }

  .auction-bid-row {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .auction-entry {
    gap: 5px;
  }

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

  .alert-modal.card-viewer .card-flip,
  .alert-body .embedded-card.alert-card-image {
    width: min(330px, 82vw);
    max-height: 72dvh;
  }

  .alert-modal.card-viewer.title-deed-viewer .card-flip,
  .property-modal .embedded-card.deed-image {
    width: min(250px, 70vw);
    max-height: 68dvh;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .app-shell,
  body[data-player-count="1"] .app-shell,
  body[data-player-count="2"] .app-shell,
  body[data-player-count="3"] .app-shell,
  body[data-player-count="4"] .app-shell {
    grid-template-rows: 68px minmax(0, 1fr);
  }

  .players-rail,
  body[data-player-count="1"] .players-rail,
  body[data-player-count="2"] .players-rail,
  body[data-player-count="3"] .players-rail,
  body[data-player-count="4"] .players-rail {
    padding: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .players-rail::-webkit-scrollbar,
  .players-list::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .players-list,
  .players-list[data-player-count="1"],
  .players-list[data-player-count="2"],
  .players-list[data-player-count="3"],
  .players-list[data-player-count="4"] {
    display: grid !important;
    grid-auto-flow: column;
    grid-template-columns: none !important;
    grid-template-rows: 1fr !important;
    grid-auto-rows: 1fr;
    grid-auto-columns: calc((100% - 15px) / 4);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .players-list[data-player-count="1"] {
    grid-auto-columns: 100%;
  }

  .players-list[data-player-count="2"] {
    grid-auto-columns: calc((100% - 5px) / 2);
  }

  .players-list[data-player-count="3"] {
    grid-auto-columns: calc((100% - 10px) / 3);
  }

  .player-card {
    scroll-snap-align: start;
    padding: 5px;
  }

  .player-summary-button {
    min-height: 54px;
    align-content: center;
    gap: 2px;
  }

  .player-identity {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px;
  }

  .player-token-small {
    width: 24px;
    height: 24px;
  }

  .player-name-button {
    font-size: clamp(10px, 2.75vw, 12px);
  }

  .cash {
    padding-left: 28px;
    font-size: clamp(10px, 2.75vw, 12px);
    line-height: 1.1;
  }

  .board-area {
    padding-bottom: 152px;
  }

  .play-controls {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(5px, env(safe-area-inset-bottom));
    width: min(340px, calc(100dvw - 16px));
    transform: translateX(-50%);
  }

  .board-stage {
    width: min(calc(100dvw - 14px), calc(100dvh - 252px));
    max-height: calc(100dvh - 252px);
    transform: none;
  }

  body[data-player-count="1"] .board-stage,
  body[data-player-count="2"] .board-stage,
  body[data-player-count="3"] .board-stage,
  body[data-player-count="4"] .board-stage {
    width: min(calc(100dvw - 14px), calc(100dvh - 252px));
    max-height: calc(100dvh - 252px);
  }

  .auction-modal {
    width: calc(100dvw - 10px);
    max-height: calc(100dvh - 10px);
  }

  .auction-modal .modal-card {
    height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
    overflow: hidden;
  }

  .auction-modal .modal-head {
    padding: 8px 10px;
  }

  .auction-modal .modal-head p {
    margin-top: 2px;
  }

  .auction-modal .auction-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
    display: grid;
  }

  .auction-modal .auction-layout,
  .auction-modal .auction-result {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 7px;
    align-items: stretch;
  }

  .auction-modal .auction-deed-image,
  .auction-modal .auction-layout .embedded-card.auction-deed-image {
    width: min(142px, 38vw);
    max-height: 24dvh;
    justify-self: center;
  }

  .auction-modal .auction-deed-image .card-face,
  .auction-modal .auction-layout .embedded-card.auction-deed-image .card-face {
    max-height: 24dvh;
  }

  .auction-modal .auction-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    overflow: hidden;
    padding: 8px;
  }

  .auction-modal .auction-current {
    font-size: 12px;
    line-height: 1.15;
  }

  .auction-modal .auction-wallet {
    font-size: 12px;
  }

  .auction-modal .auction-bid-list {
    min-height: 0;
    overflow: auto;
    gap: 5px;
    padding-right: 1px;
  }

  .auction-modal .auction-bid-row {
    min-height: 29px;
    padding: 5px 7px;
    border-radius: 9px;
    font-size: 11px;
    gap: 6px;
  }

  .auction-modal .auction-entry {
    min-height: 0;
  }

  .auction-modal .auction-entry input {
    min-height: 32px;
  }

  .auction-modal .modal-actions {
    flex: 0 0 auto;
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
    gap: 7px;
  }

  .auction-modal .modal-actions button {
    min-height: 34px;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  .game-screen {
    --mobile-player-rail: clamp(112px, 18vw, 150px);
    --mobile-control-rail: clamp(124px, 18vw, 160px);
  }

  .game-screen {
    grid-template-rows: 36px minmax(0, 1fr);
    gap: 5px;
  }

  .app-header {
    height: 36px;
    min-height: 36px;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .app-menu summary,
  .icon-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .app-shell {
    grid-template-columns: var(--mobile-player-rail) minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 5px;
  }

  .players-rail {
    padding: 4px;
  }

  .players-list {
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(8, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  .players-list::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .player-card {
    padding: 3px 5px;
    border-radius: 8px;
    grid-template-rows: 1fr;
    border-left-width: 4px;
  }

  .player-summary-button {
    align-content: center;
    height: 100%;
    min-height: 0;
    gap: 1px;
  }

  .player-identity {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
  }

  .player-token-small {
    width: 20px;
    height: 20px;
  }

  .player-name-button,
  .cash {
    font-size: clamp(9px, 1.75vw, 11px);
    line-height: 1.05;
  }

  .cash {
    padding-left: 24px;
  }

  .property-strip-list {
    display: none;
  }

  .board-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--mobile-control-rail);
    grid-template-rows: 1fr;
    gap: 6px;
    padding: 0;
    place-items: stretch;
    overflow: hidden;
  }

  .board-stage {
    grid-column: 1;
    place-self: center;
    width: min(calc(100dvh - 50px), calc(100dvw - var(--mobile-player-rail) - var(--mobile-control-rail) - 28px));
    max-width: min(calc(100dvh - 50px), calc(100dvw - var(--mobile-player-rail) - var(--mobile-control-rail) - 28px));
    max-height: calc(100dvh - 50px);
    transform: none;
  }

  .play-controls {
    position: static;
    grid-column: 2;
    place-self: center stretch;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    transform: none;
    grid-template-columns: 1fr;
    grid-template-areas:
      "turn"
      "dice"
      "shortcuts"
      "context";
    gap: 5px;
    padding: 6px;
  }

  .turn-name {
    min-height: 19px;
    font-size: 12px;
  }

  .dice-button,
  .dice-button:hover:not(:disabled),
  .dice-button:focus-visible:not(:disabled),
  body[data-theme="dark"] .dice-button,
  body[data-theme="dark"] .dice-button:hover:not(:disabled),
  body[data-theme="dark"] .dice-button:focus-visible:not(:disabled) {
    min-height: 42px;
  }

  .die {
    width: 27px;
    height: 27px;
    border-radius: 7px;
  }

  .turn-shortcuts {
    grid-template-columns: 1fr 1fr;
  }

  .turn-shortcuts button,
  .context-actions button {
    min-height: 25px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .context-actions {
    max-height: 54px;
  }

  .modal,
  .wide-modal,
  .trade-modal,
  .auction-modal,
  .setup-modal {
    width: calc(100dvw - 12px);
    max-height: calc(100dvh - 8px);
  }

  .modal-card,
  .setup-modal .modal-card,
  .trade-modal .modal-card,
  .wide-modal .modal-card,
  .auction-modal .modal-card {
    max-height: calc(100dvh - 8px);
  }

  .modal-head {
    padding: 7px 10px;
  }

  .modal h2 {
    font-size: 15px;
  }

  .alert-body,
  .property-body,
  .history-list,
  .rules-list,
  .player-modal-body,
  .trade-body,
  .auction-body {
    padding: 8px;
  }

  .modal-actions {
    padding: 6px 10px 8px;
  }

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

  .trade-column .check-list {
    max-height: calc(100dvh - 192px);
  }

  .manage-layout {
    grid-template-columns: minmax(180px, 250px) minmax(0, 1fr) !important;
    max-height: calc(100dvh - 74px);
  }

  .manage-list {
    max-height: none;
  }

  .manage-detail .embedded-card.card-flip,
  .manage-detail .deed-image {
    width: min(190px, 34dvw);
    max-height: calc(100dvh - 168px);
  }

  .auction-layout {
    grid-template-columns: minmax(180px, 250px) minmax(0, 1fr) !important;
  }

  .auction-deed-image,
  .auction-layout .embedded-card.auction-deed-image {
    width: min(190px, 34dvw);
    max-height: calc(100dvh - 140px);
  }

  .alert-modal.card-viewer .card-flip,
  .alert-body .embedded-card.alert-card-image {
    width: min(300px, 42dvw);
    max-height: 82dvh;
  }

  .alert-modal.card-viewer.title-deed-viewer .card-flip,
  .property-modal .embedded-card.deed-image {
    width: min(220px, 34dvw);
    max-height: 82dvh;
  }
}

.orientation-lock {
  display: none;
}

.home-kicker,
.home-panel h1,
.app-header h1,
body[data-theme="dark"] .app-header h1 {
  color: var(--brand-gold);
}

.home-panel h1,
.app-header h1,
body[data-theme="dark"] .app-header h1 {
  text-shadow:
    0 2px 0 rgba(255, 248, 232, 0.46),
    0 8px 20px rgba(0, 0, 0, 0.26);
}

.home-kicker {
  text-shadow: none;
}

.setup-toolbar,
body[data-theme="dark"] .setup-toolbar {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.home-actions button,
.home-actions .home-primary,
.home-actions button:disabled,
body[data-theme="dark"] .home-actions button,
body[data-theme="dark"] .home-actions .home-primary,
body[data-theme="dark"] .home-actions button:disabled {
  background:
    linear-gradient(180deg, rgba(255, 229, 132, 0.98), rgba(205, 145, 42, 0.96)) !important;
  border-color: rgba(255, 248, 232, 0.36) !important;
  color: #18231d !important;
  opacity: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 232, 0.46);
}

.home-actions button:hover:not(:disabled),
.home-actions button:focus-visible:not(:disabled),
body[data-theme="dark"] .home-actions button:hover:not(:disabled),
body[data-theme="dark"] .home-actions button:focus-visible:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 235, 149, 1), rgba(216, 153, 45, 0.98)) !important;
  color: #18231d !important;
}

.home-actions button:disabled,
body[data-theme="dark"] .home-actions button:disabled {
  cursor: not-allowed;
  filter: saturate(0.82) brightness(0.92);
}

.board-area::after,
body[data-theme="dark"] .board-area::after {
  content: none !important;
  display: none !important;
}

.room-chat {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(242, 211, 107, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(49, 61, 66, 0.94), rgba(32, 43, 49, 0.92));
  color: rgba(244, 246, 237, 0.9);
  box-shadow:
    0 8px 24px rgba(18, 31, 27, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.room-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 248, 232, 0.12);
}

.room-chat-head div {
  display: grid;
  gap: 2px;
}

.room-chat-head span {
  color: rgba(244, 246, 237, 0.66);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-chat-head strong {
  color: var(--brand-gold);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.room-chat-head button,
.chat-form button {
  min-height: 36px;
  border-radius: 12px;
}

.chat-messages {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 3px;
}

.chat-message {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.chat-message strong {
  color: #f2d36b;
  font-size: 12px;
}

.chat-message span {
  color: rgba(255, 248, 232, 0.88);
  overflow-wrap: anywhere;
}

.chat-message.system {
  background: rgba(242, 211, 107, 0.08);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 248, 232, 0.12);
}

.chat-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 12px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.92);
  color: #17211d;
}

@media (max-width: 820px) {
  .setup-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .setup-seat-summary {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .setup-row,
  .setup-seat-ai {
    grid-template-columns: 58px minmax(0, 1fr) auto !important;
    gap: 7px;
    padding: 8px;
  }

  .setup-seat-note {
    grid-column: auto;
  }

  .setup-token-select {
    grid-column: 2 / -1;
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .setup-name-input {
    grid-column: 2;
  }

  .setup-token-preview {
    width: 32px;
    height: 32px;
  }

  .setup-seat-actions {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
  }

  .setup-remove {
    width: auto;
    min-height: 36px;
  }
}

@media (max-width: 820px) and (orientation: landscape) and (pointer: coarse), (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  html,
  body {
    overflow: hidden;
  }

  .orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    background:
      radial-gradient(circle at 50% 35%, rgba(242, 211, 107, 0.18), transparent 32%),
      linear-gradient(145deg, #173136, #2c5454 54%, #14282c);
    color: #fff8e8;
    text-align: center;
  }

  body[data-theme="dark"] .orientation-lock {
    background:
      radial-gradient(circle at 50% 35%, rgba(242, 211, 107, 0.13), transparent 32%),
      linear-gradient(145deg, #11191d, #1d2c31 54%, #10181c);
  }

  .orientation-lock-card {
    width: min(360px, 86vw);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 22px;
    border: 1px solid rgba(255, 248, 232, 0.28);
    border-radius: 24px;
    background: rgba(255, 248, 232, 0.12);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
  }

  .orientation-lock-phone {
    position: relative;
    width: 58px;
    height: 86px;
    border: 4px solid #f2d36b;
    border-radius: 15px;
    box-shadow: inset 0 0 0 2px rgba(255, 248, 232, 0.18);
  }

  .orientation-lock-phone::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 18px;
    height: 4px;
    border-radius: 999px;
    background: #f2d36b;
    transform: translateX(-50%);
  }

  .orientation-lock h2 {
    margin: 0;
    color: #f2d36b;
    font-size: clamp(24px, 7vw, 34px);
    letter-spacing: 0;
  }

  .orientation-lock p {
    max-width: 24ch;
    margin: 0;
    color: rgba(255, 248, 232, 0.88);
    font-size: 15px;
    line-height: 1.35;
  }
}
