* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #07130f; --bg2: #0d2a1f; --panel: rgba(16, 38, 30, .72); --line: rgba(255,255,255,.09);
  --ink: #f4faf6; --mut: #93b3a5; --acc: #c8ff3d; --acc2: #19e68c; --gold: #ffc93c; --legend: #b78cff;
  --me: #39b7ff; --opp: #ff4f6d; --ok: #2fe08a; --bad: #ff4f6d;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif; --body: 'Rubik', system-ui, -apple-system, sans-serif;
}
html { background: var(--bg); min-height: 100%; }
body { font-family: var(--body); color: var(--ink); min-height: 100vh; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button { font-family: inherit; }
.bg { position: fixed; inset: 0; z-index: -1; background: radial-gradient(120% 70% at 50% -10%, #1d5a3f 0%, var(--bg2) 40%, var(--bg) 75%); }
.bg .lights { position: absolute; inset: 0; background: radial-gradient(40% 30% at 10% 0%, rgba(200,255,61,.13), transparent 70%), radial-gradient(40% 30% at 90% 0%, rgba(57,183,255,.12), transparent 70%); animation: flicker 6s ease-in-out infinite alternate; }
.bg .lines { position: absolute; inset: 0; opacity: .06; background: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 80px), repeating-linear-gradient(0deg, transparent 0 79px, #fff 79px 80px); mask-image: linear-gradient(transparent, #000 40%, transparent); }
@keyframes flicker { to { opacity: .6; } }
#app { max-width: 1120px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 14px 28px; }
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; gap: 14px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.display { font-family: var(--display); font-weight: 400; letter-spacing: 1.5px; font-size: 2.2rem; line-height: 1; }
.center { text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.sound { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 40; background: rgba(0,0,0,.35); border: 1px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem; }

/* ---------- Home ---------- */
#scr-home, #scr-wait { max-width: 440px; margin: 0 auto; padding-top: 4vh; text-align: center; }
.hero { position: relative; padding-top: 10px; }
.ball-anim { font-size: 3.2rem; animation: bounce 1.6s cubic-bezier(.3,0,.4,1) infinite; filter: drop-shadow(0 12px 10px rgba(0,0,0,.4)); }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-22px) rotate(180deg); } }
.title { font-family: 'Kanit', var(--display); font-style: italic; font-weight: 900; line-height: .9; display: flex; flex-direction: column; transform: skewX(-4deg); }
.title span:first-child { font-size: 1.7rem; font-weight: 800; letter-spacing: 9px; color: var(--mut); }
.title .big { font-size: 4.4rem; letter-spacing: 0; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.55)); background: linear-gradient(180deg, #fff 30%, #b9e8cf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title em { font-style: normal; background: linear-gradient(180deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(200,255,61,.45)); }
.tagline { margin-top: 8px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; font-size: .85rem; color: var(--acc); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps div { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--mut); }
.steps b { font-size: 1.4rem; }
.home-card { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--mut); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
input { font: inherit; font-size: 1rem; padding: 13px 14px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.12); background: rgba(0,0,0,.3); color: var(--ink); outline: none; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(200,255,61,.12); }
.or { display: flex; align-items: center; gap: 10px; color: var(--mut); font-size: .8rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.row2 { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.join { display: flex; gap: 8px; }
.join input { text-transform: uppercase; text-align: center; letter-spacing: 5px; font-weight: 700; min-width: 0; }
.foot { color: var(--mut); font-size: .8rem; letter-spacing: 1px; }
.hint { color: var(--mut); line-height: 1.45; }
.error { color: var(--bad); min-height: 1.1em; font-size: .9rem; }

/* ---------- Botones ---------- */
.btn { font-weight: 700; font-size: 1rem; padding: 14px 16px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; transition: transform .1s, background .2s, box-shadow .2s, opacity .2s; }
.btn:hover { background: rgba(255,255,255,.1); }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, var(--acc), #9fe31f); color: #0b1a05; border: 0; font-family: var(--display); font-size: 1.45rem; letter-spacing: 1.5px; font-weight: 400; }
.btn.primary.glow { box-shadow: 0 10px 30px rgba(200,255,61,.3), inset 0 -3px 0 rgba(0,0,0,.18); animation: pulse 2.2s ease-in-out infinite; }
.btn.big { font-size: 1.7rem; padding: 16px 22px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 10px 42px rgba(200,255,61,.5), inset 0 -3px 0 rgba(0,0,0,.18); } }

/* ---------- Espera ---------- */
.radar { position: relative; width: 140px; height: 140px; margin: 20px auto 10px; display: grid; place-items: center; }
.radar span { position: absolute; inset: 0; border: 2px solid var(--acc); border-radius: 50%; opacity: 0; animation: ping 2.4s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: .8s; } .radar span:nth-child(3) { animation-delay: 1.6s; }
.radar b { font-size: 2.6rem; animation: bounce 1.6s infinite; }
@keyframes ping { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.2); opacity: 0; } }
.bigcode { font-family: var(--display); font-size: 4.2rem; letter-spacing: 16px; color: var(--acc); text-shadow: 0 0 24px rgba(200,255,61,.5); }

