:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d7d0c3;
  --accent: #b91c1c;
  --accent-2: #1d4ed8;
  --good: #047857;
  --danger: #b42318;
  --brown: #7b4a2f;
  --lightBlue: #9bd3ea;
  --pink: #c03a92;
  --orange: #df7b31;
  --red: #c93638;
  --yellow: #e6c84f;
  --green: #2f9c62;
  --darkBlue: #253f8f;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.78), rgba(244, 241, 234, 0.2)),
    repeating-linear-gradient(90deg, rgba(123, 74, 47, 0.035) 0 1px, transparent 1px 38px),
    var(--bg);
  overflow: hidden;
}

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

button {
  border: 1px solid #111827;
  background: #111827;
  color: white;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

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

button.primary-roll {
  background: var(--good);
  border-color: var(--good);
  color: white;
}

button.danger-outline {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

h1,
h2,
p,
dl,
ol {
  margin: 0;
}

.hidden {
  display: none !important;
}

#app {
  min-height: 100vh;
}

.setup {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1fr);
  gap: 0;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(63, 48, 29, 0.16);
  overflow: auto;
}

.setup-art {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.65) 0 0.1%, transparent 34%),
    linear-gradient(145deg, #f8ecd2, #d9c39d);
  border-right: 1px solid var(--line);
}

.setup-art::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 2px solid rgba(31, 41, 51, 0.12);
  border-radius: 16px;
  transform: rotate(-2deg);
}

.setup-art::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 260px;
  height: 260px;
  border: 28px solid rgba(31, 41, 51, 0.08);
  border-radius: 50%;
}

.setup-board-edge {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(31, 41, 51, 0.18);
  background: rgba(255, 253, 248, 0.55);
  transform: rotate(-2deg);
}

.setup-board-edge span {
  min-height: 52px;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(31, 41, 51, 0.16);
  color: rgba(31, 41, 51, 0.68);
  font-size: 13px;
  font-weight: 900;
}

.setup-board-edge span:last-child {
  border-right: 0;
}

.setup-deed-card {
  position: absolute;
  left: 48px;
  bottom: 92px;
  width: 190px;
  min-height: 238px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 12px solid #1f2933;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(31, 41, 51, 0.24);
  padding: 0 16px 18px;
  transform: rotate(-9deg);
}

.setup-deed-card .deed-band {
  height: 40px;
  margin: 0 -16px 8px;
  background: var(--darkBlue);
}

.setup-deed-card strong {
  font-size: 32px;
  line-height: 1;
}

.setup-deed-card small {
  color: var(--muted);
  font-weight: 800;
}

.setup-deed-card em {
  align-self: end;
  margin-top: 44px;
  color: var(--accent);
  font-size: 28px;
  font-style: normal;
  font-weight: 950;
}

.setup-dice {
  position: absolute;
  right: 54px;
  top: 132px;
}

.setup-dice span {
  width: 82px;
  height: 82px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: #111827;
  color: white;
  box-shadow: 0 16px 26px rgba(17, 24, 39, 0.24);
  font-size: 38px;
  font-weight: 950;
}

.setup-dice span:first-child {
  transform: rotate(8deg);
}

.setup-dice span:last-child {
  margin-left: -18px;
  background: white;
  color: #111827;
  transform: translateY(70px) rotate(-8deg);
}

.setup-money-stack {
  position: absolute;
  right: 42px;
  bottom: 92px;
  display: grid;
  gap: 9px;
  transform: rotate(6deg);
}

.setup-money-stack span {
  width: 142px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(4, 120, 87, 0.28);
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--good);
  box-shadow: 0 10px 20px rgba(4, 120, 87, 0.12);
  font-weight: 950;
}

.setup-color-strip {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 34px;
  height: 12px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.setup-color-strip span {
  border-radius: 999px;
  background: var(--strip-color);
}

.setup-form {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 4vw, 46px);
}

.setup-copy {
  display: grid;
  gap: 9px;
}

