/* Farm games: wide computer layouts and vertical phone layouts. */
body[data-farm-game]{--screen-gap:clamp(12px,1.6vw,26px)}
body[data-farm-game] [hidden]{display:none!important}
body[data-farm-game] main,body[data-farm-game] main>*{min-width:0}
body[data-farm-game]>header{max-width:1600px}
body[data-farm-game] main{width:100%;max-width:1520px;margin-inline:auto}
body[data-farm-game] main>.intro{margin-block:8px 20px;padding-block:0}
body[data-farm-game] .intro h1{margin-block:10px;font-size:clamp(34px,4vw,58px)}
body[data-farm-game] .intro>p:last-child{margin-bottom:14px}
body[data-farm-game] dialog{max-width:calc(100vw - 24px);max-height:90svh;overflow:auto}
body[data-farm-game] :is(.layout,.game-layout,.adventure-layout)>*{min-width:0}
@media(min-width:1000px) and (min-aspect-ratio:6/5){
 body[data-farm-game]>header{padding-block:14px}
 body[data-farm-game] main{padding-inline:clamp(20px,3vw,48px);margin-top:10px}
 body[data-screen-family="side-arcade"] .layout{display:grid;grid-template-columns:minmax(0,1fr) clamp(260px,24vw,330px);max-width:none;gap:var(--screen-gap);align-items:start}
 body[data-screen-family="split-arcade"] .game,body[data-farm-game="barnyard-birdies"] .game{display:grid;grid-template-columns:minmax(0,1fr) clamp(220px,22vw,300px);align-items:start}
 body[data-screen-family="split-arcade"] .game>.toolbar,body[data-farm-game="barnyard-birdies"] .game>:is(.topbar,.round-progress,#status){grid-column:1/-1}
 body[data-screen-family="split-arcade"] .game>.stage,body[data-farm-game="barnyard-birdies"] .game>.scene{grid-column:1;grid-row:2/span 3;align-self:center}
 body[data-screen-family="split-arcade"] .game>.controls,body[data-farm-game="barnyard-birdies"] .game>.shotbar{grid-column:2;grid-row:2;display:flex;flex-direction:column;align-items:stretch;justify-content:center;padding:20px;gap:14px}
 body[data-screen-family="split-arcade"] .controls :is(button,.dpad){align-self:stretch}
 body[data-screen-family="split-arcade"] .controls button{min-height:44px}
 body[data-screen-family="split-arcade"] #chicken-status{grid-column:2;grid-row:3}
 body[data-farm-game="barnyard-birdies"] .game>.scene{grid-row:3/span 2}
 body[data-farm-game="barnyard-birdies"] .game>.shotbar{grid-row:3}
 body[data-screen-family="square-board"] .game-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;max-width:min(100%,calc(100svh + 150px));margin-inline:auto;gap:24px}
 body[data-screen-family="square-board"] .board-frame{padding:12px}
 body[data-farm-game="coop-clash"] .game-layout{grid-template-columns:minmax(0,1fr) 320px;gap:var(--screen-gap)}
 body[data-farm-game="barnyard-jackpot"] .layout{grid-template-columns:minmax(0,1fr) 310px;gap:var(--screen-gap)}
 body[data-farm-game="the-locked-barn"] .adventure-layout{grid-template-columns:minmax(0,1fr) 320px;gap:var(--screen-gap)}
 body[data-farm-game="twin-signal"] main{max-width:1600px;padding-top:16px}
 body[data-farm-game="twin-signal"] .arena{height:clamp(390px,calc(100svh - 235px),850px);min-height:0;max-height:none}
 body[data-farm-game="twin-signal"] header{margin-bottom:18px}
 body[data-farm-game="hat-trick"] main,body[data-farm-game="turkey-worm-hunt"] main{display:grid;grid-template-columns:minmax(0,1fr) 310px;column-gap:26px;align-items:start;max-width:1360px}
 body[data-farm-game="hat-trick"] main>.intro,body[data-farm-game="turkey-worm-hunt"] main>.intro{grid-column:1/-1}
 body[data-farm-game="hat-trick"] main>.stage{grid-column:1;grid-row:2/span 3}
 body[data-farm-game="hat-trick"] main>:is(.caption,#result){grid-column:2;margin-top:0}
 body[data-farm-game="hat-trick"] main>footer{grid-column:1/-1}
 body[data-farm-game="turkey-worm-hunt"] main>.game{grid-column:1;grid-row:2/span 5}
 body[data-farm-game="turkey-worm-hunt"] main>:is(.tips,#status,.sharing,.other){grid-column:2}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] main{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:16px 24px;max-width:1280px}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] main>.intro{grid-column:1/-1}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] .arcade{grid-column:1;grid-row:2/span 3}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] main>:is(.controls,details){grid-column:2;align-self:start}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] main>footer{grid-column:1/-1}
 body[data-farm-game="why-did-the-chicken-cross-the-road"] .controls{width:100%;max-width:260px;justify-self:center}
 body[data-farm-game="firefly-roundup"] .game{display:grid;grid-template-columns:minmax(0,1fr) 300px;align-items:start}
 body[data-farm-game="firefly-roundup"] .game>.toolbar{grid-column:1/-1}
 body[data-farm-game="firefly-roundup"] .night-scene{grid-column:1;grid-row:2/span 4}
 body[data-farm-game="firefly-roundup"] .game>:is(.planning,.result,.small-actions){grid-column:2;margin-inline:12px}
 body[data-farm-game="firefly-roundup"] .planning{grid-row:2;flex-wrap:wrap;padding:16px;gap:14px} body[data-farm-game="firefly-roundup"] .planning .main-actions{flex-wrap:wrap} body[data-farm-game="firefly-roundup"] .result{grid-row:3} body[data-farm-game="firefly-roundup"] .small-actions{grid-row:4} body[data-farm-game="firefly-roundup"] .route-rule{grid-column:1/-1;grid-row:6}
 body[data-farm-game="farm-bones"] .map{height:clamp(330px,50svh,600px)}
 body[data-screen-family="cards"] main{max-width:1500px}
 body[data-screen-family="cards"] .table{min-height:clamp(350px,46svh,550px)}
}
@media(max-width:999px),(max-aspect-ratio:6/5){
 body[data-farm-game] main{max-width:760px;padding-inline:12px;margin-top:8px}
 body[data-farm-game] main>.intro{margin-block:8px 14px}
 body[data-farm-game] .intro h1{font-size:clamp(32px,8vw,48px);margin-block:8px}
 body[data-farm-game] .intro>p:last-child{font-size:13px;line-height:1.5;margin-bottom:12px}
 body[data-farm-game]>header{padding:12px;gap:10px;flex-wrap:wrap}
 body[data-farm-game] :is(.layout,.game-layout,.adventure-layout){grid-template-columns:minmax(0,1fr);max-width:100%;gap:14px}
 body[data-farm-game] :is(.toolbar,.topbar,.dashboard,.scoreboard,.hud,.tools,.turnbar){flex-wrap:wrap;gap:8px}
 body[data-farm-game] :is(.toolbar,.topbar,.dashboard,.scoreboard){padding:12px}
 body[data-farm-game] :is(.controls,.basket-controls,.actions,.shotbar){flex-wrap:wrap}
 body[data-farm-game] :is(.controls,.basket-controls,.actions,.tools,.shotbar) button{min-height:44px}
 body[data-farm-game] :is(.rules,.below,aside){max-width:100%}
 body[data-screen-family="square-board"] .board-frame{padding:8px}
 body[data-screen-family="square-board"] aside{grid-template-columns:minmax(0,1fr)}
 body[data-screen-family="square-board"] aside>.controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-screen-family="square-board"] .board{aspect-ratio:1}
 body[data-farm-game="coop-clash"] .map-scroll{max-width:100%;overflow:auto}
 body[data-farm-game="twin-signal"] .arena{height:clamp(390px,calc(100svh - 240px),960px);max-height:none;min-height:0}
 body[data-farm-game="twin-signal"] .hud{gap:8px}
 body[data-farm-game="twin-signal"] .mission{min-width:0}
 body[data-farm-game="twin-signal"] .mission strong{font-size:12px}
 body[data-farm-game="twin-signal"] footer{flex-wrap:wrap}
 body[data-farm-game="firefly-roundup"] .board canvas{height:auto;aspect-ratio:11/7}
 body[data-farm-game="firefly-roundup"] .board-viewport{max-height:70svh}
 body[data-farm-game="hat-trick"] main{max-width:720px}
 body[data-farm-game="farm-rummy"] .draw-area{gap:20px}
 body[data-farm-game="farm-rummy"] .table-head{flex-wrap:wrap}
}
@media(max-width:480px){
 body[data-farm-game] main{padding-inline:8px}
 body[data-farm-game]>header{font-size:11px}
 body[data-farm-game] .intro>p:last-child{font-size:12px}
 body[data-farm-game] :is(.layout,.game-layout)>aside{grid-template-columns:minmax(0,1fr)}
 body[data-farm-game] .game :is(.tools,.toolbar)>button{min-height:40px}
 body[data-farm-game="coop-clash"] main{padding-inline:8px}
 body[data-farm-game="twin-signal"] main{padding-inline:8px}
}

body[data-farm-game="why-did-the-chicken-cross-the-road"] .playfield{aspect-ratio:660/780;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="why-did-the-chicken-cross-the-road"] .playfield>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:660/780}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="why-did-the-chicken-cross-the-road"] .playfield{width:min(100%,calc((100svh - 245px) * 0.8461538461538461));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="why-did-the-chicken-cross-the-road"] .playfield{width:100%;max-width:none}}

