/* Team-first preparation and transactional Pokémon picker. */
#selection #pokemon-picker{grid-column:1;grid-row:2/span 2;min-width:0;padding:18px}
body[data-menu=online] #selection #pokemon-picker{grid-row:3/span 2}
#selection #pokemon-picker #team-workbench{display:block;padding:0;margin:0;background:none;border:0;box-shadow:none;min-width:0}
#selection #pokemon-picker .team-preview{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;margin-top:15px}
#selection #pokemon-picker .team-slot{min-width:0;min-height:260px;padding:30px 7px 12px;display:flex;flex-direction:column;gap:7px;border:1px solid #277291;border-radius:8px;background:linear-gradient(155deg,#0a3048a8,#061a2b);box-shadow:none}
#selection #pokemon-picker .team-slot.active{border-color:#ecd56d;background:linear-gradient(155deg,#153c4c,#091e30);box-shadow:0 0 8px #e8bd3220}
#selection #pokemon-picker .team-edit{display:flex;flex-direction:column;justify-content:flex-start;min-height:0;flex:1;gap:6px;padding:0}
#selection #pokemon-picker .team-edit canvas{width:100%!important;height:112px!important;max-width:128px;object-fit:contain;image-rendering:pixelated}
#selection #pokemon-picker .team-order{top:10px;left:7px;font-size:10px;color:#9fcde1}
#selection #pokemon-picker .team-info{gap:8px;width:100%}#selection #pokemon-picker .team-info strong{font-size:13px;color:#f3fbff}
#selection #pokemon-picker .team-info small{display:block;font:9px 'Segoe UI',sans-serif;color:#a8c9da}
#selection #pokemon-picker .team-types{gap:3px;min-height:18px;align-items:center}.team-types .type{white-space:nowrap}
#selection #pokemon-picker .team-types .type{font-size:7px;padding:3px;border-radius:4px}
#selection #pokemon-picker .team-moves,#selection #pokemon-picker .team-remove{position:absolute;top:6px;right:31px;width:21px;min-height:21px;height:21px;padding:0;margin:0;display:grid;place-items:center;border:1px solid #56869a85;border-radius:5px;background:#0d2b3e;color:#cce5f1;z-index:2}
#selection #pokemon-picker .team-moves span{font-size:14px}#selection #pokemon-picker .team-remove{right:5px;font:18px/1 Arial}
#selection #pokemon-picker .team-moves:hover,#selection #pokemon-picker .team-remove:hover{border-color:#ffe17d;color:#ffe17d}
#selection #pokemon-picker .team-hp{width:100%;display:block}#selection #pokemon-picker .team-hp small{display:flex;justify-content:space-between;font-size:9px;margin-bottom:5px}.team-hp i{height:5px;background:#051626;display:block;border-radius:3px;overflow:hidden}.team-hp i>b{height:100%;display:block;background:#24d6aa}
#selection #pokemon-picker .team-slot:not(.filled){padding:0;opacity:1;border-style:dashed;background:#06223566}
#selection .team-add{width:100%;height:100%;flex:1;border:0;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:none;color:#8cbad6;font:800 11px/1.6 'Segoe UI',sans-serif}
#selection .team-add>b{font:300 36px/1 'Segoe UI',sans-serif;border:1px solid #5e9fc2;border-radius:50%;width:42px;height:42px}#selection .team-add:hover{background:#0f4560;color:#d8f7ff}
#selection #pokemon-picker .start-area{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;flex-direction:row;background:none;box-shadow:none;gap:8px;padding-top:12px;margin-top:12px;border-top:1px solid #2e62764d}
#selection #pokemon-picker #start{width:auto;min-width:200px;padding:12px 17px}#selection #pokemon-picker .team-help{font:11px/1.5 'Segoe UI',sans-serif;margin-top:13px;color:#a9c8dc}
#selection #strategy-panel{display:none}body[data-menu=moves] #selection #strategy-panel{display:block}
#pokemon-select-dialog{width:min(1360px,calc(100vw - 40px));height:min(850px,calc(100dvh - 40px));max-width:none;max-height:none;padding:0;margin:auto;overflow:hidden;border:1px solid #1ccef8;border-radius:13px;background:linear-gradient(135deg,#082b43,#041827);color:#e8f4fc;box-shadow:0 18px 65px #0009;font:12px 'Segoe UI',sans-serif}
#pokemon-select-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;animation:picker-enter .18s ease-out}#pokemon-select-dialog::backdrop{background:#00101dbd}
@keyframes picker-enter{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
#pokemon-select-dialog .pokemon-modal-heading{display:flex;gap:14px;align-items:center;padding:18px 20px;border-bottom:1px solid #36789955;background:none;height:auto}
#pokemon-select-dialog .pokemon-modal-heading h2{font:900 22px 'Segoe UI',sans-serif;margin:2px 0;color:#f5fbff}#pokemon-select-dialog header small{font:800 9px 'Segoe UI',sans-serif;color:#38c9f3;letter-spacing:1px}#pokemon-select-dialog header p{margin:4px 0 0;color:#a5c9df;font-size:11px}
#picker-count{margin-left:auto;color:#55d8fa;font-weight:850;white-space:nowrap}#pokemon-select-dialog [data-close-picker]{border:1px solid #45839f;border-radius:5px;width:34px;height:34px;padding:0;background:#0d3048;color:white;font:24px/1 Arial}
#pokemon-select-dialog .pokemon-modal-toolbar{padding:12px 20px}#pokemon-select-dialog .roster-toolbar{display:flex;gap:9px;align-items:center;margin:0;flex-wrap:wrap}#pokemon-select-dialog .search-box{display:flex;align-items:center;gap:6px;flex:1;min-width:190px;padding:8px 10px;background:#051b2c;border:1px solid #33738b;border-radius:6px}#pokemon-select-dialog input{width:100%;background:none;border:0;outline:none;color:white;font:12px 'Segoe UI',sans-serif}#pokemon-select-dialog select{font:11px 'Segoe UI',sans-serif;padding:8px;background:#08273c;border:1px solid #33738b;border-radius:5px;color:#e9f7ff}#pokemon-select-dialog .type-filter{margin:0}#roster-result{color:#90b9cc;font-size:10px}
#pokemon-select-dialog .pokemon-modal-body{display:grid;grid-template-columns:210px minmax(0,1fr) 220px;gap:14px;padding:0 20px 14px;min-height:0}
#pokemon-select-dialog .picker-team,#picker-detail{min-width:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#138cae #062238}
#pokemon-select-dialog .picker-team{border-right:1px solid #2d6f8b55;padding-right:12px}#pokemon-select-dialog .picker-team h3{font-size:12px;margin:6px 0 12px}#pokemon-select-dialog .picker-team>p{font-size:9px;line-height:1.5;color:#92b3c5}
#picker-slots{display:flex;flex-direction:column;gap:5px}.picker-slot{display:flex;align-items:center;gap:7px;min-height:65px;width:100%;border:1px solid transparent;border-bottom-color:#27607c55;border-radius:5px;padding:7px;background:transparent;color:#afc6d7;text-align:left}.picker-slot.active{border-color:#28c7e6;background:#0a3b53}.picker-slot>b{color:#61cef0;font-size:14px}.picker-slot canvas{width:38px!important;height:38px!important;image-rendering:pixelated;object-fit:contain;flex:none}.picker-slot strong{display:block;font-size:11px}.picker-slot small{display:flex;gap:3px;margin-top:4px;flex-wrap:wrap}.picker-slot .type{font-size:6px;padding:2px}
#pokemon-select-dialog .picker-catalog{min-width:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#13accd #062238;padding-right:5px}
#pokemon-select-dialog #roster{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:9px;padding:0;max-height:none;overflow:visible}
#pokemon-select-dialog .pokemon-card{display:flex;flex-direction:column;min-width:0;min-height:220px;padding:9px;text-align:left;border:1px solid #245b78;border-radius:7px;background:#08243a;box-shadow:none;color:#e9f8ff;cursor:pointer;transition:border-color .15s,background .15s}
#pokemon-select-dialog .pokemon-card.selected{border-color:#279bad;background:#0c3040}#pokemon-select-dialog .pokemon-card.inspected{border-color:#ffe06c;background:#243b41;box-shadow:inset 0 0 0 1px #d5b847}
#pokemon-select-dialog .card-top{display:flex;justify-content:space-between;color:#8fb7cd;font-size:9px}#pokemon-select-dialog .pick-order{font-size:10px;color:#40d3f2}#pokemon-select-dialog .sprite-stage{height:96px;display:grid;place-items:center;background:none;border:0;margin:0;flex:none}#pokemon-select-dialog .sprite-stage:after,#pokemon-select-dialog .sprite-stage:before{display:none}
#pokemon-select-dialog .sprite-stage canvas{width:96px!important;height:96px!important;object-fit:contain;image-rendering:pixelated;filter:none}
#pokemon-select-dialog .card-copy{padding:4px 0 0;min-width:0}#pokemon-select-dialog .card-copy h3{font:850 13px 'Segoe UI',sans-serif;margin:0 0 6px}#pokemon-select-dialog .type,#picker-detail .type{display:inline-block;margin:0 3px 3px 0;padding:3px 4px;border:1px solid color-mix(in srgb,var(--type) 60%,transparent);border-radius:4px;background:color-mix(in srgb,var(--type) 13%,#082132);color:var(--type);font:800 8px 'Segoe UI',sans-serif;white-space:nowrap}
#pokemon-select-dialog .role{display:none}#pokemon-select-dialog .card-attributes{margin-top:6px;display:grid;gap:5px}#pokemon-select-dialog .card-attributes label{display:flex;gap:5px;align-items:center;font:8px 'Segoe UI',sans-serif;color:#a1bcd0;margin:0}#pokemon-select-dialog .card-attributes label:nth-child(n+3){display:none}#pokemon-select-dialog .card-attributes label>i{flex:1;height:3px;border:0;background:#071929;display:block}#pokemon-select-dialog .card-attributes label i>b{display:block;height:100%;background:#29b7db}#pokemon-select-dialog .card-attributes small{font:9px 'Segoe UI',sans-serif;color:#d1e5ef}#pokemon-select-dialog .pick-status{display:block;padding:6px 0 0;margin-top:6px;border-top:1px solid #3a60784d;background:none;text-align:center;font:800 8px 'Segoe UI',sans-serif;color:#68cee7}
#picker-detail{border-left:1px solid #2e6b8555;padding-left:14px}#picker-detail>canvas{display:block;margin:auto;width:128px!important;height:128px!important;image-rendering:pixelated;object-fit:contain}#picker-detail h3{font-size:21px;margin:3px 0 7px}#picker-detail p{font-size:11px;line-height:1.5;color:#abc5d7}.picker-dex{color:#5dceeb}.picker-stat{display:grid;grid-template-columns:1fr auto;gap:6px;margin:13px 0;font-size:11px;color:#b2cfdf}.picker-stat>b{color:#effcff;font-size:14px}.picker-stat>i{grid-column:1/-1;display:block;height:4px;background:#051522;border-radius:3px;overflow:hidden}.picker-stat>i>b{display:block;height:100%;background:#35b8d5;transition:width .16s}.picker-mobility{font-size:10px!important}
#picker-place{width:100%;border:1px solid #45d5f3;border-radius:5px;padding:11px 5px;background:linear-gradient(125deg,#009fe5,#0b6bbe);color:white;font:800 11px 'Segoe UI',sans-serif}
#pokemon-select-dialog footer{display:flex;align-items:center;gap:10px;border-top:1px solid #28617a70;margin:0;padding:14px 20px;background:#062033}#picker-message{flex:1;color:#a6c7da;font-size:11px;line-height:1.4}#pokemon-select-dialog footer button{border:1px solid #468ca8;background:#0a2d43;color:#d2edf5;padding:11px 18px;font:800 12px 'Segoe UI',sans-serif;border-radius:6px}#pokemon-select-dialog footer #confirm-pokemon{background:linear-gradient(125deg,#079bdf,#066ec8);border-color:#43d5f6;color:#fff}
@media(max-width:1250px){#selection #pokemon-picker .team-preview{grid-template-columns:repeat(3,minmax(0,1fr))}#selection #pokemon-picker .team-slot{min-height:230px}#selection #pokemon-picker .team-edit canvas{height:90px!important}#pokemon-select-dialog .pokemon-modal-body{grid-template-columns:170px minmax(0,1fr) 190px;gap:10px}#pokemon-select-dialog #roster{grid-template-columns:repeat(auto-fill,minmax(125px,1fr))}}
@media(max-width:950px){#selection #pokemon-picker{grid-column:1/-1;grid-row:auto!important}#pokemon-select-dialog .pokemon-modal-body{grid-template-columns:minmax(0,1fr) 200px}.picker-team{grid-column:1/-1;border-right:0!important;padding-right:0!important}.picker-team h3,.picker-team>p{display:none}#picker-slots{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}.picker-slot{min-height:45px;padding:3px;justify-content:center;gap:3px}.picker-slot canvas{width:26px!important;height:26px!important}.picker-slot>span{display:none}#pokemon-select-dialog #roster{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}}
@media(max-width:650px){#selection #pokemon-picker{padding:12px}#selection #pokemon-picker .team-preview{grid-template-columns:repeat(2,minmax(0,1fr))}#selection #pokemon-picker .start-area{display:flex!important}#selection #pokemon-picker #start{width:100%}#pokemon-select-dialog{width:calc(100vw - 12px);height:calc(100dvh - 16px);border-radius:9px}#pokemon-select-dialog .pokemon-modal-heading{padding:12px;gap:7px}#pokemon-select-dialog header h2{font-size:17px!important}#pokemon-select-dialog header p{font-size:10px}#pokemon-select-dialog .pokemon-modal-toolbar{padding:9px}#pokemon-select-dialog .search-box{min-width:100%;box-sizing:border-box}#pokemon-select-dialog .pokemon-modal-body{display:flex;flex-direction:column;overflow:auto;padding:0 10px 10px;gap:10px}.picker-team{flex:none}.picker-catalog{overflow:visible!important;flex:none}#picker-detail{overflow:visible;flex:none;border:1px solid #2b5b70;border-radius:6px;padding:10px;display:grid;grid-template-columns:75px 1fr;gap:4px 10px}#picker-detail>canvas{width:75px!important;height:75px!important}#picker-detail>div:not(.picker-stat){min-width:0}#picker-detail h3{font-size:18px}.picker-stat{margin:5px 0;font-size:10px}.picker-stat>b{font-size:12px}#picker-detail .picker-mobility,#picker-place{grid-column:1/-1}#pokemon-select-dialog footer{padding:10px;flex-wrap:wrap;gap:7px}#picker-message{flex-basis:100%;font-size:10px}#pokemon-select-dialog footer button{flex:1;padding:10px;font-size:11px}#roster-result{display:none}}
@media(prefers-reduced-motion:reduce){#pokemon-select-dialog,#pokemon-select-dialog *{animation:none!important;transition:none!important}}

@media(max-width:650px){#pokemon-select-dialog .picker-team{order:1}#picker-detail{order:2}#pokemon-select-dialog .picker-catalog{order:3}}

/* The existing launch button is the sole primary action beneath the team. */
#selection #pokemon-picker #start{display:block;width:100%;min-height:60px;margin-top:16px;padding:14px 18px;font-size:16px}
#selection #pokemon-picker .start-area{margin-top:9px;padding-top:0;border:0;justify-content:center;gap:8px}
/* Refinements: strategy belongs to the same team surface. */
#selection #pokemon-picker #strategy-panel{display:block;grid-area:auto;padding:16px 0 0;margin:16px 0 0;border:0;border-top:1px solid #37728b60;border-radius:0;background:none;box-shadow:none}
#selection #pokemon-picker #strategy-panel .panel-heading{margin-bottom:10px}
#selection #pokemon-picker #strategy-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#selection #pokemon-picker .team-slot:not(.filled){height:auto;align-items:stretch;justify-content:stretch;border-color:#3389a8}
#selection #pokemon-picker .team-add{height:auto;min-height:220px;padding:20px 7px;box-sizing:border-box;align-self:stretch;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;background:radial-gradient(ellipse at center,#12608045,transparent 75%);color:#c3e8f8}
#selection #pokemon-picker .team-add>b{display:grid;place-items:center;position:static;margin:0;float:none;flex:none;width:46px;height:46px;line-height:1;font-weight:400;color:#55d5f5;border:1px solid #4cbfdc;box-shadow:0 0 10px #27d3f52b;background:#0d394d}
#selection #pokemon-picker .team-add>span{display:block;width:100%;margin:0;color:#d5f3ff;font:850 11px/1.5 'Segoe UI',sans-serif}
#selection #pokemon-picker .team-add>small{display:block;margin:0;color:#8dcae0;font:10px/1.4 'Segoe UI',sans-serif}
#selection #pokemon-picker .team-add:hover{background:#10445d;color:white}#selection #pokemon-picker .team-add:focus-visible{outline:2px solid #ffe17d;outline-offset:-4px}
/* Compact title + toolbar, independent of the old large search field styles. */
#pokemon-select-dialog .pokemon-modal-heading{padding:10px 14px;gap:10px;min-height:0}
#pokemon-select-dialog .pokemon-modal-heading>div>small{display:none}
#pokemon-select-dialog .pokemon-modal-heading h2{font-size:18px;margin:0;line-height:1.2}
#pokemon-select-dialog .pokemon-modal-heading p{font-size:10px;line-height:1.3;margin:3px 0 0}
#pokemon-select-dialog .pokemon-modal-heading [data-close-picker]{width:30px;height:30px;font-size:22px}
#pokemon-select-dialog .pokemon-modal-toolbar{padding:8px 14px}
#pokemon-select-dialog .roster-toolbar{gap:8px;flex-wrap:nowrap;min-height:0}
#pokemon-select-dialog .search-box{flex:0 1 360px;min-width:160px;max-width:420px;height:34px;min-height:34px;max-height:34px;padding:5px 9px;margin:0;box-sizing:border-box}
#pokemon-select-dialog .search-box input{height:22px;min-height:0;padding:0;margin:0;line-height:22px;font-size:11px}
#pokemon-select-dialog .roster-toolbar select{height:34px;padding:5px 8px;font-size:10px}
#pokemon-select-dialog #roster-result{margin-left:auto;white-space:nowrap}
#pokemon-select-dialog #picker-edit-abilities{display:block;width:100%;margin-top:7px;border:1px solid #42a2c0;border-radius:5px;padding:10px 5px;background:#0c3047;color:#d8effb;font:800 11px 'Segoe UI',sans-serif}
#pokemon-select-dialog #picker-edit-abilities:hover{border-color:#ffe17d;color:#ffe17d;background:#143c50}
@media(max-width:1250px){#selection #pokemon-picker #strategy-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){#selection #pokemon-picker #strategy-summary{grid-template-columns:1fr}#pokemon-select-dialog .pokemon-modal-heading{padding:9px 11px}#pokemon-select-dialog .pokemon-modal-heading h2{font-size:16px!important}#pokemon-select-dialog .pokemon-modal-toolbar{padding:7px 10px}#pokemon-select-dialog .roster-toolbar{flex-wrap:wrap;gap:6px}#pokemon-select-dialog .search-box{flex:1 0 100%;min-width:100%;max-width:none;height:32px;min-height:32px;max-height:32px}#pokemon-select-dialog .roster-toolbar select{height:30px}#pokemon-select-dialog #picker-edit-abilities{grid-column:1/-1;margin-top:2px}}
/* Keep the side panels together when the expanded team panel is taller. */
#selection #preparation-settings{grid-column:2;grid-row:2/span 2;display:flex;flex-direction:column;gap:14px;min-width:0;align-self:start}
body[data-menu=online] #selection #preparation-settings{grid-row:3/span 2}
#selection #preparation-settings #arena-picker,#selection #preparation-settings #match-settings{grid-area:auto;min-width:0;width:100%;box-sizing:border-box}
@media(max-width:950px){#selection #preparation-settings{grid-column:1/-1;grid-row:auto!important}}
