/* Same board-first proportions and side tools as the classic room. */
.fun-board-room .rv-turn,.fun-board-room #duo-turn{border:1px solid var(--turn-color,var(--line));border-left:5px solid var(--turn-color,var(--gold));background:color-mix(in srgb,var(--turn-color,var(--gold)) 16%,var(--surface));color:var(--ink);border-radius:10px;font-size:15px;font-weight:750;text-align:left;line-height:1.55;padding:10px 12px;overflow-wrap:anywhere}
.fun-board-room .rv-turn::before,.fun-board-room #duo-turn::before{content:'';display:inline-block;vertical-align:middle;width:11px;height:11px;border-radius:50%;margin-right:8px;background:var(--turn-color,var(--gold));box-shadow:0 0 0 4px color-mix(in srgb,var(--turn-color,var(--gold)) 18%,transparent)}
.fun-board-room .rv-player.current-turn,.fun-board-room .duo-seat.current{border:2px solid var(--seat-color);background:color-mix(in srgb,var(--seat-color) 12%,var(--surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--seat-color) 12%,transparent)}
.fun-board-room .rv-turn-dot[data-active=true]{color:var(--ink);font-weight:750}.fun-board-room .rv-turn-dot[data-active=true]::before{background:var(--seat-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--seat-color) 18%,transparent)}
.fun-board-room .duo-seat.current>b:first-child::before{content:'● ';color:var(--seat-color)}
.fun-board-room .fun-player-list{position:static!important;display:grid!important;grid-template-columns:1fr;gap:9px;margin:0!important;padding:0!important}
body .fun-board-room .fun-player-list .movable-player-card{position:static!important;transform:none!important;width:100%!important;max-width:none;box-sizing:border-box;margin:0;cursor:default;touch-action:auto;user-select:text}
.fun-board-room .rv-cell:focus-visible>circle:first-of-type{stroke:var(--move-color);stroke-width:3}
.fun-control-rail{display:flex;flex-direction:column;gap:10px;min-width:0;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
@media(min-width:900px) and (min-height:620px){
 body[data-view=fun] .sidebar,body[data-view=fun] .topbar{display:none!important}body[data-view=fun] .workspace{margin:0;width:100%}body[data-view=fun] main{padding:6px;max-width:none}
 body #view-fun.active.fun-board-room{height:calc(100dvh - 12px);display:flex;flex-direction:column;gap:6px;min-height:0}
 .fun-board-room .fun-tabs{margin:0;height:34px;min-height:34px;gap:7px;flex-shrink:0}.fun-board-room .fun-tabs h1{font-size:18px;margin-right:8px}.fun-board-room .fun-tabs button{min-height:32px;padding:4px 10px;font-size:12px}
 body #rv-match:not([hidden]){grid-template-columns:185px minmax(0,1fr) 290px;gap:7px;flex:1;min-height:0}
 body #rv-match .rv-stage{display:contents}body #rv-match .fun-control-rail{grid-column:1;grid-row:1;min-height:0;overflow:auto;gap:8px}
 body #rv-match .rv-board-wrap{grid-column:2;grid-row:1;position:relative;container-type:size;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0}
 body #rv-match #rv-board{width:min(100cqw,100cqh);height:min(100cqw,100cqh);max-width:100%;max-height:100%;flex:none;overflow:visible}
 body #rv-match .rv-aside{grid-column:3;grid-row:1;min-width:0}
 .fun-board-room .fun-control-rail>*{flex-shrink:0;max-width:100%;box-sizing:border-box}
 body #rv-match .rv-turn{font-size:14px;min-height:54px;padding:8px 10px}
 body #rv-match .rv-player{padding:8px;gap:4px;border-radius:10px;grid-template-columns:1fr}.fun-board-room .rv-player .player-identity{font-size:13px}.fun-board-room .rv-player strong{font-size:13px}.fun-board-room .rv-player>span,.fun-board-room .rv-turn-dot{font-size:11px}
 .fun-board-room .rv-player button{grid-column:1;grid-row:auto;min-height:30px;padding:4px;font-size:12px}
 body #rv-match .rv-toolbar{padding:0;border:0;background:transparent;display:flex;flex-direction:column;align-items:stretch;gap:7px}
 body #rv-match .rv-toolbar>div{display:grid;grid-template-columns:1fr 1fr;gap:5px}.fun-board-room .rv-toolbar>div:first-child>b{grid-column:1/-1;font-size:12px}
 body #rv-match .rv-toolbar .rv-time-label{grid-column:1/-1;display:flex;flex-direction:column;align-items:stretch;gap:4px}.fun-board-room .rv-time-label select{width:100%;max-width:none}
 body #rv-match .rv-controls{display:grid;grid-template-columns:1fr 1fr;padding:0;border:0;gap:5px}.fun-board-room .rv-controls button{font-size:11px;min-height:30px;padding:4px}.fun-board-room .rv-controls>span{grid-column:1/-1;margin:4px 0 0;line-height:1.5;font-size:10px}
 body #rv-match .rv-search-status,body #rv-match .rv-last{text-align:left;font-size:11px;padding:0;min-height:0;line-height:1.6}
 body #rv-match #rv-fullscreen{display:none}
 .fun-board-room #duo-root:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column}
 .fun-board-room .duo-layout:not([hidden]){flex:1;min-height:0;height:auto;grid-template-columns:185px minmax(0,1fr) 290px;gap:7px}
 .fun-board-room .duo-panel{border:1px solid var(--line);background:var(--surface);padding:10px;border-radius:12px;min-width:0}
 .fun-board-room .duo-panel h2{font-size:13px;margin:9px 0 5px}.fun-board-room .duo-panel>strong{font-size:13px}
 .fun-board-room .duo-seat{padding:8px;margin:7px 0;border-radius:10px;min-width:0}.fun-board-room .duo-seat b{font-size:12px;margin-bottom:4px}.fun-board-room .duo-seat small{font-size:11px;line-height:1.5}.fun-board-room .duo-seat button{font-size:11px;min-height:29px;padding:4px}
 .fun-board-room .duo-stage{position:relative;container-type:size;height:100%;min-height:0;width:100%;padding:0;justify-content:center;align-items:center}
 .fun-board-room #duo-board{width:min(100cqw,100cqh);height:min(100cqw,100cqh);flex:none;max-width:100%;max-height:100%;overflow:visible;filter:drop-shadow(0 9px 8px #0002)}
 .fun-board-room #duo-last{position:absolute;bottom:22px;left:10px;right:10px;pointer-events:none;text-align:center;font-size:12px;padding:4px;background:color-mix(in srgb,var(--surface) 75%,transparent);border-radius:7px}.fun-board-room .duo-stage>small{position:absolute;bottom:4px;font-size:10px}
 .fun-board-room .duo-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:6px}.fun-board-room .duo-toolbar b{grid-column:1/-1;font-size:13px}.fun-board-room .duo-toolbar button{min-height:32px;padding:5px;font-size:12px}
 .fun-board-room .duo-panel:last-child{display:flex;flex-direction:column;gap:6px;overflow:hidden}.fun-board-room .duo-panel:last-child>*{flex-shrink:0}.fun-board-room .duo-panel:last-child p{margin:2px 0;font-size:11px;line-height:1.5}
 .fun-board-room #duo-history{flex:1;min-height:50px;max-height:none;align-content:start}.fun-board-room .duo-actions{margin-top:0}.fun-board-room .duo-actions button{min-height:30px;padding:4px;font-size:12px}
 .fun-board-room #duo-message:empty{display:none}.fun-board-room #duo-message,.fun-board-room #duo-search{min-height:0;padding:2px;font-size:11px;line-height:1.5}.fun-board-room .duo-panel label{margin-top:5px;font-size:12px}
}
@media(max-width:899px){.fun-control-rail{display:contents}.fun-board-room .fun-player-list{grid-template-columns:1fr 1fr;margin:10px!important}.fun-board-room .duo-layout{height:auto;min-height:0;grid-template-columns:1fr}.fun-board-room .duo-stage{min-height:65vh;grid-row:1}.fun-board-room #duo-board{height:65vh}.fun-board-room .duo-panel{overflow:visible}.fun-board-room .rv-turn{margin:8px}}

.fun-opponent-card:empty{display:none}.fun-opponent-card .rv-player{margin:0;grid-template-columns:1fr}.fun-position-notes{display:flex;flex-direction:column;gap:5px;flex-shrink:0}.fun-position-notes .rv-last,.fun-position-notes .rv-search-status{text-align:left;padding:0;font-size:11px;line-height:1.6;min-height:0}.fun-opponent-card .rv-player button{grid-column:1;grid-row:auto}.fun-opponent-card .player-identity{font-size:14px}
.fun-board-room .duo-panel #duo-last{position:static;pointer-events:auto;left:auto;right:auto;bottom:auto;background:transparent;text-align:left;font-size:11px;line-height:1.5;padding:2px}.fun-board-room .duo-panel>small{font-size:10px;color:var(--muted);line-height:1.5}
.fun-board-room .fun-tabs #rv-home{margin-left:auto;white-space:nowrap;flex-shrink:0}

/* Keep primary actions in view; only the move list and rules may scroll. */
.fun-board-credit{position:absolute;right:9px;bottom:5px;z-index:2;font-size:10px;line-height:1.5;color:var(--muted);padding:2px 6px;border-radius:5px;background:color-mix(in srgb,var(--surface) 72%,transparent);pointer-events:none}
@media(min-width:900px) and (min-height:620px){
 body #rv-match:not([hidden]){grid-template-rows:minmax(0,1fr);align-items:stretch;flex:1 1 0;overflow:hidden}
 body #rv-match .fun-control-rail{height:100%;overflow:hidden;gap:7px}
 body #rv-match .rv-aside{height:100%;overflow:hidden;gap:7px}
 body #rv-match .fun-control-rail .rv-toolbar{margin-top:auto;padding-top:8px;border-top:1px solid var(--line)}
 body #rv-match .rv-controls{flex:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,32px);gap:5px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);margin:0}
 body #rv-match .rv-controls button{min-width:0;min-height:32px;height:32px;padding:3px;font-size:12px;white-space:nowrap}
 body #rv-match #rv-stop-best{grid-area:1/1}
 body #rv-match #rv-open-hands{grid-area:1/2;min-height:32px}
 body #rv-match #rv-pause{grid-area:1/3}
 body #rv-match #rv-prev{grid-area:2/1}
 body #rv-match #rv-next{grid-area:2/2}
 body #rv-match #rv-undo{grid-area:2/3}
 body #rv-match #rv-pass{grid-area:3/1}
 body #rv-match #rv-resign{grid-area:3/2}
 body #rv-match #rv-live{grid-area:3/3}
 body #reveal-tools>.rv-save{margin:0;gap:6px;flex:none}
 body #reveal-tools>.rv-save button{min-height:34px;padding:5px;font-size:12px;min-width:0}
 body #reveal-tools>.section-tabs{margin:0;flex:none}
 body #reveal-tools>.section-tabs button{min-height:33px;padding:5px;font-size:12px}
 body #reveal-tools .rv-panel{padding:12px;margin:0;border-radius:12px}
 body #reveal-tools .rv-panel h2{font-size:15px;margin:0 0 10px}
 body #reveal-tools #rv-history{min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable}
 body #reveal-tools #rv-history button{font-size:12px;line-height:1.5;min-height:34px}
 body #reveal-tools .fun-position-notes{gap:4px;padding:6px 8px;border-top:1px solid var(--line);font-size:11px;line-height:1.5}
 body #reveal-tools .fun-position-notes>*{margin:0;padding:0;min-height:0;text-align:left;line-height:1.5}
 body #reveal-tools #rv-ai-info{display:block;color:var(--gold)}
 body #reveal-tools .fun-storage-note{order:10;flex:none;margin:0;font-size:10px;line-height:1.5}
 body #view-fun>#rv-notice:not(:empty){margin:0;min-height:20px;flex:none;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body #reveal-tools #rv-notice:not(:empty){margin:0;min-height:0;font-size:12px;line-height:1.5}
 .fun-board-room .duo-layout:not([hidden]){grid-template-rows:minmax(0,1fr);align-items:stretch;overflow:hidden}
 .fun-board-room .duo-panel:first-child{height:100%;overflow:hidden}
 .fun-board-room .duo-panel:last-child #duo-history{flex:1 1 0;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
 .fun-board-room .duo-panel:last-child details{margin:0;font-size:11px;flex:none}
 .fun-board-room .duo-panel:last-child details[open]{max-height:24vh;overflow:auto;overscroll-behavior:contain}
}
@media(min-width:900px) and (min-height:620px) and (max-height:800px){
 .fun-board-room .duo-panel{padding:7px}
 .fun-board-room .duo-panel h2{font-size:12px;margin:4px 0 3px}
 .fun-board-room .duo-panel>strong{font-size:12px}
 .fun-board-room .duo-seat{padding:5px 6px;margin:5px 0}
 .fun-board-room .duo-seat b{font-size:12px;line-height:1.4;margin:0}
 .fun-board-room .duo-seat small{margin:1px 0;line-height:1.4;font-size:11px}
 .fun-board-room .duo-seat button{min-height:27px;height:27px;padding:3px;font-size:11px}
 .fun-board-room #duo-turn{font-size:12px;line-height:1.4;padding:5px 7px}
 .fun-board-room .duo-toolbar{gap:4px}
 .fun-board-room .duo-toolbar b{font-size:12px}
 .fun-board-room .duo-toolbar button,.fun-board-room .duo-actions button{min-height:28px;height:28px;padding:3px;font-size:11px}
 .fun-board-room .duo-actions{gap:4px}
 .fun-board-room .duo-panel label{margin:0;gap:3px}
 .fun-board-room .duo-panel select{min-height:30px;height:30px;padding:3px 6px}
 .fun-board-room .duo-panel:last-child{gap:4px}
}
@media(min-width:900px) and (min-height:620px) and (max-height:760px){
 body #rv-match .fun-control-rail{gap:5px;padding:7px}
 body #rv-match .rv-turn{min-height:38px;padding:5px 7px;line-height:1.4}
 body #rv-match .rv-player{padding:6px 7px;gap:2px}
 body #rv-match .fun-control-rail .rv-toolbar{gap:5px;padding-top:6px}
 body #rv-match .rv-time-label select{min-height:32px;height:32px;padding:4px 7px}
 body #rv-match .rv-controls{grid-template-rows:repeat(3,30px);padding:6px;gap:4px}
 body #rv-match .rv-controls button,body #rv-match #rv-open-hands{height:30px;min-height:30px;font-size:11px}
 body #reveal-tools .fun-position-notes{font-size:10px;gap:3px;padding:4px 6px}
}
@media(min-width:1600px) and (min-height:800px){
 body #rv-match:not([hidden]),.fun-board-room .duo-layout:not([hidden]){grid-template-columns:220px minmax(0,1fr) 320px}
 body #rv-match .rv-player .player-identity{font-size:15px}
 body #rv-match .rv-player strong,body #rv-match .rv-turn{font-size:14px}
 body #rv-match .rv-player>span,body #rv-match .rv-turn-dot{font-size:12px}
 body #rv-match .rv-toolbar button,body #rv-match .rv-controls button{font-size:13px}
 body #reveal-tools .fun-position-notes,body #reveal-tools .rv-history-item{font-size:13px}
 body #reveal-tools .fun-position-notes .rv-last,body #reveal-tools .fun-position-notes .rv-search-status{font-size:12px}
}