body[data-farm-game="barnyard-bullseye"] .scene{aspect-ratio:720/780;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="barnyard-bullseye"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:720/780}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="barnyard-bullseye"] .scene{width:min(100%,calc((100svh - 245px) * 0.9230769230769231));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="barnyard-bullseye"] .scene{width:100%;max-width:none}}

body[data-farm-game="barnyard-birdies"] .scene{aspect-ratio:960/600;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="barnyard-birdies"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:960/600}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="barnyard-birdies"] .scene{width:min(100%,calc((100svh - 245px) * 1.6));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="barnyard-birdies"] .scene{width:100%;max-width:none}}

body[data-farm-game="pasture-patrol"] .scene{aspect-ratio:720/800;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="pasture-patrol"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:720/800}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="pasture-patrol"] .scene{width:min(100%,calc((100svh - 245px) * 0.9));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="pasture-patrol"] .scene{width:100%;max-width:none}}

body[data-farm-game="barnyard-breakout"] .scene{aspect-ratio:720/820;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="barnyard-breakout"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:720/820}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="barnyard-breakout"] .scene{width:min(100%,calc((100svh - 245px) * 0.8780487804878049));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="barnyard-breakout"] .scene{width:100%;max-width:none}}

body[data-farm-game="fox-in-the-henhouse"] .scene{aspect-ratio:900/760;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="fox-in-the-henhouse"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:900/760}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="fox-in-the-henhouse"] .scene{width:min(100%,calc((100svh - 245px) * 1.1842105263157894));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="fox-in-the-henhouse"] .scene{width:100%;max-width:none}}

