body.game-active{overflow-anchor:none}
body.game-active .mast{padding:5px 18px;min-height:54px}
body.game-active .wordmark{font-size:27px;min-height:40px}
body.game-active .wordmark small{font-size:10px;margin-top:1px}
body.game-active #audio-strip{min-height:50px;padding:2px 18px;gap:12px}
body.game-active main{max-width:none;padding:0 12px}
body.game-active .table-top{margin:4px 0;gap:10px;min-height:44px}
body.game-active .song-heading{margin:4px 0 8px;min-height:42px}
body.game-active .song-heading h1{font-size:clamp(20px,2vw,29px);margin:0}
body.game-active .song-heading>div{display:flex;align-items:baseline;gap:14px;min-width:0}
body.game-active .song-heading span{white-space:nowrap}
body.game-active .credits{margin:9px auto 4px}
.game-layout{height:var(--play-height,calc(100dvh - 200px));min-height:400px;grid-template-columns:minmax(0,1fr) 310px;grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"board action" "board reserve" "board players";gap:10px 14px}
.play-column{display:contents}
body.is-scoring .reserve{display:none}
body.is-scoring .game-layout{grid-template-areas:"board action" "board players";grid-template-rows:auto minmax(0,1fr)}
.board-wrap{grid-area:board;display:grid;grid-template-rows:44px minmax(0,1fr) 22px auto;grid-template-areas:"tools" "meadow" "tip" "show";border-radius:12px;min-height:0;overflow:hidden;background:#292f39}
.scene{grid-area:meadow;height:100%;min-height:0;min-width:0}
.scene canvas{width:100%;height:100%;display:block}
.board-tools{grid-area:tools;position:static;display:flex;flex-wrap:nowrap;max-width:100%;padding:0 6px;gap:4px;overflow-x:auto;scrollbar-width:thin;align-items:center}
.board-tools button{flex:0 0 auto;padding:5px 10px}
.board-tip{grid-area:tip;position:static;background:transparent;max-width:100%;width:auto;font-size:11px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 8px;padding:0}
.action-strip{grid-area:action;display:block;position:static;margin:0;min-height:120px;padding:12px;border-radius:9px;box-shadow:none;align-self:stretch}
.action-strip strong{font-size:16px}
.action-strip p{font-size:12px;line-height:1.35;margin-top:4px}
.action-strip #action-error{color:#922e24;min-height:0}
.action-strip #action-error:empty{display:none}
.commit{max-width:none;width:100%;justify-content:flex-start;gap:6px;margin-top:10px;flex-shrink:1}
.commit:not(:has(> :not([hidden]))){display:none}
.commit label{width:100%;flex-basis:100%}
.commit select{max-width:none;width:100%}
.commit button{min-height:44px}
.reserve{grid-area:reserve;display:grid;grid-template-columns:1fr;gap:9px;padding:0;min-width:0;align-self:start}
.reserve-tabs{display:none}
.tribe-stock{min-width:0;flex-basis:auto}
.tribe-stock h3{font-size:12px;margin:0 0 5px}
.piece-row{gap:6px}
.piece{max-width:none;min-width:0;min-height:128px;gap:1px;padding:4px 3px 6px;justify-content:flex-end}
.piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{height:94px;width:66px;margin:0;flex:0 0 94px}
.piece .piece-name{font-size:13px;line-height:17px}
.piece .piece-meta{font-size:11px;line-height:16px;white-space:nowrap}
.piece .piece-meta b{font-weight:650}
.piece .stock-left{color:#d3d4c8}
.player-rail{grid-area:players;gap:5px;overflow-y:auto;min-height:0;display:flex;flex-direction:column}
.player-rail h2{font-size:18px}
.player{grid-template-columns:35px minmax(0,1fr) auto;gap:6px;padding:5px 3px;min-height:54px}
.player.active{padding:5px 6px}
.player svg{height:42px;width:34px}
.player-name{font-size:13px}
.player small{font-size:11px}
.player .score{font-size:24px}
.player.score-active{outline:2px solid #f3d374;outline-offset:-2px;background:#464631;border-radius:6px}
.player .calculation{color:#e5dcc8}
.table-notes summary{min-height:44px;padding:10px 3px;cursor:pointer;color:#d4dcc3;font-size:13px}
.table-notes .latest{min-height:0;margin-bottom:10px}
.table-notes .rule-reminder{padding-top:8px}
.show-controls{grid-area:show;display:flex;gap:5px;align-items:center;justify-content:center;flex-wrap:wrap;padding:4px 7px;background:#242b35;min-height:50px}
.show-controls output{font-size:12px;min-width:130px}
.show-controls button{font-size:12px;padding:5px 9px}
.score-pop{position:absolute;z-index:4;pointer-events:none;transform:translate(-50%,-100%)}
.score-chip{display:block;background:#fff3d9;color:#263d25;border:2px solid #e7c45e;border-radius:8px;padding:4px 13px;font:bold 29px Georgia,serif;box-shadow:0 4px 12px #0005;animation:score-rise 1s both}
.score-chip small{display:block;font:11px 'Segoe UI',sans-serif;white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.flat-board{grid-area:meadow;--cell:min(calc((100vw - 360px)/6),calc((var(--play-height) - 82px)/var(--rows)));height:100%;min-height:0;padding:4px;align-content:center;background:#4d6543}
.flat-cell{min-width:0;min-height:0;padding:0}
.flat-cell.score-current{outline:4px solid #f2d16b;outline-offset:-4px;z-index:1}
.flat-cell.score-current svg{animation:score-hop 900ms both;animation-delay:var(--motion-delay,0ms)}
.flat-cell.recent-placement:not(.score-current) svg{animation:placed-dance 2.8s both;animation-delay:var(--placement-delay,0ms);transform-origin:50% 90%}
.flat-board[data-dance="true"] .flat-cell:not(.staged) svg{animation:choir-loop 1.2s infinite;animation-delay:var(--choir-delay,0ms);transform-origin:50% 90%}
.flat-board[data-dance="true"][data-dance-paused="true"] .flat-cell:not(.staged) svg{animation-play-state:paused}
body.calm .flat-cell svg{animation:none!important}
body.calm .score-chip{animation:none;box-shadow:none}
@keyframes score-rise{0%{opacity:0;translate:0 8px}15%,75%{opacity:1}100%{opacity:0;translate:0 -25px}}
@keyframes score-hop{0%,100%{transform:translateY(0)}45%{transform:translateY(-27px)}70%{transform:translateY(-12px)}}
@keyframes placed-dance{0%{transform:translateY(-28px)}16%{transform:translateY(0)}28%,56%,84%{transform:translateY(-7px) rotate(-6deg)}42%,70%,96%{transform:translateY(0) rotate(6deg)}100%{transform:none}}
@keyframes choir-loop{0%,50%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-9px) rotate(-7deg)}75%{transform:translateY(-9px) rotate(7deg)}}
@media(min-width:1600px){.game-layout{grid-template-columns:minmax(0,1fr) 340px}.piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{height:108px;flex-basis:108px;width:74px}.piece{min-height:142px}.flat-board{--cell:min(calc((100vw - 390px)/6),calc((var(--play-height) - 82px)/var(--rows)))}}
@media(min-width:960px) and (max-height:820px){.piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{height:82px;flex-basis:82px}.piece{min-height:116px}.action-strip{padding:9px;min-height:110px}.reserve{gap:6px}.game-layout{gap:7px 12px}}
@media(max-width:959px){
 body.game-active .mast{display:flex;min-height:48px;padding:2px 10px;justify-content:center}
 body.game-active .wordmark{display:none}
 body.game-active .mast nav{display:flex;flex-wrap:nowrap;max-width:none;gap:8px;width:100%;justify-content:space-between;align-items:center}
 body.game-active .languages{display:flex;gap:4px}
 body.game-active #audio-strip{gap:3px 10px;padding:2px 10px;min-height:88px}
 body.game-active main{padding:0 7px}
 body.game-active .table-top{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:5px;min-height:44px;margin:3px 0}
 body.game-active .table-top #room-label{font-size:11px;letter-spacing:0;white-space:nowrap;text-align:center}
 body.game-active .table-top button{font-size:11px;line-height:1.2;padding:4px 7px;max-width:105px}
 body.game-active #connection[data-state="connected"]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body.game-active #connection:not([data-state="connected"]){grid-column:1/-1;font-size:11px;margin:0}
 body.game-active .song-heading{margin:2px 0 4px;min-height:39px;gap:6px}
 body.game-active .song-heading>div{display:block}
 body.game-active .song-heading span{font-size:10px;display:block;line-height:12px}
 body.game-active .song-heading h1{font-size:18px;line-height:21px;max-width:calc(100vw - 115px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.game-active #recap{font-size:11px;padding:5px 7px;min-height:44px}
 .game-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:48px minmax(140px,1fr) auto 70px;grid-template-areas:"players" "board" "reserve" "action";gap:5px;height:var(--play-height,calc(100dvh - 235px));min-height:400px}
 body.is-scoring .game-layout{grid-template-rows:48px minmax(170px,1fr) 100px;grid-template-areas:"players" "board" "action"}
 .player-rail{display:contents}
 .player-rail>h2,.player-rail>.table-notes{display:none}
 #players{grid-area:players;display:grid;grid-template-columns:repeat(var(--player-count,2),minmax(0,1fr));gap:4px;min-width:0}
 .player,.player.active{grid-template-columns:minmax(0,1fr) auto;gap:3px;padding:3px 4px;min-height:46px;border-bottom:0;background:#2c3340;border-radius:5px}
 .player.active{background:#354533}
 .player svg{display:none}
 .player-name{font-size:11px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .player-name small{font-size:9px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .player-name .presence{display:none}
 .player .score{font-size:20px;line-height:21px}
 .player .score small{font-size:9px;line-height:11px}
 .board-wrap{grid-template-rows:44px minmax(0,1fr) 17px auto;min-height:0;border-radius:8px}
 .board-tools{padding:0 3px;gap:3px;scrollbar-width:none}
 .board-tools button{font-size:11px;padding:4px 7px;min-height:44px}
 .board-tip{font-size:9px;line-height:13px;margin:0 4px}
 .reserve{display:block;padding:0;min-height:0}
 .reserve-tabs{display:flex;gap:5px;margin-bottom:4px}
 .reserve-tabs button{flex:1;min-width:0;min-height:44px;display:flex;gap:4px;align-items:center;justify-content:center;font-size:11px;padding:2px 4px}
 .reserve-tabs svg{height:32px;width:27px;flex:none}
 .reserve .tribe-stock[data-active="false"]{display:none}
 .reserve .tribe-stock h3{font-size:11px;line-height:15px;margin-bottom:2px}
 .reserve:has(.reserve-tabs) .tribe-stock h3{display:none}
 .piece-row{gap:5px}
 .piece{min-height:106px;padding:2px 3px 4px;gap:0;max-width:none}
 .piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{height:76px;flex-basis:76px;width:70px}
 .piece .piece-name{font-size:12px;line-height:15px}
 .piece .piece-meta{font-size:10px;line-height:14px}
 .action-strip{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;min-height:70px;height:70px;padding:6px 8px;align-items:center;overflow:visible;border-radius:7px}
 body.is-scoring .action-strip{height:100px;min-height:100px}
 .action-strip strong{font-size:13px;line-height:16px;display:block}
 .action-strip p{display:none}
 body.is-scoring .action-strip p{display:block;font-size:11px;line-height:14px}
 .action-strip #action-error:not(:empty){display:block;font-size:10px}
 .commit{display:flex;flex-wrap:wrap;max-width:165px;width:auto;justify-content:flex-end;margin:0;gap:4px;min-width:0}
 .commit label{width:100%;font-size:10px;line-height:11px}
 .commit select{min-height:44px;font-size:11px;padding:3px 5px}
 .commit button{font-size:11px;padding:5px 7px;min-height:44px}
 .show-controls{padding:2px 4px;gap:3px;min-height:44px;justify-content:space-between;flex-wrap:nowrap;overflow-x:auto}
 .show-controls output{font-size:10px;min-width:90px}
 .show-controls button{font-size:10px;padding:3px 6px;flex:0 0 auto}
 .score-chip{font-size:23px;padding:3px 9px}
 .flat-board{--cell:min(calc((100vw - 25px)/6),calc((var(--play-height) - 335px)/var(--rows)));height:100%;min-height:0;padding:2px;grid-template-columns:repeat(6,var(--cell));align-content:center}
 body.is-scoring .flat-board{--cell:min(calc((100vw - 25px)/6),calc((var(--play-height) - 270px)/var(--rows)))}
}
@media(min-width:600px) and (max-width:959px){
 body.game-active #audio-strip{min-height:50px;flex-wrap:nowrap}
 .game-layout{grid-template-columns:minmax(0,1fr) 270px;grid-template-rows:48px auto minmax(0,1fr);grid-template-areas:"players players" "board action" "board reserve";min-height:430px;gap:8px}
 body.is-scoring .game-layout{grid-template-rows:48px auto minmax(0,1fr);grid-template-areas:"players players" "board action" "board ."}
 .board-wrap{grid-template-rows:44px minmax(0,1fr) 20px auto}
 .reserve .tribe-stock{display:block!important;margin-bottom:7px}
 .reserve .tribe-stock h3{display:block!important}
 .reserve-tabs{display:none}
 .action-strip{display:block;height:auto;min-height:105px}
 .action-strip p{display:block;font-size:11px}
 .commit{max-width:none;margin-top:6px;justify-content:flex-start}
 .piece{min-height:110px}
 .piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{height:80px;flex-basis:80px;width:62px}
 .flat-board{--cell:min(calc((100vw - 315px)/6),calc((var(--play-height) - 130px)/var(--rows)))}
}
@media(max-width:359px){
 .reserve:has(.reserve-tabs){display:grid;grid-template-columns:53px minmax(0,1fr);gap:5px}
 .reserve-tabs{flex-direction:column;gap:4px;margin:0}
 .reserve-tabs button{font-size:9px;line-height:10px;flex-direction:column;gap:0;padding:2px;min-height:53px}
 .reserve-tabs svg{height:29px;width:25px}
 .piece .piece-meta{display:flex;flex-direction:column;font-size:0;line-height:0}
 .piece .piece-meta b,.piece .stock-left{display:block;font-size:10px;line-height:12px;letter-spacing:0}
 .piece svg,.piece[data-size="1"] svg,.piece[data-size="2"] svg{width:56px}
 .commit{max-width:151px}.action-strip{gap:5px;padding:5px 6px}.player .score{font-size:18px}
}
@media(max-width:599px){
 .game-layout:has(#gift-label:not([hidden])){grid-template-areas:"players" "board" "action";grid-template-rows:48px minmax(140px,1fr) 120px}
 .game-layout:has(#gift-label:not([hidden])) .reserve{display:none}
 .action-strip:has(#gift-label:not([hidden])){min-height:120px;height:120px}
 .action-strip:has(#gift-label:not([hidden])) .commit{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:165px;max-width:165px;gap:4px}
 .action-strip:has(#gift-label:not([hidden])) .commit label{grid-column:1/-1}
 .action-strip:has(#gift-label:not([hidden])) .commit button{min-width:0;line-height:1.15;padding:4px}
}
@media(prefers-reduced-motion:reduce){.score-chip,.flat-cell svg{animation:none!important}}