.setup-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.setup h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.setup p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.setup label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.setup-actions {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.setup-actions button {
  min-height: 52px;
  font-size: 16px;
  font-weight: 950;
}

.game {
  position: relative;
  height: 100dvh;
  padding: 6px;
  display: grid;
  grid-template-areas:
    "sidebar"
    "board"
    "players";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  overflow: hidden;
}

.control-sidebar {
  grid-area: sidebar;
  position: static;
  z-index: 1;
  width: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(8px);
  padding: 12px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
  overflow: hidden;
}

.game-hud {
  min-height: 0;
}

.game-hud h1 {
  font-size: 18px;
}

.game-hud p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.sidebar-footer {
  display: grid;
  gap: 8px;
}

.sidebar-footer button {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
}

.player-strip {
  grid-area: players;
  position: static;
  z-index: 1;
  display: flex;
  gap: 8px;
  min-width: 0;
  max-height: 82px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px;
  pointer-events: auto;
  scrollbar-width: thin;
}

.player-pill {
  flex: 0 0 min(220px, 46vw);
  position: relative;
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(8px);
  color: var(--ink);
  text-align: left;
  padding: 7px 10px 7px 12px;
  box-shadow: inset 4px 0 0 var(--player-color);
  pointer-events: auto;
  transition:
    flex-basis 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.player-pill.active {
  --active-player-stroke: rgba(245, 158, 11, 0.82);
  --active-player-glow-core: rgba(245, 158, 11, 0.26);
  --active-player-glow-mid: rgba(245, 158, 11, 0.18);
  --active-player-glow-tail: rgba(245, 158, 11, 0.10);
  z-index: 2;
  flex-basis: min(238px, 50vw);
  min-height: 58px;
  transform: scale(1.025);
  border-color: var(--active-player-stroke);
  background: rgba(255, 253, 248, 0.98);
  box-shadow:
    inset 8px 0 0 var(--player-color),
    0 0 0 2px var(--active-player-stroke),
    0 0 4px var(--active-player-glow-core),
    0 0 7px var(--active-player-glow-mid),
    0 0 10px var(--active-player-glow-tail),
    0 10px 20px rgba(17, 24, 39, 0.12);
}

.player-pill.bankrupt {
  opacity: 0.5;
}

.player-pill-head,
.player-pill-meta,
.player-assets-list {
  grid-column: 1 / -1;
}

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

.player-name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.player-name-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 999px;
  background: color-mix(in srgb, var(--player-color) 14%, white);
  color: var(--player-color);
  padding: 0 7px;
  font-weight: 900;
  line-height: 1.35;
  vertical-align: baseline;
}

.player-pill strong {
  justify-self: end;
}

.player-pill small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-assets-list {
  display: none;
  gap: 4px;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(215, 208, 195, 0.75);
}

.player-empty-assets {
  color: var(--muted);
  font-size: 11px;
}

.player-asset-chip {
  min-height: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  border: 1px solid rgba(215, 208, 195, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  padding: 3px 6px;
  text-align: left;
}

.player-asset-chip:hover {
  border-color: #111827;
  background: white;
}

.player-asset-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--asset-color, #64748b);
}

.player-asset-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}

.player-asset-chip em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.player-asset-chip.mortgaged {
  opacity: 0.68;
}

.player-asset-chip[data-group="brown"] {
  --asset-color: var(--brown);
}

.player-asset-chip[data-group="lightBlue"] {
  --asset-color: var(--lightBlue);
}

.player-asset-chip[data-group="pink"] {
  --asset-color: var(--pink);
}

.player-asset-chip[data-group="orange"] {
  --asset-color: var(--orange);
}

.player-asset-chip[data-group="red"] {
  --asset-color: var(--red);
}

.player-asset-chip[data-group="yellow"] {
  --asset-color: var(--yellow);
}

.player-asset-chip[data-group="green"] {
  --asset-color: var(--green);
}

.player-asset-chip[data-group="darkBlue"] {
  --asset-color: var(--darkBlue);
}

.player-asset-chip[data-kind="station"] {
  --asset-color: #475569;
}

.player-asset-chip[data-kind="utility"] {
  --asset-color: #0f766e;
}

