/* Compact play view. The lobby and celebration keep their original artwork. */
body.is-playing .header{padding:5px 12px;gap:8px}
body.is-playing .brand{font-size:16px;gap:6px}
body.is-playing .brand img{width:30px;height:30px}
body.is-playing .header nav{gap:7px;font-size:16px}
body.is-playing .header button{padding:5px 9px;font-size:16px;border-radius:9px}
body.is-playing .game-fullscreen-button{padding:5px 9px!important;font-size:16px!important}
body.is-playing .wallet{padding:5px 10px}
body.is-playing main{max-width:1000px;padding:6px 20px}
body.is-playing .play-heading{gap:8px;margin:0 0 7px}
body.is-playing .play-heading>div:first-child{min-width:0;font-size:0;line-height:1}
body.is-playing .play-heading h1{font-size:22px;margin:3px 0 0}
body.is-playing .play-heading .eyebrow{font-size:16px;letter-spacing:1px}
body.is-playing .play-tools{gap:6px;font-size:16px}
body.is-playing .play-tools button{padding:6px 10px;font-size:16px}
body.is-playing .target-chip{padding:5px 10px;font-size:16px}
body.is-playing .target-chip b{font-size:19px}
body.is-playing .scoreboard{grid-template-columns:1fr 75px 1fr;max-width:740px;gap:9px;margin-bottom:7px}
body.is-playing .score-player{min-height:0;height:56px;padding:5px 9px;gap:8px;border-radius:13px}
body.is-playing .score-player img{width:35px;height:44px;align-self:center}
body.is-playing .score-player div{gap:0;min-width:0}
body.is-playing .score-player div>span{font-size:16px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}
body.is-playing .score-player b{font-size:24px;line-height:1.05}
body.is-playing .score-player small{font-size:16px;line-height:1.1}
body.is-playing .turn-marker{bottom:auto;top:-7px;right:7px;background:#e6efdf;border-radius:8px;padding:2px 5px;font-size:14px}
body.is-playing .monkey-side .turn-marker{background:#eee5f5}
body.is-playing .prize-pot{gap:0;position:relative;padding-bottom:9px}
body.is-playing .pot-icon{font-size:15px}
body.is-playing .prize-pot>b{font-size:21px;line-height:1}
body.is-playing .prize-pot>span:last-of-type{font-size:16px;letter-spacing:.5px}
body.is-playing .round-dots{position:absolute;bottom:0;margin:0;gap:4px}
body.is-playing .round-dots i{width:5px;height:5px}
body.is-playing .turn-banner{max-width:840px;height:34px;min-height:0;margin-bottom:7px;padding:4px 10px;gap:8px}
body.is-playing #feedback{font-size:16px;line-height:1.2;max-height:2.4em;overflow:hidden}
body.is-playing #pairs-left{font-size:16px}
body.is-playing .table-scene{max-width:100%;width:max-content;padding:6px;border-width:3px;border-radius:17px}
body.is-playing .card-board{grid-template-columns:repeat(var(--cols),var(--card-size));grid-auto-rows:var(--card-size);gap:var(--board-gap,5px)}
body.is-playing .picture-card{aspect-ratio:auto;width:var(--card-size);height:var(--card-size);border-radius:9px}
body.is-playing .card-body{border-radius:9px;border-width:1.5px;box-shadow:0 2px 0 #1d4c41}
body.is-playing .card-body:before{inset:4px;border-radius:5px}
body.is-playing .card-back span{font-size:14px;letter-spacing:1px}
.picture-card.revealed .card-body{animation:none}
.picture-card.is-flipping .card-body{animation:flipIn .28s ease-out}
.number-picture{font:900 clamp(20px,calc(var(--card-size,76px)*.67),53px)/1 'Trebuchet MS',system-ui,sans-serif;color:#25485a;position:relative;z-index:1}
body.is-playing .pair-owner{font-size:14px;padding:1px 3px;top:1px;right:2px}
body.is-playing .center-target{min-height:0;max-height:none;width:96%;height:96%;border-width:2px;box-shadow:inset 0 0 0 4px #ffefba}
body.is-playing .center-target strong{font-size:clamp(29px,calc(var(--card-size)*.83),64px)}
body.is-playing .center-target .target-label{font-size:16px;letter-spacing:1px}
body.is-playing .center-target .target-help{font-size:16px;line-height:1.2;margin-top:2px}
.small-cards .target-help,.small-cards .card-back span{display:none}
.small-cards .pair-owner{font-size:0!important;width:12px;height:12px;display:grid;place-items:center;padding:0!important}
.small-cards .pair-owner:before{content:'✓';font-size:14px}
body.is-playing .game-tip{font-size:18px;line-height:1.2;margin:4px 0;text-align:center}
.compact-scores{max-width:840px;margin:4px auto 0;font-size:16px}
.compact-scores>summary{cursor:pointer;color:#416a55;font-weight:700;text-align:center}
.compact-scores .score-comparison{margin:8px 0}
body.is-playing .parent-notes,body.is-playing footer{display:none}
.card-modes{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:13px}
.card-modes>span{font-size:16px;font-weight:700}
.card-modes button{font-size:16px;padding:8px 13px}
.card-modes [aria-pressed=true]{background:#e9efdd;border-color:#21594d;box-shadow:inset 0 0 0 1px #21594d}
.turn-toast{position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:13px;width:min(350px,90%);padding:15px 19px;background:#fffdf5f5;border:3px solid #8b6fa4;border-radius:20px;box-shadow:0 10px 40px #294e3944;pointer-events:none;animation:turnArrive .2s ease-out}
.turn-toast.player-turn{border-color:#39805b}
.turn-toast img{width:65px;height:80px;object-fit:contain}
.turn-toast strong,.turn-toast small,.turn-toast span{display:block}
.turn-toast strong{font-size:23px;line-height:1.15;color:#60417d;margin:5px 0}
.turn-toast.player-turn strong{color:#246847}
.turn-toast span{font-size:16px;letter-spacing:1.5px;font-weight:900;color:#748464}
.turn-toast small{font-size:16px;line-height:1.4;color:#52644e}
.monkey-hand{position:absolute;width:58px;height:74px;left:calc(100% - 60px);top:0;z-index:6;pointer-events:none;filter:drop-shadow(2px 4px 3px #51383055);transition:left .45s ease,top .45s ease}
.monkey-choice .card-body{outline:3px solid #b38ace;outline-offset:1px;box-shadow:0 0 0 5px #cfb6e555}
@keyframes turnArrive{from{opacity:0;transform:translate(-50%,-50%) scale(.85)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
@media(max-width:620px){
 body.is-playing .header{padding:4px 8px;flex-wrap:nowrap}
 body.is-playing .brand>span{display:none}
 body.is-playing .brand img{width:26px;height:27px}
 body.is-playing .header nav{max-width:none;flex:1;flex-wrap:nowrap;justify-content:flex-end;gap:4px;font-size:16px}
 body.is-playing .header button{font-size:16px;padding:4px 6px}
 body.is-playing .game-fullscreen-button{padding:4px 6px!important;font-size:16px!important}
 body.is-playing .wallet{padding:4px 6px}
 body.is-playing main{padding:4px 8px}
 body.is-playing .play-heading{margin-bottom:6px;align-items:center}
 body.is-playing .play-heading h1{font-size:19px;margin:2px 0 0}
 body.is-playing .play-heading .eyebrow{font-size:16px;letter-spacing:.5px}
 body.is-playing .play-tools{max-width:none;flex-wrap:nowrap;gap:4px}
 body.is-playing .play-tools button{font-size:16px;padding:5px 6px}
 body.is-playing .target-chip{font-size:16px;padding:4px 6px;white-space:nowrap}
 body.is-playing .target-chip b{font-size:16px;margin-left:3px}
 body.is-playing .scoreboard{grid-template-columns:1fr 51px 1fr;gap:6px;margin-bottom:6px}
 body.is-playing .score-player{height:49px;padding:4px 6px;gap:4px}
 body.is-playing .score-player img{width:26px;height:36px}
 body.is-playing .score-player div>span{font-size:16px;max-width:92px}
 body.is-playing .score-player b{font-size:22px}
 body.is-playing .turn-marker{font-size:14px;right:4px;top:-6px;padding:1px 3px}
 body.is-playing .turn-banner{height:30px;margin-bottom:6px;padding:3px 8px;gap:6px}
 body.is-playing #feedback{font-size:16px}
 body.is-playing #pairs-left{display:none}
 body.is-playing .turn-banner>span:first-child{font-size:16px}
 body.is-playing .game-tip{display:none}
 .compact-scores{font-size:16px}
 .monkey-hand{width:43px;height:55px}
 .turn-toast{gap:8px;padding:10px 12px;border-radius:15px}
 .turn-toast img{width:44px;height:58px}
 .turn-toast strong{font-size:18px}
 .turn-toast small{font-size:16px}
 .card-modes button{font-size:16px;padding:7px 10px}
}
@media(max-height:500px){body.is-playing .header{padding-top:2px;padding-bottom:2px}body.is-playing .score-player{height:43px}body.is-playing .score-player img{height:31px;width:26px}body.is-playing .game-tip{display:none}body.is-playing .play-heading{margin-bottom:4px}body.is-playing .turn-banner{height:28px;margin-bottom:4px}}

/* Collected cards leave their original grid slots empty. */
.collected-slot{width:var(--card-size);height:var(--card-size);border:1px dashed #c4d6be30;border-radius:9px;background:#163f340c;pointer-events:none}
body.is-playing .score-player{padding-right:34px}
.collected-pile{position:absolute;right:10px;bottom:9px;width:18px;height:23px;--pile-color:#39805b}
.monkey-side .collected-pile{--pile-color:#8b6fa4}
.collected-pile i{position:absolute;inset:0;border:1.5px solid var(--pile-color);border-radius:4px;background:#fffdf0;box-shadow:0 1px 2px #24473822}
.collected-pile i:first-child{transform:translate(-4px,2px) rotate(-13deg)}
.collected-pile i:nth-child(2){transform:translate(-1px,1px) rotate(7deg)}
.collected-pile i:last-child{display:grid;place-items:center;color:var(--pile-color);font-size:16px;font-style:normal;font-weight:900}
.collection-layer{position:fixed;inset:0;z-index:19;pointer-events:none;overflow:hidden}
.flying-card{position:absolute;display:block;transform-origin:center;animation:collectCards .76s cubic-bezier(.35,.05,.35,1) var(--delay,0ms) both;filter:drop-shadow(0 5px 5px #21473655);will-change:transform,opacity}
.flying-card .card-body{border-radius:9px;border:2px solid #39805b;background:#fffdf0;box-shadow:0 3px 0 #255c43;animation:none;transform:none}
.flying-card.collection-monkey .card-body{border-color:#8b6fa4;box-shadow:0 3px 0 #69517e}
.flying-card .card-body:before{display:none}
.collection-layer.paused .flying-card{animation-play-state:paused}
.score-player.received-pair{animation:receiveCards .32s ease-out}
@keyframes collectCards{
 0%{opacity:1;transform:translate(0,0) rotate(0deg) scale(1)}
 18%{opacity:1;transform:translate(0,-18px) rotate(var(--tilt)) scale(1.08)}
 82%{opacity:1;transform:translate(calc(var(--dx)*.92),calc(var(--dy)*.92 - 12px)) rotate(var(--tilt)) scale(.42)}
 100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(0deg) scale(.23)}
}
@keyframes receiveCards{0%,100%{transform:scale(1)}45%{transform:scale(1.035);box-shadow:0 0 0 4px #e8bd6344}}
@media(max-width:620px){body.is-playing .score-player{padding-right:27px}.collected-pile{right:7px;bottom:7px;width:14px;height:19px}.collected-pile i:last-child{font-size:16px}}

/* Popups use the visible viewport, including full screen and phone rotation. */
#round-over{position:fixed;inset:auto;left:var(--popup-left,0px);top:var(--popup-top,0px);width:var(--popup-width,100vw);height:var(--popup-height,100dvh);z-index:100;display:flex;align-items:center;justify-content:center;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));margin:0;border:0;border-radius:0;background:#173e35b5;box-shadow:none;overflow:auto;overscroll-behavior:contain}
.round-over-inner{width:min(460px,100%);max-height:calc(var(--popup-height,100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:hidden;display:grid;grid-template-columns:70px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;align-items:center;column-gap:17px;row-gap:8px;padding:24px 22px;background:#fffdf4;border:3px solid #d2b965;border-radius:22px;box-shadow:0 16px 60px #102b354d;flex-shrink:0}
.round-over-inner>img{width:70px;height:94px;object-fit:contain;grid-row:1/span 2;grid-column:1}
.round-over-content{grid-row:1;grid-column:2;min-height:0;overflow:auto;overscroll-behavior:contain}
#round-over h2{font-size:clamp(21px,4vw,29px);line-height:1.15;margin:8px 0}
#round-over p{font-size:18px;line-height:1.45;margin:9px 0}
#round-over .eyebrow{font-size:16px;letter-spacing:1px}
#round-over #round-kept{color:#28684e;font-weight:700}
#round-over #next{grid-row:2;grid-column:2;min-height:44px;width:100%;font-size:16px;margin:0;padding:10px 14px}
body.is-playing .turn-toast{position:fixed;z-index:90;left:calc(var(--popup-left,0px) + var(--popup-width,100vw)/2);top:calc(var(--popup-top,0px) + var(--popup-height,100dvh)/2);width:min(350px,calc(var(--popup-width,100vw) - 32px));max-height:calc(var(--popup-height,100dvh) - 24px);overflow:hidden}
.turn-toast>div{min-width:0;overflow-wrap:anywhere}
.turn-toast img{flex-shrink:0}
.pot-icon em{font-size:14px;font-style:normal;font-weight:900;color:#795397}
.reward-breakdown{font-size:16px!important;font-weight:700;color:#38654f;background:#eef4e4;padding:10px 14px;border-radius:12px}
.pause-panel{z-index:120}
.pause-panel>div{max-height:calc(var(--popup-height,100dvh) - 24px);overflow:auto}
@media(max-width:380px){.round-over-inner{gap:10px;padding:18px 14px;grid-template-columns:48px minmax(0,1fr)}.round-over-inner>img{width:48px;height:76px}#round-over p{font-size:18px}}
@media(orientation:landscape) and (max-height:500px){.round-over-inner{width:min(560px,100%);grid-template-columns:60px minmax(0,1fr);column-gap:14px;row-gap:6px;padding:12px 18px}.round-over-inner>img{width:60px;height:82px}#round-over h2{font-size:23px;margin:4px 0}#round-over p{font-size:18px;margin:5px 0;line-height:1.35}body.is-playing .turn-toast{padding:10px 14px;gap:10px}body.is-playing .turn-toast img{width:44px;height:57px}body.is-playing .turn-toast strong{font-size:19px}.pause-panel>div{padding:16px 20px}.pause-panel h2{margin:8px 0}.pause-panel>div>span{font-size:26px}}
@media(max-height:250px){.round-over-inner{grid-template-columns:minmax(0,1fr);padding:7px 10px;row-gap:4px}.round-over-inner>img{display:none}.round-over-content,#round-over #next{grid-column:1}#round-over h2{font-size:20px}#round-over .eyebrow{display:none}}

/* A single table contains the controls, scores, and card grid. */
body.is-playing .header{display:none}
body.is-playing .table-scene{width:min(840px,100%);padding:8px;overflow:visible}
.table-top{position:sticky;top:var(--popup-top,0px);z-index:12;width:var(--table-header-width,100%);max-width:100%;margin-left:var(--table-header-left,0px);margin-bottom:8px;padding:8px;border:1px solid #c6d3ad;border-radius:11px;background:#fffdf0;box-shadow:0 3px 7px #133e3433}
body.is-playing .table-top .play-heading{margin:0 0 5px;align-items:center;flex-wrap:nowrap}
body.is-playing .table-top .play-heading h1{font-size:18px;white-space:nowrap}
body.is-playing .table-top .play-heading .eyebrow{font-size:14px;letter-spacing:.5px;display:block;white-space:nowrap}
body.is-playing .table-top .target-chip{padding:3px 7px;font-size:14px}
body.is-playing .table-top .target-chip b{font-size:18px}
.table-navigation{display:flex;align-items:center;justify-content:space-between;gap:5px;flex-wrap:wrap;margin-bottom:8px}
#table-utility{min-width:0;flex:1 1 auto}
.table-top #game-navigation{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;gap:5px;font-size:14px}
body.is-playing .table-top button,.table-top #game-navigation>a{min-height:28px;padding:4px 8px;font-size:14px;line-height:1.2;white-space:nowrap;border-radius:8px}
.table-top #game-navigation>a{display:inline-flex;align-items:center;text-decoration:none;font-weight:700;background:#edf2e2;color:#315a46}
.table-top #game-navigation .wallet{background:#fff0ad;gap:3px}
body.is-playing .table-top .game-fullscreen-button{min-height:28px;padding:4px 8px!important;font-size:14px!important;border-radius:8px!important}
body.is-playing .table-top .play-tools{max-width:none;flex-wrap:wrap;justify-content:flex-end;gap:5px}
body.is-playing .table-top .scoreboard{max-width:none;margin:0 0 7px;grid-template-columns:minmax(0,1fr) 65px minmax(0,1fr);gap:8px}
body.is-playing .table-top .score-player{min-width:0;height:53px}
body.is-playing .table-top .score-player small{white-space:nowrap}
body.is-playing .table-top .turn-banner{max-width:none;height:30px;margin:0;border-radius:8px;background:#f0f3e7}
body.is-playing .card-board{width:max-content;max-width:100%;margin:0 auto}
.quantity-picture{width:100%;height:100%;display:block}
.picture-card.revealed .card-body:before{display:none}
body.is-playing .table-scene .game-tip{margin:7px 0 4px}
.table-scene .compact-scores{margin:6px 0 1px;color:#e5ebcf}
.table-scene .compact-scores>summary{color:#e5ebcf}
.table-scene .compact-scores[open]{padding:8px;background:#fffdf0;border-radius:10px;color:#315a46}
.table-scene .compact-scores[open]>summary{color:#315a46}
body.is-playing .table-top .keep-label{display:none}
@media(max-width:620px){.table-top{padding:6px;margin-bottom:6px}body.is-playing .table-top .play-heading h1{font-size:16px}body.is-playing .table-top .play-heading .eyebrow{font-size:14px}.table-navigation{margin-bottom:7px;gap:4px}.table-top #game-navigation{gap:4px;font-size:14px}body.is-playing .table-top button,.table-top #game-navigation>a{font-size:14px;padding:4px 6px}body.is-playing .table-top .game-fullscreen-button{font-size:14px!important;padding:4px 6px!important}body.is-playing .table-top .scoreboard{grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);gap:6px}body.is-playing .table-top .score-player{height:47px}body.is-playing .table-top .score-unit{display:none}body.is-playing .table-top .turn-banner{height:27px}}
body.is-playing .compact-table-header .play-heading h1{font-size:14px}
body.is-playing .compact-table-header .play-heading .eyebrow{font-size:14px;letter-spacing:0}
body.is-playing .compact-table-header .target-chip{font-size:14px;padding:3px 5px}
body.is-playing .compact-table-header .target-chip b{font-size:15px}
body.is-playing .compact-table-header .scoreboard{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:4px}
body.is-playing .compact-table-header .score-player{height:44px;padding:3px 4px}
body.is-playing .compact-table-header .score-player img{display:none}
body.is-playing .compact-table-header .score-player div>span{font-size:14px;max-width:calc(100% - 12px)}
body.is-playing .compact-table-header .score-player b{font-size:19px}
body.is-playing .compact-table-header .score-player small{font-size:14px}
body.is-playing .compact-table-header .score-unit{display:none}
.compact-table-header .collected-pile{width:10px;height:13px;right:4px;top:12px;bottom:auto}
.compact-table-header .collected-pile i:last-child{font-size:14px}
body.is-playing .compact-table-header .prize-pot>b{font-size:15px}
body.is-playing .compact-table-header .pot-icon{font-size:14px}
body.is-playing .compact-table-header .prize-pot>span:last-of-type{font-size:14px;letter-spacing:0}
body.is-playing .compact-table-header .turn-marker{font-size:14px;letter-spacing:0;padding:1px 2px;right:2px;top:-5px}

/* Let the complete game table use the screen, including in full-screen mode. */
body.is-playing main{max-width:none;width:100%;padding:6px 10px}
body.is-playing .table-scene{width:100%;max-width:none;margin:0 auto}
body.is-playing .card-board{grid-template-columns:repeat(var(--cols),var(--card-width));grid-auto-rows:var(--card-height);width:max-content;max-width:100%}
body.is-playing .picture-card,.collected-slot{width:var(--card-width);height:var(--card-height);aspect-ratio:auto}
.number-picture{font-size:clamp(22px,calc(var(--card-size)*.68),160px)}
body.is-playing .center-target strong{font-size:clamp(29px,calc(var(--card-size)*.83),180px)}
body.is-playing .card-back span{font-size:clamp(14px,calc(var(--card-size)*.075),15px)}
@media(max-width:620px){body.is-playing main{padding:4px}.table-top{position:sticky}}
