/* Card interaction surface: transform-only motion, no page scroll while dragging. */
.match-shell{height:var(--game-height,100dvh);overscroll-behavior:none}
.match-shell .workspace{height:calc(var(--game-height,100dvh) - 46px);overscroll-behavior:none}
.match-shell .game-page{position:relative;isolation:isolate}
.match-shell .table{touch-action:none;overscroll-behavior:none}
.game-page [data-selection-id],.game-page [data-drag-card],.game-page [data-drag-pokemon]{touch-action:none;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;cursor:grab}
.game-page img{user-select:none;-webkit-user-select:none;-webkit-user-drag:none;pointer-events:none}
.match-shell button{touch-action:manipulation}
.match-shell button[data-selection-id],.match-shell button[data-drag-card]{touch-action:none}
.match-shell .hand{touch-action:pan-x;overscroll-behavior:contain;scroll-behavior:smooth;scrollbar-width:none}
.match-shell .hand-heading{display:flex;align-items:center;gap:5px}
.match-shell .hand-heading .hand-page{font-size:20px;min-width:34px;min-height:30px;padding:0 7px}
.match-shell .hand{padding-top:28px}.match-shell .hand-panel{height:132px}
.match-shell .hand-card:hover{transform:none}
.drag-card-ghost{position:fixed;z-index:1500;pointer-events:none!important;transform-origin:50% 50%;will-change:transform;contain:layout style;backface-visibility:hidden;border-radius:5px;box-shadow:0 12px 20px #0005}
.drag-card-ghost img{display:block;width:100%;height:100%;object-fit:contain;border-radius:5px}
.drag-source{opacity:.2!important}
.drop-ready{outline:2px dashed #80cbfacc!important;outline-offset:4px;transition:outline-color .12s,box-shadow .12s;opacity:1!important}
.drop-hover{outline:3px solid #ffda80!important;box-shadow:0 0 0 5px #ffda8030,0 0 22px #ffcf7070!important}
.is-dragging{overscroll-behavior:none;user-select:none;-webkit-user-select:none;cursor:grabbing}
.drag-hud{position:fixed;z-index:1700;left:8px;top:45px;max-width:calc(100vw - 16px);padding:5px 9px;background:#071521e8;border-radius:6px;font:11px ui-monospace,monospace;color:#a4f3d3;pointer-events:none}

/* Choices float over the table. There is no modal/backdrop element or bottom box. */
.match-shell .inline-selection:not(:empty){position:absolute;inset:60px 14px 144px;z-index:25;max-height:none;min-height:0;margin:0;padding:0;background:none!important;border:0!important;box-shadow:none!important;border-radius:0;overflow:visible;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;pointer-events:none}
.match-shell .inline-selection>*{pointer-events:auto;max-width:100%}
.match-shell .inline-selection .selection-heading{align-items:center;justify-content:center;text-align:center;gap:12px;color:#fff;text-shadow:0 2px 8px #000,0 1px 3px #000}
.match-shell .inline-selection .selection-heading h2{font-size:16px;max-width:540px}
.match-shell .selection-count{white-space:nowrap;font-size:13px}
.match-shell .selection-controls{margin:0;justify-content:center}
.match-shell .inline-selection .choice-tabs{margin:0;max-width:min(700px,100%);flex-shrink:0;padding:5px 2px}
.match-shell .choice-tabs .btn{background:#071824b8;border-color:#93c0da50}
.match-shell .selection-cloud{display:grid;grid-template-columns:repeat(var(--choice-columns,6),minmax(0,94px));justify-content:center;gap:14px;padding:10px 7px;animation:cards-materialize .2s ease-out}
.match-shell .selection-cloud .selection-option{min-width:0;width:94px;display:block;position:relative;background:none;border:0;padding:0}
.match-shell .selection-cloud .choice-card{display:block;width:100%;max-width:none;padding:0;border:0;border-radius:6px;background:none;box-shadow:0 8px 16px #0006}
.match-shell .selection-cloud .choice-card img{width:100%;height:auto;aspect-ratio:245/342;object-fit:contain}
.match-shell .selection-cloud .choice-card:has(img) small{display:none}
.match-shell .selection-cloud .choice-card:not(:has(img)):not(.card-back){min-height:44px;padding:10px;background:#152b3cc9;border:1px solid #6babc6}
.match-shell .selection-drop{border:1px dashed #b3daf1a1;border-radius:30px;padding:12px 20px;min-width:160px;min-height:44px;text-align:center;text-shadow:0 1px 5px #000;color:#fff;font-weight:700;font-size:13px;background:#06192555}
.floating-pages{display:flex;align-items:center;gap:14px;text-shadow:0 1px 5px #000;font-size:12px}
.floating-pages .btn{min-width:44px;min-height:36px;font-size:20px;padding:3px;background:#0718249c}
.match-shell .game-page:has(.inline-selection[data-floating="true"]:not(:empty)) .table{filter:brightness(.38);transition:filter .2s}
.match-shell .game-page:has(.inline-selection[data-floating="true"]:not(:empty)) .turn-banner{visibility:hidden}
.is-dragging .match-shell .game-page .table{filter:none!important}
.is-dragging .selection-cloud{opacity:.13;transition:opacity .12s;pointer-events:none}
.is-dragging .selection-cloud *{pointer-events:none!important}
.is-dragging .inline-selection .choice-tabs,.is-dragging .floating-pages{opacity:.15;pointer-events:none}
.match-shell .inline-selection[data-floating="false"]:not(:empty){justify-content:center;inset:auto 10px 12px;gap:4px;max-height:124px}
.match-shell .inline-selection[data-floating="false"] .selection-heading{display:none}
.match-shell .inline-selection[data-floating="false"] .choice-tabs{margin:0;padding:2px 0}
.match-shell .table-wrap:has(.inline-selection:not(:empty)) .hand-panel{visibility:hidden;display:block}
.match-shell .table-wrap:has(.inline-selection[data-surface="board"]:not(:empty)) .hand-panel,.match-shell .table-wrap:has(.inline-selection[data-surface="prizes"]:not(:empty)) .hand-panel{display:block}
.match-shell .inline-selection .compact-gallery{justify-content:center;max-height:45vh;overflow:auto;touch-action:pan-y}
.match-shell .inline-selection .detail-grid,.match-shell .inline-selection .inspection-board{max-height:48vh;overflow:auto;background:#071824e8;border-radius:12px;padding:16px;touch-action:pan-y}
.match-shell .selection-mode-active [data-selection-id]{animation:none}
.match-shell .selection-mode-active .valid-target{box-shadow:0 0 8px #78caff80}
.match-shell .selection-mode-active .selected-target{box-shadow:0 0 12px #ffda8080;opacity:.65}
@keyframes cards-materialize{from{opacity:0;transform:translate3d(0,14px,0) scale(.97)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
@media(max-width:600px){
 .match-shell .workspace{height:calc(var(--game-height,100dvh) - 40px)}
 .match-shell .site-header{padding-top:env(safe-area-inset-top)}
 .match-shell .game-page{padding-bottom:max(5px,env(safe-area-inset-bottom))}
 .match-shell .inline-selection:not(:empty){inset:62px 14px 142px;gap:7px}
 .match-shell .inline-selection .selection-heading h2{font-size:14px}
 .match-shell .selection-cloud{grid-template-columns:repeat(var(--choice-columns,3),76px);gap:13px;padding:8px 6px}
 .match-shell .selection-cloud .selection-option{width:76px}
 .match-shell .hand-panel{height:126px}.match-shell .hand{padding-top:30px}
 .match-shell .selection-drop{font-size:12px;padding:10px 15px}
 .match-shell .selection-controls .btn{min-height:34px;padding:6px 10px}
 .match-shell .inline-selection .choice-tabs .btn{min-height:30px}
}
@media(max-width:600px) and (max-height:740px){
 .match-shell .selection-cloud{grid-template-columns:repeat(var(--choice-columns,2),68px);gap:10px}
 .match-shell .selection-cloud .selection-option{width:68px}
 .match-shell .inline-selection:not(:empty){inset:50px 12px 132px;gap:4px}
 .match-shell .inline-selection .selection-heading h2{font-size:12px;line-height:1.25}
 .match-shell .inline-selection .choice-tabs{max-width:100%;padding:2px 0}
}
@media(prefers-reduced-motion:reduce){.match-shell .selection-cloud{animation:none}.match-shell .hand{scroll-behavior:auto}.drop-ready,.is-dragging .selection-cloud,.match-shell .table{transition:none!important}}

.is-dragging .match-shell .hand-panel.drop-ready{visibility:visible}