.player-color-dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--player-color);
  margin-right: 6px;
}

.board-wrap {
  grid-area: board;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  container-type: size;
}

.board {
  width: min(100%, calc(100dvh - 20px));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1.34fr repeat(9, 1fr) 1.34fr;
  grid-template-rows: 1.34fr repeat(9, 1fr) 1.34fr;
  gap: 2px;
  padding: 2px;
  background: #1f2933;
  border: 6px solid #111827;
}

@supports (width: 100cqh) {
  .board {
    width: min(100cqw, 100cqh);
  }
}

.space {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: hidden;
  background: #f8fafc;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 18px 4px 4px;
  text-align: center;
}

.space.mortgaged-space {
  opacity: 0.72;
}

.space.current-space {
  z-index: 3;
  overflow: visible;
}

.space.selected-space {
  --selected-space-outline: #0f766e;
  --selected-space-shadow: rgba(15, 118, 110, 0.28);
  z-index: 4;
  outline: 3px solid var(--selected-space-outline);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--selected-space-shadow), 0 8px 18px rgba(17, 24, 39, 0.18);
}

.space strong {
  font-size: 11px;
  line-height: 1.1;
}

.space small {
  font-size: 9px;
  line-height: 1.1;
  color: var(--muted);
}

.space-index {
  position: absolute;
  top: 5px;
  left: 8px;
  z-index: 2;
  color: var(--band-ink, rgba(17, 24, 39, 0.76));
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
  text-shadow: var(--band-index-shadow, 0 1px 1px rgba(255, 255, 255, 0.55));
}

.owner-badge {
  justify-self: center;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-badge {
  border-radius: 999px;
  background: var(--owner-color);
  color: white;
  padding: 1px 6px;
  font-size: 9px;
  line-height: 1.35;
  font-weight: 800;
}

.building-marks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.building-marks i {
  width: 12px;
  height: 13px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  background: var(--owner-color);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.75);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.hotel-mark i {
  width: 28px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, var(--owner-color), #0f766e);
  font-size: 9px;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--owner-color) 38%, transparent), 0 3px 7px rgba(17, 24, 39, 0.24);
}

.color-band {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 16px;
  background: var(--group-color, #ddd);
}

.space[data-group="brown"] {
  --group-color: var(--brown);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.35);
}

.space[data-group="lightBlue"] {
  --group-color: var(--lightBlue);
  --band-ink: rgba(17, 24, 39, 0.76);
  --band-index-shadow: 0 1px 1px rgba(255, 255, 255, 0.55);
}

.space[data-group="pink"] {
  --group-color: var(--pink);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.35);
}

.space[data-group="orange"] {
  --group-color: var(--orange);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.28);
}

.space[data-group="red"] {
  --group-color: var(--red);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.35);
}

.space[data-group="yellow"] {
  --group-color: var(--yellow);
  --band-ink: rgba(17, 24, 39, 0.76);
  --band-index-shadow: 0 1px 1px rgba(255, 255, 255, 0.55);
}

.space[data-group="green"] {
  --group-color: var(--green);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.35);
}

.space[data-group="darkBlue"] {
  --group-color: var(--darkBlue);
  --band-ink: rgba(255, 255, 255, 0.92);
  --band-index-shadow: 0 1px 1px rgba(17, 24, 39, 0.35);
}

.space-go,
.space-jail,
.space-freeParking,
.space-goToJail {
  background: #dff4e5;
}

.space-chance {
  background: #fff4dc;
}

.space-chest {
  background: #e6f1ff;
}

.space-tax {
  background: #fff0f0;
}

.space-station,
.space-utility {
  background: #f3f4f6;
}

.tokens {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  z-index: 4;
}

.token {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--player-color, var(--accent-2));
  border: 2px solid white;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.25);
}

