/* One-column browsing; damage allocation and concealed prizes retain their layout. */
#lobby .deck-grid{grid-template-columns:minmax(0,1fr);gap:6px}
#lobby .deck-tile{display:grid;grid-template-columns:24px 48px minmax(0,1fr);grid-template-rows:auto auto;gap:2px 10px;align-items:center;text-align:left;min-height:66px;padding:8px 12px;border-radius:11px}
#lobby .deck-tile-number{position:static;grid-column:1;grid-row:1/3}
#lobby .deck-tile-art{grid-column:2;grid-row:1/3;width:48px;height:48px;margin:0}
#lobby .deck-tile-art img{width:46px;height:46px;filter:none}
#lobby .deck-tile-name{grid-column:3;grid-row:1;font-size:14px;line-height:1.4}
#lobby .deck-tile-caption{grid-column:3;grid-row:2;font-size:11px;margin:0;overflow-wrap:anywhere}
#lobby .deck-selected{gap:10px;margin-bottom:16px}
#lobby .deck-selected-card{min-height:100px;padding:12px;gap:10px;flex-direction:row;align-items:center}
#lobby .deck-selected-art{flex:0 0 48px;width:48px;height:48px}
#lobby .deck-selected-art img{width:48px;height:48px}
#lobby .deck-selected-text{gap:3px}#lobby .deck-selected-text strong{font-size:14px}#lobby .deck-versus{display:none}
#choice .compact-choice-list,#choice .pokemon-target-list,#dialog .pokemon-target-list,#dialog .compact-reveal-list,#dialog .detail-list{display:flex;flex-direction:column;flex-wrap:nowrap;gap:6px;max-height:45dvh;overflow-y:auto;overflow-x:hidden;width:100%;min-width:0;box-sizing:border-box;align-items:stretch}
#choice .compact-choice-list>.choice-option{display:flex;flex:0 0 auto;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:10px;width:100%;min-width:0;min-height:58px;height:auto;padding:8px 10px;margin:0;box-sizing:border-box;text-align:left}
#choice .compact-choice-list input{position:static;flex:0 0 20px;width:20px;height:20px;margin:0}
#choice .compact-choice-list .native-choice-card,#choice .compact-choice-list>.native-choice-card,#dialog .compact-reveal-list>.mulligan-card{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:10px;text-align:left;min-width:0;width:100%;box-sizing:border-box;padding:4px}
#choice .compact-choice-list .native-choice-card b,#dialog .compact-reveal-list b{font-size:14px;line-height:1.4;overflow-wrap:anywhere;min-width:0}
#choice .compact-choice-list .sprite,#dialog .compact-reveal-list .sprite{width:42px;height:40px;flex:0 0 42px;object-fit:contain}
#choice .compact-choice-list .energy-icon,#dialog .compact-reveal-list .energy-icon{width:28px;height:28px;flex-shrink:0}
#choice .choice-option.selection-unavailable{opacity:.4;filter:grayscale(.7);background:#e9edf1;cursor:not-allowed}
#choice .choice-option[hidden]{display:none!important}
#choice .pokemon-target-list>.choice-option,#dialog .pokemon-target-list>button{display:grid;flex:0 0 auto;grid-template-columns:minmax(0,1fr) minmax(85px,.7fr) 20px;grid-template-rows:auto auto;gap:2px 8px;min-height:80px;height:auto;min-width:0;width:100%;max-width:100%;margin:0;padding:8px!important;box-sizing:border-box}
#choice .pokemon-target-list .native-choice-card,#dialog .pokemon-target-list .native-choice-card{display:flex;flex-direction:row;align-items:center;gap:6px;padding:0;min-width:0;text-align:left}
.pokemon-target-list .native-choice-card b{font-size:13px;overflow-wrap:anywhere}
#choice .pokemon-target-list .sprite,#dialog .pokemon-target-list .sprite{width:36px;height:36px;flex:0 0 36px}
#choice .pokemon-target-list .target-state,#dialog .pokemon-target-list .target-state{min-width:0;margin:0;padding:0}
#choice .pokemon-target-list .target-hp strong,#dialog .pokemon-target-list .target-hp strong{font-size:20px}
#choice .pokemon-target-list .target-energy-icons,#dialog .pokemon-target-list .target-energy-icons{flex-wrap:wrap;gap:3px;margin:3px 0}
#choice .pokemon-target-list .target-tools,#dialog .pokemon-target-list .target-tools{font-size:11px;overflow-wrap:anywhere}
#dialog .compact-reveal-list>.mulligan-card{min-height:54px;flex:0 0 auto;padding:8px 10px}
#dialog .detail-list>button{display:flex;flex:0 0 auto;align-items:center;gap:10px;text-align:left;min-height:50px;width:100%;min-width:0;padding:8px 10px}
#dialog .detail-list .sprite{width:38px;height:38px;object-fit:contain}#dialog .detail-list span{overflow-wrap:anywhere;min-width:0}
.action-notice.field-draw-notice{position:fixed;bottom:auto;right:auto;transform:translate(-50%,-50%);box-sizing:border-box;font-size:14px;max-height:110px;overflow:auto;padding:8px 12px;pointer-events:none;z-index:85}
@media(max-width:440px){#lobby .deck-selected{grid-template-columns:1fr}#lobby .deck-selected-card{min-height:76px}#lobby .deck-selected-text small{font-size:11px}#lobby .deck-edit{font-size:11px}}
#choice .compact-choice-list .card-type-badge,#dialog .compact-reveal-list .card-type-badge{flex:0 0 54px;width:54px;min-height:40px;height:40px;padding:3px;gap:2px;font-size:10px;border-radius:9px}
#choice .compact-choice-list .card-type-badge svg,#dialog .compact-reveal-list .card-type-badge svg{width:16px;height:16px}
.selection-effect-description{margin:8px 0 0;font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;color:#234557;font-weight:400}
#dialog .discard-review-list{list-style:none;padding:0;margin:8px 0 16px;max-height:45dvh;overflow-y:auto;overflow-x:hidden}#dialog .discard-review-row{display:grid;grid-template-columns:54px minmax(0,1fr) 34px;align-items:center;gap:8px;min-height:44px;padding:6px 0;border-bottom:1px solid #dce6ed;box-sizing:border-box}#dialog .discard-review-art{display:flex;align-items:center;justify-content:center}#dialog .discard-review-art .sprite{width:30px;height:30px;object-fit:contain}#dialog .discard-review-art .energy-icon{width:24px;height:24px}#dialog .discard-review-type{font-size:10px;color:#557180;white-space:nowrap}#dialog .discard-review-name{font-size:14px;line-height:1.5;overflow-wrap:anywhere}#dialog .discard-review-count{font-size:14px;font-weight:700;text-align:right}#dialog .discard-review-reason{font-size:14px;line-height:1.6;color:#425e70;margin:8px 0}#dialog .discard-review-total{font-size:12px;color:#617783;margin:4px 0}

/* One scroll surface per selection/dialog. */
#choice.is-effect-popup,#dialog{box-sizing:border-box;max-height:calc(100dvh - 32px);overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;scroll-padding-block:16px 90px}
#choice.is-effect-popup .choice-options,#choice.is-effect-popup .compact-choice-list,#choice.is-effect-popup .pokemon-target-list,#choice.is-effect-popup .energy-target-overview,#dialog .pokemon-target-list,#dialog .compact-reveal-list,#dialog .detail-list,#dialog .discard-review-list,#dialog #dialog-content{max-height:none;overflow:visible}
#choice.is-effect-popup .choice-option,#dialog .pokemon-target-list>button,#dialog .detail-list>button{touch-action:pan-y pinch-zoom}
#choice.is-effect-popup .choice-confirm-controls{position:sticky;bottom:-1px;z-index:3;padding:12px 0;background:#fbfdff;box-shadow:0 -8px 12px #fbfdff}
#dialog #dialog-content>button.primary:last-child{position:sticky;bottom:0;z-index:3;box-shadow:0 0 0 8px #fbfdff}
#lobby .deck-nickname{font-size:13px;margin:4px 0 12px;color:#526c7b}
@media(max-width:600px){#choice.is-effect-popup,#dialog{max-height:calc(100dvh - 20px);max-width:calc(100vw - 16px);padding:16px}#choice.is-effect-popup{width:calc(100vw - 16px)}}

/* Native popup scrolling; the underlying page is locked by popup-field.js. */
html.popup-scroll-locked{overflow:hidden;overscroll-behavior:none}
#choice details.effect-source>summary{cursor:pointer;font-weight:700;min-height:36px;line-height:1.5}
#choice details.effect-source:not([open]){padding-block:8px}
#choice details.effect-source .selection-effect-description{margin:8px 0 0;white-space:pre-line}
#table .player-area{position:relative}
#table .active-lane .trainer-pad,#table #trainer-zone{opacity:0;pointer-events:none;outline:none;box-shadow:none}
#table .trainer-drop-surface{position:absolute;inset:0;z-index:2;box-sizing:border-box;border:2px dashed transparent;border-radius:12px;pointer-events:none;color:transparent;background:transparent;display:flex;align-items:flex-end;justify-content:center;padding:12px;font-size:12px;font-weight:700;transition:background .15s,color .15s,border-color .15s;outline:none;box-shadow:none}
#table .trainer-drop-surface::after{content:none}
body.dragging #table .trainer-drop-surface.drop-legal{pointer-events:auto;border-color:#79ecd6;background:#67e3cf25;color:#e7fff9}
body.dragging #table .trainer-drop-surface.drop-hover{background:#67e3cf55}
@media(prefers-reduced-motion:reduce){#table .trainer-drop-surface{transition:none}}

body.dragging #table #trainer-zone.drop-legal{opacity:1;border-color:transparent;background:transparent;color:#e7fff9;position:relative;z-index:3}
body.dragging #table #trainer-zone.drop-legal::after{content:none}
#table .trainer-drop-surface,#table #trainer-zone{background-color:transparent!important}
body.dragging #table .trainer-drop-surface.drop-legal{background-color:#67e3cf25!important}
body.dragging #table .trainer-drop-surface.drop-hover{background-color:#67e3cf55!important}

/* Native horizontal momentum; vertical gestures remain available for playing cards. */
#hand.hand-scroll{scroll-snap-type:none;scroll-behavior:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pinch-zoom}
#hand .hand-card,#hand .hand-card .inspect{touch-action:pan-x pinch-zoom}

/* Mulligan cards are a compact two-column review, never a horizontal hand. */
#choice .choice-options.mulligan-review{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:none;overflow:visible}
#choice .mulligan-review .hand-card{padding:0;min-width:0}
#choice .mulligan-review .hand-card .inspect{height:92px;min-height:92px;padding:5px;gap:2px}
#choice .mulligan-review,#choice .mulligan-review *{touch-action:pan-y pinch-zoom}
#choice .mulligan-review .name{font-size:11px;line-height:1.25}
#choice .mulligan-review .sprite{width:32px;height:28px;flex-basis:auto}
#choice .mulligan-review .card-type-badge{flex:0 0 auto;width:auto;min-height:24px;height:24px;font-size:9px}
#choice .mulligan-review .energy-icon{width:24px;height:24px}
/* A separate grip preserves diagonal dragging without disabling hand momentum. */
#hand::after{content:'';flex:0 0 20px}
#hand .hand-drag-grip{position:absolute;top:0;left:0;width:calc(100% - 25px);height:26px;display:flex;align-items:center;justify-content:center;z-index:2;touch-action:none;cursor:grab;font-size:20px;line-height:1;color:#35546899;user-select:none;-webkit-user-select:none}
#hand .hand-card .inspect{padding-top:28px}
.drag-card-preview .hand-drag-grip{display:none}
