/* Editor de "Mi once": campo de juego, fichas, selector de jugador, mini once y estado de envío. */
/* Pitch */
.editor{display:grid;gap:14px}
.pitch{position:relative;border-radius:20px;overflow:hidden;padding:52px 6px 14px;display:flex;flex-direction:column;justify-content:space-around;gap:6px;min-height:560px;
  background:repeating-linear-gradient(180deg,var(--field-a) 0 56px,var(--field-b) 56px 112px);color:#F4FAF6}
.pitch svg.lines{position:absolute;inset:0;width:100%;height:100%;opacity:.4;pointer-events:none}
.line{position:relative;display:flex;justify-content:space-around;align-items:flex-start;gap:4px}
.slot{width:clamp(66px,22vw,96px);display:flex;flex-direction:column;align-items:center;gap:2px;background:none;border:0;padding:2px;color:inherit;border-radius:12px;position:relative}
.slot .shirt{width:46px;height:46px;filter:drop-shadow(0 3px 3px rgba(0,0,0,.35));transition:transform .15s}
.slot:hover .shirt:not([disabled]){transform:translateY(-3px)}
.slot .nm{font-weight:700;font-size:12px;line-height:1.1;text-align:center;background:rgba(5,22,14,.6);padding:2px 5px;border-radius:6px;max-width:112%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.slot .pr{font-family:var(--f-mono);font-size:11.5px;opacity:.95}
.slot .badge{position:absolute;top:-2px;right:6px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--gold);color:#241800}
.slot .badge svg{width:12px;height:12px;fill:currentColor;stroke:none}
.slot .badge.line1{background:#EAF4EE;color:#14583A}
.slot.changed .shirt{filter:drop-shadow(0 0 0 transparent) drop-shadow(0 0 7px var(--accent))}
.slot .new{position:absolute;left:2px;top:0;background:var(--accent);color:var(--accent-ink);font-size:9.5px;font-weight:800;border-radius:6px;padding:1px 5px;letter-spacing:.06em}
.slot[disabled]{cursor:default}
.formation{position:absolute;left:12px;top:10px;z-index:2;background:rgba(5,22,14,.6);padding:4px 10px;border-radius:8px;font-family:var(--f-display);font-weight:800;font-size:20px;letter-spacing:.06em}

.check{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line)}
.check:last-child{border-bottom:0}
.check .dot{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--good-bg);color:var(--good)}
.check.bad .dot{background:var(--bad-bg);color:var(--bad)}
.check .dot svg{width:14px;height:14px;stroke-width:3}
.check .t{flex:1;min-width:0}
.check .v{font-family:var(--f-mono);font-weight:600}
.bar{height:10px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.bar i{display:block;height:100%;background:var(--good);border-radius:999px}
.bar.over i{background:var(--bad)}
.swap{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.swap:last-child{border-bottom:0}
.swap .o{color:var(--bad);font-weight:700}
.swap .n{color:var(--good);font-weight:700;text-align:right}
.actionbar{position:fixed;left:0;right:0;bottom:calc(66px + env(safe-area-inset-bottom,0px));z-index:45;padding:8px max(16px,env(safe-area-inset-left,0px));display:flex;gap:10px;justify-content:center;pointer-events:none}
.actionbar>*{pointer-events:auto;box-shadow:var(--shadow)}
.wa{background:#0F2A1F;color:#E9F8EF;border-radius:14px;padding:14px;font-family:var(--f-mono);font-size:13px;white-space:pre-wrap;word-break:break-word}

/* Sheet */
.scrim{position:fixed;inset:0;background:rgba(3,10,7,.55);z-index:80}
.sheet{position:fixed;z-index:81;background:var(--surface);color:var(--ink);display:flex;flex-direction:column;box-shadow:0 -10px 40px rgba(0,0,0,.35);
  left:0;right:0;bottom:0;height:min(88vh,760px);border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}
.sheet header{padding:14px 16px 10px;border-bottom:1px solid var(--line)}
.sheet .list{overflow-y:auto;flex:1;padding:6px 8px 14px}
.cand{display:grid;grid-template-columns:36px 1fr auto;gap:10px;align-items:center;width:100%;text-align:left;background:none;border:0;border-radius:12px;padding:8px;min-height:56px}
.cand:hover:not([disabled]){background:var(--surface-2)}
.cand[disabled]{opacity:.5;cursor:not-allowed}
.cand .why{font-size:12px;color:var(--bad);margin-top:1px}
.cand .why.ok{color:var(--good)}
.cand .why.opp{color:var(--warn)}
.modal{position:fixed;z-index:82;left:50%;top:50%;transform:translate(-50%,-50%);width:min(480px,calc(100vw - 32px));background:var(--surface);border-radius:20px;padding:20px;box-shadow:0 20px 60px rgba(0,0,0,.5);max-height:86vh;overflow:auto}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(140px + env(safe-area-inset-bottom,0px));z-index:90;background:var(--ink);color:var(--bg);padding:11px 16px;border-radius:12px;font-weight:600;box-shadow:var(--shadow);max-width:calc(100vw - 32px)}

.slot.bad .shirt{filter:drop-shadow(0 0 6px #FF3B3B)}
.slot.bad .nm{background:#B3202A;color:#fff}
.slot .warn{position:absolute;top:-4px;right:4px;width:22px;height:22px;border-radius:50%;background:#E0262B;color:#fff;display:grid;place-items:center;box-shadow:0 0 0 2px #fff}
.slot .warn svg{width:14px;height:14px;stroke-width:2.6}
.formsel{position:absolute;left:12px;top:10px;z-index:3;display:flex;align-items:center;gap:8px;background:rgba(5,22,14,.7);padding:4px 6px 4px 10px;border-radius:10px;color:#F4FAF6}
.formsel label{font-size:11px;letter-spacing:.1em;text-transform:uppercase;opacity:.8}
.formsel select{background:transparent;color:#F4FAF6;border:1px solid rgba(244,250,246,.4);font-family:var(--f-display);font-weight:800;font-size:20px;letter-spacing:.05em;min-height:36px;padding:2px 8px}
.formsel select option{color:#111}
.mp{display:block;width:100%;text-align:left;margin-top:12px;padding:10px;border-radius:14px;border:1px solid var(--line);background:var(--surface-2)}
.mp:hover{border-color:var(--pitch)}
.mp-h{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.mp-h b{flex:1;font-size:14px}
.mp-chev{display:grid;place-items:center;transition:transform .2s}
.mp.open .mp-chev{transform:rotate(180deg)}
.mp-pitch{display:flex;flex-direction:column;gap:4px;border-radius:10px;padding:6px 4px;background:repeating-linear-gradient(180deg,var(--field-a) 0 18px,var(--field-b) 18px 36px);color:#F4FAF6}
.mp-line{display:flex;justify-content:space-around;align-items:flex-start}
.mp.open .mp-pitch{gap:10px;padding:12px 4px}
.mp-p{display:flex;flex-direction:column;align-items:center;gap:1px;min-width:0;width:72px}
.mp:not(.open) .mp-p{width:34px}
.mp-p .shirt{filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}
.mp-n{font-size:11px;font-weight:700;background:rgba(5,22,14,.6);padding:1px 5px;border-radius:5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mp-m{font-family:var(--f-mono);font-size:10.5px}
.mp-p.bad .shirt{filter:drop-shadow(0 0 5px #FF3B3B)}
.mp-p.bad .mp-n{background:#B3202A}
.estado{display:flex;align-items:center;gap:10px;margin-top:10px;padding:12px 14px;border-radius:12px;font-weight:700}
.estado .dot{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;flex:none;background:rgba(255,255,255,.28)}
.estado .dot svg{width:16px;height:16px;stroke-width:3}
.estado .t{flex:1}
.estado .v{font-family:var(--f-mono);text-transform:uppercase;letter-spacing:.04em}
.estado.ok{background:#1F8A55;color:#fff}
.estado.pend{background:#F07A1A;color:#1A0E00}
.mp{cursor:default}.mp:hover{border-color:var(--line)}

@media (min-width:900px){
  .slot .nm{max-width:100%}
  .actionbar{bottom:0;left:0;padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
  .toast{bottom:28px}
  .editor{grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);align-items:start}
  .pitch{min-height:700px}
  .slot{width:96px}
  .slot .shirt{width:52px;height:52px}
  .sheet{left:auto;top:0;right:0;bottom:0;width:440px;height:auto;border-radius:20px 0 0 20px}
}
