/* =====================================================================
   Americano Miura · estilos
   Identidad Miura Capital (paleta, DM Sans, flechas, logo) con tratamiento
   de vidrio (glassmorphism) pedido para esta app: paneles translúcidos con
   desenfoque sobre el degradado verde de marca. Mobile-first: en teléfono
   vertical es una columna; el bloque «Responsive» del final la adapta a
   teléfono horizontal, tablet y escritorio.
   Desviación declarada del manual Miura: el manual reserva el desenfoque para
   el fondo de los diálogos; acá se usa en todas las superficies por pedido.
   ===================================================================== */

:root {
  /* Paleta Miura */
  --teal-100: #005154; --teal-80: #337476; --teal-60: #669798; --teal-40: #99b9bb; --teal-20: #ccdcdd;
  --turq-100: #008582; --turq-80: #339d9b; --turq-60: #66b6b4; --turq-40: #99cecd; --turq-20: #cce7e6;
  --sky-100: #a4c8f0; --sky-60: #c8def6; --sky-20: #edf4fc;
  --blue-100: #5b809f; --blue-60: #9db3c5;
  --mist-100: #d9dae4; --mist-20: #f7f8fa;
  --ground: #00373a;

  /* Texto sobre vidrio oscuro (contraste medido sobre #0b4b4e) */
  --t1: #ffffff;            /* 9,9:1 */
  --t2: var(--teal-20);     /* 7,6:1 */
  --t3: var(--teal-40);     /* 5,1:1 */
  --accent: var(--sky-100); /* 6,9:1 */
  --gain: var(--turq-40);
  --loss: var(--blue-60);

  /* Vidrio */
  --glass: rgba(255, 255, 255, .08);
  --glass-2: rgba(255, 255, 255, .12);
  --glass-3: rgba(255, 255, 255, .18);
  --glass-line: rgba(255, 255, 255, .16);
  --glass-line-2: rgba(255, 255, 255, .26);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .22);
  --glass-shadow: 0 10px 30px rgba(0, 20, 22, .28);
  --blur: blur(18px) saturate(150%);
  --well: rgba(0, 30, 32, .32);

  --font: "DM Sans", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --ease: cubic-bezier(.4, 0, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  --fast: 160ms; --base: 240ms; --slow: 420ms;
  --app: 520px;
}
@media (prefers-reduced-motion: reduce) { :root { --fast: 0ms; --base: 0ms; --slow: 0ms; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--t1); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--ground);
}
/* Fondo de marca: degradado libre Miura con dos luces suaves que dan cuerpo al vidrio */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 10% 0%, rgba(0, 133, 130, .85) 0%, rgba(0, 133, 130, 0) 70%),
    radial-gradient(55% 40% at 100% 38%, rgba(164, 200, 240, .28) 0%, rgba(164, 200, 240, 0) 70%),
    radial-gradient(70% 50% at 20% 100%, rgba(0, 81, 84, .9) 0%, rgba(0, 81, 84, 0) 70%),
    linear-gradient(170deg, #00494c 0%, #00373a 55%, #002b2e 100%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.lucide { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--sky-100); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: var(--app); margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px rgba(0, 0, 0, .35); }
}

/* ---------- Tipografía ---------- */
.eyebrow { font-weight: 400; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); line-height: 1.35; }
.eyebrow.dim { color: var(--t3); }
.h1 { font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -.03em; }
.h2 { font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -.025em; }
.h3 { font-weight: 700; font-size: 19px; line-height: 1.2; letter-spacing: -.015em; }
.muted { color: var(--t2); }
.dim { color: var(--t3); }
.small { font-size: 14px; }
.caps { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); }

/* ---------- Superficies de vidrio ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-lg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-hi), var(--glass-shadow);
}
.glass.strong { background: var(--glass-2); border-color: var(--glass-line-2); }
.glass.pad { padding: var(--s5); }
.glass.tap { cursor: pointer; transition: background var(--base) var(--ease), border-color var(--base) var(--ease); }
.glass.tap:hover { background: var(--glass-2); border-color: var(--glass-line-2); }
.glass.tap:active { background: var(--glass-3); }
.well { background: var(--well); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-md); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.x-row { flex-wrap: wrap; }
.x-row > .row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s3);
  height: calc(60px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--s4) 0;
  background: rgba(0, 46, 49, .55); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar .logo { height: 22px; width: auto; }
.topbar .title { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.topbar .title small { display: block; font-size: 12px; font-weight: 500; color: var(--t3); letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.marks { display: inline-flex; gap: 6px; color: var(--t1); }
.marks svg { width: 12px; height: 12px; display: block; overflow: hidden; }

.page { padding: var(--s5) var(--s4) calc(112px + env(safe-area-inset-bottom)); }
.page > * + * { margin-top: var(--s4); }
.fade { animation: rise var(--base) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px;
  padding: 0 var(--s5); border-radius: var(--r-md); border: 1px solid transparent; font-weight: 700; font-size: 15px;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), opacity var(--fast);
  white-space: nowrap; text-decoration: none; user-select: none;
}
.btn.primary { background: #fff; color: var(--teal-100); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.btn.primary:hover { background: var(--sky-20); }
.btn.primary:active { background: var(--sky-60); }
.btn.glassy { background: var(--glass-2); border-color: var(--glass-line-2); color: var(--t1); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-hi); }
.btn.glassy:hover { background: var(--glass-3); }
.btn.ghost { background: transparent; color: var(--t1); }
.btn.ghost:hover { background: var(--glass); }
.btn.danger { background: transparent; border-color: rgba(255, 255, 255, .2); color: var(--t2); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 16px; border-radius: var(--r-lg); }
.btn.sm { min-height: 38px; padding: 0 var(--s3); font-size: 14px; border-radius: var(--r-sm); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--t1); flex: none;
  transition: background var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--glass-2); }
.icon-btn.glassy { background: var(--glass-2); border-color: var(--glass-line); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Formularios ---------- */
.label { display: block; font-weight: 600; font-size: 14px; color: var(--t2); margin-bottom: var(--s2); }
.input {
  width: 100%; min-width: 0; height: 50px; padding: 0 var(--s4); border-radius: var(--r-md);
  background: var(--well); border: 1px solid rgba(255, 255, 255, .18); color: var(--t1); font-size: 16px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.input::placeholder { color: var(--t3); }
.input:focus { outline: none; border-color: var(--sky-100); background: rgba(0, 30, 32, .45); }
.input.big { height: 56px; font-size: 19px; font-weight: 700; }
.add-row { display: flex; gap: var(--s2); }
.add-row .input { flex: 1; }
.seg {
  display: flex; padding: 4px; gap: 4px; border-radius: var(--r-md); background: var(--well);
  border: 1px solid rgba(255, 255, 255, .12);
}
.seg button {
  flex: 1; min-height: 42px; padding: 0 var(--s3); border: 0; border-radius: 9px; background: transparent;
  color: var(--t2); font-weight: 700; font-size: 15px; transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.seg button:hover { color: var(--t1); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--teal-100); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 0 auto; }
.stepper { display: inline-flex; align-items: center; border-radius: var(--r-md); background: var(--well); border: 1px solid rgba(255, 255, 255, .14); }
.stepper button { width: 46px; height: 48px; border: 0; background: none; display: grid; place-items: center; color: var(--t1); }
.stepper button:disabled { opacity: .35; }
.stepper output { min-width: 52px; text-align: center; font-weight: 800; font-size: 20px; }
.hint { font-size: 13px; color: var(--t3); margin-top: var(--s2); line-height: 1.45; }
.field + .field { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid rgba(255, 255, 255, .1); }

/* ---------- Chips, badges, etiquetas ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--pill);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; background: var(--glass-2); color: var(--t1); white-space: nowrap;
  border: 1px solid var(--glass-line);
}
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sky-100); box-shadow: 0 0 0 3px rgba(164, 200, 240, .25); }
.badge.white { background: #fff; color: var(--teal-100); border-color: #fff; }
.badge.burro { background: #f3d6da; color: #5a2a33; border-color: #f3d6da; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--glass); border: 1px solid var(--glass-line); font-size: 14px; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.nosuma { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ground); background: var(--sky-100); border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }

/* ---------- Avatares (cuadrado redondeado: la marca evita lo circular) ---------- */
.av {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px;
  border-radius: 12px; background: linear-gradient(150deg, var(--turq-100), var(--teal-100));
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.02em; border: 1px solid rgba(255, 255, 255, .25);
}
.av > img.ph { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av.xs { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.av.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.av.xl { width: 104px; height: 104px; border-radius: 26px; font-size: 36px; }
.av .ears { position: absolute; left: -22%; width: 144%; bottom: 72%; height: auto; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.av.burro { margin-top: 18%; }
.avs { display: inline-flex; }
.avs .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--ground); }
.avs .av:first-child { margin-left: 0; }

/* ---------- Navegación inferior ---------- */
.bnav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40; width: 100%; max-width: var(--app);
  display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(0, 40, 43, .62); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.bnav button {
  height: 56px; border: 0; background: none; border-radius: var(--r-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--t3);
}
.bnav button .lucide { width: 22px; height: 22px; }
.bnav button[aria-selected="true"] { color: var(--t1); background: var(--glass-2); box-shadow: var(--glass-hi); }

/* Barra de acción fija (formularios) */
.cta-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40; width: 100%; max-width: var(--app);
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: rgba(0, 40, 43, .7); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid rgba(255, 255, 255, .12);
}
.cta-bar .meta { flex: 1; min-width: 0; line-height: 1.3; }
.cta-bar .meta b { display: block; font-size: 15px; }
.cta-bar .meta small { color: var(--t3); font-size: 13px; }

/* ---------- Inicio ---------- */
.hero { padding: var(--s6) var(--s5); position: relative; overflow: hidden; }
.hero .h1 { margin-top: var(--s3); }
.hero p { margin-top: var(--s3); color: var(--t2); font-size: 16px; }
.hero .cta { margin-top: var(--s5); }
.rule { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.rule::before { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .25); }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.bento .tile { padding: var(--s4); min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s2); text-align: left; color: var(--t1); }
.bento .tile .lucide { width: 24px; height: 24px; color: var(--accent); }
.bento .tile b { font-size: 16px; }
.bento .tile small { color: var(--t3); font-size: 13px; display: block; }
.bento .wide { grid-column: 1 / -1; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: var(--s6) 2px var(--s3); }
.section-title + * { margin-top: 0 !important; }
.game-card { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); text-align: left; width: 100%; color: var(--t1); }
.game-card .gc-top { display: flex; align-items: center; gap: var(--s2); }
.game-card .gc-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.2; }
.game-card .gc-meta { font-size: 13px; color: var(--t3); }
.prog { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.prog > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--turq-60), var(--sky-100)); transition: width var(--slow) var(--ease-out); }
.list { display: flex; flex-direction: column; gap: var(--s2); }
.empty { text-align: center; padding: var(--s8) var(--s5); }
.empty .lucide { width: 28px; height: 28px; color: var(--accent); }
.empty h3 { margin-top: var(--s3); font-size: 18px; }
.empty p { margin-top: var(--s2); color: var(--t3); font-size: 14px; }

