/* Torneos de pádel · Salguero Torneos / Salguero Eventos / Gambeta Femenina */
:root {
  --acc: #f14a1c; --acc-2: #ff8a5c; --ink: #4f4c4c; --bg: #161414; --bg-2: #211e1e; --card: #2a2626; --line: rgba(255, 255, 255, .1);
  --txt: #f6f3f2; --mut: #b9b1af; --ball: #d9f24a; --ok: #3ccf7c; --bad: #ff5c5c;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
body[data-brand="gambeta-femenina"] { --acc: #3db68b; --acc-2: #73cfab; --ink: #393536; --bg: #141615; --bg-2: #1d201f; --card: #262a28; }
body[data-brand="salguero-eventos"] { --acc: #f14a1c; --acc-2: #ffb08f; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--acc-2); }
button { font: inherit; }
[hidden] { display: none !important; }
.disp { font-family: var(--display); font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }

/* Encabezado */
.pd-h { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(180deg, var(--bg) 70%, rgb(0 0 0 / 0)); }
.pd-h img { width: 46px; height: 46px; object-fit: contain; }
.pd-h h1 { font-family: var(--display); font-size: 24px; line-height: 1; margin: 0; text-transform: uppercase; }
.pd-h small { display: block; color: var(--mut); font-size: 12.5px; margin-top: 3px; }
.pd-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.pd-tabs button { flex: none; border: 1px solid var(--line); background: var(--bg-2); color: var(--txt); border-radius: 99px; padding: 9px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.pd-tabs button.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.pd-main { padding: 0 16px 40px; max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.sec-t { font-family: var(--display); text-transform: uppercase; font-size: 20px; margin: 10px 0 0; color: var(--acc-2); letter-spacing: .02em; }
.mut { color: var(--mut); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgb(255 255 255 / .08); color: var(--mut); white-space: nowrap; }
.chip.live { background: var(--bad); color: #fff; } .chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.chip.done { background: rgb(60 207 124 / .16); color: var(--ok); }
@keyframes blink { 50% { opacity: .2; } }

/* Partido */
.mt { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.mt.live { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.mt-t { font-family: var(--display); font-size: 22px; line-height: 1; text-align: center; } .mt-t small { display: block; font-family: var(--sans); font-size: 11px; color: var(--mut); margin-top: 4px; }
.mt-p { display: grid; gap: 3px; min-width: 0; }
.mt-p div { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 15px; } .mt-p div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-p div.w { color: var(--ball); } .mt-p div b { font-family: var(--display); font-size: 19px; min-width: 34px; text-align: right; }
.mt-p .tbd { color: var(--mut); font-weight: 500; font-style: italic; }
.mt-l { font-size: 11.5px; color: var(--mut); grid-column: 2 / -1; }

/* Tablas */
.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb th { text-align: right; font-size: 11px; color: var(--mut); font-weight: 700; padding: 6px 5px; text-transform: uppercase; }
.tb th:nth-child(2), .tb td:nth-child(2) { text-align: left; }
.tb td { text-align: right; padding: 8px 5px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tb td:first-child { color: var(--mut); width: 22px; } .tb td b { font-family: var(--display); font-size: 17px; }
.tb tr.q1 td:first-child { color: var(--ball); font-weight: 800; } .tb tr.q2 td:first-child { color: #c9d1d9; font-weight: 800; }
.zones { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Cuadro */
.br { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 6px; }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.br-col h4 { margin: 0 0 2px; font-family: var(--display); text-transform: uppercase; font-size: 15px; color: var(--mut); text-align: center; }
.bm { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; position: relative; }
.bm.live { border-color: var(--bad); } .bm.final { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.bm div { display: flex; justify-content: space-between; gap: 6px; font-size: 13.5px; font-weight: 600; } .bm div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm div.w { color: var(--ball); } .bm div b { font-family: var(--display); font-size: 16px; } .bm small { font-size: 10.5px; color: var(--mut); }

/* Jugadores */
.pl-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pc { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, var(--acc) 0%, var(--ink) 58%, var(--bg-2) 100%); aspect-ratio: 3 / 4.2; border: 0; color: #fff; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; }
.pc img, .pc .ph { position: absolute; inset: 0 0 32% 0; width: 100%; height: 68%; object-fit: cover; }
.pc .ph { display: grid; place-items: center; font-family: var(--display); font-size: 64px; color: rgb(255 255 255 / .35); }
.pc .lv { position: absolute; top: 8px; left: 8px; background: var(--ball); color: #111; font-family: var(--display); font-weight: 800; border-radius: 10px; padding: 2px 8px; font-size: 18px; }
.pc .sd { position: absolute; top: 8px; right: 8px; background: rgb(0 0 0 / .45); border-radius: 99px; padding: 3px 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pc .nm { position: relative; padding: 10px 10px 12px; background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / .78) 40%); }
.pc .nm b { display: block; font-family: var(--display); font-size: 21px; line-height: 1; text-transform: uppercase; }
.pc .nm small { color: #e8e1df; font-size: 12px; }

/* Hoja de perfil */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .6); display: grid; align-items: end; justify-items: center; }
.sheet > div { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--bg-2); border-radius: 22px 22px 0 0; padding: 18px 16px 28px; display: grid; gap: 14px; }
.pf-top { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.pf-top .pc { aspect-ratio: 3 / 4; }
.pf-top h2 { font-family: var(--display); font-size: 30px; line-height: .95; margin: 0; text-transform: uppercase; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpis div { background: var(--card); border-radius: 12px; padding: 10px 6px; text-align: center; } .kpis b { display: block; font-family: var(--display); font-size: 26px; color: var(--ball); } .kpis span { font-size: 11px; color: var(--mut); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14px; } .facts span { color: var(--mut); font-size: 12px; display: block; }

/* Formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 0; background: var(--acc); color: #fff; font-weight: 800; padding: 0 16px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); } .btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
label.f { display: grid; gap: 5px; font-size: 13px; color: var(--mut); font-weight: 600; }
.in, select.in, textarea.in { width: 100%; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 99; }
.empty { text-align: center; color: var(--mut); padding: 30px 10px; }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: #2f2b2b; color: #fff; border-radius: 12px; padding: 12px 16px; font-weight: 600; box-shadow: 0 10px 30px rgb(0 0 0 / .4); }
.toast.error { background: #6b1a1a; } .toast.ok { background: #0f5a36; }

/* Logo del cliente (torneos corporativos) */
.cli { display: inline-flex; align-items: center; gap: .5em; background: #fff; border-radius: 12px; padding: .35em .75em; flex: none; }
.cli[hidden] { display: none; }
.cli small { color: #4F4C4C; font-weight: 800; text-transform: uppercase; font-size: .62em; letter-spacing: .08em; margin: 0; }
.cli img { height: 1.9em; width: auto; display: block; }
.pd-h .cli { margin-left: auto; font-size: 13px; }

/* Marca blanca: el logo del cliente suele ser horizontal */
body[data-brand="marca-cliente"] .pd-h img[data-brand-logo] { width: auto; height: 30px; max-width: 120px; object-fit: contain; }