body[data-farm-game="eggs-from-outer-space"] .scene{aspect-ratio:800/680;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="eggs-from-outer-space"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:800/680}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="eggs-from-outer-space"] .scene{width:min(100%,calc((100svh - 245px) * 1.1764705882352942));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="eggs-from-outer-space"] .scene{width:100%;max-width:none}}

body[data-farm-game="orchard-catch"] .scene{aspect-ratio:800/600;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="orchard-catch"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:800/600}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="orchard-catch"] .scene{width:min(100%,calc((100svh - 245px) * 1.3333333333333333));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="orchard-catch"] .scene{width:100%;max-width:none}}

body[data-farm-game="midnight-at-the-coop"] .scene{aspect-ratio:960/720;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="midnight-at-the-coop"] .scene>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:960/720}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="midnight-at-the-coop"] .scene{width:min(100%,calc((100svh - 245px) * 1.3333333333333333));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="midnight-at-the-coop"] .scene{width:100%;max-width:none}}

body[data-farm-game="barnyard-breeze"] .stage{aspect-ratio:960/540;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="barnyard-breeze"] .stage>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:960/540}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="barnyard-breeze"] .stage{width:min(100%,calc((100svh - 245px) * 1.7777777777777777));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="barnyard-breeze"] .stage{width:100%;max-width:none}}

body[data-farm-game="chicken-run"] .stage{aspect-ratio:1000/400;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="chicken-run"] .stage>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:1000/400}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="chicken-run"] .stage{width:min(100%,calc((100svh - 245px) * 2.5));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="chicken-run"] .stage{width:100%;max-width:none}}

body[data-farm-game="duck-pond-dash"] .stage{aspect-ratio:960/640;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="duck-pond-dash"] .stage>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:960/640}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="duck-pond-dash"] .stage{width:min(100%,calc((100svh - 245px) * 1.5));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="duck-pond-dash"] .stage{width:100%;max-width:none}}

body[data-farm-game="tanks-snack-quest"] .stage{aspect-ratio:960/680;height:auto;min-height:0;position:relative;margin-inline:auto}
body[data-farm-game="tanks-snack-quest"] .stage>canvas{display:block;width:100%;height:auto!important;min-height:0;max-height:none;aspect-ratio:960/680}
@media(min-width:1000px) and (min-aspect-ratio:6/5){body[data-farm-game="tanks-snack-quest"] .stage{width:min(100%,calc((100svh - 245px) * 1.411764705882353));max-width:none}}
@media(max-width:999px),(max-aspect-ratio:6/5){body[data-farm-game="tanks-snack-quest"] .stage{width:100%;max-width:none}}

