/* Single-row card stacks float above the existing playmat. */
.match-shell .inline-selection[data-layout="carousel"] .search-stage{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);width:min(94%,1000px);display:flex;align-items:center;justify-content:center;gap:clamp(16px,4vw,64px);pointer-events:none}
.match-shell .search-options{flex:1;min-width:0;position:relative;pointer-events:none}
.match-shell .search-stage .selection-cloud{position:relative;inset:auto;transform:none;display:flex;flex-wrap:nowrap;justify-content:center;align-items:center;gap:0;padding:12px 8px 24px;--choice-card:clamp(112px,16vw,200px);pointer-events:none}
.match-shell .search-stage .selection-option{width:var(--choice-card);flex:0 0 var(--choice-card);pointer-events:auto}
.match-shell .search-stage .selection-option+.selection-option{margin-left:calc(var(--choice-card)*-.22)}
.match-shell .search-stage .choice-card{position:relative;transition:transform .16s,box-shadow .16s;outline-width:2px;outline-offset:2px}
.match-shell .search-stage .selection-option:hover,.match-shell .search-stage .selection-option:focus-within{z-index:5}
.match-shell .selection-source{flex:0 0 clamp(88px,19vw,230px);margin:0;pointer-events:none;filter:drop-shadow(0 14px 18px #0009);transform:rotate(2deg)}
.match-shell .selection-source img{width:100%;display:block;border-radius:6px}
.stack-count{position:absolute;z-index:3;bottom:-12px;left:50%;transform:translateX(-50%);min-width:28px;height:28px;padding:0 5px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#f4f6f5;color:#182833;font-size:17px;font-weight:800;border:2px solid #b5c7cc;box-shadow:0 3px 6px #0007;pointer-events:none}
.match-shell .search-options .floating-pages{position:relative;top:auto;left:auto;transform:none;justify-content:center;margin-top:6px;pointer-events:auto}
.match-shell .floating-pages .btn{border-radius:50%;min-width:44px;min-height:44px;background:#f0f3f3;color:#263d49;border:2px solid #a8c6d4;font-size:26px}
.match-shell .inline-selection[data-layout="carousel"] .selection-toolbar{position:absolute;top:auto!important;bottom:8%!important;left:50%!important;transform:translateX(-50%);width:max-content;max-width:94%;padding:10px 15px;border-radius:7px;display:flex;flex-wrap:wrap;gap:12px;background:linear-gradient(100deg,#0b3558ee,#155985ee);border-top:2px solid #dfbd6e;box-shadow:0 5px 16px #0004}
.match-shell .inline-selection[data-layout="carousel"] .selection-heading{flex-wrap:wrap;gap:8px}
.match-shell .inline-selection[data-layout="carousel"] .selection-heading h2{font-size:15px;max-width:500px}
.match-shell .inline-selection[data-layout="carousel"] .selection-drop{bottom:25%;z-index:2}
.match-shell .inline-selection[data-layout="carousel"]:has(.selection-drop) .selection-toolbar{bottom:3%!important}
.is-dragging .selection-source{opacity:.08}
.is-dragging .search-stage{pointer-events:none!important}
/* Opening cards stay in the actual hand. Only legal Basics glow and move. */
.match-shell .game-page[data-setup="true"] .turn-banner{visibility:visible;min-height:46px}
.match-shell .game-page[data-setup="true"] .turn-banner strong{color:#ffe19a;font-size:16px}
.match-shell .game-page[data-setup="true"] .turn-banner small{color:#d8e9ef;font-size:13px}
.match-shell .table-wrap .hand-panel.opening-hand{visibility:visible;display:block;background:none;border:0;height:180px;overflow:visible;padding:10px 12px 0}
.match-shell .opening-hand .hand-heading{display:none}
.match-shell .opening-hand .hand{--opening-card:112px;--opening-step:min(124px,calc((100vw - 96px - var(--opening-card)) / max(1,var(--hand-count) - 1)));display:flex;justify-content:center;overflow:visible;height:auto;gap:0;padding:12px 0 0}
.match-shell .opening-hand .hand .hand-card{position:relative;width:var(--opening-card);min-width:var(--opening-card);margin:0;flex:none;border-radius:5px}
.match-shell .opening-hand .hand .hand-card:not(:last-child){margin-right:calc(var(--opening-step) - var(--opening-card))}
.match-shell .opening-hand .hand .hand-card:hover,.match-shell .opening-hand .hand .hand-card:focus-visible{z-index:5}
.match-shell .opening-hand .hand-card.ineligible-target{opacity:1;filter:brightness(.76)}
.match-shell .opening-hand .hand-card.valid-target{outline:2px solid #7dd8ff;box-shadow:0 0 12px #79d9ff99}
.match-shell .opening-hand .hand-card.valid-target:before{content:'';position:absolute;top:-13px;left:calc(50% - 10px);border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:8px solid #83e3ff}
.match-shell .opening-hand .stack-count{top:-12px;bottom:auto}
.match-shell .table>.inline-selection[data-layout="opening"]:not(:empty){inset:8px;height:auto;pointer-events:none}
.match-shell .inline-selection[data-layout="opening"] .selection-toolbar{position:absolute;left:auto!important;right:3%;top:65%!important;bottom:auto!important;transform:none;width:auto;pointer-events:auto}
.opening-announcement{position:fixed;z-index:1400;inset:0;background:#061622b8;backdrop-filter:blur(3px);display:flex;flex-direction:column;justify-content:center;align-items:center;padding:24px;text-align:center;color:#fff;animation:opening-reveal .25s ease-out}
.opening-announcement h2,.opening-reveal h2{font-size:clamp(24px,4vw,42px);color:#ffe19a;margin:0 0 12px;text-shadow:0 3px 16px #0008}
.opening-announcement p,.opening-reveal p{max-width:480px;margin:0;font-size:clamp(16px,2vw,21px);line-height:1.5}
.coin-stage:has(.opening-reveal){flex-wrap:wrap;align-content:center;gap:24px}
.opening-reveal{flex-basis:100%;text-align:center;display:flex;align-items:center;flex-direction:column;animation:opening-reveal .25s ease-out}
@keyframes opening-reveal{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:600px){
 .match-shell .inline-selection[data-layout="carousel"] .search-stage{width:96%;gap:14px;top:44%}
 .match-shell .search-stage .selection-cloud{--choice-card:clamp(88px,29vw,132px);padding:10px 4px 20px}
 .match-shell .selection-source{flex-basis:clamp(64px,23vw,100px)}
 .match-shell .inline-selection[data-layout="carousel"] .selection-toolbar{bottom:5%!important;padding:7px 10px;gap:6px;justify-content:center}
 .match-shell .inline-selection[data-layout="carousel"] .selection-heading h2{font-size:13px}
 .match-shell .stack-count{min-width:24px;height:24px;font-size:14px}
 .match-shell .table-wrap .hand-panel.opening-hand{height:140px;padding:6px 8px 0}
 .match-shell .opening-hand .hand{--opening-card:84px;--opening-step:min(92px,calc((100vw - 42px - var(--opening-card)) / max(1,var(--hand-count) - 1)))}
 .match-shell .game-page[data-setup="true"] .turn-banner small{font-size:12px}
}
@media(max-height:600px){
 .match-shell .table-wrap .hand-panel.opening-hand{height:105px}
 .match-shell .opening-hand .hand{--opening-card:62px}
 .match-shell .search-stage .selection-cloud{--choice-card:95px}
 .match-shell .selection-source{flex-basis:105px}
}
@media(prefers-reduced-motion:reduce){.opening-announcement,.opening-reveal{animation:none}.match-shell .search-stage .choice-card{transition:none}}
@media(min-width:601px){
 .match-shell .search-options .floating-pages{position:absolute;top:45%;left:-26px;right:-26px;transform:translateY(-50%);margin:0;justify-content:space-between;pointer-events:none}
 .match-shell .search-options .floating-pages .btn{pointer-events:auto}
 .match-shell .search-options .floating-pages span{display:none}
}
.match-shell .game-page[data-setup="true"] .table-wrap .turn-banner{visibility:visible}
.match-shell .table-wrap:has(.inline-selection:not(:empty)) .hand-panel.opening-hand{visibility:visible}

/* v0.33: choices live on the table; controls never form a second panel. */
.match-shell .table:before{border:0;box-shadow:none}
.match-shell .slot{border-color:transparent;background:none}
.match-shell .prize-empty{border-color:transparent;background:none;opacity:0}
.match-shell .board-turn-control{left:calc(50% + var(--active-card,75px)/2 + 20px);right:auto;top:50%}
.match-shell .inline-selection .selection-toolbar,
.match-shell .inline-selection[data-layout] .selection-toolbar,
.match-shell .inline-selection[data-layout]:has(.selection-drop) .selection-toolbar{
 position:absolute;left:12px!important;right:auto;top:58%!important;bottom:auto!important;
 transform:translateY(-50%);width:max-content;max-width:96%;padding:0;
 background:none;border:0;border-radius:0;box-shadow:none;text-shadow:none;gap:8px;z-index:4
}
.match-shell .inline-selection .selection-heading.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.match-shell .inline-selection .selection-toolbar:has(.selection-controls:empty){display:none}
.match-shell .selection-shade{position:absolute;inset:-8px;background:#020a13a6;border-radius:12px;pointer-events:none!important;transition:opacity .16s;z-index:0}
.match-shell .inline-selection .search-stage,.match-shell .inline-selection .choice-tabs,.match-shell .inline-selection .selection-browse{z-index:2}
.is-dragging .selection-shade{opacity:.36}
.match-shell .selection-mode-active .valid-target:focus-visible{outline-color:#8cd9ff;outline-width:2px}
.match-shell .table>.inline-selection[data-effect]:not(:empty){inset:8px;height:auto;pointer-events:none}
.match-shell .effect-energy-row{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center;gap:18px;max-width:92%;z-index:2;pointer-events:none}
.match-shell .effect-energy{flex:0 1 130px;min-width:0;max-width:150px;padding:0;background:none;border:0;border-radius:6px;pointer-events:auto;outline:2px solid #77d1ff;box-shadow:0 6px 16px #0008;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
.match-shell .effect-energy img{display:block;width:100%;border-radius:6px}
.match-shell .table:has(.inline-selection[data-effect="crispin"]) .pokemon{opacity:1}
.match-shell .table:has(.inline-selection[data-energy-destination="pokemon"]) .selection-shade{background:#020a1373}
.match-shell .effect-target{outline:2px solid #7dd9ff;outline-offset:2px;box-shadow:0 0 12px #7dd9ff80}
.match-shell .table-wrap:has(.inline-selection[data-effect="crispin"]) .hand-panel{visibility:visible;display:block}
.effect-kept-card{width:66px;flex:none;position:relative;pointer-events:none;animation:kept-energy .22s ease-out}
.effect-kept-card img{width:100%;border-radius:5px;display:block}
.effect-kept-card>span{position:absolute;right:-3px;top:0;background:#edcc78;color:#102433;border-radius:50%;width:23px;height:23px;display:grid;place-items:center}
.counter-rail{position:absolute;z-index:5;display:flex;flex-direction:column;gap:4px;pointer-events:none!important}
.counter-token,.counter-ghost{display:grid;place-items:center;min-width:38px;width:38px;height:38px;padding:0;border:3px solid #ffe19a;border-radius:50%;background:radial-gradient(circle at 35% 25%,#ffd36a,#ee990a 75%);color:#382000;font-weight:850;font-size:17px;line-height:1;box-shadow:0 3px 7px #0008;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
.counter-token{pointer-events:auto}
.counter-token:first-child{box-shadow:0 0 10px #ffd27275,0 3px 7px #0008}
.match-shell .table:has(.inline-selection[data-effect="counters"]) .your-half .pokemon{opacity:1}
.is-dragging .effect-energy-row{opacity:.08;pointer-events:none}
.is-dragging .effect-energy-row *{pointer-events:none!important}
.counter-token.drag-source{opacity:.2}
.counter-source .damage-counter{opacity:0}
@keyframes kept-energy{from{opacity:0;transform:translate3d(0,-22px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@media(max-width:600px){
 .match-shell .inline-selection[data-layout] .selection-toolbar{left:5px!important;top:65%!important}
 .match-shell .effect-energy-row{gap:10px;max-width:95%;top:32%;width:84%;flex-wrap:wrap}
 .match-shell .effect-energy{flex-basis:65px;max-width:90px}
 .match-shell .board-turn-control{left:calc(50% + var(--active-card,75px)/2 + 9px)}
 .counter-token{width:34px;height:34px;min-width:34px;font-size:15px}
 .counter-rail{gap:3px}
}
@media(prefers-reduced-motion:reduce){.effect-kept-card{animation:none}.selection-shade{transition:none}}

/* Ordered top-deck choices retain the player's first-to-second selection. */
.selection-order{position:absolute;left:18px;top:72px;display:flex;gap:10px;z-index:4;pointer-events:none}
.selection-order>span{position:relative;width:50px}.selection-order img{display:block;width:100%;border-radius:4px}
.selection-order b{position:absolute;right:-6px;bottom:-6px;background:#ffe08b;color:#16242d;border-radius:50%;width:24px;height:24px;display:grid;place-items:center}