/* ---------- Nuevo juego ---------- */
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.type-pick button { padding: var(--s4); text-align: left; color: var(--t1); display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.type-pick button .lucide { width: 24px; height: 24px; color: var(--accent); }
.type-pick button b { font-size: 17px; }
.type-pick button small { color: var(--t3); font-size: 13px; line-height: 1.35; }
.type-pick.three { grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.type-pick.three button { padding: var(--s3); min-height: 104px; }
.type-pick.three button b { font-size: 15px; }
.type-pick.three button small { font-size: 12px; }
.type-pick.four { gap: var(--s2); }
.type-pick.four button { flex-direction: row; align-items: center; gap: var(--s3); min-height: 0; padding: var(--s3); }
.type-pick.four button > span { display: flex; flex-direction: column; min-width: 0; }
.type-pick.four button b { font-size: 15px; }
.type-pick.four button small { font-size: 12px; }
.type-pick.four button .lucide { flex: none; }
.type-pick button[aria-pressed="true"] { background: rgba(255, 255, 255, .2); border-color: #fff; box-shadow: var(--glass-hi), 0 0 0 1px #fff, var(--glass-shadow); }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s2); }
.pick {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s3) 6px;
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--glass-line); color: var(--t2);
  font-size: 13px; font-weight: 600; text-align: center; min-width: 0; transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.pick span { max-width: 100%; overflow: hidden; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.pick[aria-pressed="true"] { background: rgba(255, 255, 255, .2); border-color: #fff; color: #fff; }
.pick[aria-pressed="true"]::after { content: ""; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 5px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005154' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat; }
.counter { font-weight: 800; }
.counter small { color: var(--t3); font-weight: 500; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255, 255, 255, .12); border-radius: var(--r-md); overflow: hidden; }
.kpis > div { background: rgba(0, 46, 49, .55); padding: var(--s3) var(--s4); }
.kpis .v { font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.kpis .v.sm { font-size: 17px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis .k { font-size: 12px; color: var(--t3); font-weight: 500; }

/* ---------- Juego: cabecera y rondas ---------- */
.ghead { padding: var(--s5); }
.ghead .h2 { margin-top: var(--s2); word-break: break-word; }
.ghead .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: var(--s3); font-size: 14px; color: var(--t2); }
.ghead .meta span { display: inline-flex; align-items: center; gap: 6px; }
.ghead .prog { margin-top: var(--s4); }
.ghead .pct { font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.strip { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: 0 -2px; }
.strip::-webkit-scrollbar { display: none; }
.rchip {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--glass-line); background: var(--glass);
  font-weight: 800; font-size: 15px; color: var(--t2); position: relative;
}
.rchip.done { background: rgba(255, 255, 255, .22); color: #fff; border-color: rgba(255, 255, 255, .3); }
.rchip.live::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--sky-100); }
.rchip[aria-current="true"] { background: #fff; color: var(--teal-100); border-color: #fff; }
.round-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

.court { padding: var(--s4); cursor: pointer; display: block; width: 100%; text-align: left; color: var(--t1); }
.court-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.court-top .cn { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.court-top .cn b { color: #fff; letter-spacing: .08em; margin-left: 4px; }
.court-top .st { font-size: 12px; font-weight: 700; color: var(--t3); display: inline-flex; align-items: center; gap: 6px; }
.court-top .st.final { color: #fff; }
.pitch { position: relative; aspect-ratio: 2 / 1; margin: var(--s3) 0; border-radius: 6px; background: rgba(0, 30, 32, .25); }
.pitch svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pitch .lines * { fill: none; stroke: var(--sky-100); stroke-width: 1.5px; vector-effect: non-scaling-stroke; opacity: .85; }
.pitch .lines .net { stroke: #fff; opacity: 1; }
.side { position: absolute; top: 0; bottom: 0; width: 50%; display: grid; grid-template-rows: 1fr 1fr; align-items: center; transition: background var(--base) var(--ease); }
.side.a { left: 0; grid-template-columns: 30.5% 1fr; border-radius: 6px 0 0 6px; }
.side.b { right: 0; grid-template-columns: 1fr 30.5%; border-radius: 0 6px 6px 0; }
.side.win { background: rgba(255, 255, 255, .12); }
.side .sc { grid-row: 1 / 3; text-align: center; font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: -.03em; }
.side.a .sc { grid-column: 1; } .side.b .sc { grid-column: 2; }
.side .pl { min-width: 0; padding: 0 6px; font-weight: 700; font-size: 15px; line-height: 1.15; text-align: center; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.side.a .pl { grid-column: 2; } .side.b .pl { grid-column: 1; }
.side .p1 { grid-row: 1; } .side .p2 { grid-row: 2; }
.side.lose .pl { color: var(--t3); }
.side.lose .sc { color: var(--t2); }
.vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: var(--ground); border: 1.5px solid #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.setline { text-align: center; font-size: 14px; font-weight: 700; color: var(--t2); letter-spacing: .02em; margin: -4px 0 var(--s3); }
.court-cta { display: flex; align-items: center; justify-content: center; gap: var(--s2); height: 46px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--glass-line); font-weight: 700; font-size: 15px; }
.court.done .court-cta { background: transparent; border-color: transparent; color: var(--t3); }
.court .fill-note { font-size: 12px; color: var(--t3); text-align: center; margin-top: -4px; margin-bottom: var(--s3); }
.rest { padding: var(--s4); }
.round-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }

/* ---------- Tablas ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--s2); align-items: end; }
.pod { padding: var(--s3); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pod.p1 { padding: var(--s4) var(--s3); background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); }
.pod .rk { font-weight: 800; font-size: 26px; letter-spacing: -.03em; line-height: 1; color: var(--accent); }
.pod.p1 .rk { font-size: 40px; color: #fff; }
.pod .pn { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pv { font-weight: 800; font-size: 19px; }
.pod .pv small { display: block; font-size: 11px; font-weight: 500; color: var(--t3); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); text-align: right; padding: var(--s3) 6px; border-bottom: 1px solid rgba(255, 255, 255, .12); white-space: nowrap; }
.tbl th:nth-child(1), .tbl th:nth-child(2) { text-align: left; }
.tbl td { padding: 0 6px; height: 56px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: right; font-size: 15px; color: var(--t2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.pos { text-align: left; width: 34px; font-weight: 800; color: var(--t3); padding-left: var(--s4); }
.tbl td.pos.top { color: var(--accent); }
.tbl td.who { text-align: left; color: #fff; font-weight: 600; max-width: 0; width: 46%; }
.tbl td.who .row { gap: 10px; }
.tbl td.big { font-weight: 800; font-size: 17px; color: #fff; padding-right: var(--s4); }
.tbl tr.first td { background: rgba(255, 255, 255, .07); }
.tbl .gain { color: var(--gain); font-weight: 700; } .tbl .loss { color: var(--loss); font-weight: 700; }
.tbl-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4); flex-wrap: wrap; }
.tbl-note { padding: var(--s3) var(--s4) var(--s4); font-size: 12px; color: var(--t3); border-top: 1px solid rgba(255, 255, 255, .08); }
.prk { display: grid; grid-template-columns: 26px minmax(0, 1fr) 52px 44px; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid rgba(255, 255, 255, .08); }
.prk.head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); padding-top: var(--s2); padding-bottom: var(--s2); }
.prk .n { font-weight: 800; color: var(--t3); }
.prk .nm { min-width: 0; font-weight: 600; }
.prk .nm span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prk .nm small { display: block; font-size: 12px; color: var(--t3); font-weight: 500; }
.prk > :nth-child(3), .prk > :nth-child(4) { text-align: right; }
.prk .big { font-weight: 800; }
.gain { color: var(--gain); } .loss { color: var(--loss); }

/* Burriquita */
.burro-card { padding: var(--s4); display: flex; align-items: center; gap: var(--s4); background: linear-gradient(120deg, rgba(243, 214, 218, .22), rgba(255, 255, 255, .06)); }
.bento .tile.burro-card { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 0; padding-top: var(--s5); }
.burro-card b { font-size: 18px; letter-spacing: -.01em; }
.burro-card small { display: block; color: var(--t2); font-size: 13px; }

/* ---------- Calendario ---------- */
.select {
  width: 100%; height: 50px; padding: 0 44px 0 var(--s4); border-radius: var(--r-md); background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23ffffff' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid rgba(255, 255, 255, .18); -webkit-appearance: none; appearance: none; font-weight: 700; color: #fff;
}
.select option { color: #000; }
.cal-round { padding: var(--s4); }
.cal-round .rn { font-weight: 800; font-size: 17px; }
.cal-round .rs { font-size: 12px; font-weight: 700; color: var(--t3); }
.cal-round .rs.ok { color: var(--gain); }
.cm { display: grid; grid-template-columns: 24px 1fr auto 1fr; gap: var(--s2); align-items: center; min-height: 38px; font-size: 14px; }
.cm + .cm { border-top: 1px solid rgba(255, 255, 255, .08); }
.cm .c { font-size: 11px; font-weight: 800; color: var(--t3); }
.cm .t { min-width: 0; color: var(--t2); }
.cm .t.r { text-align: right; }
.cm .t.w { color: #fff; font-weight: 700; }
.cm .s { font-weight: 800; min-width: 56px; text-align: center; }
.cm .s.none { color: var(--t3); font-weight: 500; }
.me-row { display: grid; grid-template-columns: 70px 1fr auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); font-size: 14px; }
.me-row + .me-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.me-row .rn { font-weight: 700; } .me-row .rn small { display: block; color: var(--t3); font-weight: 500; font-size: 12px; }
.me-row.off { color: var(--t3); }
.me-row .res { font-weight: 800; text-align: right; } .me-row .res small { display: block; font-size: 12px; font-weight: 700; }

/* ---------- Jugadores ---------- */
.prow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); width: 100%; background: none; border: 0; color: var(--t1); text-align: left; }
.prow + .prow { border-top: 1px solid rgba(255, 255, 255, .08); }
.prow b { display: block; font-weight: 700; }
.prow small { display: block; font-size: 13px; color: var(--t3); }
.profile { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; padding: var(--s2) 0 var(--s4); }
.photo-actions { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }

/* ---------- Torneo (cuadro y backdraw) ---------- */
.pair-list { margin-top: var(--s3); border-radius: var(--r-md); background: var(--well); border: 1px solid rgba(255, 255, 255, .1); }
.pair-row { display: flex; align-items: center; gap: var(--s2); padding: 4px 4px 4px var(--s3); font-size: 14px; font-weight: 600; min-height: 44px; }
.pair-row + .pair-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.pair-row .pn { width: 20px; flex: none; color: var(--t3); font-weight: 800; font-size: 12px; }
.icon-btn.sm { width: 36px; height: 36px; flex: none; }
.mrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2px var(--s2); align-items: center; padding: var(--s3) var(--s4); font-size: 14px; }
.mrow + .mrow { border-top: 1px solid rgba(255, 255, 255, .08); }
.mrow.tap { cursor: pointer; }
.mrow.tap:hover { background: var(--glass); }
.mrow .ml { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.mrow .mt { min-width: 0; color: var(--t2); line-height: 1.3; }
.mrow .mt.r { text-align: right; }
.mrow .mt.w { color: #fff; font-weight: 700; }
.mrow .ms { font-weight: 800; text-align: center; min-width: 44px; }
.mrow .ms.none { color: var(--t3); font-weight: 500; }
.champ { display: flex; align-items: center; gap: var(--s4); }
.champ .avs, .pair-row .avs { gap: 4px; }
.champ .avs .av, .pair-row .avs .av { margin-left: 0; box-shadow: none; }
.champ > .lucide { width: 26px; height: 26px; color: var(--accent); flex: none; align-self: flex-start; }

/* Torneo desde Excel */
.imp-cta { display: flex; align-items: center; gap: var(--s3); }
.imp-cta label.btn { flex: none; cursor: pointer; }
.imp-g { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin: var(--s4) 0 var(--s2); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.imp-g:first-child { margin-top: 0; }
.imp-g small { font-size: 11px; letter-spacing: .04em; color: var(--t3); text-transform: none; font-weight: 600; }
.imp-vs { text-align: center; font-size: 11px; font-weight: 800; color: var(--t3); margin: 4px 0; text-transform: uppercase; letter-spacing: .12em; }
.imp-pair { display: flex; gap: var(--s2); align-items: center; border-radius: var(--r-md); background: var(--well); border: 1px solid rgba(255, 255, 255, .1); padding: 4px 8px 4px 10px; }
.imp-pair .pn { width: 20px; flex: none; color: var(--t3); font-weight: 800; font-size: 12px; }
.imp-row { display: flex; align-items: center; gap: var(--s2); min-height: 52px; }
.imp-row + .imp-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.imp-row .grow { display: flex; flex-direction: column; min-width: 0; }
.imp-row b { font-size: 14px; }
.imp-row small { font-size: 12px; color: var(--t3); }
.imp-row.bad small { color: var(--sky-100); font-weight: 700; }
.select.sm { width: 128px; flex: none; height: 38px; font-size: 13px; padding: 0 30px 0 10px; background-position: right 8px center; }
.bnav button span { text-align: center; line-height: 1.15; }
.prow .plc { width: 32px; flex: none; text-align: center; font-weight: 800; color: var(--accent); }

/* ---------- Hojas y diálogos ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 18, 20, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; align-items: flex-end; justify-content: center; animation: fadein var(--base) var(--ease) both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: var(--app); max-height: 94vh; max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: rgba(0, 52, 55, .82); -webkit-backdrop-filter: blur(28px) saturate(150%); backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--glass-line-2); border-bottom: 0; box-shadow: var(--glass-hi), 0 -20px 60px rgba(0, 0, 0, .4);
  padding-bottom: env(safe-area-inset-bottom); animation: sheetin var(--slow) var(--ease-out) both;
}
.noanim { animation: none !important; }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); margin: 10px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s4) var(--s4) 0; }
.sheet-head .h3 { margin-top: 4px; }
.sheet-body { padding: var(--s4); }
.sheet-actions { position: sticky; bottom: 0; display: flex; gap: var(--s3); padding: var(--s3) var(--s4) var(--s4); margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4)); background: rgba(0, 46, 49, .92); border-top: 1px solid rgba(255, 255, 255, .1); }
.sheet-actions .btn.primary { flex: 1; }
.dialog .sheet-actions { position: static; margin: var(--s5) 0 0; padding: 0; background: none; border: 0; }

.board { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2); padding: var(--s3); border-radius: var(--r-lg); background: var(--well); border: 1px solid rgba(255, 255, 255, .12); }
.team { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; border-radius: var(--r-md); padding: var(--s3) 6px; border: 1.5px solid transparent; cursor: pointer; transition: background var(--base), border-color var(--base); }
.team.sel { background: rgba(255, 255, 255, .14); border-color: var(--sky-100); }
.team .tg { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.team .tg.off { color: var(--t3); font-weight: 500; }
.team .tn { font-weight: 700; font-size: 15px; line-height: 1.25; max-width: 100%; }
.team .tn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .tsc { font-size: 54px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.team .tsc.empty { color: var(--t3); font-weight: 300; padding: 0; } /* .empty es también el estado vacío genérico: sin su relleno de 32 px */
.team .tst { display: flex; gap: 6px; }
.team .tst button { width: 46px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--glass-line-2); background: var(--glass); color: #fff; display: grid; place-items: center; }
.board .dash { align-self: center; font-size: 28px; font-weight: 300; color: var(--accent); }
.pick-label { display: flex; justify-content: space-between; gap: var(--s3); margin: var(--s4) 0 var(--s2); font-weight: 700; font-size: 14px; }
.pick-label span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-label span:last-child { flex: none; color: var(--t3); font-weight: 500; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.picks button { height: 44px; border-radius: var(--r-sm); border: 1px solid var(--glass-line); background: var(--glass); font-weight: 800; font-size: 15px; color: #fff; }
.picks button[aria-pressed="true"] { background: #fff; color: var(--teal-100); border-color: #fff; }
.set-block { margin-top: var(--s4); }
.set-block .between { margin-bottom: var(--s2); }
.set-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.set-row + .set-row { margin-top: 6px; }
.set-row.stb { grid-template-columns: repeat(6, 1fr); }
.set-row.nums { grid-template-columns: repeat(8, 1fr); gap: 4px; }
.set-row.nums button { height: 44px; font-size: 16px; }
.set-row button { height: 42px; border-radius: var(--r-sm); border: 1px solid var(--glass-line); background: var(--glass); font-weight: 800; font-size: 14px; color: #fff; padding: 0; }
.set-row button[aria-pressed="true"] { background: #fff; color: var(--teal-100); border-color: #fff; }
.stb-box { margin-top: var(--s3); padding: var(--s3); border-radius: var(--r-md); border: 1px dashed var(--sky-100); background: rgba(164, 200, 240, .08); }
.stb-t { font-weight: 800; font-size: 14px; color: var(--sky-100); }
.stb-t small { display: block; font-weight: 600; font-size: 12px; color: var(--t2); margin-top: 2px; }
.set-who { font-size: 12px; color: var(--t3); margin: 8px 0 4px; font-weight: 600; }
.dialog { width: 100%; max-width: var(--app); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s6) var(--s5) calc(var(--s6) + env(safe-area-inset-bottom)); background: rgba(0, 52, 55, .9); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); border: 1px solid var(--glass-line-2); border-bottom: 0; animation: sheetin var(--slow) var(--ease-out) both; }
.dialog p { margin-top: var(--s2); color: var(--t2); }
.share-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); width: 100%; text-align: left; color: #fff; border-radius: var(--r-md); }
.share-item .ic { width: 44px; height: 44px; border-radius: var(--r-md); background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: none; color: var(--accent); }
.share-item b { display: block; font-weight: 700; }
.share-item small { display: block; color: var(--t3); font-size: 13px; line-height: 1.35; }

/* Avisos */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 80; width: calc(100% - 32px); max-width: 480px; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: rgba(255, 255, 255, .94); color: var(--teal-100); font-weight: 600; font-size: 15px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); animation: rise var(--base) var(--ease-out) both; }
.net-pill { position: fixed; top: calc(68px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 35; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .92); color: var(--teal-100); font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.net-pill .lucide { width: 16px; height: 16px; }

/* ---------- Documento PDF (solo impresión) ---------- */
#print { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body::before { display: none; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #2b3c3d; font-family: var(--font); font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid var(--teal-100); margin-bottom: 16px; }
.pr-head img { height: 34px; width: auto; }
.pr-meta { text-align: right; }
.pr-eyebrow { font-size: 8pt; letter-spacing: .16em; text-transform: uppercase; color: var(--turq-100); font-weight: 500; }
.pr-head h1 { font-size: 22pt; font-weight: 800; color: var(--teal-100); letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; }
.pr-head p { font-size: 9pt; color: #5a6b6c; }
#print h2 { font-size: 13pt; font-weight: 700; color: var(--teal-100); margin: 18px 0 8px; break-after: avoid; }
#print h3 { font-size: 10.5pt; font-weight: 700; color: var(--teal-100); margin: 0 0 6px; }
.pr-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pr-t th { background: var(--teal-100); color: #fff; font-size: 7.5pt; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding: 5px 6px; text-align: center; }
.pr-t td { padding: 4px 6px; border-bottom: 1px solid var(--mist-100); text-align: center; font-size: 9.5pt; color: #404040; }
.pr-t tr:nth-child(even) td { background: var(--mist-20); }
.pr-t .l { text-align: left; } .pr-t .r { text-align: right; } .pr-t .b { font-weight: 700; color: var(--teal-100); }
.pr-t tr.pr-top td { font-weight: 600; }
.pr-t tr { break-inside: avoid; }
.pr-note { font-size: 8pt; color: #526162; margin-top: 6px; }
.pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pr-foot { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--mist-100); font-size: 8pt; color: #5a6b6c; }

/* ---------- Torneo: encabezado, canchas, llaves y festejos ----------
   Acento «pelota de pádel» (#dff04a) solo en lo que está en vivo, en el camino del
   ganador y en el trofeo, para que el torneo se sienta como un evento. */
:root { --ball: #dff04a; --ball-ink: #1e2a00; --ball-glow: rgba(223, 240, 74, .35); --line: rgba(255, 255, 255, .2); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(223, 240, 74, .55); } 70% { box-shadow: 0 0 0 8px rgba(223, 240, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(223, 240, 74, 0); } }
@keyframes popin { from { opacity: 0; transform: scale(.9) translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chip.live i, .lv.on i, .ct i, .tk.now .dot { animation: none !important; } }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; background: var(--glass-2); border: 1px solid var(--glass-line); color: var(--t2); white-space: nowrap; flex: none; }
.chip .lucide { width: 14px; height: 14px; }
.chip.live { color: #fff; background: rgba(223, 240, 74, .12); border-color: rgba(223, 240, 74, .45); }
.chip.gold { color: var(--ball-ink); background: var(--ball); border-color: var(--ball); }
.chip.live i, .lv.on i, .ct i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ball); animation: pulse 1.6s infinite; }

.thero { padding: var(--s5); position: relative; overflow: hidden; }
.thero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(223, 240, 74, .2), rgba(223, 240, 74, 0) 70%); pointer-events: none; }
.thero .h2 { margin-top: var(--s2); word-break: break-word; }
.track { position: relative; display: flex; justify-content: space-between; margin-top: var(--s5); }
.track::before, .track::after { content: ""; position: absolute; left: 28px; top: 15px; height: 3px; border-radius: 3px; }
.track::before { right: 28px; background: rgba(255, 255, 255, .14); }
.track::after { width: calc((100% - 56px) * var(--p)); background: linear-gradient(90deg, var(--turq-60), var(--ball)); transition: width var(--slow) var(--ease-out); }
.tk { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 56px; }
.tk .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #0b4b4e; border: 2px solid rgba(255, 255, 255, .22); color: var(--t3); font-size: 12px; }
.tk .dot .lucide { width: 16px; height: 16px; }
.tk small { font-size: 11px; font-weight: 700; color: var(--t3); text-align: center; line-height: 1.1; }
.tk.done .dot { background: var(--turq-100); border-color: var(--turq-60); color: #fff; }
.tk.now .dot { background: var(--ball); border-color: var(--ball); color: var(--ball-ink); animation: pulse 1.6s infinite; }
.tk.now small { color: #fff; }
.tk.cup .dot { border-style: dashed; }
.tk.cup.done .dot { background: var(--ball); color: var(--ball-ink); border: 2px solid var(--ball); box-shadow: 0 0 18px var(--ball-glow); }
.tstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: var(--s5); }
.tstats > div { border-radius: var(--r-md); background: var(--well); border: 1px solid rgba(255, 255, 255, .08); padding: 10px 4px; text-align: center; min-width: 0; }
.tstats b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.tstats b i { font-style: normal; font-size: 13px; color: var(--t3); font-weight: 700; }
.tstats small { display: block; font-size: 11px; color: var(--t3); font-weight: 600; margin-top: 2px; }

.tv-cta { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 14px var(--s4); border-radius: var(--r-lg); border: 1px solid rgba(223, 240, 74, .35); background: linear-gradient(120deg, rgba(223, 240, 74, .16), rgba(164, 200, 240, .08)); color: #fff; text-align: left; transition: transform var(--fast) var(--ease); }
.tv-cta .ic { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--ball); color: var(--ball-ink); flex: none; }
.tv-cta .ic .lucide { width: 22px; height: 22px; }
.tv-cta b { display: block; font-size: 16px; }
.tv-cta small { display: block; font-size: 13px; color: var(--t2); }
.tv-cta:active { transform: scale(.985); }

/* Tarjeta de cancha del torneo */
.court-top.tc { justify-content: flex-start; }
.court-top.tc .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cbadge { width: 54px; height: 54px; flex: none; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sky-100); color: var(--teal-100); line-height: 1; }
.cbadge small { font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cbadge b { font-size: 26px; font-weight: 800; margin-top: 2px; }
.cbadge.wait { background: var(--glass-2); color: var(--t2); border: 1px dashed var(--glass-line-2); }
.cbadge.wait .lucide { width: 22px; height: 22px; }
.court.live { border-color: rgba(223, 240, 74, .42); }
.court.live .cbadge { background: var(--ball); color: var(--ball-ink); box-shadow: 0 6px 18px rgba(223, 240, 74, .25); }
.stg { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--t3); }
.lv.on, .lv.done { color: #fff; }
.lv .lucide { width: 14px; height: 14px; }
.stakes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: -4px 0 var(--s3); }
.stakes span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--well); min-width: 0; }
.stakes .lucide { grid-row: 1 / 3; width: 18px; height: 18px; }
.stakes .up .lucide { color: var(--ball); }
.stakes .down .lucide { color: var(--blue-60); }
.stakes small { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); line-height: 1.3; }
.stakes b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.champ.gold { border-color: rgba(223, 240, 74, .5); background: linear-gradient(135deg, rgba(223, 240, 74, .18), rgba(255, 255, 255, .06)); box-shadow: 0 12px 32px rgba(0, 20, 22, .3); }
.champ.gold > .lucide { color: var(--ball); }
.prow .plc.gold { color: var(--ball); }
.prow .plc.silver { color: #fff; }
.prow .plc.bronze { color: var(--turq-40); }

/* Llaves */
.bk-title { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s4) 0 0; scroll-margin-top: 130px; }
.bk-title .small { margin-top: 2px; }
.sticky-seg { position: sticky; top: calc(68px + env(safe-area-inset-top)); z-index: 6; background: rgba(0, 46, 49, .96); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.bk { display: flex; gap: 24px; overflow-x: auto; padding: 2px 6px var(--s3); margin: 0 -6px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.bk-col { flex: none; width: 172px; display: flex; flex-direction: column; scroll-snap-align: start; }
.bk-col.cup { width: 116px; }
.bk-h { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s2) 4px; white-space: nowrap; }
.bk-ms { display: flex; flex-direction: column; height: calc(var(--n) * 100px); }
.bk-slot { flex: 1; min-height: 0; display: flex; align-items: center; position: relative; }
.bk-slot > * { width: 100%; }
.bk-col:not(.cup) .bk-slot::after { content: ""; position: absolute; left: 100%; top: 50%; width: 12px; border-top: 2px solid var(--line); }
.bk-col.join .bk-slot::before { content: ""; position: absolute; left: calc(100% + 11px); height: calc(50% + 1px); border-left: 2px solid var(--line); }
.bk-col.join .bk-slot:nth-child(odd)::before { top: 50%; }
.bk-col.join .bk-slot:nth-child(even)::before { bottom: 50%; }
.bk-col.in .bk-slot > *::before { content: ""; position: absolute; right: 100%; top: 50%; width: 12px; border-top: 2px solid var(--line); }
.bk-slot.done::after, .bk-col.join .bk-slot.done::before { border-color: var(--ball) !important; }
.bk-m { position: relative; border-radius: var(--r-sm); background: rgba(0, 44, 47, .78); border: 1px solid var(--glass-line); transition: border-color var(--base) var(--ease), transform var(--fast) var(--ease); }
.bk-m.tap { cursor: pointer; }
.bk-m.tap:hover { border-color: var(--glass-line-2); }
.bk-m.tap:active { transform: scale(.97); }
.bk-m.now { border-color: rgba(223, 240, 74, .75); box-shadow: 0 0 0 3px rgba(223, 240, 74, .12); }
.bk-m.queue { border-style: dashed; border-color: var(--sky-100); }
.bk-l { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 22px; padding: 0 8px 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t3); background: rgba(255, 255, 255, .05); border-bottom: 1px solid rgba(255, 255, 255, .08); border-radius: 7px 7px 0 0; }
.bk-l span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-l .lucide { width: 13px; height: 13px; flex: none; color: var(--sky-100); }
.bk-l .ct { display: inline-flex; align-items: center; gap: 5px; color: var(--ball); font-weight: 800; letter-spacing: .04em; }
.bk-l .ct.wait .lucide { color: var(--sky-100); }
.bk-m.now .bk-l { color: #fff; }
.bk-s { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; font-size: 13px; color: var(--t2); }
.bk-s + .bk-s { border-top: 1px solid rgba(255, 255, 255, .08); }
.bk-s .ellipsis { flex: 1; min-width: 0; }
.bk-s i { font-style: normal; color: var(--t3); font-size: 12px; }
.bk-s b { font-weight: 800; }
.bk-s.w { color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--ball); }
.bk-s.w b { color: var(--ball); }
.bk-s.l { color: var(--t3); }
.bk-cup { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: 10px 8px; border-radius: var(--r-md); border: 2px dashed rgba(255, 255, 255, .2); color: var(--t3); text-align: center; }
.bk-cup .lucide { width: 28px; height: 28px; margin-bottom: 4px; }
.bk-cup b { font-size: 13px; color: #fff; line-height: 1.25; }
.bk-cup small { font-size: 12px; }
.bk-cup.won { border: 2px solid var(--ball); background: radial-gradient(circle at 50% 0%, rgba(223, 240, 74, .3), rgba(223, 240, 74, .05) 70%); color: var(--ball); box-shadow: 0 0 24px rgba(223, 240, 74, .25); }
.hint .lucide { width: 14px; height: 14px; vertical-align: -2px; }

/* Festejo de campeones */
.scrim.center { align-items: center; padding: var(--s4); }
.dialog.champ-pop { border-radius: var(--r-xl); border-bottom: 1px solid var(--glass-line-2); text-align: center; padding: var(--s6) var(--s5); animation: popin var(--slow) var(--ease-out) both; background: radial-gradient(120% 70% at 50% 0%, rgba(223, 240, 74, .24), rgba(0, 52, 55, .95) 60%); }
.cp-cup { width: 76px; height: 76px; margin: 0 auto var(--s3); border-radius: 50%; display: grid; place-items: center; background: var(--ball); color: var(--ball-ink); box-shadow: 0 0 44px rgba(223, 240, 74, .45); }
.cp-cup .lucide { width: 40px; height: 40px; }
.champ-pop .h2 { margin-top: 4px; }
.cp-avs { display: flex; justify-content: center; gap: var(--s3); margin-top: var(--s4); }
.dialog .cp-names { font-size: 19px; font-weight: 800; color: #fff; margin-top: var(--s3); }
.dialog .cp-score { font-size: 14px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.prow .rp { flex: none; text-align: right; line-height: 1.1; }
.prow .rp b { display: block; font-size: 15px; font-weight: 800; color: var(--ball); }
.prow .rp small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

/* Ganadores animados */
.champ.tap { position: relative; overflow: hidden; cursor: pointer; transition: transform var(--fast) var(--ease); }
.champ.tap:active { transform: scale(.98); }
.champ .shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .2) 47%, rgba(223, 240, 74, .2) 53%, transparent 65%); transform: translateX(-120%); animation: shine 4.5s var(--ease) .6s infinite; }
.champ:not(.gold) .shine { background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .12) 50%, transparent 62%); animation-delay: 1.8s; }
.champ .avs { padding-top: 10px; align-self: flex-start; }
.champ .cup-ic { flex: none; align-self: flex-start; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--accent); background: rgba(255, 255, 255, .06); transform-origin: 50% 90%; animation: swing 3.2s ease-in-out 1s infinite; }
.champ .cup-ic .lucide { width: 24px; height: 24px; }
.champ.gold .cup-ic { background: var(--ball); color: var(--ball-ink); animation: swing 3.2s ease-in-out 1s infinite, glow 2.4s ease-out infinite; }
.champ .tap-hint { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--accent); }
.champ.gold .tap-hint { color: var(--ball); }
.champ .tap-hint .lucide { width: 14px; height: 14px; animation: twinkle 1.6s ease-in-out infinite; }
.crowned { position: relative; display: inline-block; }
.avs .crowned .av { margin-left: 0; }
.crowned .crown { position: absolute; left: 50%; top: -12px; width: 18px; height: 18px; margin-left: -9px; color: var(--ball); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); animation: crown 2.4s ease-in-out infinite; z-index: 1; }
.crowned .crown .lucide { width: 100%; height: 100%; fill: currentColor; }
.crowned:nth-child(2) .crown { animation-delay: .35s; }
.champ.gold .crowned .av { box-shadow: 0 0 0 2px var(--ball), 0 6px 18px rgba(223, 240, 74, .25); }
.av.lg + .crown { top: -18px; width: 26px; height: 26px; margin-left: -13px; }
.cp-avs .crowned { margin-left: 0; animation: popin .5s cubic-bezier(.2, 1.5, .4, 1) .35s both; }
.cp-avs .crowned:nth-child(2) { animation-delay: .5s; }
.cp-avs .crowned .av { box-shadow: 0 0 0 3px var(--ball); }
.bk-cup.won { overflow: hidden; cursor: pointer; animation: cupglow 2.4s ease-in-out infinite; }
.bk-cup.won .lucide { transform-origin: 50% 90%; animation: swing 3.2s ease-in-out 1s infinite; }
.bk-cup.won::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .25) 50%, transparent 65%); transform: translateX(-120%); animation: shine 4.5s var(--ease) 1.2s infinite; }
.bk-cup.won:active { transform: scale(.97); }
.cp-stage { position: relative; width: 76px; height: 76px; margin: 0 auto var(--s3); }
.cp-stage .cp-cup { position: relative; z-index: 1; margin: 0; animation: cupin .8s cubic-bezier(.2, 1.6, .4, 1) .05s both, glow 2.4s ease-out 1s infinite; }
.cp-stage .cp-cup .lucide { transform-origin: 50% 90%; animation: swing 3.2s ease-in-out 1.2s infinite; }
.cp-rays { position: absolute; left: 50%; top: 50%; width: 280px; height: 280px; margin: -140px 0 0 -140px; border-radius: 50%; pointer-events: none; background: repeating-conic-gradient(rgba(223, 240, 74, .2) 0 8deg, transparent 8deg 22.5deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%); animation: spin 16s linear infinite, fadein .8s ease .2s both; }
.dialog.champ-pop { position: relative; overflow: hidden; }
.champ-pop .eyebrow, .champ-pop .h2 { position: relative; }
.champ-pop .cp-names, .champ-pop .cp-score { animation: rise .5s var(--ease-out) .65s both; }
@keyframes shine { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }
@keyframes swing { 0%, 45%, 100% { transform: rotate(0); } 10% { transform: rotate(-12deg) scale(1.08); } 20% { transform: rotate(10deg) scale(1.08); } 30% { transform: rotate(-6deg); } 38% { transform: rotate(3deg); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(223, 240, 74, .55); } 80%, 100% { box-shadow: 0 0 0 14px rgba(223, 240, 74, 0); } }
@keyframes cupglow { 0%, 100% { box-shadow: 0 0 16px rgba(223, 240, 74, .2); } 50% { box-shadow: 0 0 34px rgba(223, 240, 74, .45); } }
@keyframes crown { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-4px) rotate(8deg); } }
@keyframes twinkle { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15) rotate(15deg); } }
@keyframes cupin { 0% { opacity: 0; transform: scale(.2) rotate(-30deg); } 100% { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .champ .shine, .champ .cup-ic, .champ .tap-hint .lucide, .crowned .crown, .cp-avs .crowned, .bk-cup.won, .bk-cup.won .lucide, .bk-cup.won::after, .cp-stage .cp-cup, .cp-stage .cp-cup .lucide, .cp-rays, .champ-pop .cp-names, .champ-pop .cp-score { animation: none !important; }
}
.sticky-seg button { white-space: nowrap; padding-left: 6px; padding-right: 6px; }

/* Páginas de 25 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: 2px 2px 0; }
.pg-info { font-size: 13px; color: var(--t3); }
.pg-btns { display: flex; align-items: center; gap: 4px; }
.pg-b { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .06); color: var(--t1); font-weight: 700; font-size: 14px; display: inline-grid; place-items: center; cursor: pointer; transition: background var(--fast) var(--ease); }
.pg-b:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.pg-b.on { background: #fff; color: var(--teal-100); border-color: #fff; }
.pg-b:disabled { opacity: .35; cursor: default; }
.pg-b .lucide { width: 18px; height: 18px; }
.pg-gap { color: var(--t3); padding: 0 2px; }
section.glass .pager { padding: var(--s3) var(--s4); border-top: 1px solid rgba(255, 255, 255, .08); }
.tbl-empty { text-align: center; color: var(--t3); padding: var(--s5) var(--s3) !important; }
/* Jugadores */
.prow .prk { width: 26px; flex: none; text-align: center; font-weight: 800; color: var(--t3); }
.prow .prk.top { color: var(--accent); }
.prow .pval { flex: none; text-align: right; line-height: 1.1; }
.prow .pval b { display: block; font-size: 18px; font-weight: 800; }
.prow .pval small { font-size: 11px; }
/* Fotos del plantel */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); }
.ph-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s4) var(--s2) var(--s3); text-align: center; color: var(--t1); min-width: 0; cursor: pointer; }
.ph-card:active { transform: scale(.97); }
.ph-av { position: relative; }
.ph-badge { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-100); color: var(--teal-100); box-shadow: 0 0 0 3px var(--ground); }
.ph-badge .lucide { width: 14px; height: 14px; }
.ph-card.ok .ph-badge { background: var(--ball); color: var(--ball-ink); }
.ph-card:not(.ok) .av { border: 2px dashed rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .05); }
.ph-card.busy { opacity: .7; }
.ph-card.busy .ph-badge .lucide { animation: spin 1s linear infinite; }
.ph-n { font-size: 13px; font-weight: 700; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.ph-s { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); }
.ph-card.ok .ph-s { color: var(--t3); }
.seg.nw button { white-space: nowrap; padding-left: 6px; padding-right: 6px; }

