/* Recargá Pilas 2026 · Portal del jugador/a (mobile first) */
html, body.pj { background: #eef3f9; min-height: 100%; }
body.pj { margin: 0; font-family: var(--sans); color: var(--ink); -webkit-tap-highlight-color: transparent; }
.pj [hidden] { display: none !important; }
.pj button { font: inherit; color: inherit; }
.muted { color: var(--ink-3); }

/* ---------- Vinculación ---------- */
.pj-link { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% 0%, var(--deep) 0%, var(--night) 60%); color: #fff; }
.pj-link-card { width: min(400px, 100%); display: grid; gap: 12px; text-align: center; justify-items: center; }
.pj-link-card img { border-radius: 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.pj-link h1 { font-family: var(--display); font-size: 28px; margin: 6px 0 0; }
.pj-link p { margin: 0; color: #b8c7e0; font-size: 14.5px; line-height: 1.5; }
#linkForm { width: 100%; display: grid; gap: 12px; margin-top: 8px; text-align: left; }
#linkForm label, #mailLinkForm label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #cfdbef; }
#linkForm .input, #mailLinkForm .input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; font-size: 18px; }
#linkForm .input.code { letter-spacing: .3em; text-transform: uppercase; font-weight: 700; text-align: center; }
.pj-hint { font-size: 13px !important; }
.pj-back { color: #9fb6da; font-size: 14px; }

/* ---------- Botones ---------- */
.pj-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 50px; border-radius: 14px; border: 0; background: var(--blue); color: #fff !important; font-weight: 700; font-size: 16px; cursor: pointer; padding: 0 18px; text-decoration: none; width: 100%; }
.pj-btn.ghost { background: #fff; color: var(--ink) !important; border: 1px solid var(--line); }
.pj-link .pj-btn.ghost { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .3); }
.pj-btn.sm { min-height: 42px; font-size: 14px; width: auto; }
.pj-mini { justify-self: end; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; margin: -2px 0 6px; }

/* ---------- Encabezado con los colores de la camiseta ---------- */
.pj-hero { --kit: var(--blue); background: linear-gradient(140deg, var(--night) 0%, #10275a 55%, var(--kit) 160%); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 16px 18px; position: relative; overflow: hidden; }
.pj-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: var(--kit); opacity: .35; filter: blur(8px); }
.pj-hero-in { position: relative; z-index: 1; display: flex; gap: 14px; align-items: center; max-width: 720px; margin: 0 auto; }
.pj-id { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pj-id small { color: #a9bbd8; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pj-id b { font-family: var(--display); font-size: 26px; line-height: 1.05; letter-spacing: .02em; overflow-wrap: anywhere; }
.pj-id span { color: #d6e2f5; font-size: 13.5px; }
.pj-dorsal { flex: none; width: 64px; height: 72px; border-radius: 12px 12px 16px 16px; background: var(--kit); color: var(--kit-ink, #fff); display: grid; place-items: center; align-content: center; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .1); }
.pj-dorsal span { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-dorsal b { font-family: var(--display); font-size: 30px; line-height: 1; }
.pj-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--ice-2); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.pj-av.xl { width: 68px; height: 68px; font-size: 22px; border: 3px solid rgba(255, 255, 255, .85); }

/* ---------- Contenido ---------- */
.pj-view { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; display: grid; gap: 14px; }
.pj-card { background: #fff; border-radius: 20px; padding: 14px 16px; border: 1px solid #dde6f1; box-shadow: 0 1px 2px rgb(var(--night-rgb) / .04); display: grid; gap: 10px; text-align: left; }
.pj-card.soft { background: linear-gradient(135deg, #eef4fb, #fff); }
.pj-card h3 { margin: 0; font-size: 17px; font-family: var(--display); }
.pj-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.pj-card.live { border: 2px solid #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.pj-card.champ { background: linear-gradient(135deg, var(--night), var(--blue)); color: #fff; font-size: 20px; text-align: center; }
.pj-card-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.pj-card-h small { color: var(--ink-3); font-weight: 600; text-transform: none; letter-spacing: 0; }
.pj-card-f { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.pm { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.pm-t { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 14px; }
.pm-t.me b { color: var(--blue); }
.pj-shirt { width: 84px; display: inline-block; }
.pj-shirt > img:first-child { width: 100%; aspect-ratio: 1480/970; object-fit: contain; }
.pm-s { display: grid; justify-items: center; font-variant-numeric: tabular-nums; }
.pm-s b { font-family: var(--display); font-size: 40px; line-height: 1; }
.pm-s small { font-size: 12px; color: var(--ink-3); }
.pm-s .vs { font-size: 16px; color: var(--ink-3); font-weight: 700; }
.live-dot { color: #c2410c; font-weight: 800; letter-spacing: .06em; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: pjblink 1s infinite; }
@keyframes pjblink { 50% { opacity: .25; } }
.pj-live-btn { border: 0; background: #e11d48; color: #fff !important; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.pj-live-btn.big { width: 100%; padding: 12px; font-size: 15px; border-radius: 14px; }
.pj-streams { display: grid; gap: 8px; }
.pj-card.rate { display: flex; align-items: center; gap: 12px; cursor: pointer; border: 2px dashed #f5c14e; background: #fffaf0; width: 100%; font: inherit; }
.rate-ic { font-size: 26px; }
.pj-card.rate span:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.pj-card.rate small { color: var(--ink-2); font-size: 13px; }
.pj-card.rate .go { font-size: 28px; color: var(--ink-3); }
.pj-sec { display: grid; gap: 10px; }
.pj-sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 6px 2px 0; font-family: var(--sans); }
.pj-note { margin: 0 2px; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.pj-h3 { font-size: 14px; margin: 12px 2px 6px; }
.pj-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pj-kpis.six { grid-template-columns: repeat(3, 1fr); }
.pj-kpis > div { background: #fff; border-radius: 16px; padding: 12px 6px; text-align: center; display: grid; gap: 2px; border: 1px solid #dde6f1; }
.pj-kpis b { font-family: var(--display); font-size: 24px; line-height: 1.1; }
.pj-kpis span { font-size: 11.5px; color: var(--ink-3); }
.pj-big-stars { text-align: center; font-size: 30px; }
.stars { white-space: nowrap; letter-spacing: 1px; }
.stars i { font-style: normal; color: #d3dbe7; }
.stars i.on { color: #f5a524; }
.stars i.half { background: linear-gradient(90deg, #f5a524 50%, #d3dbe7 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pj .tz { border-radius: 18px; }
.pj .match-list { display: grid; gap: 8px; }
.pj-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.pj-subtabs { margin-top: 0; }
.pj-card .code, .code { font-family: var(--display); letter-spacing: .18em; background: var(--ice-2); padding: 1px 8px; border-radius: 6px; }

/* ---------- Plantel y rankings ---------- */
.roster { display: grid; gap: 6px; }
.rp { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; border: 1px solid #dde6f1; }
.rp.me { border-color: var(--blue); background: #f3f8fe; }
.rp-i { flex: 1; min-width: 0; display: grid; }
.rp-i b { font-size: 15.5px; } .rp-i b em { font-style: normal; color: var(--blue); margin-right: 6px; }
.rp-i span { font-size: 12.5px; color: var(--ink-3); }
.rp-s { display: grid; gap: 2px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rank li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; border: 1px solid #dde6f1; }
.rank li.me { border-color: var(--blue); background: #f3f8fe; }
.rank .pos { width: 22px; font-weight: 800; color: var(--ink-3); text-align: center; }
.rank li:nth-child(1) .pos { color: #d4a017; } .rank li:nth-child(2) .pos { color: #8d99ae; } .rank li:nth-child(3) .pos { color: #b87333; }
.rank .nm { flex: 1; min-width: 0; display: grid; } .rank .nm small { color: var(--ink-3); font-size: 12px; }
.rank .val { display: grid; text-align: right; } .rank .val b { font-family: var(--display); font-size: 20px; } .rank .val small { font-size: 11px; color: var(--ink-3); }

/* ---------- Perfil ---------- */
.pj-form { background: #fff; border-radius: 20px; padding: 14px 16px; border: 1px solid #dde6f1; }
.pj-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pj-form .nick { text-transform: uppercase; font-weight: 700; letter-spacing: .1em; }
.pf-photo button { display: flex; align-items: center; gap: 12px; border: 0; background: none; cursor: pointer; padding: 0; font-weight: 600; color: var(--blue) !important; }
.pf-photo .pj-av.xl { border-color: var(--ice-2); }

/* ---------- Navegación inferior ---------- */
.pj-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid #dde6f1; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.pj-nav button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; font-size: 11px; font-weight: 600; color: var(--ink-3) !important; cursor: pointer; padding: 4px 0; }
.pj-nav svg { width: 24px; height: 24px; }
.pj-nav button.active { color: var(--blue) !important; }

/* ---------- Hoja inferior ---------- */
.pj-sheet { position: fixed; inset: 0; z-index: 50; background: rgb(var(--night-rgb) / 0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.pj-sheet.open { background: rgb(var(--night-rgb) / .5); }
.pj-sheet-card { width: min(640px, 100%); max-height: 90dvh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; display: grid; gap: 10px; }
.pj-sheet.open .pj-sheet-card { transform: none; }
.pj-grab { width: 44px; height: 5px; border-radius: 3px; background: #d3dbe7; margin: 2px auto 6px; }
.sh-h { font-family: var(--display); font-size: 20px; margin: 0; }
.sh-p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.sh-actions { display: flex; gap: 8px; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.pj-sheet h4 { margin: 10px 0 4px; display: flex; gap: 8px; align-items: center; font-size: 15px; }
.rt-list { display: grid; gap: 4px; }
.rt { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--ice-2); }
.rt-n { flex: 1; min-width: 0; display: grid; font-size: 14px; } .rt-n small { color: var(--ink-3); font-size: 12px; }
.rt-s { display: flex; }
.rt-s button { border: 0; background: none; font-size: 24px; line-height: 1; padding: 2px; color: #d3dbe7 !important; cursor: pointer; }
.rt-s button.on { color: #f5a524 !important; }
.rt-mvp { border: 1.5px dashed var(--line); background: #fff; border-radius: 10px; font-size: 18px; width: 38px; height: 38px; cursor: pointer; opacity: .45; }
.rt-mvp.on { opacity: 1; border-style: solid; border-color: #f5a524; background: #fff6df; }
.pj-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.pj-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 380px) { .rt-s button { font-size: 20px; } .pj-kpis { grid-template-columns: repeat(2, 1fr); } }
.pj-av.kit { object-fit: contain; background: var(--night); padding: 3px; }
/* Avisos arriba para no tapar los botones de abajo */
body .toasts { top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; }
body .toast, body .demo-badge { pointer-events: none; }
body .demo-badge { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); opacity: .75; }
.pj-champ { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 14px; background: rgba(0, 0, 0, .22); }
.pj-champ .kitimg { width: 100%; }
.pj-champ .champ-tag { justify-self: start; }
.pj-logi { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--ice, #f1f5fa); border: 1px solid var(--line, #d7e0ec); }
.pj-logi h3 { margin: 0; font-size: 16px; }
.pj-logi .logi.full .lg-h { font-size: 14px; }
.pj-logi .lg-sub label { display: flex; flex-direction: row; font-weight: 500; }
.pj-logi label.lg-opt, .pj-logi label.chip-opt { display: block; gap: 0; }
.pj-card.todo { display: grid; gap: 14px; border: 2px solid #f6c9a4; background: linear-gradient(135deg, #fff6ee, #fff); }
.todo-h { display: flex; gap: 12px; align-items: flex-start; }
.todo-ic { font-size: 30px; line-height: 1; }
.todo-h h3 { margin: 0 0 4px; }
.todo-h p { margin: 0; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.todo-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.todo-grid .nick { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* Términos y condiciones al entrar */
.pj-tc { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 14.5px; line-height: 1.45; color: #dfe7f5; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; }
.pj-tc input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--charge); }
.pj-tc a { color: #fff; font-weight: 700; }
.pj-tc.invalid { outline: 2px solid #ff6b81; outline-offset: 3px; }

/* Acceso al álbum de figuritas */
.pj-album { display: flex !important; grid-template-columns: none; align-items: center; gap: 12px; text-decoration: none; color: #fff !important; background: linear-gradient(120deg, var(--blue), var(--deep)) !important; border: 0 !important; }
.pj-album div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pj-album b { font-size: 15.5px; }
.pj-album small { font-size: 12.5px; color: #d7e0f2; }
.pj-album > span:last-child { font-size: 26px; opacity: .8; }
.pj-album-ic { font-size: 30px; }

/* Mi figurita */
.pj-figu-cv { display: grid; place-items: center; min-height: 200px; background: linear-gradient(160deg, var(--night-2, #0e2348), var(--night, #07142f)); border-radius: 16px; padding: 12px; }
.pj-figu-cv img { width: min(260px, 72vw); height: auto; border-radius: 12px; box-shadow: 0 14px 30px rgb(0 0 0 / .35); display: block; }
.pj-figu-load { color: #c9d6ee; font-size: 14px; }
.pj-figu-act { display: flex; gap: 8px; flex-wrap: wrap; }
.pj-figu-act .pj-btn { flex: 1 1 30%; min-height: 44px; }
/* Capitán/a: plantel */
.pj-cap p { margin: 0; font-size: 14px; color: #3c4763; }
.pj-cap .pj-btn { text-align: center; text-decoration: none; min-height: 44px; display: grid; place-items: center; }
.pj-cap-bar { height: 8px; border-radius: 99px; background: #e6edf7; overflow: hidden; }
.pj-cap-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue, #2167AE), #5BE37D); border-radius: inherit; }
/* Vinculación sin código: enlace por mail */
.pj-nocode { width: 100%; text-align: left; font-size: 14px; }
.pj-nocode summary { cursor: pointer; font-weight: 600; color: #cfdbef; text-align: center; list-style: none; text-decoration: underline; text-underline-offset: 3px; opacity: .9; }
.pj-nocode summary::-webkit-details-marker { display: none; }
.pj-nocode form { display: grid; gap: 10px; margin-top: 10px; }

/* Avisos de partido: cartel tipo notificación + tarjeta en el inicio */
.pj-push { position: fixed; z-index: 1000; left: 50%; top: calc(10px + env(safe-area-inset-top)); width: min(440px, calc(100% - 20px)); transform: translate(-50%, -140%); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); background: rgba(250, 252, 255, .97); color: #06122e; border-radius: 20px; padding: 12px 14px 14px; box-shadow: 0 18px 50px rgba(0, 10, 40, .45), 0 0 0 1px rgba(0, 0, 0, .06); display: grid; gap: 4px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pj-push.in { transform: translate(-50%, 0); }
.pj-push-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #5a6782; }
.pj-push-top img { width: 22px; height: 22px; border-radius: 6px; }
.pj-push-top span { flex: 1; }
.pj-push-x { border: 0; background: none; font-size: 16px; color: #5a6782; cursor: pointer; padding: 4px 6px; min-width: 32px; min-height: 32px; }
.pj-push b { font-size: 17px; line-height: 1.25; }
.pj-push p { margin: 0; font-size: 15px; line-height: 1.4; }
.pj-push small { font-size: 12.5px; color: #3c4a68; }
.pj-push-act { margin-top: 8px; }
.pj-push-act .pj-btn { background: #1f7a45; min-height: 48px; }
.pj-alert { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start; border: 2px solid #F9E547; background: #fffbe0; }
.pj-alert.ok { border-color: #2e9e5b; background: #eefaf2; }
.pj-alert-ic { font-size: 30px; line-height: 1; }
.pj-alert b { font-size: 16.5px; }
.pj-alert p { margin: 4px 0; }
.pj-alert small { color: var(--ink-3); }
.pj-alert .pj-btn { grid-column: 1 / -1; background: #1f7a45; }
.pj-notif { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.pj-notif > span { font-size: 26px; }
.pj-notif small { display: block; color: var(--ink-3); margin-top: 2px; }
.pj-notif .pj-btn { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { .pj-push { transition: none; } }