/* ---------- Topbar ---------- */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: rgba(4,12,9,.7); border: 1px solid var(--line); padding: 10px 12px; border-radius: 18px; position: sticky; top: 6px; z-index: 6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin-right: 44px; }
.topbar .pl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .pl > div { display: flex; flex-direction: column; min-width: 0; }
.topbar .opp { justify-content: flex-end; text-align: right; }
.topbar .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar small { color: var(--mut); font-size: .78rem; }
.av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 1.2rem; color: #06120d; }
.me .av { background: var(--me); } .opp .av { background: var(--opp); }
.topbar .me .nm { color: var(--me); } .topbar .opp .nm { color: var(--opp); }
.mid { text-align: center; min-width: 96px; }
.round { font-family: var(--display); font-size: 1.25rem; letter-spacing: 1px; }
.timer { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin-top: 4px; }
#timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width .25s linear; }
#timer-bar.low { background: var(--bad); }

.panel { display: none; flex-direction: column; gap: 14px; }
.panel.show { display: flex; animation: rise .35s ease both; }
.status { text-align: center; color: var(--mut); min-height: 1.3em; }

/* ---------- Formación ---------- */
.formations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .formations { grid-template-columns: repeat(2, 1fr); } }
.fcard { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; transition: transform .15s, border-color .2s, box-shadow .2s; color: var(--ink); }
.fcard:hover { transform: translateY(-3px); }
.fcard.sel { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(200,255,61,.15), 0 12px 30px rgba(0,0,0,.3); }
.fcard .fname { font-family: var(--display); font-size: 2rem; letter-spacing: 2px; }
.fcard .fdesc { font-size: .75rem; color: var(--mut); text-align: center; }
.fpitch { width: 100%; aspect-ratio: 3/4; border-radius: 10px; background: linear-gradient(#1f8a4c, #187340); border: 1.5px solid rgba(255,255,255,.4); display: flex; flex-direction: column; justify-content: space-around; padding: 6px 0; position: relative; }
.fpitch::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid rgba(255,255,255,.35); }
.fpitch .ln { display: flex; justify-content: space-evenly; }
.fpitch i { width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.fcard.sel .fpitch i { background: var(--acc); }

/* ---------- Pregunta ---------- */
.q-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.cat { text-transform: uppercase; font-size: .75rem; font-weight: 700; letter-spacing: 2px; background: rgba(200,255,61,.12); color: var(--acc); padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(200,255,61,.3); }
.ring { position: relative; width: 58px; height: 58px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: rgba(255,255,255,.1); }
.ring .fg { stroke: var(--acc); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset .25s linear, stroke .3s; }
.ring.low .fg { stroke: var(--bad); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.7rem; }
.q-text { text-align: center; font-size: clamp(1.3rem, 3.6vw, 1.9rem); font-weight: 700; line-height: 1.3; max-width: 760px; margin: 0 auto; padding: 4px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.options button { font-size: 1.05rem; font-weight: 600; padding: 14px 16px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.12); background: var(--panel); color: var(--ink); cursor: pointer; text-align: left; display: flex; align-items: center; gap: 12px; transition: transform .1s, border-color .2s, background .2s; animation: rise .35s ease both; }
.options button:nth-child(2) { animation-delay: .05s; } .options button:nth-child(3) { animation-delay: .1s; } .options button:nth-child(4) { animation-delay: .15s; }
.options button:not(:disabled):hover { border-color: var(--acc); transform: translateY(-2px); }
.options button .l { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); font-family: var(--display); font-size: 1.2rem; }
.options button:disabled { cursor: default; }
.options button.sel { border-color: var(--acc); }
.options button.right { background: linear-gradient(180deg, #2fe08a, #1fb86e); border-color: transparent; color: #04170c; animation: pop .45s; }
.options button.right .l { background: rgba(0,0,0,.15); }
.options button.wrong { background: linear-gradient(180deg, #ff5f7a, #e23a57); border-color: transparent; animation: shake .4s; }
.options button .who { margin-left: auto; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.25); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---------- Draft ---------- */
.turn { text-align: center; font-weight: 700; font-size: 1.05rem; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.turn.mine { background: linear-gradient(90deg, rgba(200,255,61,.18), rgba(25,230,140,.12)); border-color: rgba(200,255,61,.5); color: var(--acc); animation: pulseb 1.6s infinite; }
@keyframes pulseb { 50% { box-shadow: 0 0 22px rgba(200,255,61,.25); } }
.draft { display: grid; grid-template-columns: minmax(300px, 1fr) 1.15fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .draft { grid-template-columns: 1fr; } }
.pitches { display: grid; gap: 10px; }
.pitches h3, .vs-cards h3 { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--mut); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; font-weight: 700; }
.tag { background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 8px; color: var(--ink); font-family: var(--display); font-size: 1rem; letter-spacing: 1px; }
.pitch { position: relative; aspect-ratio: 4 / 3.7; border-radius: 16px; background: repeating-linear-gradient(0deg, #1f8a4c 0 9%, #1a7c44 9% 18%); border: 2px solid rgba(255,255,255,.55); display: flex; flex-direction: column; justify-content: space-around; padding: 8px 4px; overflow: hidden; box-shadow: inset 0 0 40px rgba(0,0,0,.35); }
.pitch::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255,255,255,.4); }
.pitch::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.4); border-radius: 50%; }
.pitch .line { display: flex; justify-content: space-evenly; position: relative; z-index: 1; gap: 3px; }
.slot { flex: 0 1 19%; min-height: 50px; border-radius: 10px; background: rgba(0,0,0,.22); border: 1.5px dashed rgba(255,255,255,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; text-align: center; padding: 3px 2px; color: rgba(255,255,255,.75); }
.slot.full { background: linear-gradient(180deg, #23392f, #0d1d16); border: 1.5px solid var(--gold); color: var(--ink); box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.slot.full.retro { background: linear-gradient(180deg, #3b2a5c, #1c1330); border-color: var(--legend); }
.slot b { font-family: var(--display); font-size: 1.2rem; line-height: 1; color: var(--gold); font-weight: 400; }
.slot.retro b { color: var(--legend); }
.slot .nm { font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; font-size: .66rem; }
.slot.fresh { animation: drop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes drop { 0% { transform: scale(1.7) translateY(-10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.pitch.small { aspect-ratio: 4 / 2.6; }
.pitch.small .slot { min-height: 32px; } .pitch.small .slot b { font-size: .95rem; } .pitch.small .slot .nm { font-size: .58rem; }

.browser { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.browser.locked .plist { opacity: .4; pointer-events: none; filter: grayscale(.5); }
.tabs { display: flex; gap: 6px; background: rgba(0,0,0,.3); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; padding: 10px 6px; border-radius: 11px; border: 0; background: transparent; color: var(--mut); cursor: pointer; font-weight: 700; font-size: .92rem; }
.tabs button.on { background: var(--ink); color: #0b1a12; }
.tabs button[data-era="retro"].on { background: linear-gradient(180deg, #c9a6ff, #9a6cf0); color: #1a0d33; }
.tabs button:disabled { opacity: .4; cursor: not-allowed; }
.pill { font-size: .72rem; padding: 2px 6px; border-radius: 8px; background: rgba(0,0,0,.25); margin-left: 3px; }
.note { font-size: .8rem; color: var(--legend); text-align: center; min-height: 1em; }
.note:empty { display: none; }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chips button { flex: 1; padding: 7px 4px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.12); background: transparent; color: var(--ink); cursor: pointer; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chips button.on { background: var(--acc); color: #0b1a05; border-color: var(--acc); }
.chips button:disabled { opacity: .3; cursor: default; }
.plist { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 2px; }
.prow { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(0,0,0,.25); cursor: pointer; border: 1.5px solid transparent; transition: border-color .15s, transform .1s; }
.prow:hover { border-color: rgba(200,255,61,.5); }
.prow:active { transform: scale(.98); }
.rt { font-family: var(--display); font-size: 1.6rem; line-height: 1; text-align: center; border-radius: 10px; padding: 8px 0 5px; background: #23392f; }
.rt.b { background: linear-gradient(135deg, #d9a066, #8a5a2b); color: #1b0f05; }
.rt.s { background: linear-gradient(135deg, #f1f4f6, #9aa3ab); color: #111; }
.rt.g { background: linear-gradient(135deg, #ffe58a, #e0a40d); color: #231700; box-shadow: 0 0 12px rgba(255,201,60,.35); }
.rt.l { background: linear-gradient(135deg, #e3cfff, #8c5cf0); color: #1a0d33; box-shadow: 0 0 12px rgba(183,140,255,.4); }
.prow .nm { font-weight: 700; }
.prow small { color: var(--mut); display: block; font-size: .8rem; }
.ps { font-size: .72rem; font-weight: 800; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.08); letter-spacing: .5px; }
.ps.POR { color: #ffd166; } .ps.DEF { color: #4cc9f0; } .ps.MED { color: #80ed99; } .ps.DEL { color: #ff6b6b; }
.prow.taken { opacity: .3; pointer-events: none; }
.prow.taken .nm::after { content: ' · fichado'; font-weight: 400; color: var(--mut); }
.empty { color: var(--mut); text-align: center; padding: 20px; }

/* ---------- Listo ---------- */
.vs-cards { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.vs-cards .vs { font-family: var(--display); font-size: 2.6rem; color: var(--acc); text-shadow: 0 0 20px rgba(200,255,61,.5); }
.vs-cards .me h3 { color: var(--me); } .vs-cards .opp h3 { color: var(--opp); }
@media (max-width: 680px) { .vs-cards { grid-template-columns: 1fr; } .vs-cards .vs { text-align: center; font-size: 2rem; } }
#ready-panel .btn { align-self: center; min-width: 260px; }

/* ---------- Partido ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: linear-gradient(180deg, #0a1712, #040a07); border: 1px solid var(--line); border-radius: 20px; padding: 16px; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.scoreboard .team { display: flex; flex-direction: column; font-weight: 800; font-size: 1.05rem; min-width: 0; }
.scoreboard .team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .team small { color: var(--mut); font-weight: 500; font-size: .78rem; }
.scoreboard .me { color: var(--me); } .scoreboard .opp { color: var(--opp); text-align: right; }
.score { display: flex; flex-direction: column; align-items: center; }
#sb-score { font-family: var(--display); font-size: 3.6rem; line-height: 1; letter-spacing: 3px; }
#sb-score.bump { animation: pop .6s; color: var(--acc); }
.clock { font-family: var(--display); font-size: 1.3rem; color: #06120d; background: var(--acc); padding: 1px 10px; border-radius: 8px; margin-top: 4px; }
.minipitch { position: relative; height: 86px; border-radius: 14px; background: repeating-linear-gradient(90deg, #1f8a4c 0 8%, #1a7c44 8% 16%); border: 2px solid rgba(255,255,255,.55); overflow: hidden; }
.minipitch::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid rgba(255,255,255,.5); }
.minipitch::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%,-50%); border: 2px solid rgba(255,255,255,.5); border-radius: 50%; }
.minipitch .goal { position: absolute; top: 28%; bottom: 28%; width: 12px; border: 2px solid rgba(255,255,255,.7); }
.minipitch .goal.l { left: -2px; border-left: 0; } .minipitch .goal.r { right: -2px; border-right: 0; }
#ball { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transition: left .7s cubic-bezier(.3,.8,.4,1), top .7s ease; font-size: 1.35rem; z-index: 2; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.progress { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
#match-progress { height: 100%; width: 0; background: var(--acc); transition: width .2s linear; }
.feed { list-style: none; display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow-y: auto; }
.feed li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: 44px 1fr; gap: 8px; animation: slidein .4s ease both; border-left: 4px solid transparent; line-height: 1.35; }
.feed li .m { font-family: var(--display); font-size: 1.25rem; color: var(--acc); }
.feed li.goal { font-weight: 700; background: linear-gradient(90deg, rgba(200,255,61,.18), rgba(16,38,30,.8)); border-color: rgba(200,255,61,.4); }
.feed li.t0 { border-left-color: var(--me); } .feed li.t1 { border-left-color: var(--opp); }
.feed li.half, .feed li.end, .feed li.kickoff { background: rgba(255,255,255,.07); font-weight: 600; }
.feed li.yellow .m::after { content: ' 🟨'; font-size: .8rem; } .feed li.red .m::after { content: ' 🟥'; font-size: .8rem; }
@keyframes slidein { from { opacity: 0; transform: translateX(-14px); } }

/* ---------- Resultado ---------- */
#result-panel { align-items: center; text-align: center; padding-top: 3vh; max-width: 480px; margin: 0 auto; width: 100%; }
#result-panel .btn { width: 100%; }
.emoji { font-size: 5rem; animation: bounce 1.6s infinite; }
#result-title { font-size: 3rem; }
.final { font-family: var(--display); font-size: 2.2rem; letter-spacing: 1.5px; margin: 6px 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-bottom: 8px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: .85rem; color: var(--mut); }
.stats b { display: block; font-family: var(--display); font-size: 1.6rem; color: var(--ink); font-weight: 400; }

/* ---------- Overlays ---------- */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle, rgba(10,30,20,.92), rgba(0,0,0,.97)); }
.splash.hidden, .goal-flash.hidden, .modal.hidden { display: none; }
.sp-in { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--display); }
.sp-name { font-size: 3.2rem; letter-spacing: 2px; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-name.me { color: var(--me); animation: inl .6s cubic-bezier(.2,1.4,.4,1) both; }
.sp-name.opp { color: var(--opp); animation: inr .6s .15s cubic-bezier(.2,1.4,.4,1) both; }
.sp-vs { font-size: 5rem; color: var(--acc); text-shadow: 0 0 30px rgba(200,255,61,.6); animation: zoom .5s .3s both; }
@keyframes inl { from { transform: translateX(-60vw); } } @keyframes inr { from { transform: translateX(60vw); } }
@keyframes zoom { from { transform: scale(3); opacity: 0; } }
.goal-flash { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle, rgba(30,60,10,.85), rgba(0,0,0,.7) 75%); animation: fadeout 2s ease forwards; }
.goal-flash span { font-family: var(--display); font-size: clamp(4rem, 18vw, 9rem); color: var(--acc); text-shadow: 0 0 40px rgba(200,255,61,.8), 0 6px 0 #0b1a05; animation: zoom .45s cubic-bezier(.2,1.6,.4,1); }
.goal-flash small { font-weight: 800; font-size: 1.3rem; }
.goal-flash.opp span { color: var(--opp); text-shadow: 0 0 40px rgba(255,79,109,.8), 0 6px 0 #2a0710; }
.goal-flash.opp { background: radial-gradient(circle, rgba(70,10,20,.85), rgba(0,0,0,.7) 75%); }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 44; width: 100%; height: 100%; }
#toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #0a1712; border: 1px solid var(--acc); padding: 11px 18px; border-radius: 14px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: 90vw; text-align: center; z-index: 60; font-weight: 600; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 55; padding: 20px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-box { background: linear-gradient(180deg, #13332a, #0a1a14); border: 1px solid var(--line); border-radius: 24px; padding: 20px; max-width: 340px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 16px; animation: zoomin .3s cubic-bezier(.2,1.4,.4,1); }
@keyframes zoomin { from { transform: scale(.8); opacity: 0; } }
.modal-box .row { display: flex; gap: 10px; } .modal-box .row .btn { flex: 1; }
.pcard { margin: 0 auto; width: 190px; border-radius: 18px; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: linear-gradient(160deg, #ffe58a, #c78c06); color: #231700; box-shadow: 0 14px 30px rgba(0,0,0,.45); position: relative; overflow: hidden; }
.pcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 45%, transparent 60%); animation: shine 2.2s infinite; }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.pcard.s { background: linear-gradient(160deg, #f4f6f8, #8e98a1); color: #111; }
.pcard.b { background: linear-gradient(160deg, #e0aa72, #7b4e22); color: #1b0f05; }
.pcard.l { background: linear-gradient(160deg, #e7d6ff, #7a48e0); color: #1a0d33; }
.pcard .r { font-family: var(--display); font-size: 3.4rem; line-height: .9; }
.pcard .p { font-weight: 800; font-size: .8rem; letter-spacing: 2px; }
.pcard .n { font-family: var(--display); font-size: 1.6rem; letter-spacing: 1px; line-height: 1; text-align: center; margin-top: 6px; }
.pcard .t { font-size: .8rem; font-weight: 600; opacity: .8; }
.pcard .e { position: absolute; top: 8px; right: 10px; font-size: .62rem; font-weight: 800; letter-spacing: 1px; }

@media (max-width: 860px) {
  .draft .pitches { grid-template-columns: 1fr 1fr; gap: 8px; }
  .draft .pitch, .draft .pitch.small { aspect-ratio: 3 / 3.5; padding: 5px 2px; }
  .draft .pitch .slot { min-height: 32px; flex-basis: 19%; border-radius: 7px; }
  .draft .pitch .slot b { font-size: .9rem; }
  .draft .pitch .slot .nm { font-size: .54rem; }
  .plist { max-height: none; }
}
@media (max-width: 420px) {
  .title .big { font-size: 3.5rem; }
  .topbar .av { display: none; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------- Penalti ---------- */
.pen { position: fixed; inset: 0; z-index: 48; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.pen.hidden { display: none; }
.pen-box { width: 100%; max-width: 460px; background: linear-gradient(180deg, #13332a, #08160f); border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; text-align: center; animation: zoomin .35s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.pen-title { font-family: var(--display); font-size: 3rem; letter-spacing: 2px; color: var(--acc); text-shadow: 0 0 24px rgba(200,255,61,.5); line-height: 1; }
.pen-title.opp { color: var(--opp); text-shadow: 0 0 24px rgba(255,79,109,.5); }
.pen-sub { color: var(--ink); font-weight: 600; line-height: 1.4; }
.goalframe { position: relative; height: 150px; margin: 6px 10px 0; border: 5px solid #fff; border-bottom: 0; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); overflow: hidden; }
.goalframe .net { position: absolute; inset: 0; opacity: .25; background: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 12px), repeating-linear-gradient(-45deg, #fff 0 1px, transparent 1px 12px); }
.zones { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.zones span { border-right: 1px dashed rgba(255,255,255,.2); transition: background .2s; }
.zones span:last-child { border-right: 0; }
.zones span.mine { background: rgba(200,255,61,.18); }
.keeper { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 2.6rem; transition: left .5s cubic-bezier(.3,.9,.4,1), transform .5s; z-index: 2; }
.keeper.d0 { left: 18%; transform: translateX(-50%) rotate(-50deg); } .keeper.d2 { left: 82%; transform: translateX(-50%) rotate(50deg); } .keeper.d1 { transform: translateX(-50%) translateY(-30px); }
.pball { position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%) scale(1.6); font-size: 1.6rem; transition: all .45s cubic-bezier(.2,.8,.3,1); z-index: 3; }
.pball.s0 { left: 18%; bottom: 60px; transform: translateX(-50%) scale(.9); } .pball.s1 { left: 50%; bottom: 70px; transform: translateX(-50%) scale(.9); } .pball.s2 { left: 82%; bottom: 60px; transform: translateX(-50%) scale(.9); }
.pen-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pen-btns button { padding: 14px 4px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--ink); font-weight: 800; font-size: .95rem; cursor: pointer; transition: transform .1s, background .2s; }
.pen-btns button:active { transform: scale(.95); }
.pen-btns button.sel { background: var(--acc); color: #0b1a05; border-color: var(--acc); }
.pen-btns button:disabled:not(.sel) { opacity: .35; }
.pen-timer { font-family: var(--display); font-size: 1.6rem; color: var(--mut); min-height: 1.6rem; }
.pen-result { font-family: var(--display); font-size: 2.6rem; letter-spacing: 2px; }
.feed li.penalty { background: linear-gradient(90deg, rgba(255,201,60,.2), rgba(16,38,30,.8)); font-weight: 700; }
.feed li.penalty .m::after { content: ' ⚠️'; font-size: .8rem; }

/* ---------- Tanda de penaltis ---------- */
.pen-so { display: grid; gap: 6px; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px; }
.pen-so.hidden { display: none; }
.pen-so .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; text-align: left; font-weight: 700; font-size: .9rem; }
.pen-so .row.me .nm { color: var(--me); } .pen-so .row.opp .nm { color: var(--opp); }
.pen-so .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pen-so .dots { display: flex; gap: 5px; }
.pen-so .dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); display: grid; place-items: center; font-style: normal; font-size: .7rem; }
.pen-so .dots i.g { background: var(--ok); border-color: var(--ok); }
.pen-so .dots i.f { background: var(--bad); border-color: var(--bad); }
.so-score { font-weight: 700; color: var(--gold); font-size: .85rem; margin-top: 4px; min-height: 1em; }
.feed li.end90 { background: linear-gradient(90deg, rgba(255,201,60,.25), rgba(16,38,30,.8)); font-weight: 700; }
.feed li.sogoal, .feed li.sosave { font-weight: 600; }

/* ---------- Cómo se juega ---------- */
.howto { text-align: left; padding: 14px 18px; }
.howto summary { cursor: pointer; font-weight: 800; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: '▾'; color: var(--acc); transition: transform .2s; }
.howto[open] summary::after { transform: rotate(180deg); }
.howto ol { margin: 10px 0 2px; padding-left: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 8px; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: .88rem; line-height: 1.4; color: var(--mut); }
.howto li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: rgba(200,255,61,.15); color: var(--acc); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.howto b { color: var(--ink); }

/* ---------- Cuenta atrás ---------- */
.countdown { position: fixed; inset: 0; z-index: 49; display: grid; place-items: center; background: radial-gradient(circle, rgba(10,40,25,.9), rgba(0,0,0,.95)); }
.countdown.hidden { display: none; }
.cd-in { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cd-in small { color: var(--mut); font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.cd-num { font-family: 'Kanit', var(--display); font-style: italic; font-weight: 900; font-size: 11rem; line-height: 1; color: var(--acc); text-shadow: 0 0 50px rgba(200,255,61,.6), 6px 6px 0 #0b1a05; }
.cd-num.go { font-size: 4.5rem; color: #fff; }
.cd-num.tick { animation: cdpop .9s ease-out; }
@keyframes cdpop { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.8); opacity: .2; } }
.cd-tip { color: var(--ink); font-weight: 600; margin-top: 10px; }

/* ---------- Idioma y modo de juego ---------- */
.langsel { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 12px; z-index: 40; display: flex; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langsel button { background: none; border: 0; color: var(--mut); font: 700 .78rem/1 inherit; font-family: inherit; padding: 8px 10px; border-radius: 999px; cursor: pointer; letter-spacing: .5px; }
.langsel button.on { background: var(--acc); color: #07130f; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-transform: none; letter-spacing: 0; }
.modes button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); cursor: pointer; font-family: inherit; transition: .15s; }
.modes button b { font-size: 1.4rem; line-height: 1; }
.modes button span { font-weight: 800; font-size: .9rem; }
.modes button small { font-size: .66rem; color: var(--mut); font-weight: 500; line-height: 1.2; }
.modes button.on { border-color: var(--acc); background: rgba(200,255,61,.12); box-shadow: 0 0 0 1px var(--acc) inset; }
.gm-badge { display: block; font-size: .68rem; color: var(--mut); font-weight: 700; letter-spacing: .5px; }
#wait-mode { margin-top: -4px; font-weight: 700; }
body.ingame .langsel { display: none; } /* el idioma se cambia desde el menú; en partida no tapa el marcador */

/* ---------- Modo equipos legendarios ---------- */
.modes { grid-template-columns: repeat(2, 1fr); }
.club-mine { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.club-mine h3 { font-size: .72rem; color: var(--mut); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 6px; }
.club-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.cchip { font-size: .72rem; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: rgba(57,183,255,.15); border: 1px solid var(--me); }
.club-chips.opp .cchip { background: rgba(255,80,110,.12); border-color: var(--opp); }
.club-chips .none { font-size: .75rem; color: var(--mut); }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.club-grid.locked .ccard:not(.mine):not(.theirs) { opacity: .75; }
.ccard { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(183,140,255,.16), rgba(255,255,255,.03)); color: var(--ink); font-family: inherit; cursor: pointer; transition: .15s; }
.ccard:not(:disabled):hover { border-color: var(--legend); transform: translateY(-2px); }
.ccard:disabled { cursor: default; }
.ccard .cf { font-size: 1.2rem; line-height: 1; }
.ccard .cn { font-weight: 800; font-size: .92rem; line-height: 1.15; }
.ccard .cr { font-size: .72rem; color: var(--gold); font-weight: 700; }
.ccard .cs { font-size: .68rem; color: var(--mut); line-height: 1.2; }
.ccard .ct { position: absolute; top: 8px; right: 10px; font-size: .68rem; font-weight: 800; color: var(--opp); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard.mine { border-color: var(--me); background: rgba(57,183,255,.14); opacity: 1; }
.ccard.mine .ct { color: var(--me); }
.ccard.theirs { opacity: .4; }
.ccard.big { min-width: 230px; padding: 18px 20px; align-items: center; text-align: center; opacity: 1; }
.ccard.big .cf { font-size: 2.2rem; } .ccard.big .cn { font-size: 1.3rem; }
.clubf { margin-bottom: 6px; }
.tabs.hidden, .clubf.hidden { display: none; }
/* Fichaje recién hecho, visible para los dos */
.signed { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4,10,8,.55); backdrop-filter: blur(3px); animation: fadein .2s; pointer-events: none; }
.signed.hidden { display: none; }
.signed-in { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: signpop .35s cubic-bezier(.2,1.4,.4,1); }
.signed-in small { font-family: var(--display); font-size: 1.5rem; letter-spacing: 1px; color: var(--me); }
.signed.opp .signed-in small { color: var(--opp); }
@keyframes signpop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Decisiones en el partido (protesta / falta) ---------- */
.dec-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.dec-btns.hidden { display: none; }
.dec-btns button { padding: 16px 8px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--ink); font-weight: 800; font-size: .98rem; font-family: inherit; cursor: pointer; transition: transform .1s, background .2s; }
.dec-btns button:active { transform: scale(.95); }
.dec-btns button.sel { background: var(--acc); color: #07130f; border-color: var(--acc); }
.dec-btns button:disabled:not(.sel) { opacity: .45; }
.dec-odds { font-size: .85rem; color: var(--gold); font-weight: 700; margin: 2px 0 8px; text-align: center; }
.dec.protest .pen-box { border-color: #ffd23c; }
.dec .pen-sub { margin-bottom: 6px; }
.pen-taker { font-weight: 800; font-size: .95rem; color: var(--gold); background: rgba(0,0,0,.25); border: 1px solid rgba(255,201,60,.35); border-radius: 999px; padding: 6px 14px; margin: 2px auto 8px; width: fit-content; max-width: 100%; text-align: center; }
.pen-taker:empty { display: none; }

/* Enlaces legales y aviso de cookies */
.legal-links { margin-top: 10px; font-size: .8rem; }
.legal-links a, .cookie-note a { color: var(--mut); text-decoration: underline; }
.cookie-note { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; max-width: 520px; margin: 0 auto;
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(10, 28, 21, .96); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: .82rem; line-height: 1.35; color: var(--ink); }
.cookie-note p { margin: 0; flex: 1; }
.cookie-note .btn { flex: none; width: auto; padding: 9px 14px; font-size: .85rem; }
.cookie-note.hidden, body.ingame .cookie-note { display: none; }