/* Carga de fotos en lote y pendientes de aprobación */
.bulk-btns { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.bulk-btns .btn { flex: 1 1 140px; }
.bulk-k { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s3); text-align: center; }
.bulk-k div { padding: 8px 4px; border-radius: var(--r-sm); background: var(--well); }
.bulk-k b { display: block; font-size: 20px; font-weight: 800; }
.bulk-k small { font-size: 11px; color: var(--t3); }
.bulk.run .prog > span { background: linear-gradient(90deg, var(--turq-60), var(--ball)); }
.section-title .eyebrow .lucide { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.pend { padding: var(--s3); display: flex; flex-direction: column; gap: 10px; }
.pend.busy { opacity: .6; pointer-events: none; }
.pend-top { display: flex; gap: var(--s3); align-items: flex-start; }
.pend-img { width: 76px; height: 76px; flex: none; border-radius: 16px; object-fit: cover; background: var(--well); border: 1px solid var(--glass-line); }
.pend-top .grow { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pend-name { font-size: 12px; color: var(--t3); }
.pend-name .lucide { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.seg.sm button { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.pd-q { font-size: 15px; }
.pd-q b { color: var(--ball); }
.pd-btns { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pd-btns .btn { flex: 1 1 120px; }
.pd-sub { font-size: 12px; color: var(--t3); }
.pd-hits { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-hit { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .07); color: var(--t1); font-size: 14px; font-weight: 600; cursor: pointer; }
.pd-hit:hover { background: rgba(255, 255, 255, .14); }
.pd-hit:active { transform: scale(.97); }
.input.sm { height: 42px; font-size: 15px; }
.burro-ph { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); margin: 0 0 var(--s4); border-radius: var(--r-md); background: var(--well); text-align: left; }
.burro-ph .av.burro { margin-top: 14px; }
.burro-ph b { display: block; }
.burro-ph small { display: block; font-size: 12px; color: var(--t3); margin: 2px 0 8px; }
.burro-ph .photo-actions { justify-content: flex-start; }
.ph-card .av.burro { margin-top: 14px; }
body.dropping .page::after { content: "Suelte las fotos para subirlas"; position: fixed; inset: 12px; z-index: 70; display: grid; place-items: center; border: 3px dashed var(--ball); border-radius: 24px; background: rgba(0, 46, 49, .85); color: var(--ball); font-size: 22px; font-weight: 800; pointer-events: none; }

/* Wrapped del torneo */
.wr-cta { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s4); border-radius: var(--r-lg); border: 0; color: #fff; text-align: left; cursor: pointer; background: linear-gradient(120deg, #6d28d9, #db2777 55%, #f59e0b); box-shadow: 0 12px 28px rgba(109, 40, 217, .35); position: relative; overflow: hidden; transition: transform var(--fast) var(--ease); }
.wr-cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .25) 50%, transparent 65%); transform: translateX(-120%); animation: shine 4s var(--ease) 1s infinite; pointer-events: none; }
.wr-cta:active { transform: scale(.98); }
.wr-cta b { display: block; font-size: 17px; font-weight: 800; }
.wr-cta small { display: block; font-size: 13px; opacity: .85; margin-top: 2px; }
.wr-cta > .lucide { width: 20px; height: 20px; flex: none; }
.wr-cta-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; }
.wr-cta-ic .lucide { width: 24px; height: 24px; animation: twinkle 1.8s ease-in-out infinite; }
.btn.wr-go { margin-top: var(--s4); color: #fff; border: 0; background: linear-gradient(120deg, #6d28d9, #db2777 55%, #f59e0b); }

.wr { position: fixed; inset: 0; z-index: 90; background: #05080a; color: #fff; display: flex; justify-content: center; animation: fadein .25s ease both; }
.wr-stage { position: relative; width: 100%; max-width: 480px; height: 100%; }
.wr-bars { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 456px; display: flex; gap: 4px; z-index: 3; }
.wr-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.wr-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.wr-bars span.done i { width: 100%; }
.wr-bars span.on i { animation: wrbar linear forwards; }
@keyframes wrbar { to { width: 100%; } }
.wr-x { position: absolute; top: calc(22px + env(safe-area-inset-top)); right: max(12px, calc(50% - 228px)); z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .25); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wr-x .lucide { width: 22px; height: 22px; }
.wr-tap { position: absolute; top: 0; bottom: 0; z-index: 2; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wr-tap.prev { left: 0; width: 30%; }
.wr-tap.next { right: 0; width: 70%; }
.wr-tap:focus-visible { outline: none; }
.wr-s { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; padding: 80px 28px 60px; }
.wr-s > *:not(.wr-glow) { position: relative; animation: rise .55s var(--ease-out) both; }
.wr-s > :nth-child(3) { animation-delay: .12s; }
.wr-s > :nth-child(4) { animation-delay: .24s; }
.wr-s > :nth-child(5) { animation-delay: .36s; }
.wr-s > :nth-child(6) { animation-delay: .48s; }
.wr-s > :nth-child(7) { animation-delay: .6s; }
.wr-glow { position: absolute; inset: -30%; pointer-events: none; animation: spin 24s linear infinite; }
.t-intro { background: linear-gradient(160deg, #002e31, #005154 50%, #0b3b6b); }
.t-intro .wr-glow { background: radial-gradient(circle at 30% 30%, rgba(102, 182, 180, .55), transparent 40%), radial-gradient(circle at 70% 70%, rgba(164, 200, 240, .45), transparent 42%); }
.t-gold { background: linear-gradient(160deg, #1f3d00, #00514f 60%, #002e31); }
.t-gold .wr-glow { background: radial-gradient(circle at 30% 25%, rgba(223, 240, 74, .6), transparent 40%), radial-gradient(circle at 75% 75%, rgba(0, 133, 130, .6), transparent 45%); }
.t-info { background: linear-gradient(160deg, #1e1b4b, #312e81 50%, #0b3b6b); }
.t-info .wr-glow { background: radial-gradient(circle at 25% 30%, rgba(99, 102, 241, .6), transparent 40%), radial-gradient(circle at 70% 70%, rgba(14, 165, 233, .5), transparent 45%); }
.t-roast { background: linear-gradient(160deg, #4a044e, #9f1239 55%, #c2410c); }
.t-roast .wr-glow { background: radial-gradient(circle at 30% 30%, rgba(244, 63, 94, .6), transparent 40%), radial-gradient(circle at 70% 75%, rgba(251, 146, 60, .55), transparent 45%); }
.wr-eye { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .25); }
.wr-eye .lucide { width: 16px; height: 16px; }
.t-gold .wr-eye { color: var(--ball); }
.wr-title { font-size: clamp(28px, 8vw, 40px); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; max-width: 14em; }
.wr-big { font-size: clamp(64px, 22vw, 112px); font-weight: 900; line-height: .95; letter-spacing: -.04em; }
.t-gold .wr-big { color: var(--ball); }
.t-roast .wr-big { color: #fde68a; }
.wr-big.score { font-size: clamp(72px, 26vw, 128px); }
.wr-unit { font-size: 15px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-top: -6px; }
.wr-text { font-size: 18px; line-height: 1.4; max-width: 22em; opacity: .95; }
.wr-avs { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.wr-pair { display: inline-flex; gap: 6px; }
.wr-pair .av { box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.wr-pair .av.burro { margin-top: 18px; }
.wr-avs:not(.vs) .av.lg { width: 92px; height: 92px; border-radius: 26px; font-size: 32px; }
.wr-vs { font-size: 14px; font-weight: 900; letter-spacing: .1em; opacity: .7; }
.wr-rank { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.wr-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: rgba(0, 0, 0, .25); text-align: left; animation: rise .5s var(--ease-out) var(--d) both; }
.wr-row > b:first-child { width: 22px; font-size: 20px; color: var(--ball); }
.wr-row .av.lg { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
.wr-row .grow { font-weight: 700; font-size: 15px; min-width: 0; }
.wr-row .pts { font-size: 20px; color: var(--ball); }
.wr-end { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin-top: 10px; z-index: 3; }
@media (prefers-reduced-motion: reduce) { .wr-glow, .wr-cta::after, .wr-cta-ic .lucide { animation: none !important; } .wr-s > *, .wr-row { animation: none !important; } }
.wr-row .wr-nm { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wr-row .av.lg { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.wr-row .wr-pair { gap: 4px; flex: none; }


/* =====================================================================
   Responsive
   Base (arriba): teléfono vertical, 360–430 px.
   1. Bordes seguros: notch y barra de gestos también a los lados (horizontal).
   2. Pantallas bajas (teléfono horizontal): barras compactas y hojas de altura completa.
   3. Desde 700 px de ancho (teléfono horizontal grande, tablet): más ancho,
      listas en grilla, navegación flotante y diálogos centrados.
   4. Desde 1100 px (escritorio): columna de 1200 px, vistas de lectura a 880 px
      y la portada en dos columnas.
   El atributo data-view de #app (lo pone render()) identifica la vista.
   ===================================================================== */
:root { --gutter: var(--s4); --top-h: 60px; }
.topbar { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.page { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.bnav, .cta-bar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
.sticky-seg { top: calc(var(--top-h) + 8px + env(safe-area-inset-top)); }
.net-pill { top: calc(var(--top-h) + 8px + env(safe-area-inset-top)); }
.bk-title { scroll-margin-top: calc(var(--top-h) + 70px); }

/* 3. Tablet y teléfono horizontal ancho */
@media (min-width: 700px) {
  :root { --app: 960px; --gutter: var(--s6); }
  #app { box-shadow: none; }
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s3); align-items: start; }
  .type-pick.four { grid-template-columns: repeat(4, 1fr); }
  .type-pick.four button { flex-direction: column; align-items: flex-start; }
  .hero .h1 { font-size: 42px; }
  .hero p { max-width: 34em; }
  /* Navegación inferior y barra de acción: flotantes y centradas */
  .bnav {
    width: min(560px, calc(100% - 32px)); bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px;
    border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--glass-hi), 0 14px 40px rgba(0, 0, 0, .35);
  }
  .cta-bar {
    width: min(760px, calc(100% - 32px)); bottom: calc(12px + env(safe-area-inset-bottom)); padding: var(--s3) var(--s3) var(--s3) var(--s5);
    border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--glass-hi), 0 14px 40px rgba(0, 0, 0, .35);
  }
  .page { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  /* Hojas y diálogos: tarjeta centrada en vez de hoja desde abajo */
  .scrim { align-items: center; padding: var(--s6); }
  .sheet { max-width: 600px; max-height: calc(100dvh - 48px); border-radius: var(--r-xl); border-bottom: 1px solid var(--glass-line-2); padding-bottom: 0; animation-name: popin; box-shadow: var(--glass-hi), 0 30px 80px rgba(0, 0, 0, .45); }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: var(--s5); }
  .dialog { max-width: 460px; border-radius: var(--r-xl); border-bottom: 1px solid var(--glass-line-2); padding-bottom: var(--s6); animation-name: popin; }
  .podium { max-width: 560px; margin-left: auto; margin-right: auto; }
}
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* 4. Escritorio */
@media (min-width: 1100px) {
  :root { --app: 1200px; --gutter: var(--s8); }
  .list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  /* Vistas de lectura y formularios: ancho cómodo, centradas */
  #app[data-view="new"] .page, #app[data-view="players"] .page, #app[data-view="ranking"] .page,
  #app[data-view="game-table"] .page, #app[data-view="game-set"] .page, #app[data-view="cuadro-set"] .page { max-width: 880px; margin-left: auto; margin-right: auto; }
  /* Portada: bienvenida y accesos lado a lado */
  #app[data-view="home"] .page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); column-gap: var(--s4); }
  #app[data-view="home"] .page > * { grid-column: 1 / -1; }
  #app[data-view="home"] .page > .hero { grid-column: 1; }
  #app[data-view="home"] .page > .bento { grid-column: 2; margin-top: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
  #app[data-view="home"] .page > .bento .tile { min-height: 0; }
  /* Llaves del torneo: las columnas aprovechan el ancho */
  .bk-col:not(.cup) { flex: 1 0 172px; max-width: 280px; }
}

/* 2. Pantallas bajas: teléfono horizontal (y ventanas muy bajas) */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --top-h: 48px; }
  .topbar { height: calc(48px + env(safe-area-inset-top)); }
  .page { padding-top: var(--s3); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .page > * + * { margin-top: var(--s3); }
  .section-title { margin-top: var(--s4); }
  .bnav { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .bnav button { height: 44px; flex-direction: row; gap: 8px; font-size: 13px; }
  .bnav button .lucide { width: 20px; height: 20px; }
  .cta-bar { padding-top: var(--s2); padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom)); }
  .cta-bar .btn.lg { min-height: 48px; }
  .toasts { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .hero { padding: var(--s4) var(--s5); }
  .hero .h1 { font-size: 30px; margin-top: var(--s2); }
  .hero p { margin-top: var(--s2); }
  .hero .cta { margin-top: var(--s3); }
  .rule { margin-top: var(--s3); }
  .ghead, .thero { padding: var(--s4); }
  .track, .tstats { margin-top: var(--s3); }
  .court { padding: var(--s3); }
  .pitch { aspect-ratio: 5 / 2; margin: var(--s2) 0; }
  .side .sc { font-size: 26px; }
  .court-cta { height: 44px; }
  .scrim { padding: 8px; }
  .sheet { max-width: 720px; max-height: calc(100dvh - 16px); }
  .sheet-head { padding: var(--s3) var(--s4) 0; }
  .sheet-body { padding: var(--s3) var(--s4); }
  .sheet-actions { padding: var(--s2) var(--s4) var(--s3); }
  .team { padding: var(--s2) 6px; }
  .team .tsc { font-size: 40px; }
  .dialog { padding: var(--s4) var(--s5); max-height: calc(100dvh - 16px); overflow: auto; }
  .dialog .sheet-actions { margin-top: var(--s3); }
  .av.xl { width: 72px; height: 72px; border-radius: 20px; font-size: 26px; }
  /* Hoja de resultado: marcador a la izquierda, teclado a la derecha */
  #sheet-scrim .sheet-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: var(--s4); align-items: start; }
  #sheet-scrim .sheet-body > * { grid-column: 2; }
  #sheet-scrim .sheet-body > .board { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 0; }
  #sheet-scrim .sheet-body > .sheet-actions { grid-column: 1 / -1; }
  #sheet-scrim .sheet-body > .pick-label:nth-child(2), #sheet-scrim .sheet-body > .set-block:nth-child(2) { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 700px) {
  .bnav { bottom: calc(6px + env(safe-area-inset-bottom)); }
  .cta-bar { bottom: calc(6px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 699px) {
  /* Teléfonos horizontales angostos: las hojas siguen saliendo desde abajo */
  .scrim { padding: 0; }
  .sheet { max-height: 100dvh; }
}

/* Llaves en espejo (como el Excel): mitad izquierda → final ← mitad derecha */
.bk.mirror { gap: 20px; }
.bk.mirror .bk-col { width: 150px; }
.bk.mirror .bk-ms { height: calc(max(var(--n), 3) * 100px); }
.bk.mirror .bk-col:not(.fin) .bk-slot::after { width: 10px; }
.bk.mirror .bk-col.join .bk-slot::before { left: calc(100% + 9px); }
.bk.mirror .bk-col.in .bk-slot > *::before { width: 10px; }
/* lado derecho: las líneas salen hacia la izquierda */
.bk.mirror .bk-col.rt .bk-h { text-align: right; margin: 0 4px var(--s2) 0; }
.bk.mirror .bk-col.rt .bk-slot::after { left: auto; right: 100%; }
.bk.mirror .bk-col.rt.join .bk-slot::before { left: auto; right: calc(100% + 9px); }
.bk.mirror .bk-col.rt.in .bk-slot > *::before { right: auto; left: 100%; }
.bk.mirror .bk-col.rt .bk-s.w { box-shadow: inset -3px 0 0 var(--ball); }
/* centro: la final con el trofeo arriba, y las dos semifinales entrando por los costados */
.bk.mirror .bk-col.fin { width: 160px; }
.bk.mirror .bk-col.fin .bk-h { text-align: center; margin-left: 0; color: var(--ball); }
.bk.mirror .bk-col.fin .bk-slot::after, .bk.mirror .bk-col.fin .bk-slot::before { display: none; }
.bk.mirror .fin-wrap { position: relative; width: 100%; }
.bk.mirror .fin-wrap > .bk-cup { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 12px); min-height: 0; padding: 10px 6px; }
.bk.mirror .fin-wrap > .bk-m { border-color: rgba(223, 240, 74, .45); }
.bk.mirror .fin-wrap > .bk-m::before, .bk.mirror .fin-wrap > .bk-m::after { content: ""; position: absolute; top: 50%; width: 10px; border-top: 2px solid var(--line); }
.bk.mirror .fin-wrap > .bk-m::before { right: 100%; }
.bk.mirror .fin-wrap > .bk-m::after { left: 100%; }
.bk.mirror .bk-slot.done .fin-wrap > .bk-m::before, .bk.mirror .bk-slot.done .fin-wrap > .bk-m::after { border-color: var(--ball); }
.bk-s b .tbp { font-size: 10px; font-weight: 700; margin-left: 2px; vertical-align: super; opacity: .85; }
@media (min-width: 1100px) {
  .bk.mirror .bk-col:not(.cup) { flex: 1 1 0; min-width: 128px; max-width: 220px; }
  .bk.mirror .bk-col.fin { min-width: 144px; }
}