/* Keep Pedro's scores, table, and complete hand together on computer screens. */
.pedro-stage,.pedro-dashboard{min-width:0}
@media(min-width:1000px) and (min-aspect-ratio:6/5){
 body[data-farm-game="farm-pedro"]>header{padding:7px 20px;height:34px}
 body[data-farm-game="farm-pedro"] main{margin:0 auto;padding:0 16px;max-width:1660px}
 body[data-farm-game="farm-pedro"] main>.intro{display:none}
 body[data-farm-game="farm-pedro"] .game{height:calc(100svh - 46px);min-height:590px;display:flex;flex-direction:column}
 body[data-farm-game="farm-pedro"] .toolbar{padding:8px 14px;gap:8px;flex-shrink:0}
 body[data-farm-game="farm-pedro"] .toolbar b{font-size:20px}
 body[data-farm-game="farm-pedro"] .toolbar button,body[data-farm-game="farm-pedro"] .mode-picker select{padding:7px 10px}
 body[data-farm-game="farm-pedro"] .pedro-stage{display:grid;grid-template-columns:250px minmax(0,1fr);flex:1;min-height:0}
 body[data-farm-game="farm-pedro"] .pedro-dashboard{padding:10px;overflow:auto;border-right:1px solid #c1c5b133}
 body[data-farm-game="farm-pedro"] .team-scores{padding:0 0 6px;gap:6px;position:sticky;top:-10px;background:#172f46;z-index:4}
 body[data-farm-game="farm-pedro"] .team-scores>div{padding:7px;gap:5px;flex-wrap:wrap}
 body[data-farm-game="farm-pedro"] .team-scores span{font-size:9px;letter-spacing:0}
 body[data-farm-game="farm-pedro"] .team-scores b{font-size:27px;line-height:1}
 body[data-farm-game="farm-pedro"] .seats{padding:8px 0 0;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 body[data-farm-game="farm-pedro"] .seat{display:block;padding:6px}
 body[data-farm-game="farm-pedro"] .seat h3{font-size:11px}
 body[data-farm-game="farm-pedro"] .seat .total{display:block;font-size:9px;text-align:left}
 body[data-farm-game="farm-pedro"] #status{padding:0;margin:8px 0;min-height:0;font-size:12px}
 body[data-farm-game="farm-pedro"] .bid-panel{margin:8px 0;padding:8px}
 body[data-farm-game="farm-pedro"] .bid-panel button{padding:7px;min-width:38px}
 body[data-farm-game="farm-pedro"] .bid-log{padding:0;margin:7px 0;font-size:10px}
 body[data-farm-game="farm-pedro"] .bid-odds{margin:8px 0 0;padding:8px}
 body[data-farm-game="farm-pedro"] .bid-odds b{font-size:12px}
 body[data-farm-game="farm-pedro"] .bid-odds p{font-size:10px;margin-top:5px}
 body[data-farm-game="farm-pedro"] .table{height:100%;min-height:0;padding:8px 12px 20px;--played-card-width:clamp(48px,8.3svh,80px);overflow:hidden}
 body[data-farm-game="farm-pedro"] .felt-title{margin-bottom:5px}
 body[data-farm-game="farm-pedro"] .table-with-trumps{height:calc(100% - 20px);grid-template-columns:204px minmax(0,1fr) 204px}
 body[data-farm-game="farm-pedro"] .trick-layout{height:100%;grid-template-columns:1fr var(--played-card-width) 1fr;grid-template-rows:minmax(0,1fr) 44px minmax(0,1fr);gap:3px}
 body[data-farm-game="farm-pedro"] .trump-side{height:100%;min-height:0;overflow:auto}
 body[data-farm-game="farm-pedro"] .trump-side h3{margin:0;font-size:12px}
 body[data-farm-game="farm-pedro"] .trump-side p{margin:3px 0 6px;font-size:10px}
 body[data-farm-game="farm-pedro"] .turnbar{min-height:44px;padding:5px 14px;gap:8px;flex-shrink:0}
 body[data-farm-game="farm-pedro"] .turnbar button{padding:6px 10px}
 body[data-farm-game="farm-pedro"] .hand-title{padding:5px 14px 2px;flex-shrink:0}
 body[data-farm-game="farm-pedro"] .hand-title h2{font-size:18px}
 body[data-farm-game="farm-pedro"] .hand{height:clamp(110px,18svh,165px);min-height:0;padding:4px 14px 8px;display:flex;justify-content:center;gap:9px;flex-shrink:0;max-width:none;width:100%}
 body[data-farm-game="farm-pedro"] .hand .card{width:auto;height:100%;flex:0 1 auto;aspect-ratio:5/7;min-width:0}
 body[data-farm-game="farm-pedro"] .hand-note{padding:0 14px 6px;font-size:10px;flex-shrink:0}
 body[data-farm-game="farm-pedro"] .welcome>div{padding:14px}
 body[data-farm-game="farm-pedro"] .welcome h2{font-size:26px}
}

