/* Upright cards over a perspective pitch; the bench shares its exact height. */
.squad-topline{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:-8px 0 20px;color:var(--muted);font-size:13px}.squad-topline>span{display:flex;align-items:center;gap:7px}.squad-topline .icon{width:20px;height:20px;color:var(--lime)}
.squad-board{--pitch-height:calc(var(--pitch-rows)*140px + 80px);display:grid;grid-template-columns:minmax(165px,200px) minmax(0,1fr) minmax(185px,220px);grid-template-areas:"controls pitch bench" "selected selected selected";gap:22px;align-items:start;margin-bottom:24px}
.squad-controls{grid-area:controls;display:grid;gap:24px;min-width:0}.squad-formation{display:grid;gap:10px}.squad-formation label{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.06em}.squad-formation select{width:100%;min-width:0;min-height:48px}.squad-formation .button{width:100%;padding-inline:10px;font-size:13px}
.squad-board{direction:ltr}html[dir=rtl] .squad-controls,html[dir=rtl] .squad-bench,html[dir=rtl] .squad-rail{direction:rtl}
.squad-bench{grid-area:bench;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;min-width:0;min-height:0;height:var(--pitch-height);padding:16px 8px 8px 12px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(160deg,#261a38,#120d1e)}
.squad-bench:has(.squad-archive-note){grid-template-rows:auto minmax(0,1fr) auto}
.squad-section-label{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-inline-end:4px;min-width:0}.squad-section-label h2{font-size:19px;line-height:1.2;overflow-wrap:anywhere}.squad-section-label>span{display:grid;place-items:center;min-width:27px;height:27px;padding:3px;border:1px solid var(--line);border-radius:50%;font-size:12px;color:var(--muted)}
.squad-bench-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:13px 9px;min-height:0;min-width:0;overflow-y:scroll;overflow-x:hidden;padding:6px 7px 8px 4px;scrollbar-width:thin;scrollbar-color:var(--violet) #120d1e;scrollbar-gutter:stable;overscroll-behavior:contain;border-radius:5px}
.squad-bench-grid{grid-auto-rows:max-content}.squad-bench-grid:focus-visible{outline:2px solid var(--lime);outline-offset:2px}.squad-bench-grid .player-card{width:100%;max-width:100px;min-width:44px;margin:0 auto;height:auto;aspect-ratio:88/122}.squad-bench-grid .player-card .card-name{font-size:10px}.squad-archive-note{font-size:11px;color:var(--muted);line-height:1.5;overflow-wrap:anywhere;padding:0 4px 4px}.squad-archive-note .icon{width:15px;height:15px;vertical-align:middle}
.squad-pitch{grid-area:pitch;position:relative;isolation:isolate;min-width:0;height:var(--pitch-height);display:flex;flex-direction:column;align-items:center;justify-content:space-around;padding:36px 10px 32px;color:#e2efe6}
.squad-pitch-surface{position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;color:#dceee0;filter:drop-shadow(0 10px 0 #080d0bcc)}
.squad-field-lines{opacity:.64}.squad-pitch-title{position:absolute;top:17px;left:14%;font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#d2e7d8}
.squad-pitch-row{display:flex;justify-content:space-evenly;align-items:center;gap:8px;position:relative;min-width:0;width:var(--row-width)}
.squad-position{min-width:0;flex:1 1 0;max-width:99px;display:flex;flex-direction:column;align-items:center;position:relative;padding:3px;border-radius:5px}
.squad-position.is-active{box-shadow:0 0 0 2px var(--lime),0 0 19px #d7ff3f29}.squad-role{font:700 11px var(--display);color:#e2efe6;margin-bottom:5px}
.squad-position .player-card.mini{width:100%;min-width:44px;max-width:89px;height:auto;aspect-ratio:88/122;margin:0;box-shadow:0 5px 12px #0007}.squad-pitch-deep .squad-position{max-width:86px}.squad-pitch-deep .player-card.mini{max-width:80px}
.squad-out-position{font-size:10px;color:#ffe69b;line-height:1.2;white-space:nowrap;margin-top:5px}.squad-pitch-formation{position:absolute;bottom:13px;left:24px;color:#e2efe6;font:700 19px var(--display)}.squad-missing{display:grid;place-items:center;min-height:88px;color:#d2e7d8;border:1px dashed #c4ddc877;width:100%}
.squad-strength{display:grid;text-align:center;gap:11px;padding:24px 14px;border-radius:16px;background:linear-gradient(155deg,#45305f,var(--panel2));border-bottom:2px solid var(--violet)}.squad-strength>span{font:600 20px var(--display);color:var(--muted)}.squad-strength>strong{font:700 57px/1 var(--display);color:var(--lime)}.squad-strength>div{display:flex;justify-content:space-evenly;gap:10px;margin-top:9px}.squad-strength b{font:700 27px var(--display)}.squad-strength small{font:12px var(--font);display:block;margin-top:4px}
.squad-rail{grid-area:selected;min-width:0}
.squad-selected{display:grid;grid-template-columns:95px minmax(0,1fr) minmax(170px,250px);align-items:center;gap:22px;padding:20px 24px;background:var(--panel2);border:1px solid var(--line);border-radius:16px;min-width:0}.squad-selected-preview{min-width:0}.squad-selected-preview>.player-card{max-width:100%;width:88px;height:122px;margin:0}.squad-selected-copy{min-width:0;overflow-wrap:anywhere}.squad-selected-copy>.eyebrow{font-size:10px;color:var(--muted)}.squad-selected h2{font-size:27px;margin:7px 0}.squad-selected p,.squad-selected a{font-size:12px;line-height:1.6}.squad-selected a{display:inline-block;margin-top:7px}.squad-selected-actions{display:grid;gap:10px}.squad-selected-actions .button{width:100%;padding-inline:10px;font-size:13px}.squad-perks p{margin-top:16px}
dialog:has(.upgrade-picker),dialog:has(.upgrade-quote){width:min(900px,calc(100vw - 32px));max-width:900px;max-height:calc(100dvh - 32px);padding:26px;overflow-y:auto;overscroll-behavior:contain}.upgrade-picker,.upgrade-quote{min-width:0}.upgrade-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.upgrade-heading h2{font-size:28px;margin-top:5px;overflow-wrap:anywhere}.upgrade-heading .eyebrow{font-size:11px;color:var(--muted)}.upgrade-heading .upgrade-close{padding:10px;min-width:44px;min-height:44px;flex-shrink:0}.upgrade-close .icon{width:22px;height:22px}.upgrade-source{display:flex;align-items:center;gap:14px;border:1px solid var(--line);border-radius:12px;padding:13px;min-width:0}.upgrade-source .upgrade-static-card>.player-card{width:64px;height:89px}.upgrade-source>div:nth-child(2){display:grid;gap:5px;min-width:0}.upgrade-source strong{overflow-wrap:anywhere;font-size:14px}.upgrade-source span,.upgrade-source small{font-size:11px;color:var(--muted)}.upgrade-wallet{display:grid;grid-template-columns:auto auto;gap:3px 5px;align-items:center;margin-inline-start:auto;flex-shrink:0;color:var(--lime)}.upgrade-wallet .icon{width:21px;height:21px}.upgrade-wallet small{grid-column:1/-1;text-align:end}.upgrade-wallet strong{font-size:18px}.upgrade-help{font-size:13px;color:var(--muted);line-height:1.6;margin:16px 0}.upgrade-filters{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:12px;margin:20px 0}.upgrade-filters label{display:grid;gap:7px;min-width:0;font-size:12px;color:var(--muted)}.upgrade-filters input,.upgrade-filters select{width:100%;min-width:0;min-height:46px;font-size:14px}.upgrade-catalog{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.upgrade-option{display:flex;flex-direction:column;align-items:center;min-width:0;gap:9px;padding:15px 12px;border:1px solid var(--line);border-radius:12px;background:#160f24;text-align:center}.upgrade-option>.player-card{width:96px;height:133px;margin:0}.upgrade-option h3{font-size:18px;line-height:1.2;overflow-wrap:anywhere}.upgrade-option p{font-size:10px;line-height:1.45;color:var(--muted);overflow-wrap:anywhere}.upgrade-option-fee{margin-top:auto;padding-top:5px}.upgrade-option-fee>small{display:block;font-size:10px}.upgrade-option-fee>strong{display:flex;justify-content:center;align-items:center;gap:5px;font-size:17px;margin-top:4px;color:var(--lime)}.upgrade-option-fee .icon{width:19px;height:19px}.upgrade-option>.button{width:100%;font-size:12px;padding:9px 6px;min-height:44px}.upgrade-option.is-unavailable{border-color:#44364f}.upgrade-option.is-unavailable .upgrade-option-fee{opacity:.65}.upgrade-static-card>.player-card:disabled{opacity:1;cursor:default;transform:none;box-shadow:none}.upgrade-no-results{grid-column:1/-1;text-align:center;padding:28px 10px;color:var(--muted)}
.upgrade-comparison{display:grid;grid-template-columns:minmax(0,1fr) 35px minmax(0,1fr);gap:20px;align-items:center;padding:16px 0}.upgrade-comparison>.upgrade-static-card{display:flex;flex-direction:column;align-items:center;min-width:0;gap:12px;text-align:center}.upgrade-comparison .player-card{width:112px;height:155px;max-width:100%}.upgrade-comparison small{font-size:12px}.upgrade-comparison strong{font-size:16px;overflow-wrap:anywhere}.upgrade-direction{color:var(--lime);text-align:center}.upgrade-direction .icon{width:28px;height:28px}.upgrade-cost{margin:20px 0;padding:6px 18px;border:1px solid var(--line);border-radius:12px;background:#160f24}.upgrade-cost>div{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0}.upgrade-cost>div+div{border-top:1px solid var(--line)}.upgrade-cost dt{font-size:13px;color:var(--muted);line-height:1.5}.upgrade-cost dd{display:flex;align-items:center;gap:6px;margin:0;font-size:24px;font-weight:700;white-space:nowrap}.upgrade-cost .icon{width:23px;height:23px;color:var(--lime)}.upgrade-replace-notice,.upgrade-insufficient{font-size:12px;line-height:1.6;color:var(--muted);margin-top:15px}.upgrade-insufficient{color:#ffbccb}.upgrade-quote-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}.upgrade-quote-actions .button{flex:1;min-width:150px}

@media(max-width:1100px){
 .squad-board{grid-template-columns:minmax(0,1fr) 205px;grid-template-areas:"controls controls" "pitch bench" "selected selected";gap:20px}
 .squad-controls{grid-template-columns:minmax(180px,1fr) minmax(0,1fr);align-items:center}
 .squad-formation{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px}.squad-formation label{grid-column:1/-1}.squad-formation .button{grid-column:2;grid-row:2}
 .squad-strength{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px}.squad-strength>span{font-size:16px;max-width:90px;text-align:start}.squad-strength>strong{font-size:40px}.squad-strength>div{margin:0;gap:13px}.squad-strength b{font-size:24px}.squad-strength small{font-size:9px}
}
@media(max-width:800px){
 .squad-controls{grid-template-columns:minmax(0,1fr) 270px;gap:18px}.squad-board{grid-template-columns:minmax(0,1fr) 180px;gap:16px}.squad-bench{padding-inline:8px}.squad-bench-grid{gap:12px 6px}.squad-section-label h2{font-size:17px}.squad-strength{padding:15px 12px;gap:9px}.squad-strength>strong{font-size:35px}.squad-strength>span{font-size:14px}.squad-strength b{font-size:21px}
 .squad-selected{grid-template-columns:85px minmax(0,1fr) minmax(150px,190px);padding:18px;gap:16px}
}
@media(max-width:650px){
 .squad-topline{font-size:12px;margin-top:-5px}.squad-board{--pitch-height:calc(var(--pitch-rows)*120px + 60px);display:flex;flex-direction:column;gap:18px}
 .squad-controls{display:contents}.squad-formation{order:1;width:100%}.squad-formation label{font-size:11px}.squad-formation .button{font-size:12px;padding:10px 8px}
 .squad-pitch{order:2;width:100%;padding:34px 7px 31px}.squad-pitch-row{gap:5px;width:calc(var(--row-width)*.5 + 50%)}.squad-position{max-width:82px;padding:2px}.squad-position .player-card.mini{max-width:74px;min-width:44px}.squad-pitch-deep .squad-position{max-width:68px}.squad-pitch-deep .player-card.mini{max-width:64px}.squad-role{font-size:10px;margin-bottom:4px}.squad-out-position{font-size:8px;white-space:normal;text-align:center}
 .squad-bench{order:3;width:100%;height:auto;padding:15px 10px 8px;gap:8px}
 .squad-bench-grid{grid-template-columns:none;grid-template-rows:repeat(2,119px);grid-auto-flow:column;grid-auto-columns:86px;gap:12px;overflow-x:scroll;overflow-y:hidden;scrollbar-gutter:auto;padding:6px 5px 12px;scroll-padding-inline:5px}
 .squad-bench-grid .player-card{width:86px;max-width:86px}.squad-section-label h2{font-size:21px}
 .squad-strength{order:4;width:100%;padding:17px;gap:13px}.squad-strength>span{font-size:16px;max-width:100px}.squad-strength>strong{font-size:39px}.squad-strength b{font-size:24px}.squad-strength>div{gap:13px}
 .squad-rail{order:5;width:100%}.squad-selected{grid-template-columns:82px minmax(0,1fr);gap:12px}.squad-selected-preview>.player-card{width:78px;height:108px}.squad-selected-copy>h2{font-size:22px}.squad-selected-copy p,.squad-selected-copy a{font-size:11px}.squad-selected-actions{grid-column:1/-1;grid-template-columns:1fr 1fr}
 .squad-board .player-card .card-top b{font-size:23px}.squad-board .player-card .card-top small{font-size:8px}.squad-board .player-card .card-top{padding:5px}.squad-board .player-card .card-portrait{width:50px;height:62px;top:18px;right:0}.squad-board .player-card .card-portrait>.icon{width:46px;height:58px}.squad-board .player-card .card-portrait>strong{font-size:20px;top:23px}.squad-board .player-card .card-nation{font-size:8px;bottom:20px;left:5px;right:5px}.squad-board .player-card .card-nation .icon{width:9px;height:9px}.squad-board .player-card .card-name{font-size:9px;padding:4px 1px;line-height:1.15}.squad-perks .perk-stats{flex-wrap:wrap}.squad-perks p{font-size:12px}
 .upgrade-catalog{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.upgrade-option{padding:12px 8px}.upgrade-option h3{font-size:16px}.upgrade-option>.player-card{width:86px;height:119px}.upgrade-filters{grid-template-columns:1fr 1fr}.upgrade-search-label{grid-column:1/-1}
}
@media(max-width:420px){
 .squad-pitch-row{gap:3px}.squad-position{max-width:73px}.squad-position .player-card.mini{max-width:67px}.squad-pitch-deep .player-card.mini{max-width:64px}
 .squad-pitch .player-card .card-top b{font-size:20px}.squad-pitch .player-card .card-portrait{width:39px;height:51px;top:17px;right:0}.squad-pitch .player-card .card-portrait>.icon{width:37px;height:48px}.squad-pitch .player-card .card-portrait>strong{font-size:16px;top:20px}.squad-pitch .player-card .card-name{font-size:8px;min-height:17px}.squad-pitch .player-card .card-nation{bottom:18px;font-size:7px}
 .squad-strength{gap:8px;padding:14px}.squad-strength>span{font-size:14px;max-width:85px}.squad-strength>strong{font-size:34px}.squad-strength b{font-size:22px}.squad-strength>div{gap:10px}.squad-strength small{font-size:8px}.squad-selected{padding:14px}.squad-selected-actions .button{font-size:12px;gap:5px}.squad-selected-actions .icon{width:18px;height:18px}
 dialog:has(.upgrade-picker),dialog:has(.upgrade-quote){padding:18px 14px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.upgrade-heading h2{font-size:24px}.upgrade-heading{gap:8px}.upgrade-source{gap:10px;padding:10px}.upgrade-source .upgrade-static-card>.player-card{width:49px;height:68px}.upgrade-source .card-portrait{display:none}.upgrade-source .card-top b{font-size:20px}.upgrade-source .card-top small,.upgrade-source .card-name{font-size:7px}.upgrade-source .card-nation{display:none}.upgrade-wallet strong{font-size:16px}.upgrade-wallet .icon{width:17px;height:17px}.upgrade-source strong{font-size:12px}.upgrade-catalog{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.upgrade-option>.player-card{width:91px;height:126px}.upgrade-option h3{font-size:18px}.upgrade-comparison{gap:8px;grid-template-columns:minmax(0,1fr) 25px minmax(0,1fr)}.upgrade-comparison .player-card{width:97px;height:135px}.upgrade-comparison strong{font-size:14px}.upgrade-comparison small{font-size:10px}.upgrade-cost{padding-inline:12px}.upgrade-cost dd{font-size:21px}.upgrade-quote-actions{flex-direction:column;gap:10px}.upgrade-quote-actions .button{width:100%}.upgrade-help{font-size:12px}
}

/* Free squad substitutions use a separate, compact picker from card upgrades. */
dialog:has(.substitution-picker){width:min(500px,calc(100vw - 32px));max-width:500px;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);padding:24px;border:1px solid #68507e;border-radius:22px;background:#21182f;color:#faf8ff;overflow:auto;overscroll-behavior:contain;box-shadow:0 24px 80px #07040cbb}
dialog:has(.substitution-picker)::backdrop{background:#090612ba;backdrop-filter:blur(5px)}
dialog:has(.substitution-picker)>.dialog-close{position:absolute;inset:auto;inset-block-start:10px;inset-inline-end:10px;min-width:44px;width:44px;height:44px;min-height:44px;padding:12px;border:1px solid #68507e;border-radius:50%;background:#342441;color:#faf8ff;z-index:1}
.substitution-picker{width:100%;min-width:0;text-align:start;font-family:'DM Sans','Noto Sans Arabic','Noto Sans JP',sans-serif}
.substitution-picker *{box-sizing:border-box;min-width:0}
.substitution-picker .substitution-heading{padding-inline-end:42px;margin:0 0 18px}
.substitution-picker .substitution-heading .eyebrow{display:block;font-size:10px;color:#d9ff43;letter-spacing:.06em;margin-bottom:5px}
.substitution-picker .substitution-heading h2{font-family:'Rajdhani','Noto Sans Arabic','Noto Sans JP',sans-serif;font-size:30px;line-height:1.15;margin:0 0 9px;overflow-wrap:anywhere}
.substitution-picker .substitution-heading p{font-size:13px;line-height:1.6;color:#cbbcd8;margin:0;overflow-wrap:anywhere}
.substitution-picker .substitution-source{display:flex;align-items:center;gap:14px;padding:12px 14px;border:1px solid #59436d;border-radius:14px;background:linear-gradient(120deg,#33223f,#261c35);margin-bottom:14px}
.substitution-picker .substitution-source>.upgrade-static-card{flex:none;width:60px}
.substitution-picker .substitution-source .upgrade-static-card>.player-card{width:60px;height:83px;min-width:0;margin:0;opacity:1;cursor:default;transform:none}
.substitution-picker .substitution-source .card-top{padding:5px}.substitution-picker .substitution-source .card-top b{font-size:22px}.substitution-picker .substitution-source .card-top small{font-size:8px}
.substitution-picker .substitution-source .card-name{font-size:8px;padding:4px 1px;line-height:1.15}.substitution-picker .substitution-source .card-nation{display:none}
.substitution-picker .substitution-source>div:last-child{display:flex;flex-direction:column;gap:4px;flex:1}
.substitution-picker .substitution-source>div:last-child small{font-size:11px;color:#cbbcd8}.substitution-picker .substitution-source>div:last-child strong{font-size:17px;line-height:1.4;overflow-wrap:anywhere}.substitution-picker .substitution-source>div:last-child span{font-size:12px;color:#cbbcd8}
.substitution-picker .substitution-free{display:flex;align-items:flex-start;gap:9px;margin:0 0 20px;font-size:12px;line-height:1.6;color:#d5e8b3}
.substitution-picker .substitution-free>.icon{width:17px;height:17px;flex:none;margin-top:2px;color:#d9ff43}
.substitution-picker>h3{font-size:16px;line-height:1.4;margin:0 0 10px;color:#faf8ff}
.substitution-picker .substitution-options{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0;padding:0;overflow:visible;max-height:none}
.substitution-picker .substitution-choice{display:flex;align-items:center;gap:12px;width:100%;min-height:66px;padding:11px 12px;border:1px solid #614a76;border-radius:12px;background:#181121;color:#faf8ff;text-align:start;cursor:pointer;touch-action:manipulation;font:inherit;transition:border-color .15s,background .15s}
.substitution-picker .substitution-choice:hover:not(:disabled){border-color:#d9ff43;background:#30223e}
.substitution-picker .substitution-choice:disabled{opacity:.6;cursor:wait}
.substitution-picker .substitution-rating{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:0 0 44px;min-height:44px;padding:4px;border-radius:9px;background:#3b2a4b;color:#e5ffc1;font:700 24px/1 'Rajdhani',sans-serif}
.substitution-picker .substitution-rating small{font:700 10px/1.4 'DM Sans',sans-serif;color:#cbbcd8;margin-top:4px}
.substitution-picker .substitution-name{display:flex;flex-direction:column;gap:5px;flex:1}.substitution-picker .substitution-name strong{font-size:15px;font-weight:750;line-height:1.4;overflow-wrap:anywhere}.substitution-picker .substitution-name small{font-size:11px;line-height:1.5;color:#cce7b1;overflow-wrap:anywhere}
.substitution-picker .substitution-choice>.icon{width:19px;height:19px;flex:none;color:#d9ff43}
.substitution-picker .substitution-choice.is-out-position{border-color:#776044}.substitution-picker .substitution-choice.is-out-position .substitution-name small{color:#f0cd92}
.substitution-picker .substitution-error{margin:12px 0;padding:12px;border:1px solid #ec879f;border-radius:10px;color:#ffd9e2;background:#411d31;font-size:13px;line-height:1.5}
.substitution-picker .substitution-other{margin-top:18px;padding-top:4px;border-top:1px solid #57416b}
.substitution-picker .substitution-other>summary{min-height:48px;padding:13px 4px;cursor:pointer;color:#cbbcd8;font-size:13px;font-weight:700;line-height:1.5;touch-action:manipulation}
.substitution-picker .substitution-other[open]>.substitution-options{margin:0 0 4px}
.substitution-picker .substitution-footer{display:flex;align-items:center;justify-content:center;margin:20px 0 0;padding:16px 0 0;border-top:1px solid #57416b;font-size:13px}
.substitution-picker .substitution-footer>.button{width:100%;min-height:48px;padding:11px 14px;border-radius:11px;font-size:13px}
.substitution-picker :focus-visible{outline:3px solid #d9ff43;outline-offset:3px}
html[dir=rtl] .substitution-picker .substitution-choice>.icon{transform:scaleX(-1)}
@media(max-width:600px){
 dialog:has(.substitution-picker){width:calc(100vw - 20px);max-width:none;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:20px 16px;border-radius:18px}
 .substitution-picker .substitution-heading{padding-inline-end:42px;margin-bottom:16px}.substitution-picker .substitution-heading h2{font-size:27px}.substitution-picker .substitution-heading p{font-size:12px}
 .substitution-picker .substitution-source{gap:12px;padding:11px 12px}.substitution-picker .substitution-source>div:last-child strong{font-size:16px}
 .substitution-picker .substitution-free{font-size:12px;margin-bottom:17px}.substitution-picker .substitution-choice{gap:10px;padding:10px;min-height:66px}.substitution-picker .substitution-name strong{font-size:15px}
 .substitution-picker .substitution-footer{margin-top:18px;padding-top:14px}
}
@media(max-width:360px){.substitution-picker .substitution-heading h2{font-size:25px}.substitution-picker .substitution-source{padding:10px;gap:10px}.substitution-picker .substitution-choice{gap:9px;padding:10px 9px}.substitution-picker .substitution-choice>.icon{width:17px;height:17px}.substitution-picker .substitution-source>div:last-child strong{font-size:15px}}
@media(prefers-reduced-motion:reduce){.substitution-picker *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Shared card actions remain outside the workbench's single scrolling body. */
dialog:has(.card-workbench){width:min(820px,calc(100vw - 32px));max-width:820px;height:min(800px,calc(100vh - 32px));height:min(800px,calc(100dvh - 32px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);padding:0;border:1px solid #68507e;border-radius:22px;background:#21182f;color:#faf8ff;overflow:hidden;overscroll-behavior:contain;box-shadow:0 24px 80px #07040cbb}
dialog:has(.card-workbench)::backdrop{background:#090612ba;backdrop-filter:blur(5px)}
dialog:has(.card-workbench)>.dialog-close{position:absolute;inset:auto;inset-block-start:10px;inset-inline-end:10px;width:44px;height:44px;min-width:44px;min-height:44px;padding:12px;border:1px solid #68507e;border-radius:50%;background:#342441;color:#faf8ff;z-index:2}
.card-workbench{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;text-align:start;font-family:'DM Sans','Noto Sans Arabic','Noto Sans JP',sans-serif}
.card-workbench *{box-sizing:border-box;min-width:0}
.card-workbench-header{padding:20px 22px 16px;border-bottom:1px solid #684c7c;background:linear-gradient(125deg,#332141,#281c37);box-shadow:0 5px 12px #0a06172b;position:relative;z-index:1}
.card-workbench-identity{display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:14px;padding-inline-end:42px}
.card-workbench-identity>.upgrade-static-card{width:58px;display:flex;align-items:center;justify-content:center}
.card-workbench-identity .upgrade-static-card>.player-card{width:58px;height:80px;min-width:0;margin:0;transform:none;opacity:1;cursor:default;box-shadow:none}
.card-workbench-identity .card-top{padding:4px}.card-workbench-identity .card-top b{font-size:22px}.card-workbench-identity .card-top small{font-size:8px}.card-workbench-identity .card-name{font-size:8px;line-height:1.15;padding:4px 1px}.card-workbench-identity .card-nation{display:none}
.card-workbench-player{display:flex;flex-direction:column;gap:4px;min-width:0}
.card-workbench-player>.eyebrow{display:block;font-size:10px;line-height:1.3;letter-spacing:.04em;color:#cbbcd8;margin:0}
.card-workbench-player>h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-family:'Rajdhani','Noto Sans Arabic','Noto Sans JP',sans-serif;font-size:28px;line-height:1.1;margin:0;color:#faf8ff}
.card-workbench-player>p{font-size:12px;line-height:1.45;color:#cbbcd8;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-workbench-wallet{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:end;gap:3px 6px;color:#d9ff43;min-width:60px}
.card-workbench-wallet>.icon{width:21px;height:21px}.card-workbench-wallet>strong{font-size:20px;line-height:1.2;overflow-wrap:anywhere}.card-workbench-wallet>small{grid-column:1/-1;color:#cbbcd8;font-size:10px;line-height:1.3;text-align:end}
.card-workbench-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
.card-workbench .card-workbench-action{display:flex;align-items:center;justify-content:flex-start;gap:11px;min-height:62px;width:100%;padding:11px 14px;border:1px solid #856398;border-radius:12px;background:#1b1328;color:#eee3f8;text-align:start;cursor:pointer;touch-action:manipulation;white-space:normal;font:inherit;transition:background .15s,border-color .15s}
.card-workbench .card-workbench-action>.icon{width:25px;height:25px;flex:none;color:#d9ff43}
.card-workbench .card-workbench-action>span{display:flex;flex-direction:column;gap:4px;flex:1}
.card-workbench .card-workbench-action strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere}.card-workbench .card-workbench-action small{font-size:11px;font-weight:400;line-height:1.35;color:#cbbcd8;overflow-wrap:anywhere}
.card-workbench .card-workbench-action:hover:not(:disabled){border-color:#d9ff43;background:#44314f}
.card-workbench .card-workbench-action.is-active,.card-workbench .card-workbench-action[aria-pressed=true]{background:#d9ff43;border-color:#d9ff43;color:#211727;box-shadow:0 2px 0 #95ae32}
.card-workbench .card-workbench-action.is-active>.icon,.card-workbench .card-workbench-action[aria-pressed=true]>.icon{color:#211727}.card-workbench .card-workbench-action.is-active small,.card-workbench .card-workbench-action[aria-pressed=true] small{color:#393328}
.card-workbench .card-workbench-action:disabled{cursor:wait;opacity:.65}
.card-workbench-body{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#9870b2 #160f24;scroll-padding-block:18px;padding:20px 22px 24px;background:#21182f}
.card-workbench-body>.substitution-picker,.card-workbench-body>.upgrade-picker{min-width:0;max-height:none;height:auto;overflow:visible}
.card-workbench .substitution-heading{padding-inline-end:0;margin:0 0 12px}
.card-workbench .substitution-heading h3,.card-workbench .upgrade-heading h3{font-family:'Rajdhani','Noto Sans Arabic','Noto Sans JP',sans-serif;font-size:26px;line-height:1.2;margin:0 0 6px;color:#faf8ff;overflow-wrap:anywhere}
.card-workbench .substitution-heading p{font-size:13px;line-height:1.5}.card-workbench .substitution-free{margin-bottom:16px}
.card-workbench .substitution-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;overflow:visible;max-height:none}
.card-workbench .substitution-choice{gap:10px;padding:10px 11px;min-height:70px}.card-workbench .substitution-name strong{font-size:14px}.card-workbench .substitution-name small{font-size:11px}.card-workbench .substitution-choice>.icon{width:17px;height:17px}
.card-workbench .upgrade-heading{margin-bottom:0;gap:0}.card-workbench .upgrade-help{margin:8px 0 16px;font-size:13px;line-height:1.5}
.card-workbench .upgrade-filters{margin:16px 0;gap:12px}.card-workbench .upgrade-filters input,.card-workbench .upgrade-filters select{font-size:16px;min-height:48px}
.card-workbench .upgrade-catalog{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;overflow:visible;max-height:none}
.card-workbench .upgrade-option{padding:13px 9px}.card-workbench .upgrade-option h3{font-size:17px}
.card-workbench :focus-visible{outline:3px solid #d9ff43;outline-offset:3px}.card-workbench .card-workbench-action.is-active:focus-visible{outline-color:#faf8ff}
@media(max-width:700px){
 dialog:has(.card-workbench){width:calc(100vw - 20px);height:calc(100vh - 20px);height:calc(100dvh - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);border-radius:18px}
 .card-workbench-header{padding:15px 16px 14px}.card-workbench-identity{grid-template-columns:48px minmax(0,1fr) auto;gap:11px;padding-inline-end:38px}.card-workbench-identity>.upgrade-static-card{width:48px}.card-workbench-identity .upgrade-static-card>.player-card{width:48px;height:66px}.card-workbench-player>h2{font-size:24px}.card-workbench-player>p{font-size:11px}.card-workbench-wallet>strong{font-size:18px}.card-workbench-wallet>.icon{width:18px;height:18px}
 .card-workbench-actions{gap:9px;margin-top:12px}.card-workbench .card-workbench-action{min-height:60px;padding:10px 11px;gap:8px}.card-workbench .card-workbench-action>.icon{width:22px;height:22px}.card-workbench .card-workbench-action strong{font-size:14px}.card-workbench .card-workbench-action small{font-size:10px}
 .card-workbench-body{padding:16px 16px 22px}.card-workbench .substitution-heading h3,.card-workbench .upgrade-heading h3{font-size:24px}.card-workbench .substitution-options{grid-template-columns:minmax(0,1fr)}
 .card-workbench .upgrade-catalog{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.card-workbench .upgrade-filters{grid-template-columns:1fr 1fr;gap:10px}.card-workbench .upgrade-search-label{grid-column:1/-1}
}
@media(max-width:440px){
 .card-workbench-header{padding:14px 14px 12px}.card-workbench-identity{grid-template-columns:44px minmax(0,1fr);gap:4px 10px;padding-inline-end:40px;align-items:start}.card-workbench-identity>.upgrade-static-card{grid-column:1;grid-row:1/span 2;width:44px;align-self:center}.card-workbench-identity .upgrade-static-card>.player-card{width:44px;height:61px}.card-workbench-identity .card-portrait{display:none}.card-workbench-identity .card-top b{font-size:20px}.card-workbench-identity .card-name{font-size:7px}
 .card-workbench-player{grid-column:2;grid-row:1;gap:3px}.card-workbench-player>.eyebrow{font-size:9px}.card-workbench-player>h2{font-size:21px;line-height:1.1}.card-workbench-player>p{font-size:10px;line-height:1.4}
 .card-workbench-wallet{grid-column:2;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:5px;min-width:0}.card-workbench-wallet>.icon{width:16px;height:16px}.card-workbench-wallet>strong{font-size:16px}.card-workbench-wallet>small{font-size:10px;text-align:start}
 .card-workbench-actions{gap:8px;margin-top:11px}.card-workbench .card-workbench-action{padding:9px;gap:7px;min-height:60px}.card-workbench .card-workbench-action>.icon{width:20px;height:20px}.card-workbench .card-workbench-action strong{font-size:13px}.card-workbench .card-workbench-action small{font-size:10px}
 .card-workbench-body{padding:15px 12px 20px;scroll-padding-block:14px}.card-workbench .substitution-heading h3,.card-workbench .upgrade-heading h3{font-size:23px}.card-workbench .substitution-heading p,.card-workbench .upgrade-help{font-size:12px}
 .card-workbench .upgrade-catalog{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.card-workbench .upgrade-option{padding:12px 7px}.card-workbench .upgrade-option>.player-card{width:88px;height:122px}.card-workbench .upgrade-option h3{font-size:16px}.card-workbench .upgrade-filters{gap:9px}.card-workbench .upgrade-filters label{font-size:11px}
}
@media(max-height:500px){
 dialog:has(.card-workbench){height:calc(100vh - 12px);height:calc(100dvh - 12px);max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px)}
 .card-workbench-header{padding-block:10px}.card-workbench-identity{gap:4px 10px}.card-workbench-identity>.upgrade-static-card{width:40px}.card-workbench-identity .upgrade-static-card>.player-card{width:40px;height:55px}.card-workbench-player>h2{font-size:20px}.card-workbench-player>p{font-size:10px}.card-workbench-player>.eyebrow{font-size:9px}.card-workbench-actions{margin-top:9px}
 .card-workbench .card-workbench-action{min-height:54px;padding-block:8px}.card-workbench .card-workbench-action strong{font-size:13px}.card-workbench .card-workbench-action small{font-size:10px}.card-workbench-body{padding-block:14px}
}
@media(prefers-reduced-motion:reduce){.card-workbench *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