.active-token {
  --active-token-stroke: rgba(245, 158, 11, 0.82);
  --active-token-glow-core: rgba(245, 158, 11, 0.34);
  --active-token-glow-mid: rgba(245, 158, 11, 0.20);
  --active-token-glow-tail: rgba(245, 158, 11, 0.10);
  width: 26px;
  height: 26px;
  z-index: 2;
  border-color: var(--active-token-stroke);
  font-size: 12px;
  box-shadow: 0 0 4px var(--active-token-glow-core), 0 0 6px var(--active-token-glow-mid), 0 0 8px var(--active-token-glow-tail);
  transform: translateY(-2px);
}

.moving-token {
  animation: token-hop 0.18s ease-in-out infinite alternate;
}

@keyframes token-hop {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

.board-center {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #cfeedd;
  padding: 18px;
  overflow: hidden;
}

.deck-row {
  display: flex;
  gap: 12px;
}

.deck-row span {
  min-width: 112px;
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(31, 41, 51, 0.35);
  color: rgba(31, 41, 51, 0.7);
  font-weight: 700;
}

.center-card {
  width: min(560px, 94%);
  max-height: 96%;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(17, 24, 39, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.18);
  padding: 14px;
  overflow: auto;
}

.turn-card {
  box-shadow: inset 5px 0 0 var(--player-color), 0 18px 34px rgba(17, 24, 39, 0.18);
}

.turn-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.center-card h2 {
  font-size: 24px;
  line-height: 1.1;
}

.turn-card h2 .player-name-chip {
  font-size: 24px;
  line-height: 1.15;
  padding: 1px 9px;
}

.center-card p,
.center-card dd,
.center-card dt,
.center-card span {
  font-size: 13px;
}

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

.turn-stats span,
.rent-grid span,
.event-toast,
.turn-guide,
.notice {
  border-radius: 6px;
  background: #f3f4f6;
  padding: 7px 8px;
}

.turn-guide {
  display: grid;
  gap: 3px;
  border-left: 4px solid var(--accent);
  background: #fff7ed;
}

.turn-guide strong {
  font-size: 14px;
}

.turn-guide span {
  color: var(--ink);
}

.notice {
  color: var(--danger);
  font-weight: 800;
}

.event-toast {
  display: grid;
  gap: 2px;
  border-left: 4px solid var(--accent-2);
}

.event-toast strong {
  font-size: 13px;
}

.action-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(260px, calc(100vw - 16px));
  display: none;
  border-radius: 7px;
  background: #111827;
  color: white;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.28);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
}

.action-tooltip.visible {
  display: block;
}

.action-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #111827;
  transform: translateX(-50%) rotate(45deg);
}

.action-tooltip[data-placement="top"]::after {
  bottom: -4px;
}

.action-tooltip[data-placement="bottom"]::after {
  top: -4px;
}

.tone-pay,
.tone-error,
.tone-debt,
.tone-danger,
.tone-jail {
  border-left-color: var(--danger);
}

.tone-collect,
.tone-buy,
.tone-build {
  border-left-color: var(--good);
}

.main-actions button {
  min-width: 88px;
}

.turn-actions {
  align-items: center;
}

.turn-actions button {
  min-width: 78px;
  white-space: nowrap;
}

.deed-facts {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 10px;
}

.deed-facts dt {
  color: var(--muted);
}

.deed-facts dd {
  font-weight: 800;
}

.deed-owner-inline {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) minmax(72px, 96px) auto;
  gap: 5px;
  align-items: center;
  max-width: 100%;
}

.deed-owner-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deed-owner-inline select {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
}

.deed-owner-inline button {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
}

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

.owner-control label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}

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

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

.auction-status span {
  border-radius: 6px;
  background: #f3f4f6;
  padding: 7px 8px;
  font-weight: 800;
}

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

.auction-player-pill {
  border: 1px solid color-mix(in srgb, var(--player-color) 36%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--player-color) 10%, white);
  color: var(--ink);
  padding: 5px 8px;
}

.auction-player-pill.current {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--player-color) 34%, transparent);
}

.auction-player-pill.high {
  background: color-mix(in srgb, var(--player-color) 18%, white);
}

.auction-player-pill strong,
.auction-player-pill small {
  font-size: 12px;
}

.auction-player-pill strong {
  color: var(--player-color);
}

