/* Local display choices and the current turn's controls share the existing
   paper / green visual language, including the dark palette. */
.tv-toolbar{flex-wrap:wrap}
.tv-toolbar-actions{flex-wrap:wrap;justify-content:flex-end}
.tv-controls[open]>div{width:300px;gap:12px;padding:18px;background:var(--paper);border-color:var(--line)}
.tv-controls label{margin:0;font-size:.85rem}
.tv-controls .tv-button{white-space:normal;text-align:left;min-height:44px}
.settings-caption,.action-context{display:block;font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.tv-controls .layout-note{line-height:1.5;color:var(--muted);font-size:12px}
#sound-volume{accent-color:var(--green);height:34px;padding:0;border:0;box-shadow:none;background:transparent}
#sound-volume-value{float:right;font-variant-numeric:tabular-nums}
.scene-camera-buttons{flex-wrap:wrap;max-width:calc(100% - 20px);z-index:2}
.scene-camera-buttons .tv-button{min-height:40px;font-size:.8rem}
.board-3d-canvas{cursor:grab}
.board-3d-canvas:active{cursor:grabbing}
.board-3d-canvas:focus-visible{outline:3px solid #bc792f;outline-offset:-4px}
.board-3d-canvas[data-camera=manual]{touch-action:none}
.scene-manual-controls{position:absolute;bottom:10px;left:10px;right:10px;z-index:2;pointer-events:none}
.scene-manual-controls>span{display:inline-block;font-size:12px;padding:5px 8px;background:var(--paper);border:1px solid var(--line);border-radius:6px;color:var(--ink);margin-bottom:5px}
.scene-manual-controls>div{display:flex;flex-wrap:wrap;gap:5px;pointer-events:auto;width:fit-content}
.scene-manual-controls .tv-button{min-width:44px;min-height:44px;font-size:17px;padding:6px 9px;box-shadow:0 2px 9px #152c3017}
.scene-manual-controls .tv-button:last-child{font-size:13px}
.action-controls{display:grid;gap:10px;margin-top:18px}
.action-controls .button-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.action-controls .button{min-height:48px;line-height:1.35;white-space:normal;margin:0}
.action-controls .bid-form{margin:0}
.action-controls .action-budget{font-size:.85rem;line-height:1.4;margin:0}
.action-controls .action-context{color:var(--ink);overflow-wrap:anywhere}
.action-controls button:disabled{opacity:.55;cursor:not-allowed}
.controller-shell{padding-bottom:calc(var(--action-dock-height,0px) + 45px)}
.controller-shell .action-controls{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:20;width:min(100%,620px);margin:0;padding:14px 20px max(14px,env(safe-area-inset-bottom));border:1px solid var(--line);border-radius:18px 18px 0 0;background:var(--paper);color:var(--ink);box-shadow:0 -8px 28px #173d321a;max-height:50dvh;overflow:auto}
.controller-shell .action-controls .roll-button{min-height:52px}
.has-action-dock #toast{bottom:calc(var(--action-dock-height,150px) + 20px)}
.desktop-sidebar .action-controls .action-budget{font-size:.82rem;margin:0}
.desktop-sidebar .action-context{font-size:.72rem}
/* Larger readable information, without stretching the board geometry. The
   information areas may scroll for unusually long names or custom cards. */
.text-large .tv-caption{font-size:clamp(15px,1.8cqw,22px)}
.text-large .tv-instruction,.text-large .tv-event-detail{font-size:clamp(16px,1.8cqw,23px)}
.text-large .tv-player-info>strong{font-size:clamp(20px,1.7vw,29px)}
.text-large .tv-player-money>strong{font-size:clamp(24px,2vw,34px)}
.text-large .tv-player-info>small,.text-large .tv-player-money>small,.text-large .tv-ownership-key,.text-large .tv-highlight-help,.text-large .spectator-count{font-size:clamp(14px,1.1vw,19px);line-height:1.4}
.text-large .tv-player{min-height:82px}
.text-large .tv-badge{width:38px;height:38px}
.text-large .tv-card p{font-size:clamp(20px,2.6cqw,30px)}
.view-3d .tv-center{min-height:0;max-height:min(32%,calc(100% - 220px))}
.text-large.view-3d .tv-center{max-height:min(42%,calc(100% - 220px));padding:16px 20px;gap:10px 22px;grid-template-columns:minmax(0,1fr) minmax(200px,1fr)}
.text-large.view-3d .tv-caption,.text-large.view-3d .tv-card>span,.text-large.view-3d .tv-owner,.text-large.view-3d .tv-instruction,.text-large.view-3d .tv-event-detail,.text-large.view-3d .tv-rent>span,.text-large.view-3d .tv-buildings{font-size:16px}
.text-large.view-3d .tv-announcement,.text-large.view-3d .tv-announcement.long-announcement{font-size:clamp(22px,2.2vw,36px)}
.text-large.view-3d .tv-center :is(.tv-property,.tv-auction,.tv-debt) h2{font-size:clamp(22px,2vw,32px)}
.text-large.view-3d .tv-rent>strong{font-size:30px}
.text-large.view-3d .tv-card p{font-size:clamp(20px,1.8vw,27px)}
.text-large.view-3d .tv-dice>strong{font-size:30px}
.text-large.view-3d .tv-dice>small{font-size:13px;max-width:60px}
.text-large.view-3d .tv-celebration,.text-large.view-3d .tv-moment{font-size:20px}
@media(max-width:650px){
  .tv-toolbar{position:relative}
  .tv-controls{position:static}
  .tv-controls[open]>div{left:0;right:0;top:calc(100% + 6px);width:auto;max-width:none;max-height:65dvh}
  .tv-toolbar-actions{gap:6px;justify-content:flex-start}
  .tv-toolbar .tv-button{font-size:.76rem;padding:8px 10px}
  .scene-camera-buttons .tv-button{font-size:.75rem;padding:6px 8px}
  .scene-manual-controls{bottom:6px;left:6px;right:6px}
  .scene-manual-controls>span{font-size:10px}
  .scene-manual-controls>div{gap:3px}
  .scene-manual-controls .tv-button{min-width:38px;min-height:42px;padding:6px}
  .view-3d .tv-center{max-height:min(38%,calc(100% - 220px))}
  .text-large.view-3d .tv-center{grid-template-columns:minmax(0,1fr);padding:12px;max-height:min(44%,calc(100% - 220px))}
  .text-large.view-3d .tv-center :is(.tv-property,.tv-auction,.tv-debt,.tv-card){grid-column:1;grid-row:auto}
}
@media(max-height:480px){
  .controller-shell .action-controls{position:static;transform:none;width:auto;max-height:none;padding:12px;border-radius:12px;box-shadow:none}
  .controller-shell{padding-bottom:30px}
  .has-action-dock #toast{bottom:24px}
}

/* A storage fallback matters more than decorative help text. Keep it visible. */
.session-notice{padding:12px 20px;background:var(--paper);color:var(--ink);border-bottom:2px solid #c58d32;font-size:1rem;line-height:1.5;text-align:center}.session-notice[hidden]{display:none}

/* Phone cards stay outside the small board so their story remains readable. */
.phone-board-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.phone-board-heading>div:first-child{min-width:0}.phone-board-heading strong{display:block;font-size:1.05rem;overflow-wrap:anywhere}.phone-board-heading>div>span:not([aria-hidden]){display:block;font-size:.9rem;color:var(--muted);margin-top:5px}.phone-board-heading .dice-row{font-size:1.7rem;gap:5px;flex-shrink:0}.board-tab .center-property h3{font-size:1.05rem;line-height:1.3;overflow-wrap:anywhere;margin-top:0}.board-tab .center-property p{font-size:.9rem}.phone-board-inspect{margin-top:16px;min-height:48px;white-space:normal}.board-tab .phone-board-card{max-width:none;padding:20px;margin-top:16px}.board-tab .phone-board-card h3{font-size:1.2rem}.board-tab .phone-board-card p{font-size:1rem;line-height:1.6}

/* Use the same alignment box for summary toggles and neighboring buttons. */
.tv-toolbar .tv-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px}
.tv-toolbar .tv-controls>summary.tv-button{text-align:center}
.tv-toolbar .tv-controls>div .tv-button{justify-content:flex-start}
/* Controls take their own space, leaving the full canvas available for framing. */
.scene-viewport{display:flex;flex-direction:column;min-height:min-content}
.scene-camera-buttons{position:relative;top:auto;left:auto;order:-1;flex:none;padding:8px;max-width:none;background:var(--paper);border-bottom:1px solid var(--line)}
.scene-canvas-host{position:relative;inset:auto;flex:1;min-height:160px}
.scene-canvas-host>.board-3d-canvas{position:absolute;inset:0}
.scene-manual-controls{position:relative;bottom:auto;left:auto;right:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px;pointer-events:auto;background:var(--paper);border-top:1px solid var(--line)}
.scene-manual-controls[hidden]{display:none}
#app .scene-drag-control{display:flex;flex-direction:row;align-items:center;gap:7px;margin:0;font-size:12px}
.scene-drag-control select{width:auto;font-size:14px;min-height:44px;padding:6px 25px 6px 9px}
.scene-manual-controls .tv-button{display:inline-flex;align-items:center;justify-content:center}
.board-3d-canvas[data-camera=manual][data-drag=pan]{cursor:move}
.tv-controls[open]>div{max-height:calc(100dvh - 100px);overflow-y:auto;overscroll-behavior:contain}

/* Short displays scroll the page instead of clipping camera controls. */
.view-3d .tv-board{min-height:520px}
.view-3d .tv-center{flex-shrink:1;min-height:92px}
