/* In-game layout. The viewport owns the board's size; zoom never affects layout. */
body:has(.game-shell){height:100dvh;overflow:hidden}
body:has(.game-shell) footer{display:none}
body:has(.game-shell) #main{display:flex;flex-direction:column;width:100%;min-width:0;min-height:0;height:calc(100dvh - var(--game-header-height,64px))}
body.has-navigation:has(.game-shell){padding-left:0}
body.has-navigation:has(.game-shell) .topbar{margin-left:0}
body:has(.game-shell) .panel-toolbar{flex-shrink:0;min-height:32px;padding:4px 12px;gap:7px;font-size:11px}
body:has(.game-shell) .panel-toolbar :is(button,select,summary){min-height:25px;padding:3px 6px;font-size:11px}
.game-shell{position:relative;display:flex;flex:1;flex-direction:column;gap:6px;width:100%;height:auto;min-height:0;min-width:0;max-width:100%;padding:6px 12px;margin:0;overflow:hidden;box-sizing:border-box}
.game-shell :is(.table-toolbar,.table-status,.game-shortcuts,.workspace-heading,.panel-hint){display:none}
.game-shell .game-heading{flex-shrink:0;display:flex;align-items:center;min-height:25px;height:25px;padding:0;margin:0;gap:6px}
.game-shell .game-heading h1{font:600 16px Arial,sans-serif!important;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.game-shell .game-heading>div:first-child{display:flex;align-items:center;gap:10px;min-width:0}
.game-shell .game-heading a,.game-shell .game-label{font-size:11px}
.game-shell .game-layout{position:relative;display:flex;flex:1;align-items:stretch;min-width:0;min-height:0;gap:10px;overflow:hidden}
.game-shell .board-column{position:relative;display:flex;flex:1;flex-direction:column;align-self:stretch;height:100%;min-width:0;min-height:0;gap:6px}
.game-shell .board-view-controls{order:0;display:flex;align-items:center;flex-shrink:0;flex-wrap:wrap;min-width:0;min-height:30px;margin:0;padding:3px 0;gap:6px;font-size:11px}
.game-shell .board-view-controls>div{display:none}
.game-shell .board-view-controls button{padding:4px 7px;font-size:11px;min-height:26px}
.game-shell .board-view-controls input{width:70px}
.game-shell .board-view-controls output{min-width:38px;font-size:10px}
.game-shell .board-viewport{order:1;position:relative;display:block;flex:1 1 0;min-width:0;min-height:0;height:auto;max-height:none;width:auto;padding:0;overflow:hidden!important;touch-action:none;border:1px solid var(--line);border-radius:10px;background:var(--wash)}
.game-shell .game-board,.game-shell:not(.board-focus) .game-board{position:absolute!important;left:50%;top:50%;width:var(--fit-size,300px)!important;height:var(--fit-size,300px)!important;min-width:0!important;min-height:0!important;max-width:none!important;aspect-ratio:1;margin:0;padding:4px;gap:var(--cell-gap,2px);border:1px solid var(--line);border-radius:7px;box-shadow:none;box-sizing:border-box;transform:translate(calc(-50% + var(--pan-x,0px)),calc(-50% + var(--pan-y,0px))) scale(var(--view-zoom,1));transform-origin:center}
.game-shell .board-cell{min-width:0!important;min-height:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;padding:1px!important;gap:1px!important;border-radius:2px;overflow:hidden;line-height:1}
.game-shell .board-cell .cell-name{display:none!important}
.game-shell .board-cell>.icon{position:static!important;inset:auto!important;flex-shrink:0;width:clamp(2px,calc(var(--cell-unit,40px)*.3),20px);height:clamp(2px,calc(var(--cell-unit,40px)*.3),20px)}
.game-shell .board-cell .cell-number{position:absolute;top:1px;left:1px;font-size:6px}
.game-shell .board-cell>.cell-price{display:block!important;position:static;flex-shrink:0;font-size:clamp(5px,calc(var(--cell-unit,40px)*.2),11px)!important;line-height:1;white-space:nowrap;color:var(--ink)}
.game-shell .board-cell>.owner-tag{right:1px;bottom:1px;min-width:8px;padding:0 1px;font-size:7px!important;line-height:1.1}
.game-shell .board-cell>.owner-tag.unowned{display:none!important}
.game-shell .board-cell .property-band{height:3px}
.game-shell .board-cell .cell-pawns{position:absolute;left:1px;right:auto;bottom:1px;display:flex;min-height:0!important;gap:1px}
.game-shell .board-cell .cell-pawns .board-pawn{flex:0 0 12px;width:12px;height:12px;min-width:12px;border-width:1px;padding-top:2px;gap:1px;margin:0;box-shadow:none}
.game-shell .board-cell .cell-pawns .board-pawn i{width:3px;height:4px;border-width:1px}
.game-shell .board-cell .cell-pawns :is(.pawn-mouth,.pawn-cheek){display:none}
.game-shell .slot-logos{display:flex;gap:1px;font-size:7px}
.game-shell .slot-logos .icon{width:8px;height:8px}
.game-shell .board-middle{display:flex;flex-direction:column;justify-content:center;align-items:stretch;min-width:0;min-height:0;padding:clamp(4px,1.5vw,20px);gap:6px;overflow:hidden}
.game-shell .board-middle :is(.board-wordmark,.board-key,.center-instruction){display:none}
.game-shell .board-middle .center-top{flex-shrink:0;justify-content:center;padding:0;border:0}
.game-shell .board-middle .center-turn{flex-shrink:1;min-height:0;margin:0;gap:3px;text-align:center}
.game-shell .board-middle .center-turn>.board-pawn{display:none}
.game-shell .board-middle .center-turn>strong{font-size:clamp(11px,1.8vw,24px)!important}
.game-shell .board-middle .center-metrics{display:flex;flex-wrap:wrap;justify-content:center;flex-shrink:0;padding:5px;gap:8px}
.game-shell .board-middle .game-metric{min-width:0;padding:3px}
.game-shell .board-middle .game-metric>strong{font-size:clamp(10px,1.2vw,19px)}
.game-shell .board-middle .game-metric>span{font-size:9px}
.game-shell .board-middle .forecast{font-size:10px;margin:0}
.game-shell .board-middle .test-label{font-size:8px;padding:2px}
.game-shell .turn-panel{order:2;position:static!important;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;flex-wrap:nowrap;min-height:40px;max-height:none;min-width:0;margin:0;padding:5px 8px;gap:6px;box-shadow:none}
.game-shell .turn-panel>div{min-width:0}
.game-shell .turn-panel #turn-title{font-size:12px;white-space:normal;overflow-wrap:anywhere}
.game-shell .turn-panel #turn-clock{font-size:10px}
.game-shell .turn-panel #action-guidance{display:none}
.game-shell .turn-panel #cash-receipt{position:absolute;bottom:80px;right:10px;z-index:4;pointer-events:none}
.game-shell .turn-panel .action-row{display:flex;align-items:center;flex-wrap:wrap;gap:5px;width:auto;margin:0}
.game-shell .turn-panel .action-row>button{min-height:28px;padding:4px 9px;font-size:12px}
.game-shell .game-dice{display:flex;gap:4px}
.game-shell .game-dice .pip-die{width:24px;height:24px;padding:4px;gap:2px;border-radius:4px;box-shadow:none}
.game-shell .game-dice .pip-die i{width:3px;height:3px}
.game-shell .game-tabs{order:3;display:flex;flex-shrink:0;flex-wrap:nowrap;min-width:0;max-width:100%;min-height:32px;max-height:36px;gap:3px;padding:0;margin:0;border:0;overflow-x:auto;overflow-y:hidden}
.game-shell .game-tabs>button{display:flex;flex:0 0 auto;align-items:center;white-space:nowrap;min-height:30px;height:30px;padding:4px 7px;gap:3px;font-size:11px!important;border-radius:5px}
.game-shell .game-tabs>button>.icon{flex:0 0 13px;width:13px;height:13px}
.game-shell .game-sidebar{display:flex;flex-direction:column;flex-shrink:0;width:250px;min-width:0;min-height:0;height:100%;max-height:100%;gap:8px;overflow:auto}
.game-shell .game-sidebar>.panel-frame{flex-shrink:0}
.game-shell .panel-chrome{flex-wrap:nowrap;padding:5px;gap:3px}
.game-shell .panel-chrome button{padding:2px;width:24px;min-width:24px;height:24px;min-height:24px}
.game-shell .panel-chrome button .icon{width:14px;height:14px}
.game-shell .panel-chrome .panel-title{font-size:11px}
.game-shell .player-strip{display:flex;flex-shrink:0;min-width:0;min-height:42px;height:42px;overflow:hidden;gap:5px}
.game-shell .player-strip .panel-frame{display:flex;flex-direction:row;align-items:center;min-width:0;min-height:0;width:100%!important;height:auto;max-height:42px;padding:0;border:0;background:none;overflow:hidden}
.game-shell .player-strip .panel-chrome{display:flex;flex-direction:column;flex-shrink:0;width:25px;padding:0;border:0}
.game-shell .player-strip .panel-chrome>.panel-title,.game-shell .player-strip .panel-chrome>button:not(:first-of-type),.game-shell .player-strip .panel-resize{display:none}
.game-shell .player-strip .player-panel{flex:1;min-width:0;width:100%;padding:0}
.game-shell .player-strip .player-panel>.panel-heading{display:none}
.game-shell .player-strip #players{display:flex;gap:5px;overflow-x:auto;scrollbar-width:thin}
.game-shell .player-strip .player-row{flex:0 0 auto;min-width:145px;padding:3px 5px;gap:4px;line-height:1.15}
.game-shell .player-strip .player-row :is(strong,span,small){font-size:10px}
.game-shell .player-strip .player-row .board-pawn{width:20px;height:20px;min-width:20px}
.game-shell .player-strip .player-row .player-turn-marker{display:none}
.game-shell[data-rules-version="4"] .event-announcement{display:none}
.game-shell .board-column>.panel-frame:has(#workspace){order:4;position:absolute;align-self:stretch;top:45px;bottom:82px;right:0;width:min(44%,480px)!important;height:auto!important;min-height:0;max-height:none;overflow:auto;z-index:2;background:var(--surface);box-shadow:none}
.game-shell .board-column:has(>[data-panel-id="game:workspace"][data-panel-state="open"]:not([hidden])) .board-viewport{margin-right:min(45%,490px)}
.game-shell .board-column>.panel-frame:has(#workspace)[data-panel-state="minimized"]{top:auto;bottom:80px;max-height:34px;width:auto!important}
.game-shell #workspace{padding:12px;margin:0;min-width:0}
.game-shell #workspace h2{font-size:20px}.game-shell #workspace h3{font-size:16px}
.board-mini{position:absolute;right:8px;bottom:8px;z-index:3;width:65px;height:65px;padding:3px;border:1px solid var(--line);background:var(--surface)}
.board-mini[hidden]{display:none}.board-mini svg{width:100%;height:100%}
.game-menu{max-width:560px;width:calc(100% - 30px);color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px}.game-menu::backdrop{background:#0008}.game-menu button{margin:4px}
.industry-card{border:1px solid var(--line);padding:12px;border-radius:8px;margin:8px 0}.industry-card progress{width:100%;accent-color:var(--accent)}
.industry-form{display:flex;gap:8px;flex-wrap:wrap;align-items:end;padding:10px 0}.industry-form label{display:flex;flex-direction:column;min-width:0;max-width:100%;font-size:12px;gap:4px}.industry-form :is(input,select){min-width:0;max-width:190px}
.industry-alerts{position:absolute;top:20%;left:20%;right:auto;max-height:20%;overflow:auto;z-index:3;pointer-events:none;display:flex;flex-direction:column;gap:4px;align-items:flex-start}.industry-alerts button{pointer-events:auto;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-left:4px solid var(--warning);padding:6px;font-size:11px;max-width:95%;text-align:left}
.bundle-columns{display:grid;grid-template-columns:1fr 1fr;gap:8px}.bundle-columns .industry-card{min-width:0;padding:8px}.bundle-columns :is(input,select){max-width:100%;width:100%;font-size:12px}.bundle-row{display:flex;align-items:center;gap:4px;margin-top:7px;padding-top:7px;border-top:1px solid var(--line);font-size:12px;flex-wrap:wrap}.bundle-row span{flex:1}.bundle-row input{width:80px}.bundle-row button{font-size:10px}.bundle-composer select{max-width:100%;min-width:0}.industry-card pre{white-space:pre-wrap;word-break:break-word;font-size:11px}
.search-hidden,.mode-hidden,.panel-frame:has(>.setup-section.search-hidden){display:none!important}.preset-tools{display:flex;flex-wrap:wrap;gap:8px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.preset-tools p{flex-basis:100%;overflow-wrap:anywhere}
@media(min-width:1700px){body:has(.game-shell):not(.navigation-open) .site-navigation{visibility:hidden;transform:translateX(-100%)}body:has(.game-shell) .navigation-toggle{display:flex}}
@media(max-width:1100px){.game-shell .game-sidebar{display:none}}
@media(max-width:800px){
 body:has(.game-shell) .panel-toolbar{flex-wrap:nowrap;overflow-x:auto;min-height:33px;padding:3px 5px}
 body:has(.game-shell) .panel-toolbar>button,body:has(.game-shell) .panel-toolbar>label{flex-shrink:0}
 body:has(.game-shell) .panel-toolbar>.panel-save-status{display:none}
 .game-shell{padding:4px;gap:4px}.game-shell .game-heading{min-height:20px;height:20px}.game-shell .game-heading h1{font-size:12px!important}.game-shell .game-heading a{display:none}
 .game-shell .board-view-controls{gap:3px;min-height:28px;padding:0;justify-content:center}.game-shell .board-view-controls :is(button,label){font-size:10px;padding:3px}.game-shell .board-view-controls input{width:45px}.game-shell .board-view-controls output{min-width:30px}.game-shell .jackpot-indicator{font-size:9px}
 .game-shell .board-column{gap:4px}.game-shell .game-layout{gap:0}
 .game-shell .board-column>.panel-frame:has(#workspace){position:static;flex:0 1 auto;width:100%!important;min-width:0;height:auto!important;max-height:36%;border-radius:10px 10px 0 0;order:4}
 .game-shell .board-column:has(>[data-panel-id="game:workspace"][data-panel-state="open"]:not([hidden])) .board-viewport{margin-right:0}
 .game-shell .board-column>.panel-frame:has(#workspace)[data-panel-state="minimized"]{max-height:30px}
 .game-shell #workspace{padding:8px}.game-shell .player-strip{height:42px;min-height:42px}
 .game-shell .board-middle .forecast{display:none}.game-shell .board-middle .center-top .eyebrow{font-size:8px}.game-shell .board-middle .game-metric>span{font-size:8px}
 .game-shell .turn-panel{padding:4px;min-height:36px}.game-shell .turn-panel>div:first-child{display:none}.game-shell .turn-panel .action-row{flex:1;justify-content:center}.game-shell .turn-panel .action-row>button{font-size:11px;min-height:26px}
 .game-shell .game-tabs{min-height:30px;max-height:34px}.game-shell .game-tabs>button{font-size:10px!important;padding:3px 6px}.board-mini{width:40px;height:40px}
 .bundle-columns{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.game-board{transition:none}}
.price-spark{display:block;width:180px;height:44px;color:var(--accent);margin:8px 0}.industry-card[data-severity=critical]{border-left:4px solid var(--danger)}.industry-card[data-severity=warning]{border-left:4px solid var(--warning)}.industry-card[data-severity=success]{border-left:4px solid var(--accent)}.slot-state{position:absolute;top:1px;right:1px;color:var(--danger);font-weight:bold;font-size:8px}.event-affected{box-shadow:inset 0 0 0 1px var(--warning)}

.game-shell .game-board[data-detail=tiny] .cell-price,.game-shell .game-board[data-detail=tiny] .cell-number{display:none!important}
.game-shell .game-board[data-detail=tiny] .board-cell{padding:0!important;gap:0!important}
.game-shell .game-board[data-detail=tiny] .property-band{height:1px}
.game-shell .game-sidebar .panel-content>h2:first-child{display:none}
@media(max-width:800px){
 .game-shell .game-heading .game-label{display:none}
 .game-shell .board-middle{gap:3px;padding:4px}
 .game-shell .board-middle .center-turn{display:flex;flex-direction:column;flex-shrink:0;gap:2px;line-height:1.1}
 .game-shell .board-middle .center-turn .eyebrow{font-size:7px;letter-spacing:.5px}
 .game-shell .board-middle .center-turn>strong{font:600 11px Arial,sans-serif!important}
 .game-shell .board-middle .center-metrics{display:grid;grid-template-columns:1fr 1fr;gap:2px;padding:2px}
 .game-shell .board-middle .game-metric{padding:1px;display:flex;flex-direction:column;gap:1px;line-height:1.1}
 .game-shell .board-middle .game-metric>span{font-size:7px}.game-shell .board-middle .game-metric>strong{font-size:10px}
 .game-shell .turn-panel .action-row>button{width:auto;flex:0 1 auto}
}

.game-shell .game-sidebar .panel-heading{display:none}

.game-shell .player-strip .panel-frame{position:relative}
.game-shell .player-strip .player-menu-toggle{display:flex!important}
.game-shell .player-strip .player-controls-open .panel-chrome{position:absolute;left:0;top:0;z-index:5;flex-direction:row;width:auto;min-height:40px;padding:3px;background:var(--surface);border:1px solid var(--line);border-radius:5px}
.game-shell .player-strip .player-controls-open .panel-chrome>button{display:flex!important}
.game-shell .player-strip:not(:has(.panel-frame:not([hidden]))){height:0;min-height:0}
body.panels-hidden .player-strip{display:none}
body:has(.game-shell) .panel-float-layer>.panel-maximized{left:auto!important;right:8px!important;top:140px!important;bottom:8px!important;width:min(68vw,900px)!important;height:auto!important}
@media(max-width:700px){body:has(.game-shell) .panel-float-layer>.panel-maximized{left:8px!important;right:8px!important;top:auto!important;bottom:8px!important;width:auto!important;height:50dvh!important}}

.game-shell .turn-panel{padding:5px 8px!important}
@media(max-width:800px){
 body:has(.game-shell) .panel-toolbar{scrollbar-width:none}
 body:has(.game-shell) .panel-toolbar>details{flex:0 0 auto}
 body:has(.game-shell) .panel-toolbar summary{white-space:nowrap}
 body:has(.game-shell) .panel-toolbar>.layout-status{display:none}
 .game-shell .board-view-controls{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;min-height:30px}
 .game-shell .board-view-controls>*{flex-shrink:0;white-space:nowrap}
 .game-shell .turn-panel{padding:4px!important}
 .game-shell .turn-panel .action-row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
}
@media(max-width:800px) and (max-height:650px){.game-shell .board-column>.panel-frame:has(#workspace){max-height:25%}.game-shell .board-viewport{min-height:85px}}

/* Playback controls share two compact rows on phones, preserving every action. */
.game-shell .replay-controls{flex-shrink:0;gap:6px;margin:0;min-width:0}
.game-shell .replay-controls :is(button,input,select){min-height:30px;margin:0;padding:4px 6px}
.game-shell .replay-controls input[type=range]{padding:0;min-width:90px}
@media(max-width:800px){
 .game-shell .replay-controls{display:grid;grid-template-columns:44px 62px 44px minmax(85px,1fr) 44px;grid-template-areas:"back play next speed speed" "range range index round jump";gap:4px}
 .game-shell .replay-controls :is(button,input,select){min-height:44px;font-size:11px;max-width:100%;box-sizing:border-box}
 .game-shell #replay-back{grid-area:back}.game-shell #replay-play{grid-area:play}.game-shell #replay-next{grid-area:next}
 .game-shell .replay-controls label:has(#replay-speed){grid-area:speed;justify-content:flex-end}
 .game-shell #replay-range{grid-area:range;min-width:0;width:100%}.game-shell #replay-index{grid-area:index;text-align:center;font-size:10px;white-space:nowrap}
 .game-shell .replay-controls label:has(#replay-round){grid-area:round;justify-content:flex-end;min-width:0;gap:3px;font-size:10px}
 .game-shell #replay-round{width:45px;padding:4px}.game-shell #replay-jump{grid-area:jump;padding:4px}
}
@media(max-width:340px){
 .game-shell .replay-controls{grid-template-columns:40px 55px 40px minmax(70px,1fr) 40px}
 .game-shell .replay-controls label:has(#replay-speed){gap:3px}.game-shell #replay-speed{width:60px}
}
.game-shell:has(.replay-controls) .turn-panel{display:none}

/* Building sheets share the board's semantic palette and remain readable on phones. */
.building-metrics { display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:12px 0; }
.building-metrics dt { color:var(--muted);font-size:.85rem; }
.building-metrics dd { margin:4px 0 0;font-weight:700;overflow-wrap:anywhere; }
.building-detail { scroll-margin:16px; }
.building-detail details { margin:8px 0;border-top:1px solid var(--line);padding-top:8px; }
.building-detail summary { cursor:pointer;font-weight:700;padding:8px 0;min-height:44px; }
.building-explanation { padding:10px 12px;border-inline-start:3px solid var(--gain);background:var(--wash); }
.building-explanation[data-blocked=true] { border-color:var(--warning); }
.building-chart { display:block;width:100%;height:130px;color:var(--accent); }
.building-filters { display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:12px 0; }
.building-filters input { flex:1 1 200px; }
.building-filters select { max-width:100%; }
.building-comparison table { min-width:600px; }
.building-detail caption { text-align:start;color:var(--muted);padding:8px 0; }
#property-dialog { padding:0; }
#property-content { padding:24px; }
#property-content #property-title { padding-inline-end:36px; }
@media(max-width:600px) {
  #property-dialog { width:100%;max-width:100%;max-height:92dvh;margin:auto 0 0;inset:auto 0 0;border-radius:12px 12px 0 0; }
  #property-content { padding:16px 12px; }
  .building-detail .building-metrics { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 8px; }
  .building-detail .building-metrics dt { font-size:.8rem; }
}
#property-dialog>.dialog-close { position:sticky;top:6px;right:auto;float:right;margin:6px 8px 0;z-index:2; }