.auction-quick-bids {
  display: grid;
  grid-template-columns: repeat(3, minmax(46px, 1fr));
  gap: 6px;
}

.auction-quick-bids button {
  min-width: 0;
}

.card-reel {
  min-height: 148px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 52%, #f8fafc 100%);
  overflow: hidden;
  padding: 12px;
}

.card-reel.rolling,
.card-reel.revealed {
  position: relative;
  padding: 0;
}

.reel-window {
  position: relative;
  width: 100%;
  height: 148px;
  overflow: hidden;
}

.reel-window::before,
.reel-window::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
  height: 46px;
  pointer-events: none;
}

.reel-window::before {
  top: 0;
  background: linear-gradient(180deg, #fffdf8 0%, rgba(255, 253, 248, 0) 100%);
}

.reel-window::after {
  bottom: 0;
  background: linear-gradient(0deg, #f8fafc 0%, rgba(248, 250, 252, 0) 100%);
}

.reel-track {
  display: grid;
  gap: 8px;
  padding: 52px 10px 12px;
  animation: card-reel-settle 1.72s cubic-bezier(0.08, 0.76, 0.1, 1) forwards;
  will-change: transform;
}

.reel-track span {
  height: 44px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(215, 208, 195, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 7px 10px;
  color: rgba(31, 41, 51, 0.72);
  line-height: 1.25;
  transform-origin: center;
}

.reel-track .target-preview {
  border-color: rgba(185, 28, 28, 0.42);
  background: #fff7ed;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.12);
}

.card-reel.revealed .reel-track {
  animation: none;
  transform: translateY(var(--reel-travel));
  opacity: 0.28;
  filter: blur(1px);
}

.card-reel.revealed .target-preview {
  transform: scale(1.03);
}

.reel-focus {
  position: absolute;
  top: 50%;
  right: 10px;
  left: 10px;
  z-index: 3;
  height: 42px;
  border: 2px solid rgba(185, 28, 28, 0.44);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 8px 20px rgba(17, 24, 39, 0.1);
  transform: translateY(-50%);
  pointer-events: none;
  animation: reel-focus-pulse 1.72s ease-out forwards;
}

.revealed-card {
  position: absolute;
  top: 18px;
  right: 12px;
  bottom: 18px;
  left: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 2px solid rgba(185, 28, 28, 0.35);
  border-radius: 8px;
  background: linear-gradient(160deg, #fff7ed 0%, #ffffff 58%, #fef2f2 100%);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
  animation: card-reveal-pop 0.34s cubic-bezier(0.16, 0.9, 0.24, 1.12) both;
}

.card-reel.revealed strong {
  font-size: 16px;
  line-height: 1.45;
}

@keyframes card-reel-settle {
  0% {
    transform: translateY(-14px);
  }
  28% {
    transform: translateY(calc(var(--reel-travel) * 0.42));
  }
  62% {
    transform: translateY(calc(var(--reel-travel) * 0.84));
  }
  86% {
    transform: translateY(calc(var(--reel-travel) * 0.985));
  }
  94% {
    transform: translateY(calc(var(--reel-travel) * 1.01));
  }
  100% {
    transform: translateY(var(--reel-travel));
  }
}

@keyframes reel-focus-pulse {
  0%,
  52% {
    opacity: 0.42;
    transform: translateY(-50%) scaleX(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes card-reveal-pop {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
  }
  72% {
    opacity: 1;
    transform: translateY(0) scale(1.025);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dice-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  width: 60%;
  height: 60%;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.dice-overlay.active {
  opacity: 1;
}

#diceBox {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 26px rgba(17, 24, 39, 0.28));
  pointer-events: none;
}

#diceBox canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

.dice-hidden {
  display: none !important;
}

.space-tooltip {
  position: fixed;
  z-index: 50;
  width: min(320px, calc(100vw - 16px));
  display: none;
  gap: 8px;
  border: 1px solid #111827;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.22);
  padding: 12px;
  pointer-events: none;
}

.space-tooltip.visible {
  display: grid;
}

.space-tooltip strong {
  font-size: 15px;
}

.space-tooltip > span,
.space-tooltip p,
.space-tooltip dt,
.space-tooltip dd {
  font-size: 12px;
}

.space-tooltip > span,
.space-tooltip dt {
  color: var(--muted);
}

.space-tooltip dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 5px 8px;
}

.space-tooltip dd {
  font-weight: 700;
}

.tooltip-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}

.tools-drawer {
  position: static;
  z-index: 2;
  width: 100%;
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.tool-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.manual-section {
  align-content: start;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.manual-section > summary.panel-heading {
  cursor: pointer;
  list-style: none;
}

.manual-section > summary.panel-heading::-webkit-details-marker {
  display: none;
}

.manual-section > summary.panel-heading::after {
  content: "展开";
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-section[open] > summary.panel-heading::after {
  content: "收起";
}

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

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

#manualReason {
  grid-column: 1 / -1;
}

.log-section {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

#log {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-left: 22px;
}

#log li {
  margin-bottom: 6px;
  font-size: 13px;
}

.log-player-name {
  display: inline-block;
  border-radius: 999px;
  background: color-mix(in srgb, var(--player-color) 14%, white);
  color: var(--player-color);
  padding: 0 5px;
  font-weight: 900;
  line-height: 1.35;
}

@media (max-width: 980px), (orientation: portrait) {
  body {
    overflow: hidden;
  }

  .game {
    height: 100dvh;
    overflow: hidden;
    padding: 6px;
  }

  .board-wrap {
    justify-content: center;
    overflow: hidden;
  }
}

@media (min-width: 1120px) and (orientation: landscape) {
  .game {
    padding: 10px;
    grid-template-areas:
      "sidebar board players"
      "sidebar board players";
    grid-template-columns: clamp(210px, 18vw, 280px) minmax(0, 1fr) clamp(180px, 16vw, 240px);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  .control-sidebar {
    align-self: stretch;
    height: 100%;
    min-height: 0;
  }

  .player-strip {
    align-self: stretch;
    max-height: none;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 4px;
  }

  .player-pill {
    flex: 0 0 auto;
    width: 100%;
    align-content: start;
  }

  .player-pill.active {
    flex-basis: auto;
    margin-block: 3px;
  }

  .player-assets-list {
    display: grid;
    max-height: 170px;
    overflow: auto;
    scrollbar-width: thin;
  }

  .manual-tools {
    grid-template-columns: 1fr;
  }

  #log {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .setup {
    max-height: none;
    grid-template-columns: 1fr;
    margin: 0;
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .setup-art {
    min-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .setup-board-edge {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .setup-board-edge span {
    min-height: 40px;
    font-size: 11px;
  }

  .setup-deed-card {
    left: 28px;
    bottom: 36px;
    width: 128px;
    min-height: 156px;
    border-width: 8px;
    padding: 0 10px 12px;
  }

  .setup-deed-card .deed-band {
    height: 28px;
    margin: 0 -10px 6px;
  }

  .setup-deed-card strong {
    font-size: 22px;
  }

  .setup-deed-card em {
    margin-top: 22px;
    font-size: 20px;
  }

  .setup-dice {
    right: 26px;
    top: 92px;
  }

  .setup-dice span {
    width: 56px;
    height: 56px;
    border-radius: 13px;
    font-size: 27px;
  }

  .setup-money-stack {
    right: 28px;
    bottom: 30px;
  }

  .setup-money-stack span {
    width: 96px;
    min-height: 30px;
    font-size: 12px;
  }

  .setup-color-strip {
    left: 28px;
    right: 28px;
    bottom: 16px;
    height: 8px;
  }

  .setup-actions,
  .turn-stats,
  .auction-form,
  .manual-tools {
    grid-template-columns: 1fr;
  }

  .player-pill {
    flex-basis: 158px;
    min-height: 48px;
    padding: 6px 8px;
  }

  .player-pill.active {
    flex-basis: 172px;
    min-height: 54px;
  }

  .player-pill small:last-child {
    display: none;
  }

  .center-card h2 {
    font-size: 21px;
  }
}
