/* Update 8.23: the player editor as the user drew it (ui.mjs playerEditor). Loaded last: only overrides. */
.player-editor.pe823{display:grid;grid-template-columns:minmax(0,40fr) minmax(0,60fr);gap:clamp(14px,1.6vw,26px);align-items:stretch;height:calc(100vh - 318px);min-height:470px}
/* ---- the stage ---- */
.pe823 .pe-stage{position:relative;display:flex;flex-direction:column;min-height:0;border-radius:18px;overflow:hidden;border:1px solid #ffffff1a;box-shadow:0 18px 40px #0007}
.pe823 .pe-stage #playerPreview{flex:1;min-height:0;height:100%;border-radius:0!important;margin:0}
.pe823 .pe-stage #playerPreview canvas{width:100%!important;height:100%!important}
.pe823 .pe-view{position:absolute;left:0;right:0;bottom:14px;display:flex;justify-content:center;gap:10px;z-index:4;pointer-events:none}
.pe823 .pe-view>*{pointer-events:auto}
.alpha-panel .pe823 button.pe-vb{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border-radius:999px;border:1px solid #ffffff2a;background:#05141299;backdrop-filter:blur(6px);color:#eef5e4;font:900 11.5px/1 var(--fam);letter-spacing:.14em;box-shadow:0 6px 16px #0006}
.alpha-panel .pe823 button.pe-vb svg{width:20px;height:20px}
.alpha-panel .pe823 button.pe-vb:is(:hover,:focus-visible){border-color:#d4f26a99;background:#0b2622dd}
.pe823 .pe-rot{display:inline-flex;align-items:center;gap:4px;min-height:44px;padding:0 6px;border-radius:999px;border:1px solid #ffffff2a;background:#05141299;backdrop-filter:blur(6px);font:900 11.5px/1 var(--fam);letter-spacing:.14em;color:#eef5e4;box-shadow:0 6px 16px #0006}
.alpha-panel .pe823 .pe-rot button.pe-arrow{min-height:36px;padding:0 12px;border:0;background:none;box-shadow:none;backdrop-filter:none;font-size:20px;letter-spacing:0}
.alpha-panel .pe823 .pe-rot button.pe-arrow:is(:hover,:focus-visible){color:var(--lime);background:none}
/* ---- the panel ---- */
.pe823 .pe-panel{display:flex;flex-direction:column;gap:14px;min-height:0;min-width:0}
.pe823 .e-name{display:block;font-weight:800;font-size:13.5px;color:#e6efdf}
.pe823 .e-name input{display:block;width:100%;margin-top:8px;min-height:46px;padding:0 16px;border-radius:12px;border:1px solid #ffffff1c;background:#061a18;color:#fff;font-size:15px;box-sizing:border-box}
.pe823 .pe-cats{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));border:1px solid #ffffff1a;border-radius:14px;background:#04131180;overflow:hidden}
.alpha-panel .pe823 button.pe-cat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:78px;padding:10px 4px 9px;border:0;border-right:1px solid #ffffff12;border-radius:0;background:none;color:#e9f0e3;font:900 clamp(8.5px,.62vw,11px)/1.05 var(--fam);letter-spacing:.08em;text-align:center}
.alpha-panel .pe823 button.pe-cat:last-child{border-right:0}
.pe823 .pe-cat svg{width:clamp(24px,2.1vw,34px);height:clamp(24px,2.1vw,34px);color:#f3f6ee}
.alpha-panel .pe823 button.pe-cat:is(:hover,:focus-visible){background:#ffffff0c}
.alpha-panel .pe823 button.pe-cat.on{background:linear-gradient(180deg,#d4f26a2e,#d4f26a10);box-shadow:inset 0 0 0 2px var(--lime);border-radius:12px;color:#fff}
.pe823 .pe-cat.on svg{color:var(--lime);filter:drop-shadow(0 0 6px #d4f26a88)}
.pe823 .pe-cats:has(.pe-cat:nth-child(10)){grid-template-columns:repeat(10,minmax(0,1fr))}
.pe823 .pe-body{flex:1;min-height:0;overflow:hidden;padding:2px 0 0 2px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:var(--lime) #0d2f2a}
.pe823 .pe-subs{display:flex;flex-wrap:wrap;gap:8px}
.alpha-panel .pe823 button.pe-sub{min-height:34px;padding:0 14px;border-radius:999px;border:1px solid #ffffff22;background:#ffffff08;color:#dce6d6;font:900 10.5px/1 var(--fam);letter-spacing:.1em;text-transform:uppercase}
.alpha-panel .pe823 button.pe-sub.on{background:var(--lime);color:#14301f;border-color:transparent}
/* the pictures */
.pe823 .pe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(clamp(110px,8.4vw,150px),1fr));gap:12px}
.pe823 .pe-grid.off{opacity:.45;pointer-events:none}
.alpha-panel .pe823 button.pk{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:0;padding:0;border-radius:12px;border:1px solid #ffffff1c;background:linear-gradient(180deg,#183230,#0d201e);overflow:hidden;transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease}
.pe823 .pk-img{display:block;aspect-ratio:1/.82;background:radial-gradient(ellipse at 50% 40%,#2c4a45,#0f2321 75%)}
.pe823 .pk-img img{display:block;width:100%;height:100%;object-fit:cover}
.pe823 .pk-feet .pk-img img,.pe823 .pk-legs .pk-img img,.pe823 .pk-full .pk-img img{object-fit:contain}
.pe823 .pk-name{display:block;padding:7px 8px 8px;font:800 11.5px/1.15 var(--fam);color:#dfe8da;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#00000040}
.alpha-panel .pe823 button.pk:is(:hover,:focus-visible){transform:translateY(-2px);border-color:#ffffff66}
.alpha-panel .pe823 button.pk.on{border:2px solid var(--lime);box-shadow:0 0 0 3px #d4f26a33,0 10px 22px #0007}
.pe823 .pk.on .pk-name{color:#fff}
.pe823 .pk-check{position:absolute;top:8px;right:8px;width:24px;height:24px;border-radius:50%;background:var(--lime);box-shadow:0 2px 6px #0008}
.pe823 .pk-check::after{content:"";position:absolute;left:8px;top:4px;width:6px;height:11px;border:solid #14301f;border-width:0 3px 3px 0;transform:rotate(45deg)}
.alpha-panel .pe823 button.pk:disabled{opacity:.5}
/* the colours */
.pe823 .pe-colrow{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.pe823 .pe-colors{min-width:0;padding:12px 14px 6px;border-radius:14px;border:1px solid #ffffff1a;background:#04131180}
.pe823 .pe-colors h5{margin:0 0 8px;font:900 10.5px/1 var(--fam);letter-spacing:.16em;color:#cfd9ca}
.pe823 .pe-sw{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;overflow-y:hidden;padding:4px 4px 8px;scrollbar-width:thin;scrollbar-color:var(--lime) #0d2f2a}
.alpha-panel .pe823 .pe-sw button.sw{flex:none;width:30px;height:30px;min-height:0;padding:0;border-radius:50%;border:2px solid #ffffff33;background:var(--c);box-shadow:inset 0 -3px 6px #0003}
.alpha-panel .pe823 .pe-sw button.sw.on{border-color:var(--lime);box-shadow:0 0 0 3px #d4f26a55,0 0 10px #d4f26a88}
.pe823 .pe-rackets h5{margin:4px 0 10px;font:900 10.5px/1 var(--fam);letter-spacing:.16em;color:#cfd9ca}
.pe823 .pe-rk{display:grid;grid-template-columns:repeat(auto-fill,minmax(clamp(110px,8.4vw,150px),1fr));gap:12px}
.pe823 .pe-rk .pk-img img{object-fit:contain;padding:6px;box-sizing:border-box}
/* the foot: the two big buttons on the right */
.pe823 .pe-scroll{flex:1;min-height:0;overflow:auto;padding:2px 6px 4px 0;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:var(--lime) #0d2f2a}
.pe823 .pe-colrow{flex:none}
.pe823 .pe-foot{position:static;padding:0;border:0;background:none;backdrop-filter:none;border-radius:0;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.pe823 .pe-actions{display:flex;gap:12px;margin-left:auto}
.alpha-panel .pe823 .pe-actions button{min-height:56px;padding:0 30px;border-radius:14px;font:900 15px/1 var(--fam);letter-spacing:.08em}
.alpha-panel .pe823 .pe-actions button.quiet{background:#ffffff0a;border:1px solid #ffffff2a;color:#eef5e4}
.pe823 .e-note{margin:0;padding:8px 12px;border-radius:10px;background:#ffb34714;border:1px solid #ffb34740;color:#ffd9a6;font-size:12.5px}
@media(max-width:1100px){.player-editor.pe823{grid-template-columns:1fr;height:auto}.pe823 .pe-stage{height:56vh}.pe823 .pe-cats{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* the profile's heading made compact while the editor is open, as in the picture: more room for the choices */
.alpha-panel .tab-body:has(.pe823){margin-top:0}
.alpha-panel .menu:has(.pe823) .scr-head{min-height:0;margin-bottom:6px;padding-top:0}
.alpha-panel .menu:has(.pe823) .scr-head h2{font-size:clamp(24px,2.2vw,34px);margin:2px 0 0}
.alpha-panel .menu:has(.pe823) nav.tabs{margin:4px 0 14px}
.alpha-panel .menu:has(.pe823) nav.tabs .tab{min-height:34px;padding:0 16px;font-size:10.5px}
.alpha-panel .menu:has(.pe823) .player-editor.pe823{height:calc(100vh - 282px);min-height:430px}
/* narrow windows: the four buttons under the model stay on one line */
@media(max-width:1400px){.alpha-panel .pe823 button.pe-vb{padding:0 12px;gap:6px;font-size:10px;letter-spacing:.1em;white-space:nowrap}.pe823 .pe-rot{font-size:10px;letter-spacing:.1em}.alpha-panel .pe823 .pe-rot button.pe-arrow{padding:0 8px}.alpha-panel .pe823 button.pe-vb svg{width:17px;height:17px}.pe823 .pe-view{gap:6px}}
@media(max-width:1300px){.pe823 .pe-vb span{display:none}.alpha-panel .pe823 button.pe-vb{padding:0 14px}}

/* low windows (720-820 px): everything a little tighter so the pictures keep their room */
@media(max-height:820px){.pe823 .pe-panel{gap:8px}.pe823 .e-name{font-size:12px}.pe823 .e-name input{min-height:36px;margin-top:5px;font-size:14px}.alpha-panel .pe823 button.pe-cat{min-height:56px;gap:5px;padding:7px 2px 6px}.pe823 .pe-cat svg{width:22px;height:22px}.alpha-panel .pe823 button.pe-sub{min-height:28px}.pe823 .pe-body{gap:8px}.pe823 .pe-colors{padding:8px 12px 4px}.pe823 .pe-colors h5{margin-bottom:5px}.alpha-panel .pe823 .pe-sw button.sw{width:24px;height:24px}.alpha-panel .pe823 .pe-actions button{min-height:44px;padding:0 22px;font-size:13px}.pe823 .pe-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}.pe823 .pk-name{padding:5px 6px 6px;font-size:10.5px}.alpha-panel .menu:has(.pe823) .player-editor.pe823{height:calc(100vh - 262px);min-height:400px}}

/* the career's creator (no profile tabs above it): the editor takes the room left under its heading */
.alpha-panel .menu:has(.pe823):not(:has(nav.tabs)) .player-editor.pe823{height:calc(100vh - 215px);min-height:430px}
.pe823 .pe-panel>.hint{margin:0;font-size:12px}

/* ---- Update 8.24 ---- */
.pe823 .pe-namerow{display:flex;align-items:flex-end;gap:12px}.pe823 .pe-namerow .e-name{flex:1;min-width:0}
.alpha-panel .pe823 button.pe-random{display:inline-flex;align-items:center;gap:9px;min-height:46px;padding:0 20px;border-radius:12px;border:1px solid #d4f26a80;background:#d4f26a1a;color:#e9f6c7;font:900 12px/1 var(--fam);letter-spacing:.14em;white-space:nowrap}
.alpha-panel .pe823 button.pe-random svg{width:20px;height:20px;color:var(--lime)}
.alpha-panel .pe823 button.pe-random:is(:hover,:focus-visible){background:var(--lime);color:#14301f}.alpha-panel .pe823 button.pe-random:is(:hover,:focus-visible) svg{color:#14301f}
@media(max-height:820px){.alpha-panel .pe823 button.pe-random{min-height:36px;padding:0 14px}}
/* TEST > Colori dei vestiti */
.wp-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,300px);gap:18px;align-items:start}
/* (8.68) the wardrobe as the player editor's (its sections, its pictures); the colours of the chosen garment on the right, its picture above them */
body[data-screen=DEV] .alpha-panel .menu:has(.wp-ward){max-width:calc(100vw - 48px)}
.wp-ward .pe-scroll{flex:none;overflow:visible;padding:0;display:block}
.wp-big{width:min(100%,230px);margin:2px auto 16px}.wp-big .pk-img{border-radius:12px;overflow:hidden;border:1px solid #ffffff1c}
.wp-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:6px}
.alpha-panel button.wp-item{display:flex;align-items:center;gap:10px;min-height:34px;padding:4px 10px;border-radius:10px;border:1px solid #ffffff18;background:#ffffff06;color:#dfe8da;font-size:12px;font-weight:700;text-align:left}
.alpha-panel button.wp-item.on{border-color:var(--lime);background:#d4f26a1c;color:#fff}
.wp-item i{flex:none;width:26px;height:18px;border-radius:5px;background:linear-gradient(135deg,var(--a) 55%,var(--b) 55%);border:1px solid #ffffff40}
.wp-edit{position:sticky;top:0}.wp-field{margin-bottom:14px}.wp-field small{display:block;margin-bottom:8px;font-weight:800;color:#cfd9ca}
.wp-sw{display:flex;flex-wrap:wrap;gap:7px}.alpha-panel .wp-sw button.sw{width:28px;height:28px;min-height:0;padding:0;border-radius:50%;border:2px solid #ffffff33;background:var(--c)}
.alpha-panel .wp-sw button.sw.on{border-color:var(--lime);box-shadow:0 0 0 3px #d4f26a55}