:root {
  color-scheme: dark; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ecf3f7; background: #0b1018; font-synthesis: none;
  --panel: #17222f; --line: #314050; --muted: #a3b5c4; --accent: #c8f578;
  --clay: #ff947f; --sage: #c8f578; --gold: #ffdb84; --blue: #83deef; --purple: #c0abff; --pink: #ffa8d7;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 50% 45%, #1b2b39 0%, #0b1018 70%); min-height: 100dvh; }
button, input, select { font: inherit; }
button, a, input, select, summary, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { border: 1px solid transparent; border-radius: 10px; min-height: 44px; padding: 11px 18px; background: var(--accent); color: #1a2c0d; font-size: 13px; font-weight: 750; cursor: pointer; transition: background .18s, filter .18s, transform .18s, box-shadow .18s; }
/* Preserve each button’s background/text pairing when hovered. */
button:hover:enabled { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 5px 18px #0003; }
button:active:enabled { transform: translateY(1px); }
button:disabled { background: #2b3944; color: #98aab6; cursor: default; box-shadow: none; }
.secondary, .icon-button { background: #ffffff06; border-color: #ffffff14; color: #cbd8e2; }
.secondary:hover:enabled, .icon-button:hover:enabled { background: #ffffff12; box-shadow: none; }
.icon-button { padding: 4px; width: 40px; font-size: 23px; }
h1, h2, p { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.welcome { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
#room-form { width: min(100%, 360px); text-align: center; padding: 32px; border: 1px solid #ffffff12; border-radius: 24px; background: #14202bcc; box-shadow: 0 24px 80px #0003; animation: arrive .5s ease-out; }
#room-form h1 { font-size: 38px; font-weight: 850; letter-spacing: -2px; margin: 20px 0 6px; }
#room-form h1 span, .brand span { color: var(--accent); }
.intro { font-size: 12px; color: var(--muted); margin-bottom: 26px; }
.lobby-dice { display: flex; justify-content: center; gap: 10px; }
.lobby-dice span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; font-size: 40px; background: #e5e9f3; color: #1a2534; transform: rotate(-12deg); box-shadow: 0 4px #9cabc0; }
.lobby-dice span + span { background: var(--accent); box-shadow: 0 4px #829f50; transform: rotate(12deg) translateY(6px); }
label { display: block; text-align: left; font-size: 11px; font-weight: 650; margin: 16px 0 7px; }
label span { color: var(--muted); font-weight: 400; float: right; }
input, select { width: 100%; min-width: 0; padding: 12px; border: 1px solid #354653; background: #0c161f; border-radius: 8px; color: #f3f7fa; font-size: 12px; }
input::placeholder { color: #91a5b5; }
#code { text-transform: uppercase; letter-spacing: .5px; }#code::placeholder { text-transform: none; letter-spacing: 0; }
form button { width: 100%; margin-top: 24px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 12px 0 0; }
#game { min-height: 100dvh; display: flex; justify-content: center; align-items: center; padding: 20px; }
.game-shell { width: var(--board-size, min(80dvh, 720px)); max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.room-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 38px; }
.brand { color: #edf3f6; text-decoration: none; font-size: 22px; letter-spacing: -1px; font-weight: 850; }
.room-tools { display: flex; align-items: center; gap: 7px; }
.room-tools button { font-size: 10px; min-height: 36px; padding: 8px 11px; border-radius: 8px; }
.room-tools .icon-button { width: 36px; font-size: 20px; padding: 0; }
#connection { color: var(--accent); font-size: 9px; margin-right: 6px; }
.game-layout { width: 100%; }
.board { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); width: 100%; aspect-ratio: 1; container-type: inline-size; gap: 5px; padding: 9px; border: 1px solid #6e8a9566; border-radius: 24px; background: linear-gradient(145deg, #38505a, #1c303b 60%, #324852); box-shadow: 0 7px 0 #0b1b25, 0 9px 0 #49616b66, 0 24px 55px #0007, inset 0 1px #b7dae844; }
.group-0 { --district: #bca7f5; --tile-bg: #34374b; }
.group-1 { --district: #80d8e5; --tile-bg: #293f4b; }
.group-2 { --district: #f0a0c6; --tile-bg: #483847; }
.group-3 { --district: #f0cd80; --tile-bg: #494338; }
.tile { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: clamp(2px, .7cqw, 6px); gap: clamp(2px, .5cqw, 4px); border: 1px solid #ffffff12; border-radius: 8px; background: var(--tile-bg, #2b414b); text-align: center; cursor: pointer; box-shadow: 0 3px 0 #09151b99, inset 0 1px #ffffff0a; transition: transform .18s, background .18s, box-shadow .18s; }
.tile.property { border-top: clamp(4px, 1.1cqw, 9px) solid var(--district); }
.tile:hover { transform: translateY(-2px); filter: brightness(1.18); z-index: 2; }
.tile.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile.current-space { box-shadow: inset 0 0 0 1px #f0f9fe99, 0 0 12px #c8f57818; }
.tile strong { color: #f1f5f7; font-size: clamp(9px, 1.6cqw, 12px); font-weight: 650; line-height: 1.18; overflow-wrap: anywhere; }
.tile small { color: #c3d2dd; font-size: clamp(8px, 1.4cqw, 11px); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-symbol { color: #bed1d9; width: 3.8cqw; height: 3.8cqw; max-width: 30px; max-height: 30px; margin-bottom: .3cqw; flex-shrink: 0; }
.tile-symbol svg { width: 100%; height: 100%; display: block; }
.tile.property .tile-symbol { color: var(--district); }
.tile.start { background: #3c533c; --district: var(--accent); }.tile.start .tile-symbol { color: var(--accent); }
.tile.tax { background: #513c40; }.tile.tax .tile-symbol { color: var(--clay); }
.tile.rest { background: #2b434b; }
.tile .owner { position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--player-color); padding: 0; font-size: 0; }
.tokens { position: absolute; bottom: 4px; left: 3px; right: 3px; display: flex; justify-content: center; gap: 3px; pointer-events: none; }
.tile:has(.tokens:not(:empty)) { padding-bottom: 3.4cqw; }
.token { display: inline-grid; place-items: center; flex-shrink: 0; background: var(--player-color); color: #13202a; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 850; border: 2px solid #ffffff99; box-shadow: 0 3px 0 #0005, inset 0 2px 2px #ffffff66; }
.board .token { width: clamp(10px, 2.8cqw, 22px); height: clamp(10px, 2.8cqw, 22px); font-size: clamp(7px, 1.5cqw, 11px); border-width: 1px; }
.clay { --player-color: var(--clay); }.sage { --player-color: var(--sage); }.gold { --player-color: var(--gold); }.blue { --player-color: var(--blue); }.purple { --player-color: var(--purple); }.pink { --player-color: var(--pink); }
.board-center { grid-area: 2 / 2 / 6 / 6; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2cqw; border: 1px solid #91b7bf15; border-radius: 15px; background: radial-gradient(ellipse, #284b52, #1d373f 80%); background-image: radial-gradient(ellipse, #31545b44, #19323b99), repeating-linear-gradient(45deg, transparent, transparent 7px, #a4d7cf04 7px, #a4d7cf04 8px); box-shadow: inset 0 3px 16px #08151b44; }
.board-center .eyebrow { color: #b5d4ce; font-size: clamp(8px, 1.4cqw, 10px); letter-spacing: .35cqw; text-transform: uppercase; }
.board-center h2 { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(17px, 4.8cqw, 36px); font-weight: 750; line-height: 1.1; letter-spacing: -.15cqw; margin: 1.3cqw 0 3cqw; }
.board-center > p { display: none; }
.center-dice { display: flex; justify-content: center; gap: 2.4cqw; margin: 0 0 3cqw; perspective: 500px; }
.die { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 10cqw; height: 10cqw; padding: 1.8cqw; gap: .6cqw; border-radius: 1.8cqw; background: #f1f1e9; box-shadow: 0 .65cqw 0 #a8b9b5, 0 1.2cqw 1.4cqw #0004, inset 0 2px #fff; transform: rotate(-9deg); }
.die + .die { transform: rotate(9deg); background: var(--accent); box-shadow: 0 .65cqw 0 #8da959, 0 1.2cqw 1.4cqw #0004, inset 0 2px #e5ffb6; }
.pip { background: #253b3c; border-radius: 50%; box-shadow: inset 0 1px 2px #0007; }
.turn-panel { width: min(100%, 290px); }
#turn { font-size: clamp(10px, 1.8cqw, 13px); color: #c3d6d9; line-height: 1.5; margin: 0 0 2cqw; }
#actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
#actions button { flex: 1 1 100px; font-size: clamp(11px, 1.9cqw, 14px); box-shadow: 0 3px 0 #719044; }
#actions button + button { background: #3b5960; color: #edf4f4; box-shadow: 0 3px 0 #172e34; }
#actions button:disabled { box-shadow: none; }
.player-dock { display: flex; justify-content: center; gap: 7px; padding-top: 5px; }
.player { flex: 1; min-width: 0; max-width: 180px; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid #ffffff13; border-radius: 11px; background: #1a2832; }
.player .token { grid-row: span 2; }
.player > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; color: #bbccd6; text-align: left; }
.player strong { font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.player.active { border-color: #c8f57888; background: #2b3c2d; box-shadow: 0 0 18px #c8f5780c; }
dialog { width: min(420px, calc(100% - 28px)); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; background: #172731; border: 1px solid #637e8955; border-radius: 18px; color: #edf4f6; box-shadow: 0 30px 100px #0008; }
dialog[open] { animation: arrive .2s ease-out; }
dialog::backdrop { background: #071019b3; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dialog-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.5px; }
.property-details { font-size: 12px; line-height: 1.7; color: #becfd9; }
.development label { margin-top: 0; }.development-status { margin: 12px 0; font-size: 12px; color: var(--accent); }
.development-actions { display: flex; gap: 8px; }.development-actions button { flex: 1; font-size: 11px; padding: 10px; }
.development-actions button + button:enabled { background: #354d58; color: #eff4f8; }
.development details, .holdings { margin-top: 18px; }
summary { cursor: pointer; font-size: 11px; font-weight: 650; color: #c5d9df; }
.set { display: flex; flex-direction: column; gap: 5px; border-left: 3px solid transparent; padding: 2px 10px; margin-top: 16px; }
.set strong { font-size: 11px; }.set small { font-size: 10px; color: var(--muted); line-height: 1.5; }
.rent-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 11px; }
.rent-table caption { text-align: left; color: var(--muted); margin-bottom: 6px; }.rent-table th { text-align: left; font-weight: 400; }.rent-table td { text-align: right; }.rent-table th, .rent-table td { padding: 5px 0; border-bottom: 1px solid var(--line); }.rent-table .current-level { color: var(--accent); }
#log { list-style: none; padding: 0; margin: 10px 0 0; }#log li { color: #b0c4d1; font-size: 12px; line-height: 1.6; padding: 10px 0; border-bottom: 1px solid var(--line); }#log li:first-child { color: #f0f5fa; }
.buildings { position: absolute; top: -1cqw; left: 4px; font-size: clamp(7px, 1.2cqw, 10px); line-height: 1; letter-spacing: 1px; color: #152008; background: var(--accent); padding: 1px 2px; border-radius: 2px; }.buildings.hotel { color: #23131c; background: var(--pink); font-weight: 900; }
#notice:empty { display: none; }#notice { position: fixed; z-index: 20; bottom: 12px; left: 50%; transform: translateX(-50%); max-width: min(500px, calc(100% - 24px)); width: max-content; padding: 12px 18px; border: 1px solid #5a7581; border-radius: 8px; background: #263d49; color: #f2f4fc; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; box-shadow: 0 8px 30px #0008; margin: 0; }
.moving-token { position: fixed; top: 0; left: 0; z-index: 15; pointer-events: none; }
.rolling .die { animation: dice-roll .55s cubic-bezier(.2,.7,.3,1); }.rolling .die + .die { animation-name: dice-roll-second; }
@keyframes dice-roll { 0% { transform: translateY(-8px) rotate(-140deg) scale(.8); } 60% { transform: translateY(-13px) rotate(12deg); } 100% { transform: rotate(-9deg); } }
@keyframes dice-roll-second { 0% { transform: translateY(-10px) rotate(150deg) scale(.8); } 60% { transform: translateY(-17px) rotate(-12deg); } 100% { transform: rotate(9deg); } }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
[hidden] { display: none !important; }
@container (max-width: 530px) {
  .tile.property .tile-symbol { display: none; }.tile .owner { width: 5px; height: 5px; bottom: 3px; right: 3px; }
  .tile strong { font-size: 9px; }.tile small { font-size: 9px; }
  .board-center h2 { margin-bottom: 2cqw; }.center-dice { margin-bottom: 3cqw; }
  #actions { gap: 5px; }#actions button { padding: 8px 10px; }
}
@container (max-width: 370px) {
  .tile small { display: none; }.tile strong { font-size: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .tokens { gap: 1px; }.tile:has(.tokens:not(:empty)) { padding-bottom: 13px; }
  .tile-symbol { width: 18px; height: 18px; }.tile:has(.tokens:not(:empty)) .tile-symbol { display: none; }
  .board-center h2 { font-size: 17px; }.board-center .eyebrow { font-size: 8px; }
  #turn { font-size: 10px; line-height: 1.3; }#actions button { flex-basis: 70px; font-size: 10px; min-height: 36px; padding: 6px; }
}
@media (max-width: 620px) {
  #game { padding: 12px; }.game-shell { gap: 11px; }.brand { font-size: 19px; }.room-tools { gap: 4px; }.room-tools button { padding: 7px 8px; font-size: 9px; }.room-tools .icon-button { width: 30px; }#connection { font-size: 0; margin-right: 2px; }#connection::before { content: '●'; font-size: 8px; }
  .board { padding: 5px; gap: 3px; border-radius: 15px; }.tile { border-radius: 5px; }.board-center { border-radius: 9px; }
  .player-dock { gap: 5px; flex-wrap: wrap; }.player { padding: 7px 8px; min-width: calc(30% - 5px); column-gap: 6px; }.player .token { width: 20px; height: 20px; font-size: 9px; }.player > span:nth-child(2) { font-size: 9px; }.player strong { font-size: 11px; }
  .development-actions { flex-direction: column; }
}
@media (max-height: 500px) and (min-width: 621px) {
  #game { padding: 8px; }.game-shell { gap: 8px; }.room-heading { min-height: 30px; }.brand { font-size: 16px; }.room-tools button { min-height: 28px; padding: 5px; font-size: 8px; }#connection { display: none; }.player { padding: 5px; }.player-dock { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.game-shell { width: max(320px, var(--board-size)); }
.game-layout { display: flex; justify-content: center; }
.board { width: var(--board-size); max-width: 100%; }
.tokens:has(.token:nth-child(4)) { display: grid; grid-template-columns: repeat(3, max-content); }
.tile:has(.token:nth-child(4)) { padding-bottom: max(24px, 5.8cqw); }
.tile:has(.token:nth-child(4)) .tile-symbol { display: none; }
#connection[data-online="false"] { color: #ffd184; }
.player { column-gap: 6px; padding-inline: 8px; }
.tile.start::after { content: '←'; position: absolute; top: 2px; left: 5px; color: var(--accent); font-size: clamp(10px, 2cqw, 15px); line-height: 1; }
.tile .short-name { display: none; }
@container (max-width: 530px) {
  .tile .full-name { display: none; }
  .tile .short-name { display: inline; }
  .tile strong { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* A larger central board, with persistent activity and player rails. */
#game { display: grid; grid-template-columns: clamp(170px, 16vw, 238px) minmax(0, 1fr) clamp(170px, 16vw, 238px); column-gap: clamp(16px, 2vw, 32px); row-gap: 14px; align-items: start; padding: 20px; }
.game-shell { grid-column: 2; grid-row: 1; width: 100%; max-width: 100%; align-self: center; gap: 14px; min-width: 0; }
.room-heading { width: min(100%, var(--board-size)); margin-inline: auto; }
.side-panel { min-width: 0; border: 1px solid #d1e8ed12; border-radius: 16px; background: linear-gradient(160deg, #192832bd, #101d25c9); box-shadow: 0 12px 30px #0002; overflow: hidden; }
.event-panel { grid-column: 1; grid-row: 1; }
.players-panel { grid-column: 3; grid-row: 1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 17px 16px 13px; }
.panel-heading h2 { font-size: 12px; font-weight: 650; letter-spacing: .2px; margin: 0; }
.panel-heading > span { font-size: 9px; color: #97adb9; font-variant-numeric: tabular-nums; }
.panel-heading .live-dot { color: #acd794; letter-spacing: 1px; font-size: 8px; }
.live-dot::before { content: '●'; margin-right: 5px; }
.players-panel .player-dock { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 5px; padding: 0 8px 10px; }
.players-panel .player { width: 100%; min-width: 0; max-width: none; flex: none; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 8px; padding: 12px 8px; background: #ffffff02; border-color: transparent; border-radius: 8px; }
.players-panel .player .token { grid-row: auto; }
.players-panel .player > span:nth-child(2) { font-size: 11px; }
.players-panel .player strong { font-size: 11px; text-align: right; }
.players-panel .player.active { border-color: #c8f57840; background: #c8f5780b; box-shadow: none; }
#event-feed { list-style: none; padding: 0 10px 10px; margin: 0; max-height: calc(100dvh - 100px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3c5660 transparent; }
.event { position: relative; padding: 13px 10px; border: 1px solid transparent; border-bottom-color: #d6edf30a; border-radius: 10px; color: #91a8b7; }
.event-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 7px; font-weight: 700; letter-spacing: 1px; color: #8299a8; margin-bottom: 7px; }
.event p { font-size: 11px; line-height: 1.65; margin: 0; overflow-wrap: anywhere; }
.event strong { font-weight: 650; color: inherit; }
.event-growth { --event-color: #c8f578; --event-bg: #c8f5780e; }
.event-money { --event-color: #ffbd92; --event-bg: #ffbd920e; }
.event-move { --event-color: #83deef; --event-bg: #83deef0e; }
.event.latest { border-color: color-mix(in srgb, var(--event-color) 25%, transparent); background: var(--event-bg); color: #dfebf0; margin-bottom: 4px; box-shadow: none; }
.event.latest .event-meta, .event.latest strong { color: var(--event-color); }
.board { border-radius: 25px; padding: 10px; gap: 5px; background: linear-gradient(145deg, #50616a, #283c46 48%, #425761); border-color: #b8d0d252; box-shadow: 0 5px 0 #162832, 0 7px 0 #79919655, 0 22px 50px #0006, inset 0 1px #f0fffc55; }
.tile { background: linear-gradient(150deg, #ffffff09, transparent 70%), var(--tile-bg, #2b414b); border-radius: 9px; box-shadow: 0 2px 0 #08182099, inset 0 1px #ffffff0b; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, filter .25s; }
.tile.property { border-top-width: clamp(4px, .85cqw, 7px); }
.tile:hover { transform: translateY(-3px); filter: brightness(1.12); box-shadow: 0 5px 10px #0004, inset 0 1px #ffffff22; }
.board-center { position: relative; border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, #35565d66, #172e3766), repeating-linear-gradient(45deg, transparent, transparent 4px, #c6e7dd03 4px, #c6e7dd03 5px); border: 1px solid #b3d1d51c; box-shadow: inset 0 1px 18px #07151c33; }
.board-center::before { content: ''; position: absolute; inset: 10px; border: 1px solid #c2e5df0c; border-radius: 11px; pointer-events: none; }
.board-center .eyebrow { color: #b3cfcb; letter-spacing: .4cqw; }
.die { border: 1px solid #ffffff60; }
@keyframes dice-roll { 0% { transform: translateY(-5px) rotateX(100deg) rotate(-110deg) scale(.85); } 45% { transform: translateY(-20px) rotateX(-20deg) rotate(25deg); } 75% { transform: translateY(2px) rotate(-14deg); } 100% { transform: rotate(-9deg); } }
@keyframes dice-roll-second { 0% { transform: translateY(-9px) rotateY(110deg) rotate(120deg) scale(.85); } 50% { transform: translateY(-24px) rotateY(-15deg) rotate(-20deg); } 80% { transform: translateY(1px) rotate(13deg); } 100% { transform: rotate(9deg); } }
@media (max-width: 1100px) and (min-width: 901px) {
  #game { grid-template-columns: 155px minmax(0, 1fr) 155px; column-gap: 12px; padding: 14px; }
  .players-panel .player { grid-template-columns: 22px minmax(0, 1fr); gap: 3px 7px; padding: 8px; }
  .players-panel .player .token { grid-row: span 2; }.players-panel .player strong { grid-column: 2; text-align: left; }
  .room-tools { gap: 4px; }.room-tools button { padding-inline: 7px; }.brand { font-size: 18px; }#connection { display: none; }
}
@media (max-width: 900px) {
  #game { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; gap: 12px; align-content: start; }
  .event-panel { grid-column: 1; grid-row: 1; height: 160px; }
  .players-panel { grid-column: 2; grid-row: 1; height: 160px; }
  .game-shell { grid-column: 1 / -1; grid-row: 2; gap: 10px; }
  .panel-heading { padding: 10px 11px; }.panel-heading h2 { font-size: 10px; }
  #event-feed { height: 120px; padding: 0 6px 6px; }
  .event { padding: 9px 8px; }.event p { font-size: 10px; line-height: 1.5; }.event-meta { font-size: 6px; letter-spacing: .6px; }
  .players-panel .player-dock { height: 120px; overflow-y: auto; scrollbar-width: thin; padding: 0 5px 5px; gap: 3px; }
  .players-panel .player { padding: 7px 5px; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 5px; }.players-panel .player > span:nth-child(2) { font-size: 9px; }.players-panel .player strong { font-size: 9px; }
  .board { padding: 6px; gap: 3px; border-radius: 17px; }.tile { border-radius: 5px; }
}
@media (max-width: 360px) {
  .players-panel .player { grid-template-columns: 18px minmax(0, 1fr); row-gap: 1px; }.players-panel .player .token { grid-row: span 2; }.players-panel .player strong { grid-column: 2; text-align: left; }
}
@media (max-height: 500px) and (min-width: 621px) {
  #game { grid-template-columns: 150px minmax(0, 1fr) 150px; padding: 8px; gap: 12px; }
  .game-shell { grid-column: 2; grid-row: 1; }.event-panel { grid-column: 1; grid-row: 1; height: auto; }.players-panel { grid-column: 3; grid-row: 1; height: auto; }
  #event-feed { height: auto; max-height: calc(100dvh - 65px); }.players-panel .player-dock { height: auto; max-height: calc(100dvh - 65px); }
  .players-panel .player { grid-template-columns: 20px minmax(0,1fr); }.players-panel .player .token { grid-row: span 2; }.players-panel .player strong { grid-column: 2; text-align: left; }
}
.side-panel { position: relative; }
.side-panel[data-more="true"]::after { content: ''; position: absolute; bottom: 0; left: 1px; right: 1px; height: 23px; background: linear-gradient(transparent, #101d25); pointer-events: none; border-radius: 0 0 15px 15px; }
#players:focus-visible, #event-feed:focus-visible { outline: 1px solid #c8f57888; outline-offset: -2px; }
.tile.start::after { display: none; }
.tile.start:has(.token:nth-child(4))::after { display: block; }
@container (max-width: 370px) { .tile.start:has(.token)::after { display: block; } }
/* Readable activity, persistent dice, and nonmodal property inspection. */
.event p { font-size: 14px; line-height: 1.65; }
.event { color: #b5c7d2; }
.event-meta { font-size: 9px; letter-spacing: .6px; }
.room-heading { display: grid; grid-template-columns: auto 1fr; }
.room-tools { justify-self: end; }
.dice-display { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 7px 0 3px; min-height: 43px; }
.dice-display .center-dice { display: flex; margin: 0; gap: 10px; }
.dice-display .die { width: 32px; height: 32px; padding: 6px; gap: 2px; border-radius: 7px; box-shadow: 0 3px 0 #a8b9b5; }
.dice-display .die + .die { box-shadow: 0 3px 0 #8da959; }
#dice-result { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: #dceacf; }
.property-mini { position: fixed; z-index: 8; right: 20px; top: var(--inspector-top, 200px); width: var(--inspector-width, 238px); max-height: calc(100dvh - var(--inspector-top, 200px) - 16px); overflow-y: auto; scrollbar-width: thin; padding: 16px; border: 1px solid #8ba5ad55; border-radius: 14px; background: #192c36; box-shadow: 0 10px 28px #0004; }
.property-mini .dialog-heading { margin-bottom: 8px; gap: 5px; }
.property-mini .dialog-heading h2 { font-size: 16px; }
.property-mini .dialog-heading button { flex-shrink: 0; min-height: 30px; width: 26px; }
.property-mini .property-details { font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.property-mini label { margin-top: 10px; }
.property-mini .rent-table { font-size: 12px; }
.property-mini .rent-table th, .property-mini .rent-table td { padding: 6px 0; }
.property-mini .development-status { line-height: 1.6; }
.property-mini .development-actions { flex-direction: column; margin-top: 12px; }
.tile.owned { box-shadow: inset 0 0 0 2px var(--owner-color), 0 2px 0 #08182099; padding-bottom: 18px; }
.tile .owner { display: block; position: absolute; left: 2px; right: 2px; bottom: 2px; width: auto; height: 13px; padding: 1px 3px; border-radius: 3px; background: var(--player-color); color: #12202a; font-size: 9px; font-weight: 800; line-height: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.owned .tokens { bottom: 18px; }
.tile.owned:has(.tokens:not(:empty)) { padding-bottom: calc(18px + 3.4cqw); }
.tile.owned:has(.token:nth-child(4)) { padding-bottom: calc(18px + 5.8cqw); }
@media (max-width: 1100px) and (min-width: 901px) { .property-mini { right: 14px; padding: 10px; }.property-mini .rent-table { font-size: 11px; } }
@media (max-width: 900px) {
  .event p { font-size: 12px; line-height: 1.55; }.event-meta { font-size: 8px; }
  .property-mini { right: 12px; top: auto; bottom: 12px; width: min(310px, calc(100% - 24px)); max-height: min(440px, 60dvh); padding: 14px; }
}
@container (max-width: 530px) {
  .tile .owner { height: 11px; line-height: 9px; font-size: 8px; }
  .tile.owned .tokens { bottom: 15px; }
  .tile.owned:has(.tokens:not(:empty)) .tile-symbol, .tile.owned:has(.tokens:not(:empty)) > small { display: none; }
}
@media (max-height: 500px) and (min-width: 621px) { .property-mini { right: 8px; top: 8px; bottom: auto; max-height: calc(100dvh - 16px); width: 240px; } }
.property-mini { display: flex; flex-direction: column; overflow: hidden; }
.property-mini > .dialog-heading { flex-shrink: 0; margin-bottom: 3px; }
.inspector-body { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #64818b transparent; }
.inspector-scroll { flex-shrink: 0; font-size: 10px; line-height: 1.4; color: #b7d9bd; margin: 0 0 9px; }
@media (max-width: 900px) {
  .property-mini { top: 12px; bottom: auto; right: 12px; width: min(340px, calc(100% - 24px)); max-height: 200px; }
  .property-mini .property-details { margin-bottom: 5px; }
}
@media (max-height: 500px) and (min-width: 621px) {
  .property-mini { top: 8px; right: 8px; max-height: calc(100dvh - 16px); width: var(--inspector-width, 150px); padding: 10px; }
}
@media (max-width: 900px) and (min-height: 501px) {
  .property-mini { max-height: 220px; }
  .property-mini label[for="property-select"], .property-mini #property-select { display: none; }
  .property-mini .development-status { margin: 5px 0; font-size: 11px; line-height: 1.4; }
  .property-mini .rent-table { margin-top: 5px; font-size: 11px; }
  .property-mini .rent-table th, .property-mini .rent-table td { padding: 4px 0; }
}
@container (max-width: 370px) {
  .tile.owned:has(.token:nth-child(4)) { padding-bottom: 0; }
  .tile.owned:has(.token:nth-child(4)) strong, .tile.owned:has(.token:nth-child(4)) > small { display: none; }
  .tile.owned:has(.token:nth-child(4)) .token { width: 9px; height: 9px; font-size: 6px; }
}
/* Dice stay on the board, including while buying and bidding. */
.board-center .dice-display { display: flex; flex-direction: column; flex-shrink: 0; gap: 12px; padding: 0; margin: 0 0 2cqw; min-height: 0; }
.board-center .dice-display .center-dice { gap: 3cqw; }
.board-center .dice-display .die { width: clamp(36px, 12cqw, 84px); height: clamp(36px, 12cqw, 84px); padding: 2cqw; gap: .8cqw; border-radius: 2cqw; box-shadow: 0 .6cqw 0 #a8b9b5, 0 1.2cqw 1.5cqw #0004; }
.board-center .dice-display .die + .die { box-shadow: 0 .6cqw 0 #8da959, 0 1.2cqw 1.5cqw #0004; }
.board-center #dice-result { font-size: clamp(10px, 1.9cqw, 14px); }
@container (max-width: 530px) {
  .board-center .dice-display { gap: 7px; margin-bottom: 2cqw; }
  .board[data-phase="debt"] .board-center > .eyebrow { display: none; }
  .board-center h2 { margin-top: 1cqw; margin-bottom: 2cqw; }
}
@container (max-width: 370px) {
  .board[data-phase="debt"] .board-center h2 { display: none; }
  .board-center .dice-display { gap: 5px; margin-bottom: 5px; }
  .board[data-phase="debt"] #turn { margin-bottom: 5px; }
}
/* Plain, readable activity with semantic highlights. */
.event-panel.side-panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.event-panel.side-panel::after { display: none; }
.event-panel #event-feed { padding: 0 8px 0 0; scrollbar-gutter: stable; }
.event, .event.latest { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 10px 0; margin: 0; color: #acbeca; }
.event.latest { color: #e6eef2; }
.event .event-money-value, .event.latest .event-money-value { color: #a7e47e; font-weight: 700; }
.event .event-player, .event.latest .event-player { color: var(--player-color); font-weight: 650; }
.event .event-estate, .event.latest .event-estate { color: var(--district); font-weight: 650; }
.event-dice { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; color: #e4eeec; font-size: 24px; line-height: 1; }
@media (max-width: 900px) { .event-panel #event-feed { height: 100%; }.event { padding: 7px 0; }.event-dice { font-size: 22px; } }
/* Reserve controls in every client's view so taking a turn does not lift the dice/title. */
#actions { min-height: 44px; align-content: start; }
#turn { min-height: 3em; display: grid; align-items: center; }
@container (max-width: 370px) {
  #actions { min-height: 36px; }
  #turn { min-height: 2.6em; }
}
/* Separate the inspector's reading column from its scroll track. */
.inspector-body { scrollbar-gutter: stable; padding-right: 12px; }
.inspector-body::-webkit-scrollbar { width: 6px; }
.inspector-body::-webkit-scrollbar-thumb { border-radius: 6px; background: #64818b; }
.property-mini .dialog-heading { align-items: flex-start; margin-bottom: 6px; }
.property-mini .dialog-heading h2 { color: var(--district); font-size: 17px; line-height: 1.3; padding-top: 4px; }
.property-mini .property-details { color: #a7bfcb; font-size: 11px; margin: 0 0 14px; }
.property-mini .inspector-scroll { font-size: 9px; margin-bottom: 10px; }
.property-mini label { font-size: 10px; color: #9eb5c1; margin: 0 0 6px; }
.property-mini select { font-size: 11px; padding: 10px 8px; }
.property-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 8px; font-size: 12px; line-height: 1.5; margin: 16px 0; }
.property-facts dt { color: #a9bdc9; }
.property-facts dd { text-align: right; margin: 0; color: #eef4f6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.property-facts .fact-owner { color: var(--player-color); font-weight: 650; }
.property-mini .rent-table { margin-top: 0; }
.property-mini .rent-table caption { color: #a9bdc9; font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.property-mini .rent-table td { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) and (min-height: 501px) {
  .property-facts { margin: 8px 0 12px; gap: 5px 8px; font-size: 11px; }
  .property-mini .property-details { margin-bottom: 8px; }
}
.property-facts { grid-template-columns: max-content minmax(0, 1fr); }
/* Keep activity compact and centered beside the board. */
.event-panel.side-panel { align-self: center; height: auto; max-height: min(440px, 58dvh); }
.event-panel #event-feed { height: auto; max-height: min(440px, 58dvh); }
.event, .event.latest { padding-left: 14px; }
.event.latest { color: #f3f7f5; font-weight: 600; }
.event.latest::before { content: ''; position: absolute; left: 0; top: 19px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px #c8f57880; }
.event-dice { gap: 6px; margin: 0 3px; }
.event-dice .die { width: 23px; height: 23px; padding: 4px; gap: 1.5px; border-radius: 5px; flex: none; box-shadow: 0 2px 0 #a8b9b5, 0 3px 5px #0003; }
.event-dice .die + .die { box-shadow: 0 2px 0 #8da959, 0 3px 5px #0003; }
@media (max-width: 900px) and (min-height: 561px) {
  .event-panel.side-panel, .event-panel #event-feed { max-height: 160px; }
  .event.latest::before { top: 16px; }
}
.event-panel[data-more="true"] #event-feed { mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
/* Direct board interaction: dice above, selected-property details below. */
.board-center { display: grid; grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5cqw; padding: 2.2cqw; }
.center-play { min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.center-play .eyebrow { font-size: clamp(7px, 1.2cqw, 9px); }
.center-play h2 { font-size: clamp(16px, 3.8cqw, 28px); margin: .8cqw 0 1.8cqw; }
.board-center .dice-display { gap: 1.2cqw; margin: 0 0 1cqw; }
.board-center .dice-display .die { width: clamp(30px, 9cqw, 66px); height: clamp(30px, 9cqw, 66px); padding: 1.5cqw; gap: .6cqw; border-radius: 1.5cqw; }
#roll-dice { border: 0; background: transparent; padding: 1cqw 2cqw; margin: 0; box-shadow: none; opacity: 1; min-height: 0; border-radius: 14px; }
#roll-dice:not(:disabled) { cursor: pointer; }
#roll-dice:not(:disabled):hover .die { filter: brightness(1.12); }
#roll-dice:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#roll-dice:disabled { cursor: default; }
#roll-dice:not(:disabled) .die { filter: drop-shadow(0 0 5px #c8f57835); }
.board-center #dice-result { font-size: clamp(9px, 1.6cqw, 12px); }
.center-play #turn { font-size: clamp(9px, 1.6cqw, 12px); line-height: 1.35; min-height: 2.7em; margin: .7cqw 0; }
.center-play #actions { min-height: 30px; gap: 4px; }
.center-play #actions:empty { min-height: 0; }
.center-play #actions button { min-height: 28px; padding: 5px 8px; font-size: clamp(9px, 1.5cqw, 12px); }
.board-property { min-height: 0; height: 100%; width: 100%; display: flex; flex-direction: column; text-align: left; border-top: 1px solid #c2e5df20; padding-top: 1.5cqw; overflow: hidden; }
.board-property.empty { justify-content: center; align-items: center; text-align: center; }
.board-property .property-prompt { font-size: clamp(12px, 2.3cqw, 17px); color: #d7e8e5; margin: 0 0 6px; }
.board-property .hint { font-size: clamp(9px, 1.7cqw, 12px); margin: 0; }
.board-property-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.board-property-heading h3 { color: var(--district); margin: 0; font-size: clamp(12px, 2.5cqw, 18px); }
.board-property-heading button { min-height: 24px; width: 24px; padding: 0; flex-shrink: 0; font-size: 18px; background: transparent; border: 0; }
.board-property-body { overflow-y: auto; min-height: 0; padding: 3px 8px 4px 0; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #708f95 transparent; }
.property-summary { display: flex; justify-content: space-between; gap: 8px; font-size: clamp(10px, 1.9cqw, 14px); margin-bottom: 1cqw; }
.property-summary .fact-owner { color: var(--player-color); font-weight: 650; }
.current-rent { color: var(--accent); }
.building-prices { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: clamp(9px, 1.6cqw, 12px); color: #bacdce; }
.rent-schedule { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 1.2cqw 0; text-align: center; font-size: clamp(8px, 1.4cqw, 11px); }
.rent-schedule > div { padding: 6px 1px; background: #091e292e; border-radius: 5px; }
.rent-schedule dt { color: #b1c6c9; font-size: .9em; white-space: nowrap; }
.rent-schedule dd { margin: 4px 0 0; font-weight: 650; }
.rent-schedule .current-level { background: #c8f57818; color: var(--accent); }
.rent-schedule .current-level dt { color: inherit; }
.building-guidance { font-size: clamp(9px, 1.5cqw, 11px); line-height: 1.4; color: #b2c7c9; margin: 0; }
.tile-hit { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; box-shadow: none; z-index: 2; }
.tile-hit:hover { background: #ffffff07; }
.tile-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
@container (max-width: 530px) {
  .center-play .eyebrow { display: none; }
  .center-play #turn { min-height: 2.7em; }
  .center-play h2 { margin: 0 0 1cqw; }
  .center-play #actions button { min-height: 24px; padding: 3px 5px; }
  .center-play #actions { min-height: 24px; }
  .rent-schedule { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board[data-phase="debt"] .center-play .dice-display { display: none; }
}
#roll-dice:hover:enabled, .tile-hit:hover:enabled { background: transparent; transform: none; box-shadow: none; }
.center-play #actions:empty { min-height: 30px; }
@container (max-width: 530px) {
  .center-play #actions:empty { min-height: 24px; }
  .board[data-phase="debt"] .board-center { grid-template-rows: minmax(0, 2fr) minmax(0, 1fr); }
  .board[data-phase="debt"] .center-play .dice-display { display: flex; }
  .board[data-phase="debt"] .center-play h2 { display: none; }
}
.board-center { grid-template-columns: minmax(0, 1fr); }
@container (max-width: 530px) {
  .board-center { grid-template-rows: minmax(114px, 1.25fr) minmax(0, 1fr); padding: 1.5cqw 2cqw; }
  .center-play #turn { min-height: 1.4em; margin: 2px 0 4px; }
  .center-play h2 { font-size: 15px; }
  .board-center .dice-display { gap: 2px; margin-bottom: 2px; }
  #roll-dice { padding: 3px 8px; }
  .board[data-phase="buy"] .board-center { grid-template-rows: minmax(130px, 1.5fr) minmax(0, 1fr); }
}
.board-property-heading h3 { flex: 1; }
.board-property-heading .property-more { display: none; width: auto; font-size: 10px; color: #c8f578; padding: 0 4px; }
.board-property[data-overflow="true"] .property-more { display: block; }
.property-development { display: none; }
@container (max-width: 530px) {
  .property-development { display: flex; gap: 5px; margin: 8px 0; }
  .property-development button { flex: 1; min-height: 44px; padding: 4px; font-size: 10px; }
  .property-development button + button { background: #edc4b0; color: #47302c; }
  .property-development button:disabled { opacity: .5; }
  .board-property-heading { gap: 2px; }
  .board-property-heading .property-more { font-size: 9px; }
}
@container (max-width: 360px) {
  .board-center { grid-template-rows: minmax(94px, 1fr) minmax(0, 1fr); }
  .board[data-phase="roll"] .center-play #turn, .board[data-phase="end"] .center-play #turn { display: none; }
}
/* Corner controls leave the full central height to the board. */
#game { align-items: start; }
.game-shell { gap: 0; }
.activity-rail { grid-column: 1; grid-row: 1; align-self: stretch; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.activity-rail > .brand { align-self: flex-start; line-height: 36px; }
.activity-rail .event-panel { width: 100%; margin-block: auto; }
.player-rail { grid-column: 3; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.room-tools { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 30px; gap: 5px; width: 100%; }
.room-tools button { min-width: 0; padding: 6px 3px; font-size: 10px; }
.room-tools .icon-button { width: 30px; }
#connection { display: block; grid-column: 1 / -1; font-size: 10px; margin: 0 0 3px; color: #adcbb5; }
#connection::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin: 0 6px 1px 0; background: var(--accent); }
#connection[data-online="false"] { color: #e1a598; }
#connection[data-online="false"]::before { background: #ff947f; }
.player-rail .players-panel { width: 100%; height: auto; }
.player-rail #players { max-height: calc(100dvh - 160px); overflow-y: auto; scrollbar-width: thin; }
#dice-result { display: none; }
.board-center { grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr); }
.center-play h2 { margin: 0 0 2cqw; }
.board-center .dice-display { margin: 0 0 2cqw; }
#roll-dice { position: relative; }
#roll-dice::after { content: ''; position: absolute; inset: -5px -10px; border: 2px solid #c8f578; border-radius: 22px; opacity: 0; pointer-events: none; }
#roll-dice.roll-ready::after { opacity: .7; animation: roll-invitation 1.8s ease-in-out infinite; }
#roll-dice.roll-ready::before { content: ''; position: absolute; right: -13px; bottom: -8px; width: 13px; height: 13px; border: 2px solid #1d373f; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #c8f57877; }
@keyframes roll-invitation { 0%,100% { transform: scale(.98); opacity: .35; box-shadow: 0 0 0 0 #c8f57800; } 50% { transform: scale(1.05); opacity: .9; box-shadow: 0 0 18px 2px #c8f57825; } }
@media (prefers-reduced-motion: reduce) { #roll-dice.roll-ready::after { animation: none; opacity: .7; } }
.property-development { display: flex; gap: 8px; margin: 10px 0; }
.property-development button { flex: 1; min-height: 40px; padding: 6px; font-size: 12px; }
.property-development button + button { background: #edc4b0; color: #47302c; }
.property-development button:disabled { opacity: .5; }
.decision-summary { font-size: clamp(9px, 1.7cqw, 12px); line-height: 1.4; color: #d9e8e7; margin: 0 0 6px; flex-shrink: 0; text-align: center; }
@media (max-width: 900px) and (min-height: 501px) {
  .activity-rail { grid-column: 1; align-self: stretch; gap: 6px; }
  .player-rail { grid-column: 2; gap: 8px; }
  .activity-rail > .brand { font-size: 21px; }
  .activity-rail .event-panel, .activity-rail #event-feed { max-height: 140px; }
  .player-rail #players { height: auto; max-height: 104px; }
  .room-tools { grid-template-columns: minmax(0, 1fr) 28px; gap: 4px; }
  .room-tools #invite { grid-column: 1; }
  .room-tools #history { grid-column: 2; grid-row: 2 / 4; align-self: stretch; width: 28px; }
  .room-tools #assets { grid-column: 1; }
  .room-tools button { min-height: 28px; padding: 3px; font-size: 9px; }
}
@media (max-height: 500px) and (min-width: 621px) {
  .activity-rail { grid-column: 1; gap: 8px; }
  .player-rail { grid-column: 3; }
  .activity-rail #event-feed { max-height: min(58dvh, 250px); }
  .room-tools button { font-size: 8px; }
  .player-rail #players { max-height: calc(100dvh - 148px); }
}
@container (max-width: 530px) {
  .board-center { grid-template-rows: minmax(84px, 1fr) minmax(0, 1.4fr); }
  .board[data-phase="buy"] .board-center { grid-template-rows: minmax(90px, 1fr) minmax(0, 1.4fr); }
  .board[data-phase="debt"] .board-center { grid-template-rows: minmax(110px, 1.2fr) minmax(0, 1fr); }
  .board[data-phase="debt"] .center-play h2 { display: block; font-size: 13px; }
  .board-center .dice-display { margin-bottom: 3cqw; }
  #roll-dice::after { inset: -2px -4px; border-radius: 12px; }
  #roll-dice.roll-ready::before { width: 9px; height: 9px; right: -6px; bottom: -4px; }
  .property-development { gap: 5px; margin: 8px 0; }
  .property-development button { min-height: 44px; font-size: 10px; }
}
/* A soft light and small tap gesture replace the dice frame. */
#roll-dice::before, #roll-dice.roll-ready::before { display: none; }
#roll-dice::after { border: 0; inset: auto 0 -10px; height: 18px; border-radius: 50%; background: radial-gradient(ellipse, #c8f57838, transparent 70%); box-shadow: none; }
#roll-dice.roll-ready::after { animation: dice-light 2s ease-in-out infinite; }
@keyframes dice-light { 0%,100% { opacity: .35; transform: scaleX(.85); } 50% { opacity: .9; transform: scaleX(1.1); } }
.dice-display { position: relative; }
.dice-cue { display: none; position: absolute; right: -10px; bottom: -10px; width: 24px; height: 24px; color: #dcf3c3; pointer-events: none; transform: rotate(-15deg); }
.dice-cue svg { width: 100%; height: 100%; }
.dice-display:has(.roll-ready) .dice-cue { display: block; }
@media (prefers-reduced-motion: reduce) { #roll-dice.roll-ready::after { animation: none; opacity: .6; } }
.tile.owned { box-shadow: 0 2px 0 #08182099; }
.activity-rail { row-gap: 8px; }
.activity-rail #connection { margin: -3px 0 8px; }
.room-tools { grid-template-rows: auto; }
.board-property-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) auto auto 20px; gap: 8px; }
.board-property-heading h3, .header-owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-owner, .board-property-heading .current-rent { font-size: clamp(9px, 1.7cqw, 13px); white-space: nowrap; }
.header-owner.fact-owner { color: var(--player-color); font-weight: 650; }
.board-property-heading > .icon-button { grid-column: 5; width: 20px; }
.board-property-heading .property-more { grid-column: 4; padding: 0; }
.property-price { font-size: clamp(10px, 1.8cqw, 13px); margin: 6px 0; color: #c3d5d7; }
.building-prices { margin: 8px 0; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) and (min-height: 501px) { .room-tools #history { grid-row: 1 / 3; } }
@container (max-width: 530px) {
  .board-property-heading { gap: 4px; grid-template-columns: minmax(0, 1fr) minmax(0, .55fr) auto 12px 16px; }
  .board-property-heading h3 { font-size: 11px; }
  .board-property-heading .property-more { font-size: 0; }
  .board-property-heading .property-more::after { content: '↓'; font-size: 12px; }
  .board-property-heading > .icon-button { width: 16px; }
  .dice-cue { width: 18px; height: 18px; bottom: -9px; right: -8px; }
  .center-play h2 { font-size: 14px; }
}
.tile.selected { outline: none; }
.tile.selected > strong { text-decoration: underline; text-decoration-color: #e1eee580; text-underline-offset: 3px; }
.rent-label-short { display: none; }
@container (max-width: 530px) {
  .rent-schedule { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin: 4px 0; }
  .rent-schedule > div { padding: 4px 0; }
  .rent-label-full { display: none; }.rent-label-short { display: inline; }
  .property-development { margin: 4px 0; }
  .board-property-heading > button { min-height: 20px; }
}
@container (max-width: 360px) {
  .center-play { justify-content: flex-start; }
  .board[data-phase="roll"] .board-center, .board[data-can-roll="true"] .board-center { grid-template-rows: minmax(70px, 1fr) minmax(0, 1.65fr); }
  .center-play #actions:empty { min-height: 0; }
}
@container (max-width: 360px) {
  .board[data-phase="roll"] .board-center, .board[data-can-roll="true"] .board-center { grid-template-rows: minmax(60px, 1fr) minmax(0, 1.9fr); }
  .center-play h2 { margin-bottom: 2px; }
  .board-center .dice-display { margin-bottom: 2px; }
  #roll-dice { padding-block: 2px; }
  .property-development button { white-space: nowrap; font-size: 9px; }
}
/* Bottom-anchor details and center the turn display in the remaining space. */
.board-center { display: flex; flex-direction: column; justify-content: flex-start; padding-bottom: 1cqw; }
.center-play { flex: 1 1 0; min-height: 70px; justify-content: center; }
.board-property { flex: 0 1 auto; height: auto; max-height: calc(100% - 80px); margin-top: auto; }
.board-property.empty { min-height: 60px; padding-bottom: 8px; }
.board-property-body { flex: 0 1 auto; }
@container (max-width: 530px) {
  .center-play { min-height: 66px; }
  .board-property { max-height: calc(100% - 72px); }
  .board[data-phase="debt"] .center-play { min-height: 110px; }
  .board[data-phase="debt"] .board-property { max-height: calc(100% - 116px); }
}
/* Reserve the same details space regardless of the selected property. */
.board-property { flex: 0 0 auto; height: clamp(104px, 24cqw, 180px); }
.board-property-body { flex: 1 1 auto; }
.room-tools #trade { grid-column: 1 / 3; }
.room-tools #history { grid-column: 3; grid-row: 1 / 3; height: 100%; }
.trade-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 8px; }
.trade-heading h3 { margin: 0; font-size: clamp(12px, 2.4cqw, 18px); }
.trade-heading button { min-height: 22px; width: 22px; }
.trade-body { padding-top: 5px; }
.trade-body > label { display: inline; margin: 0 8px 0 0; }
.trade-body > select { width: auto; max-width: 65%; padding: 4px 8px; font-size: 11px; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 7px; }
.trade-side { border: 0; padding: 0; margin: 0; min-width: 0; font-size: 12px; }
.trade-side legend { color: #bdcdd0; font-size: 11px; margin-bottom: 5px; }
.trade-side > label { margin: 0 0 3px; font-size: 10px; }
.trade-side > input { padding: 4px 6px; font-size: 12px; }
.trade-properties { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.trade-properties li, .trade-choice span { color: var(--district); }
.trade-choice { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 11px; }
.trade-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.trade-choice:has(input:disabled) { opacity: .5; }
.trade-cash { color: var(--accent); }
.trade-actions { display: flex; flex-shrink: 0; gap: 6px; padding-top: 6px; }
.trade-actions button { flex: 1; padding: 6px; min-height: 32px; font-size: 11px; }
.trade-actions button + button { background: #344d53; color: #edf3ed; }
@media (max-width: 900px) and (min-height: 501px) {
  .room-tools #trade { grid-column: 1; }
  .room-tools #history { grid-column: 2; grid-row: 1 / 4; }
}
@container (max-width: 530px) {
  .trade-sides { gap: 6px; }
  .trade-side, .trade-side legend, .trade-choice { font-size: 10px; }
  .trade-actions { gap: 3px; padding-top: 4px; }
  .trade-actions button { font-size: 10px; min-height: 28px; padding: 3px; }
}
.trade-heading h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.trade-heading button { height: 22px; min-height: 22px; line-height: 20px; padding: 0; }
.trade-heading .trade-scroll { display: none; width: 22px; background: transparent; color: var(--accent); border: 0; }
.trade-panel[data-overflow="true"] .trade-scroll { display: block; }
.trade-side legend { margin-bottom: 2px; line-height: 1.2; }
.trade-cash { display: block; font-size: 12px; line-height: 1.2; }
.trade-properties { margin: 2px 0; gap: 2px; line-height: 1.2; }
/* Trades use the inner board so both sides can be reviewed before accepting. */
.board-center:has(.trade-panel) > .center-play { display: none; }
.board-center > .trade-panel { flex: 1 1 0; height: 100%; max-height: 100%; border-top: 0; padding-top: 0; }
.trade-heading { margin-bottom: 8px; }
.trade-heading h3 { font-size: clamp(14px, 2.8cqw, 21px); }
.trade-body { padding-top: 0; }
.trade-sides { gap: 14px; margin-top: 12px; }
.trade-side { border-radius: 10px; background: #0c222d55; padding: 10px; }
.trade-side legend { font-size: 11px; padding: 0 2px; }
.trade-cash { font-size: 18px; margin-bottom: 8px; }
.trade-properties { gap: 7px; margin: 7px 0 0; }
.trade-properties li { font-size: 13px; line-height: 1.3; }
.trade-choice { min-height: 28px; font-size: 12px; }
.trade-side > input { padding: 7px; }
.trade-actions button { min-height: 40px; font-size: 12px; }
@container (max-width: 530px) {
  .trade-heading { margin-bottom: 4px; }
  .trade-sides { gap: 6px; margin-top: 7px; }
  .trade-side { padding: 5px; border-radius: 6px; }
  .trade-side legend { font-size: 9px; }
  .trade-cash { font-size: 15px; margin-bottom: 4px; }
  .trade-properties { gap: 4px; margin-top: 4px; }
  .trade-properties li, .trade-choice { font-size: 10px; }
  .trade-choice { min-height: 22px; }
  .trade-side > input { padding: 4px; }
  .trade-actions button { min-height: 32px; font-size: 10px; }
}
/* Bounded side rails: activity and offers left, players and chat right. */
.activity-rail, .player-rail { height: calc(100dvh - 40px); min-height: 0; }
.activity-rail .event-panel, .activity-rail #event-feed { max-height: min(330px, 42dvh); }
.player-rail #players { height: auto; max-height: min(290px, 32dvh); }
.player-rail .players-panel { flex-shrink: 0; }
.trade-inbox { margin-top: auto; flex-shrink: 0; max-height: min(210px, 28dvh); width: 100%; }
.trade-inbox summary, .chat-panel summary { cursor: pointer; list-style: none; padding: 11px 12px; font-size: 12px; font-weight: 650; }
.trade-inbox summary::marker, .chat-panel summary::marker { content: ''; }
.trade-inbox summary::-webkit-details-marker, .chat-panel summary::-webkit-details-marker { display: none; }
#trade-count { color: var(--accent); margin-left: 5px; }
#trade-list { overflow-y: auto; max-height: min(165px, 21dvh); padding: 0 6px 6px; scrollbar-width: thin; }
.trade-inbox-item { display: flex; flex-direction: column; width: 100%; text-align: left; min-height: 48px; padding: 8px; gap: 5px; background: #ffffff04; color: #baccd1; border: 0; font-size: 10px; }
.trade-inbox-item strong { font-size: 11px; }.trade-inbox-item.incoming strong { color: var(--accent); }
.chat-panel { margin-top: auto; width: 100%; flex-shrink: 0; }
.chat-content { display: flex; flex-direction: column; height: min(255px, 32dvh); min-height: 120px; }
#chat-messages { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; list-style: none; padding: 0 12px; margin: 0; }
.chat-message { display: flex; flex-direction: column; gap: 3px; padding: 7px 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-message strong { color: var(--player-color); font-size: 10px; }
#chat-form { display: flex; gap: 5px; padding: 8px; }
#chat-input { min-width: 0; padding: 8px; font-size: 12px; }
#chat-send { flex-shrink: 0; width: 30px; min-height: 32px; padding: 2px; margin: 0; }
.room-tools #history svg { width: 20px; height: 20px; vertical-align: middle; }
.player[role="button"] { cursor: pointer; }.player[aria-pressed="true"] { background: #ffffff0b; }
.player .remove-bot { position: absolute; right: 4px; top: 1px; min-height: 18px; height: 18px; width: 18px; padding: 0; font-size: 13px; background: transparent; color: #bacbd1; }
.player:has(.remove-bot) { position: relative; padding-right: 22px; }
.board.holdings-focus .tile { opacity: .3; filter: brightness(.7); }
.board.holdings-focus .tile.holding-match { opacity: 1; filter: brightness(1.15); }
.board.holdings-focus .board-center { opacity: .5; }
.tile, .board-center { transition: opacity .2s, filter .2s; }
.tile .tile-symbol[data-level] { display: block !important; width: clamp(17px, 4cqw, 30px); height: clamp(17px, 4cqw, 30px); }
.tile .tile-symbol[data-level="hotel"] { color: #ffdc84; }
.tile .tile-symbol[data-level^="houses"] { color: #c8f578; }
.tile .tile-symbol[data-level="set"] { color: #e3cfff; }
.tile .buildings.sr-only { display: none; }
.rent-strip { display: flex; align-items: center; gap: 3px; margin: 6px 0; }
.rent-strip .rent-schedule { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 70px; gap: 5px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 5px; margin: 0; scroll-snap-type: x proximity; }
.rent-strip .rent-schedule > div { min-height: 48px; padding: 7px 3px; scroll-snap-align: start; }
.rent-strip .rent-schedule dt { font-size: 11px; }
.rent-strip .rent-schedule dd { font-size: 14px; margin-top: 5px; }
.rent-strip .rent-label-full { display: inline; }.rent-strip .rent-label-short { display: none; }
.rent-arrow { width: 18px; min-height: 40px; flex-shrink: 0; padding: 0; background: transparent; color: #c8f578; font-size: 23px; border: 0; }
@media (max-width: 900px) and (min-height: 501px) {
  .activity-rail, .player-rail { height: auto; }
  .activity-rail .event-panel, .activity-rail #event-feed { max-height: 112px; }
  .player-rail #players { max-height: 100px; }
  .trade-inbox, .chat-panel { position: fixed; z-index: 12; bottom: 8px; width: calc(50% - 18px); max-height: min(290px, 45dvh); margin: 0; background: #172832; }
  .trade-inbox { left: 12px; }.chat-panel { right: 12px; }
  .trade-inbox[open], .chat-panel[open] { width: min(340px, calc(100% - 24px)); }
  .trade-inbox summary, .chat-panel summary { padding: 9px 12px; }
  #trade-list { max-height: min(230px, 36dvh); }
  .chat-content { height: min(230px, 35dvh); }
}
@media (max-height: 500px) and (min-width: 621px) {
  .activity-rail, .player-rail { height: calc(100dvh - 16px); }
  .activity-rail .event-panel, .activity-rail #event-feed { max-height: 100px; }
  .player-rail #players { max-height: 76px; }
  .trade-inbox { max-height: 115px; }#trade-list { max-height: 76px; }
  .chat-content { height: 100px; min-height: 80px; }
  .chat-message { font-size: 10px; padding-block: 4px; }
  #chat-input { padding: 5px; font-size: 10px; }
  .trade-inbox summary, .chat-panel summary { padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) { .tile, .board-center { transition: none; } }
.players-panel .player-dock { justify-content: flex-start; }
@container (max-width: 360px) {
  .center-play { min-height: 50px; }
  .board-property { max-height: calc(100% - 56px); }
}
.trade-inbox summary::after, .chat-panel summary::after { content: '⌃'; float: right; color: #9aadb5; }
.trade-inbox[open] summary::after, .chat-panel[open] summary::after { content: '⌄'; }
@media (max-width: 500px) and (max-height: 650px) {
  .room-tools { grid-template-columns: 1fr 1fr; gap: 3px; }
  .room-tools #invite, .room-tools #trade { grid-column: 1; grid-row: auto; }
  .room-tools #assets, .room-tools #history { grid-column: 2; grid-row: auto; width: auto; }
  .room-tools button { min-height: 27px; font-size: 8px; }
  .player-rail { gap: 5px; }
  .players-panel { padding: 6px; }
  .players-panel .section-heading { margin-bottom: 4px; }
  .player-rail #players { max-height: 86px; }
  .activity-rail .event-panel, .activity-rail #event-feed { max-height: 90px; }
}
@media (max-height: 500px) and (min-width: 621px) {
  .player-rail #players { max-height: 94px; }
  .player-rail .player { min-height: 40px; padding-block: 5px; }
  .chat-content { height: 120px; }
}
/* Tile inspection floats inward over the full-height turn area. */
.board-center > .center-play { flex: 1 1 auto; width: 100%; min-height: 0; justify-content: center; }
#board .board-center > .tile-popover { position: absolute; z-index: 10; width: min(440px, calc(100% - 12px)); height: min(240px, calc(100% - 12px)); max-height: calc(100% - 12px); margin: 0; padding: 14px; border: 1px solid #91b7bf66; border-radius: 14px; background: #192f39; box-shadow: 0 14px 40px #0009; animation: tile-inspect-in .18s ease-out; }
.tile-popover[data-edge="bottom"] { transform-origin: bottom; }
.tile-popover[data-edge="top"] { transform-origin: top; }
.tile-popover[data-edge="left"] { transform-origin: left; }
.tile-popover[data-edge="right"] { transform-origin: right; }
.tile-popover .board-property-heading { flex-shrink: 0; }
.tile-popover .board-property-body { min-height: 0; padding-right: 5px; }
.center-play > .decision-summary { flex-shrink: 0; max-width: 100%; }
.chat-message { display: block; }
.chat-message strong { font-size: inherit; }
@keyframes tile-inspect-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@container (max-width: 400px) {
  #board .board-center > .tile-popover { padding: 8px; border-radius: 9px; }
  .tile-popover .board-property-heading { grid-template-columns: minmax(0, 1fr) auto 22px; gap: 4px; }
  .tile-popover .board-property-heading h3 { grid-column: 1 / 3; white-space: normal; }
  .tile-popover .board-property-heading > .icon-button { grid-column: 3; grid-row: 1; width: 22px; }
  .tile-popover .header-owner { grid-column: 1; grid-row: 2; }
  .tile-popover .current-rent { grid-column: 2; grid-row: 2; }
  .tile-popover .property-more { grid-column: 3; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { #board .board-center > .tile-popover { animation: none; } }
/* A complete property deed, with every rent level visible at once. */
#board .board-center > .tile-popover { width: min(440px, calc(100cqw - 24px)); height: auto; max-height: none; padding: 18px; border-color: #a8c6c538; border-top: 3px solid var(--district); background: linear-gradient(145deg, #233e48, #142a34); overflow: visible; }
.tile-popover .board-property-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 8px; margin-bottom: 14px; }
.tile-popover .board-property-heading h3 { grid-column: 1 / 3; grid-row: 1; font-size: 18px; white-space: normal; }
.tile-popover .board-property-heading > .icon-button { grid-column: 3; grid-row: 1; width: 28px; min-height: 28px; border-radius: 50%; background: #ffffff09; }
.tile-popover .header-owner { grid-column: 1; grid-row: 2; font-size: 12px; }
.tile-popover .current-rent { grid-column: 2 / 4; grid-row: 2; font-size: 12px; }
.tile-popover .board-property-body { padding: 0; overflow: visible; flex: none; }
.tile-popover .rent-schedule { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; overflow: visible; }
.tile-popover .rent-schedule > div { padding: 9px 3px; border: 1px solid #b7d2db12; border-radius: 8px; background: #061c2544; }
.tile-popover .rent-schedule > div:last-child { grid-column: span 2; }
.tile-popover .rent-schedule dt { font-size: 11px; }
.tile-popover .rent-schedule dd { font-size: 14px; margin-top: 4px; }
.tile-popover .rent-label-full { display: inline; }.tile-popover .rent-label-short { display: none; }
.tile-popover .rent-schedule .current-level { background: #c8f57817; border-color: #c8f57866; }
.tile-popover .property-development { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.tile-popover .property-development button { min-height: 42px; border-radius: 9px; font-size: 12px; padding: 8px 4px; }
.tile-popover .build-house { background: #c8f578; color: #203319; border: 1px solid #dbff9e; }
.tile-popover .sell-house { background: #ffffff08; color: #ffbca5; border: 1px solid #ffbca544; }
.tile-popover .property-development button:disabled { opacity: .4; }
.tile-popover .building-prices { justify-content: space-between; font-size: 11px; }
@container (max-width: 400px) {
  #board .board-center > .tile-popover { padding: 11px; }
  .tile-popover .board-property-heading { margin-bottom: 8px; gap: 4px; }
  .tile-popover .board-property-heading h3 { font-size: 14px; }
  .tile-popover .rent-schedule { margin-bottom: 9px; gap: 4px; }
  .tile-popover .rent-schedule > div { padding: 6px 2px; }
  .tile-popover .rent-schedule dt { font-size: 10px; }
  .tile-popover .rent-schedule dd { font-size: 12px; }
  .tile-popover .property-development button { font-size: 11px; min-height: 36px; }
}
/* Screen-centered negotiations leave the board layout intact. */
#trade-dialog { width: min(640px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 28px); padding: 0; border: 1px solid #a3c4c938; border-radius: 20px; background: #162b35; color: #e4eef0; box-shadow: 0 24px 90px #0009; overflow: hidden; }
#trade-dialog::backdrop { background: #050c16a6; backdrop-filter: blur(5px); }
#trade-dialog[open] { animation: negotiation-in .22s cubic-bezier(.2,.8,.2,1); }
#trade-dialog .trade-panel { display: flex; flex-direction: column; height: auto; max-height: calc(100dvh - 30px); padding: 24px; margin: 0; width: 100%; overflow: hidden; border: 0; }
#trade-dialog .trade-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-shrink: 0; }
#trade-dialog .trade-heading h3 { font-size: 22px; margin: 0; flex: 1; }
#trade-dialog .icon-button { width: 32px; min-height: 32px; border-radius: 50%; background: #ffffff0a; }
#trade-dialog .trade-body { min-height: 0; overflow-y: auto; padding: 0 4px 0 0; font-size: 13px; }
#trade-dialog .trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
#trade-dialog .trade-side { min-width: 0; padding: 14px; background: #091e2866; border: 1px solid #90b8bd22; border-radius: 12px; }
#trade-dialog .trade-side:last-child { border-color: #c8f57833; }
#trade-dialog .trade-side legend { padding: 0 5px; font-size: 12px; color: #c5d5d9; }
#trade-dialog .trade-side label { font-size: 12px; }
#trade-dialog .trade-side > input { padding: 10px; margin-top: 6px; }
#trade-dialog .trade-cash { font-size: 26px; color: #c8f578; margin-bottom: 12px; }
#trade-dialog .trade-properties { display: grid; gap: 6px; padding: 0; list-style: none; margin-top: 12px; }
#trade-dialog .trade-properties li, #trade-dialog .trade-choice { font-size: 13px; line-height: 1.4; border-left: 3px solid transparent; padding: 7px; border-radius: 4px; background: #ffffff04; }
#trade-dialog .trade-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; flex-shrink: 0; }
#trade-dialog .trade-actions button { min-height: 42px; flex: 1; font-size: 13px; border-radius: 10px; }
.unread-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; border-radius: 10px; background: #c8f578; color: #192b20; font-size: 11px; box-shadow: 0 0 12px #c8f57825; }
.unread-badge[hidden] { display: none; }
.trade-inbox-item { padding: 10px; margin-bottom: 5px; border: 1px solid #9dbac31c; border-radius: 10px; background: linear-gradient(120deg,#ffffff06,#ffffff02); gap: 10px; }
.trade-inbox-item.incoming { border-color: #c8f57838; }
.offer-title { display: flex; justify-content: space-between; gap: 5px; align-items: center; width: 100%; }
.offer-title strong { color: var(--player-color) !important; overflow: hidden; text-overflow: ellipsis; }
.offer-status { font-size: 9px; color: #a1b6bf; }
.offer-preview { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; width: 100%; font-size: 11px; }
.offer-preview > span:last-child { text-align: right; }.offer-exchange { color: #c8f578; font-size: 18px; }
.token { border-radius: 9px 9px 11px 11px; background: linear-gradient(145deg, #ffffff80, transparent 50%), var(--player-color); border: 1px solid #ffffffa6; box-shadow: 0 3px 0 #0005, inset 0 -3px 0 #0002; }
.token svg { display: block; width: 88%; height: 94%; }
.players-panel .player .token { width: 30px; height: 32px; }
.board .token { width: clamp(13px,3.2cqw,25px); height: clamp(15px,3.6cqw,28px); border-radius: 6px 6px 8px 8px; }
.moving-token { filter: drop-shadow(0 4px 5px #0007); }
.center-dice { perspective: 500px; }
@keyframes negotiation-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 500px), (max-height: 500px) {
  #trade-dialog .trade-panel { padding: 14px; }
  #trade-dialog .trade-heading { margin-bottom: 10px; }
  #trade-dialog .trade-heading h3 { font-size: 17px; }
  #trade-dialog .trade-sides { gap: 8px; margin-top: 10px; }
  #trade-dialog .trade-side { padding: 8px; }
  #trade-dialog .trade-properties li, #trade-dialog .trade-choice { font-size: 11px; }
  #trade-dialog .trade-actions { padding-top: 12px; }
  .players-panel .player .token { width: 21px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) { #trade-dialog[open] { animation: none; } }
#roll-dice:disabled { opacity: 1; cursor: default; }
.board-center .dice-display .center-dice { gap: 5cqw; padding-block: 2cqw; }
.motion-running .center-play h2, .motion-running #actions, .motion-running .decision-summary { visibility: hidden; }
.motion-running .tile-hit { pointer-events: auto; }
/* Every card has the same icon, title, visitor lane, and ownership footer. */
#board .tile { display: grid; grid-template-rows: minmax(12px,1fr) auto clamp(13px,3.9cqw,30px) 13px; justify-items: center; align-items: center; gap: 3px; padding: 7px 4px 3px; border: 1px solid #a8c5cc22; border-top: 4px solid var(--district,#718e95); background: linear-gradient(155deg,#ffffff09,#081e2822), #263d47; box-shadow: 0 2px 0 #07172088; }
#board .tile > .tile-symbol { grid-row: 1; position: static; opacity: .85; width: clamp(13px,3cqw,23px); height: clamp(13px,3cqw,23px); }
#board .tile > strong { display: block; grid-row: 2; width: 100%; font-size: clamp(7px,1.45cqw,11px); line-height: 1.15; text-align: center; }
#board .tile > small { display: block; grid-row: 4; font-size: clamp(7px,1.1cqw,9px); }
#board .tile .tokens { position: static; grid-row: 3; display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; width: 100%; height: 100%; gap: 0; min-width: 0; }
#board .tile .tokens .token { width: clamp(11px,3cqw,23px); height: clamp(12px,3.4cqw,26px); border-radius: 7px 7px 9px 9px; position: relative; flex-shrink: 0; box-shadow: 0 2px 3px #0006, inset 0 -2px 0 #0002; }
#board .tile .tokens .token + .token { margin-left: clamp(-9px,-1.2cqw,-4px); }
#board .tile .tokens:has(.token:nth-child(4)) .token + .token { margin-left: clamp(-12px,-1.65cqw,-5px); }
#board .tile .owner { position: absolute; inset: auto 3px 3px; height: 13px; border-radius: 3px; font-size: 9px; line-height: 11px; }
#board .tile.owned > small { visibility: hidden; }
#board .tile.selected { border-color: var(--district,#c8f578); box-shadow: inset 0 0 0 1px #ffffff25; }
@container (max-width: 400px) {
  #board .tile { grid-template-rows: 0 auto 12px 6px; padding: 2px 1px 1px; gap: 1px; border-top-width: 2px; }
  #board .tile > .tile-symbol { display: none !important; }
  #board .tile > strong { font-size: 7px; }
  #board .tile > small { font-size: 6px; line-height: 6px; }
  #board .tile .owner { height: 6px; line-height: 6px; font-size: 6px; padding: 0; inset: auto 1px 1px; }
}
#board .tile.property { background: linear-gradient(150deg, color-mix(in srgb, var(--district) 13%, #263d47), #233942); }
#board .tile:not(.property) { border-top-color: #789a9e; }
#board .tile.tax { border-top-color: #e6927c; }
#board .tile.start { border-top-color: #c8f578; }
#board .tile > strong { font-size: clamp(8px,1.6cqw,12px); }
#board .tile > small { font-size: clamp(8px,1.4cqw,10px); }
@container (max-width: 400px) {
  #board .tile { grid-template-rows: 0 auto 12px 8px; }
  #board .tile > strong { font-size: 8px; }
  #board .tile > small { font-size: 7px; line-height: 8px; }
  #board .tile .tokens .token { width: 10px; height: 11px; }
  #board .tile .tokens:has(.token:nth-child(4)) .token + .token { margin-left: -5px; }
}
@container (max-width: 400px) {
  #board .tile > .tile-symbol[data-level]:not([data-level="base"]) { display: block !important; position: absolute; right: 2px; top: 3px; width: 9px; height: 9px; }
  #board .tile:has(.tile-symbol[data-level]:not([data-level="base"])) > strong { padding-right: 9px; }
}
#board .tile .tokens:has(.token:nth-child(4)) { display: grid; grid-template-columns: repeat(3,max-content); grid-template-rows: repeat(2,14px); justify-content: center; align-content: center; gap: 1px 3px; }
#board .tile .tokens:has(.token:nth-child(4)) .token { width: 14px; height: 14px; margin: 0; border-radius: 4px; }
@container (max-width: 400px) {
  #board .tile { grid-template-rows: 0 10px 18px 6px; gap: 0; padding: 1px; }
  #board .tile > small { font-size: 7px; line-height: 6px; }
  #board .tile .tokens:has(.token:nth-child(4)) { grid-template-rows: repeat(2,8px); gap: 1px 2px; }
  #board .tile .tokens:has(.token:nth-child(4)) .token { width: 10px; height: 8px; margin: 0; border-radius: 3px; }
}
#board .tile .tokens:has(.token:nth-child(4)) .token + .token { margin: 0; }
/* The rolling dice do not inherit the flat activity-log die styles. */
#roll-dice .dice-shell { --die-size: clamp(32px,9cqw,66px); display:block; position:relative; width:var(--die-size); height:var(--die-size); padding:0; border:0; background:none; box-shadow:none; border-radius:0; filter:none; transform:none; perspective:600px; }
#board .center-play { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:44px 100px 52px 48px; align-content:center; justify-items:center; gap:4px; }
#board .center-play h2 { margin:0; align-self:center; visibility:visible; }
#board .center-play .dice-display { margin:0; padding:0; height:100%; justify-content:center; }
#board .center-play #turn-panel { width:100%; margin:0; align-self:center; max-height:100%; }
#board .center-play .decision-summary { margin:0; height:48px; width:100%; font-size:11px; line-height:1.3; overflow:auto; }
#board.motion-running .center-play h2 { visibility:visible; }
#board.motion-running .dice-cue { display:block; }
#board .tile:hover { transform:none; }
@container (max-width: 400px) {
  #board .center-play { grid-template-rows:32px 52px 40px 38px; gap:0; }
  #board .center-play h2 { font-size:13px; }
  #board .center-play .decision-summary { height:38px; font-size:9px; }
  #board .center-play #actions { gap:3px; }
  #board .center-play #actions button { min-height:26px; font-size:9px; padding:3px; }
}
#board .center-play { grid-template-rows:44px 100px 64px 48px; }
@container (max-width: 450px) {
  #board .center-play { grid-template-rows:28px 44px 58px 32px; gap:0; }
  #board .center-play .decision-summary { height:32px; font-size:9px; }
}
/* One shaded rounded solid per die; the result stays put between players. */
#roll-dice .dice-shell { perspective:none; }
#roll-dice .dice-shell::after { content:none; }
.sculpted-die { position:absolute; left:-20px; top:-20px; width:calc(100% + 40px); height:calc(100% + 40px); pointer-events:none; }
#board .dice-cue { display:block; opacity:0; transition:opacity .24s ease; pointer-events:none; }
#board .dice-display:has(.roll-ready) .dice-cue { opacity:.8; }
#board.motion-running .dice-cue { opacity:0; }
@media(prefers-reduced-motion:reduce) { #board .dice-cue { transition:none; } }
/* Quiet transaction results sit below the fixed turn controls. */
#board .center-play #actions [data-action="end"] { flex:0 0 auto; width:auto; min-width:112px; max-width:100%; padding:10px 22px; font-size:16px; line-height:1.2; }
#board .center-play #actions [data-leaving] { pointer-events:none; }
.money-results { position:absolute; bottom:3cqw; left:4%; width:92%; display:flex; flex-wrap:wrap; justify-content:center; align-content:end; gap:6px 18px; pointer-events:none; }
.money-result { display:inline-flex; align-items:baseline; gap:7px; max-width:100%; font-size:clamp(10px,1.9cqw,15px); line-height:1.4; }
.money-result > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:18cqw; }
.money-result strong { font-variant-numeric:tabular-nums; white-space:nowrap; }
.money-gain { color:#c8f578; }.money-loss { color:#ff9b88; }
@container (max-width:450px) {
  #board .center-play #actions [data-action="end"] { min-width:80px; padding:6px 12px; font-size:12px; }
  .money-results { bottom:1cqw; gap:2px 9px; }
  .money-result { gap:4px; font-size:11px; }
}
/* Purchase choices share the turn control's compact, animated treatment. */
#board .center-play { grid-template-rows:44px 100px 48px 64px; }
#board .center-play .decision-summary { display:flex; align-items:end; justify-content:center; padding-bottom:4px; overflow:visible; }
#board .center-play #actions { position:relative; }
#board .center-play #actions :is([data-action="buy"],[data-action="pass"]) { flex:0 1 auto; width:auto; min-width:72px; max-width:100%; padding:10px 16px; font-size:16px; line-height:1.2; }
#board .center-play #actions [data-leaving] { position:absolute; }
.trade-inbox { display:flex; flex-direction:column; height:min(210px,28dvh); }
.trade-inbox h2 { margin:0; padding:11px 12px; font-size:12px; font-weight:650; }
#trade-list { flex:1; min-height:0; max-height:none; }
.trade-empty { color:#9aadb5; font-size:11px; margin:8px; }
.offer-title strong { min-width:0; overflow-wrap:anywhere; }
@container (max-width:450px) {
  #board .center-play { grid-template-rows:28px 44px 32px 58px; }
  #board .center-play #actions :is([data-action="buy"],[data-action="pass"]) { min-width:44px; padding:6px 8px; font-size:12px; }
}
@media (max-width:900px) and (min-height:501px) {
  .trade-inbox { height:80px; max-height:80px; }
  .trade-inbox h2 { padding:5px 10px; }
  .trade-inbox-item { padding:4px 6px; gap:2px; min-height:36px; }
}
@media (max-height:500px) and (min-width:621px) { .trade-inbox { height:115px; } }
@container (max-width:400px) {
  #board .center-play { grid-template-rows:24px 40px 30px 32px; align-content:start; padding-top:5px; }
  #board .center-play .decision-summary { height:30px; font-size:9px; }
  #board .center-play #actions :is([data-action="buy"],[data-action="pass"]) { padding:5px 6px; font-size:11px; }
}
@container (max-width:300px) {
  #board .center-play { grid-template-rows:24px 38px 24px 28px; padding-top:0; }
  #board .center-play .decision-summary { height:24px; padding-bottom:0; }
  #board .center-play #actions { flex-wrap:nowrap; gap:3px; }
  #board .center-play #actions :is([data-action="buy"],[data-action="pass"]) { min-width:34px; padding:4px; font-size:10px; }
}

.decision-compact { display:none; }
@container (max-width:300px) {
  .decision-full { display:none; }.decision-compact { display:block; }
  #board .tile { grid-template-rows:0 10px 16px 6px; }
}
@media (max-width:900px) and (min-height:501px) {
  .offer-preview { display:flex; justify-content:space-between; gap:4px; font-size:10px; }
  .offer-preview > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .offer-preview .offer-exchange { flex-shrink:0; font-size:14px; }
}
/* A two-sided exchange, with tangible property cards and clear action intent. */
#trade-dialog { width:min(760px,calc(100vw - 28px)); border-radius:22px; background:#142731; }
#trade-dialog .trade-panel { padding:26px; background:radial-gradient(ellipse at top left,#28444b88,transparent 70%); }
#trade-dialog .trade-heading { margin-bottom:20px; }
#trade-dialog .trade-heading h3 { font-size:23px; letter-spacing:-.5px; }
#trade-dialog .trade-scroll { display:none; }
#trade-dialog .trade-body { scrollbar-gutter:stable; padding-right:8px; }
#trade-dialog .trade-body > label { display:block; margin-bottom:7px; color:#abc3ca; font-size:12px; }
#trade-dialog select { background:#0d2029; color:#eef6f4; border:1px solid #45616b; padding:12px; border-radius:10px; }
#trade-dialog .trade-sides { gap:16px; margin-top:22px; align-items:start; }
#trade-dialog .trade-side { border:1px solid #69848a45; border-top:3px solid var(--trader); border-radius:14px; padding:16px; background:#0b1d2699; }
#trade-dialog .trade-side legend { font-size:11px; font-weight:700; color:#d4e4e7; padding:0 8px; }
.trade-person { display:flex; align-items:center; gap:10px; margin:3px 0 18px; min-width:0; }
.trade-person strong { color:#edf5f4; font-size:15px; overflow-wrap:anywhere; }
.trade-monogram { display:grid; place-items:center; width:34px; height:34px; flex-shrink:0; border-radius:11px; background:var(--trader); color:#162b30; font-size:17px; font-weight:800; }
.trade-wallet { padding:12px; border-radius:12px; background:#233b444f; border:1px solid #b3d0d51a; }
#trade-dialog .trade-wallet > label, .trade-cash-label { color:#aec3c9; font-size:11px; }
.trade-cash-input { display:flex; gap:8px; align-items:center; color:#c8f578; font-size:25px; }
#trade-dialog .trade-cash-input input { width:100%; min-width:0; padding:8px 0; margin:0; border:0; border-radius:3px; background:transparent; color:#f0f6ed; box-shadow:none; font-size:28px; font-weight:750; font-variant-numeric:tabular-nums; }
.trade-wallet small { color:#a5bdc5; font-size:10px; }
.trade-selection { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:20px; font-size:11px; color:#c6d9df; }
.trade-selection > span { color:#9eb5bc; font-size:10px; }
#trade-dialog .trade-properties { gap:8px; margin-top:10px; }
#trade-dialog .trade-choice { display:flex; align-items:center; gap:10px; padding:12px; margin:0; border:1px solid #7b9ba12b; border-left:1px solid #7b9ba12b; border-radius:9px; background:#ffffff04; cursor:pointer; transition:background .16s,border-color .16s; }
#trade-dialog .trade-choice:hover { background:#ffffff0b; }
#trade-dialog .trade-choice:has(:checked) { background:#c8f57813; border-color:#b5df7470; }
#trade-dialog .trade-choice:has(:disabled) { opacity:.5; cursor:default; }
#trade-dialog .trade-choice input { width:17px; height:17px; margin:0; flex-shrink:0; accent-color:#c8f578; }
.trade-estate-info { display:flex; flex-direction:column; gap:4px; min-width:0; }
.trade-estate-info strong { color:#e3eff1; font-size:12px; font-weight:650; }
.trade-estate-info small { color:#a7c0c6; font-size:10px; }
#trade-dialog .trade-properties li { padding:12px; border-radius:9px; display:flex; flex-direction:column; gap:5px; }
#trade-dialog .trade-properties li small { color:#a7c0c6; font-size:11px; }
#trade-dialog .trade-empty-estates { padding:12px 0; font-size:11px; color:#94acb4; border:0; background:none; }
#trade-dialog .trade-actions { border-top:1px solid #76969c26; margin-top:22px; padding-top:18px; gap:10px; }
#trade-dialog .trade-actions button { flex:1; padding:12px 18px; font-size:14px; font-weight:750; box-shadow:none; color:var(--action-fg); background:var(--action-bg); border:1px solid var(--action-border); transition:background .16s,border-color .16s; }
#trade-dialog .trade-actions :is(.trade-accept,.trade-send) { --action-fg:#16351d; --action-bg:#bde889; --action-border:#c7f197; --action-hover:#d0f6a4; }
#trade-dialog .trade-actions .trade-reject { --action-fg:#ffd0c9; --action-bg:#512e35; --action-border:#9d5961; --action-hover:#693b43; }
#trade-dialog .trade-actions .trade-counter { --action-fg:#cceaff; --action-bg:#234658; --action-border:#4c839c; --action-hover:#305b70; }
#trade-dialog .trade-actions button:hover:not(:disabled), #trade-dialog .trade-actions button:focus-visible { color:var(--action-fg); background:var(--action-hover); border-color:var(--action-border); filter:none; }
#trade-dialog .trade-actions button:disabled { opacity:.5; cursor:not-allowed; }
@media(max-width:500px) {
  #trade-dialog .trade-panel { padding:16px; }
  #trade-dialog .trade-heading h3 { font-size:19px; }
  #trade-dialog .trade-sides { grid-template-columns:1fr; gap:16px; }
  #trade-dialog .trade-side { padding:14px; }
  #trade-dialog .trade-actions { margin-top:14px; padding-top:12px; gap:6px; }
  #trade-dialog .trade-actions button { padding:10px 8px; font-size:12px; }
}
@media(prefers-reduced-motion:reduce) { #trade-dialog .trade-choice,#trade-dialog .trade-actions button { transition:none; } }
#trade-dialog .trade-side:last-child { border-color:#69848a45; border-top-color:var(--trader); }
#trade-dialog .trade-cash-input input::-webkit-inner-spin-button { appearance:none; }
#trade-dialog .trade-cash-input input { appearance:textfield; }
/* World edition: a larger promenade around a calm central playing surface. */
#board { grid-template-columns:repeat(var(--board-side,7),minmax(0,1fr)); grid-template-rows:repeat(var(--board-side,7),minmax(0,1fr)); border-radius:22px; gap:5px; padding:10px; background:linear-gradient(145deg,#405b64,#1b3039 65%); }
#board .board-center { grid-area:2 / 2 / var(--board-side,7) / var(--board-side,7); border:1px solid #a5ccd21a; border-radius:16px; background:radial-gradient(ellipse at 50% 35%,#2e4b54,#1c343e 80%); }
.group-4 { --district:#efa586; --tile-bg:#493a36; }
#board .tile { background:linear-gradient(145deg,#ffffff09,#10263044),#29434e; border-radius:9px; box-shadow:0 2px 0 #081d2580; }
#board .tile.property { background:linear-gradient(150deg,color-mix(in srgb,var(--district) 11%,#29434e),#243e48); }
#board .tile.event { border-top-color:#91e3c8; background:linear-gradient(145deg,#315951,#243f48); }
#board .tile.event .tile-symbol { color:#b6f1da; }
#board .tile.event > small { color:#b6f1da; font-size:8px; letter-spacing:.6px; }
#board .tile > strong { font-weight:650; letter-spacing:.1px; font-size:clamp(8px,1.55cqw,12px); }
.side-panel { border-color:#9cbfc31b; box-shadow:0 10px 28px #0002; background:linear-gradient(145deg,#1b3039,#12252e); }
.players-panel .player { transition:background .2s,border-color .2s; }
#board .owner { font-weight:750; letter-spacing:.1px; }
@media(min-width:1100px) { #game { grid-template-columns:minmax(170px,200px) minmax(0,1fr) minmax(170px,210px); gap:20px; padding:16px; } }
@container(max-width:450px) {
  #board { gap:3px; padding:6px; border-radius:15px; }
  #board .tile { grid-template-rows:0 11px 10px 6px; gap:0; padding:1px; border-top-width:2px; border-radius:4px; }
  #board .tile > strong { font-size:7px; line-height:1.05; }
  #board .tile > small { font-size:6px; }
  #board .tile.event > small { font-size:5px; letter-spacing:0; }
  #board .tile .tokens .token { width:9px; height:10px; }
  #board .tile .tokens:has(.token:nth-child(4)) { grid-template-rows:repeat(2,5px); gap:0 2px; }
  #board .tile .tokens:has(.token:nth-child(4)) .token { width:8px; height:5px; }
}

#board .center-play .event-outcome { flex-direction:column; align-items:center; justify-content:center; gap:4px; color:#bcd5d2; }
.event-outcome strong { color:#c2f0da; font-size:15px; }
@container(max-width:450px) { .event-outcome strong { font-size:10px; } #board .center-play .event-outcome { gap:1px; font-size:8px; } }

#board .city-country { display:block; font-size:8px; line-height:1.5; color:#a4bec5; font-weight:500; margin-top:4px; letter-spacing:.5px; }
@container(max-width:550px) { #board .city-country { display:none; } }
@container(max-width:350px) {
  #board .tile { grid-template-rows:0 9px 8px 6px; padding:0 1px; }
  #board .tile .tokens .token { width:8px; height:8px; }
  #board .tile .tokens:has(.token:nth-child(4)) { grid-template-rows:repeat(2,4px); gap:0 1px; }
  #board .tile .tokens:has(.token:nth-child(4)) .token { width:7px; height:4px; }
}
@container(min-width:451px) {
  #board .tile { grid-template-rows:minmax(10px,1fr) auto 26px 13px; gap:2px; padding:5px 4px 3px; }
  #board .tile .tokens:has(.token:nth-child(4)) { grid-template-rows:repeat(2,12px); }
  #board .tile .tokens:has(.token:nth-child(4)) .token { height:12px; }
  #board .city-country { line-height:1.1; margin-top:2px; }
}
#board .tile.event > strong { color:#d0f0e1; }
@container(max-width:450px) {
  #board .event-outcome > span { display:none; }
  #board .tile.event > small { font-size:0; }
  #board .tile.event > small::after { content:'EVENT'; font-size:5px; }
}

#board .event-outcome[data-tone="expense"] strong { color:#ffb5a1; }
@media(max-width:900px) and (min-height:501px), (max-height:500px) {
  #board { gap:3px; padding:6px; border-radius:16px; }
}
@media(max-width:600px) and (max-height:700px) {
  .activity-rail .event-panel,.activity-rail #event-feed { max-height:64px; }
  .player-rail #players { max-height:56px; padding-bottom:4px; }
  .players-panel .panel-heading { padding:7px 10px; }
  .players-panel .player { grid-template-columns:16px minmax(0,1fr) auto; gap:4px; padding:4px; }
  .players-panel .player .token { grid-row:auto; width:16px; height:18px; }
  .players-panel .player strong { grid-column:auto; text-align:right; font-size:9px; }
  .players-panel .player > span:nth-child(2) { font-size:9px; }
}
@container(max-width:450px) {
  #board .tile { grid-template-rows:0 14px 8px 6px; }
  #board .tile > strong { white-space:normal; overflow-wrap:anywhere; text-overflow:clip; font-size:7px; line-height:1; letter-spacing:0; }
}

/* Keep the invitation mounted so starting and ending a roll can fade it. */
#board #roll-dice::after { animation:none; opacity:0; transform:none; transition:opacity .3s ease; }
#board #roll-dice.roll-ready::after { opacity:.7; }
@media(prefers-reduced-motion:reduce) { #board #roll-dice::after { transition:none; } }
