/* @version 1.2.1
   Layout: una columna para celular (máx. 760px). Encabezado fijo azul con la franja de la bandera
   (1:1:2:1:1) y pestañas; banderines y balón de fondo como ambiente mundialista; tarjetas de equipo en 2-3 columnas si hay espacio. */
:root {
  --cr-blue: #001489;   /* Pantone Reflex Blue, Ley 10178 */
  --cr-red: #CE1126;
  --cr-white: #FFFFFF;
  --bg: #F3F6FC;
  --surface: #FFFFFF;
  --sunk: #E8EDF8;
  --line: #D3DBEC;
  --edge: rgba(14, 22, 48, 0.5);
  --fg: #0E1630;
  --muted: #536079;
  --primary: #CE1126;
  --on-primary: #FFFFFF;
  --link: #0B2BB0;
  --header-bg: #001489;
  --header-fg: #FFFFFF;
  --header-soft: rgba(255, 255, 255, 0.16);
  --good: #17784A;
  --warn: #9A5B05;
  --bad: #B42318;
  --pos-por: #9A5B05;
  --pos-def: #1D4ED8;
  --pos-med: #15803D;
  --pos-del: #B91C1C;
  --ball: #0E1630;
  --shadow: 0 1px 2px rgba(14, 22, 48, 0.08), 0 8px 24px rgba(14, 22, 48, 0.06);
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060B1F; --surface: #0D1533; --sunk: #0A1129; --line: #1F2B52; --edge: rgba(238, 242, 251, 0.55);
    --fg: #EEF2FB; --muted: #9AA6C4; --primary: #D92440; --on-primary: #FFFFFF; --link: #8EA8FF;
    --good: #5CC48A; --warn: #E3B341; --bad: #F87171;
    --pos-por: #FACC15; --pos-def: #93C5FD; --pos-med: #86EFAC; --pos-del: #FCA5A5;
    --ball: #EEF2FB; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060B1F; --surface: #0D1533; --sunk: #0A1129; --line: #1F2B52; --edge: rgba(238, 242, 251, 0.55);
  --fg: #EEF2FB; --muted: #9AA6C4; --primary: #D92440; --on-primary: #FFFFFF; --link: #8EA8FF;
  --good: #5CC48A; --warn: #E3B341; --bad: #F87171;
  --pos-por: #FACC15; --pos-def: #93C5FD; --pos-med: #86EFAC; --pos-del: #FCA5A5;
  --ball: #EEF2FB; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--header-bg); }
#app { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); text-transform: uppercase; line-height: 1.02; text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); font-family: var(--font-display); font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Ambiente: balón de fondo, bandera y banderines */
.bg-ball { position: fixed; inset: 0; overflow: hidden; color: var(--ball); opacity: 0.05; pointer-events: none; z-index: 0; }
.bg-ball svg { position: absolute; right: -140px; bottom: -140px; width: min(560px, 95vw); height: auto; aspect-ratio: 1; transform: rotate(-14deg); display: block; }
.flag-band { height: 12px; background: linear-gradient(to bottom, var(--cr-blue) 0 16.667%, var(--cr-white) 16.667% 33.333%, var(--cr-red) 33.333% 66.667%, var(--cr-white) 66.667% 83.333%, var(--cr-blue) 83.333% 100%); }
.bunting { height: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='30'%3E%3Cpath d='M0 3 Q36 9 72 3' fill='none' stroke='%238A96B4' stroke-width='1.3'/%3E%3Cpolygon points='3,4.2 21,6.3 12,26' fill='%23001489'/%3E%3Cpolygon points='27,6.6 45,6.8 36,27' fill='%23FFFFFF' stroke='%23B9C3DA' stroke-width='1'/%3E%3Cpolygon points='51,6.3 69,4.2 60,26' fill='%23CE1126'/%3E%3C/svg%3E"); background-repeat: repeat-x; background-size: 72px 30px; }

/* Encabezado */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--header-bg); color: var(--header-fg); }
.top-row { display: flex; align-items: center; gap: 10px; padding-block: 10px 6px; }
.home-link { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; color: var(--header-fg); text-decoration: none; background: var(--header-soft); font-size: 22px; line-height: 1; }
.top-title { flex: 1; min-width: 0; }
.eyebrow { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.top-title h1 { font-size: 25px; font-weight: 800; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.me-chip { flex: none; max-width: 44%; border: 1px solid var(--header-soft); background: var(--header-soft); color: var(--header-fg); border-radius: 99px; padding: 7px 12px; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; padding-block: 0; }
.tabs button { flex: 1 1 auto; min-width: 0; white-space: nowrap; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--header-fg); padding: 10px 2px 9px; font-weight: 600; font-size: 14px; opacity: 0.78; }
@media (max-width: 400px) { .tabs button { font-size: 13px; } .tab-count { display: none; } .tabs button[aria-current="page"] .tab-count { display: inline; } }
.tabs button[aria-current="page"] { opacity: 1; border-bottom-color: var(--cr-red); }
.tab-count { font-size: 11px; background: var(--header-soft); padding: 1px 6px; border-radius: 99px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.progress { height: 3px; background: linear-gradient(90deg, transparent, var(--cr-red), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: progress 0.9s linear infinite; }
@keyframes progress { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.me-menu { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 8px 12px; }
.me-menu .btn { min-height: 38px; background: var(--header-soft); border-color: transparent; color: var(--header-fg); }

/* Estructura */
.main { padding-block: 16px 120px; display: grid; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 25px; font-weight: 700; letter-spacing: 0.01em; }
h3 { font-size: 19px; font-weight: 700; }
.label, legend, .field > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.field { display: grid; gap: 6px; min-width: 0; }
.input { width: 100%; min-height: 44px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
textarea.input { resize: vertical; line-height: 1.4; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.grid-fields .wide { grid-column: 1 / -1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.group { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.setup-row { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--warn); background: var(--surface); }
.notice p { flex: 1 1 240px; min-width: 0; }
.notice.info { border-color: var(--link); }
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.hint { font-size: 13px; color: var(--muted); }

/* Botones y controles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; text-decoration: none; transition: background-color 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { border-color: var(--fg); }
.btn-blue { background: var(--cr-blue); border-color: var(--cr-blue); color: var(--cr-white); }
.btn-big { width: 100%; min-height: 54px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn[data-confirming="true"] { border-color: var(--bad); color: var(--bad); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.link { background: none; border: 0; padding: 6px; color: var(--link); text-decoration: underline; font-size: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 11px; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--sunk); border-radius: 11px; padding: 4px; }
.stepper button { width: 38px; height: 36px; border: 0; border-radius: 8px; background: var(--surface); font-size: 20px; font-weight: 700; }
.stepper output { min-width: 42px; text-align: center; font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--sunk); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.good { color: var(--good); }
.pill.warn { color: var(--warn); }
.pill.blue { color: var(--link); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sunk); border: 0; text-align: left; width: 100%; }
.switch .knob { flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background-color 0.15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch[aria-checked="true"] .knob { background: var(--good); }
.switch[aria-checked="true"] .knob::after { transform: translateX(18px); }

/* Colores de camisa */
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.color-chip[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.color-chip svg { width: 28px; height: 28px; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px var(--edge); }

/* Posiciones */
.pos { display: inline-grid; place-items: center; min-width: 36px; height: 22px; padding: 0 4px; border-radius: 5px; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.05em; color: var(--pc, var(--muted)); background: color-mix(in srgb, var(--pc, var(--muted)) 15%, transparent); }
.pos-POR { --pc: var(--pos-por); }
.pos-DEF { --pc: var(--pos-def); }
.pos-MED { --pc: var(--pos-med); }
.pos-DEL { --pc: var(--pos-del); }

/* Portada */
.hero { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: 18px 26px; display: grid; gap: 12px; position: relative; }
.hero-title { font-size: clamp(44px, 13vw, 76px); font-weight: 800; line-height: 0.9; letter-spacing: 0.005em; }
.hero-title span { display: block; color: var(--cr-red); }
.hero-sub { font-size: 17px; max-width: 34ch; color: var(--muted); }
.hero-ball { position: absolute; right: -60px; top: 10px; width: 230px; color: var(--ball); opacity: 0.1; transform: rotate(18deg); pointer-events: none; }
.hero-ball svg { width: 100%; height: auto; display: block; }
.group-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; }
.group-card:hover { border-color: var(--muted); }
.group-card b { font-family: var(--font-display); font-size: 21px; text-transform: uppercase; display: block; line-height: 1.05; }
.cards { display: grid; gap: 8px; }

/* Identificarse */
.who-list { display: grid; gap: 6px; }
.who { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.who:hover { border-color: var(--muted); }
.who b { font-size: 16px; }
.who small { display: block; color: var(--muted); }
.who[data-confirming="true"] { border-color: var(--warn); }
.invite-head { display: grid; gap: 6px; }
.invite-head h2 { font-size: clamp(32px, 10vw, 48px); font-weight: 800; }

/* Ficha del jugador (tarjeta tipo álbum) */
.ficha-wrap { display: grid; grid-template-columns: minmax(0, 190px) 1fr; gap: 16px; align-items: start; }
.ficha { position: relative; border-radius: 16px; padding: 12px 12px 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; display: grid; gap: 4px; justify-items: center; text-align: center; }
.ficha::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 9px; background: linear-gradient(to right, var(--cr-blue) 0 16.667%, var(--cr-white) 16.667% 33.333%, var(--cr-red) 33.333% 66.667%, var(--cr-white) 66.667% 83.333%, var(--cr-blue) 83.333% 100%); }
.ficha-top { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; padding-left: 8px; }
.ficha-media { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.ficha-jersey svg { width: 96px; height: 96px; display: block; }
.ficha-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.ficha-sub { font-size: 13px; color: var(--muted); min-height: 1em; }
.ficha-attrs { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.ficha-attrs dt { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.ficha-attrs dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.attr { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.attr-label { display: grid; }
.attr-label small { color: var(--muted); font-size: 13px; }
.scale { display: inline-flex; gap: 4px; }
.scale button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--muted); }
.scale button.on { background: color-mix(in srgb, var(--cr-blue) 14%, var(--surface)); border-color: color-mix(in srgb, var(--cr-blue) 40%, var(--line)); color: var(--fg); }
.scale button[aria-pressed="true"] { background: var(--cr-blue); border-color: var(--cr-blue); color: var(--cr-white); }
.calc { font-size: 14px; color: var(--muted); background: var(--sunk); padding: 10px 12px; border-radius: 10px; }
.calc b { color: var(--fg); font-variant-numeric: tabular-nums; }
.dirty { font-size: 13px; font-weight: 600; color: var(--warn); }

/* La fecha */
.match-card { display: grid; gap: 6px; }
.match-date { font-size: clamp(34px, 10vw, 46px); font-weight: 800; }
.match-meta { color: var(--muted); font-size: 15px; }
.rsvp { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--sunk); }
.rsvp b { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; }
.signups { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.signups li { display: grid; grid-template-columns: 26px auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.signups .num { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.signups .remove { width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.signups .remove:hover { border-color: var(--line); }
.signups .waiting { color: var(--muted); }
.list-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 4px; }
.you { font-size: 11px; font-weight: 700; color: var(--link); text-transform: uppercase; letter-spacing: 0.06em; margin-left: 4px; }
.pname { display: grid; min-width: 0; }
.pname b { font-weight: 700; overflow-wrap: anywhere; }
.pname small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pmedia { font-family: var(--font-display); font-weight: 700; font-size: 21px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px 0 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.chip:hover { border-color: var(--muted); }

/* Equipos */
.balance { display: grid; gap: 8px; padding: 14px; background: var(--sunk); border-radius: 12px; }
.balance-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.balance-pct { font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.verdict { font-family: var(--font-display); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 0.06em; }
.verdict.good { color: var(--good); }
.verdict.warn { color: var(--warn); }
.verdict.bad { color: var(--bad); }
.meter { position: relative; height: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--good); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.meter-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.warnings { margin: 0; padding-left: 18px; color: var(--warn); font-size: 14px; display: grid; gap: 2px; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.team { border: 1px solid var(--line); border-top: 6px solid var(--team); border-radius: 14px; background: var(--surface); padding: 12px; display: grid; gap: 10px; align-content: start; min-width: 0; animation: deal 0.35s ease-out both; }
.team:nth-child(2) { animation-delay: 0.06s; }
.team:nth-child(3) { animation-delay: 0.12s; }
@keyframes deal { from { transform: translateY(8px); } to { transform: none; } }
.team-head { display: flex; align-items: center; gap: 8px; }
.team-head svg { width: 38px; height: 38px; flex: none; }
.team .team-name { flex: 1; min-width: 0; min-height: 38px; padding: 4px 6px; border-color: transparent; background: transparent; font-family: var(--font-display); font-weight: 700; font-size: 23px; text-transform: uppercase; }
.team .team-name:hover, .team .team-name:focus { border-color: var(--line); }
.team-media { text-align: right; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.team-media small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.team-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.team-stats div { background: var(--sunk); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.team-stats dt { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.team-stats dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.prow { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; border: 1px solid transparent; background: transparent; text-align: left; transition: background-color 0.15s; }
.prow:hover { background: var(--sunk); }
.prow[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.score-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.score-team { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 19px; text-transform: uppercase; }
.score-input { width: 70px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 24px; }

/* Jugadores */
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plist > li { border-bottom: 1px solid var(--line); }
.prow-lg { grid-template-columns: auto 1fr auto auto; padding: 10px 4px; border-radius: 0; }
.votes { font-size: 12px; color: var(--muted); text-align: right; }
.editor { padding: 6px 4px 18px; display: grid; gap: 16px; }
.vote-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.vote-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vote-row .pname { flex: 1 1 140px; }

/* Historial */
.events { list-style: none; margin: 0; padding: 0; display: grid; }
.event { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--cr-white); background: var(--av, var(--cr-blue)); }
.event p { overflow-wrap: anywhere; }
.event time { display: block; font-size: 12px; color: var(--muted); }
.event .lineup { font-size: 13px; color: var(--muted); margin-top: 2px; }
.played { display: grid; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.played:last-child { border-bottom: 0; }
.played-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.played-team { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px; padding: 10px; border-radius: 12px; background: var(--sunk); border: 2px solid transparent; }
.played-team.winner { border-color: var(--good); }
.played-team svg { width: 30px; height: 30px; }
.played-team b { font-family: var(--font-display); font-size: 19px; text-transform: uppercase; }
.played-team .goals { font-family: var(--font-display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.played-team .names { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 32px); background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); z-index: 40; }

@media (max-width: 520px) {
  .ficha-wrap { grid-template-columns: 1fr; }
  .ficha { max-width: 220px; justify-self: center; width: 100%; }
}
@media (min-width: 620px) {
  .top-title h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 1.1.0: lista de WhatsApp, reserva, figura, tabla y sorteo ---------- */
.gear { flex: none; }
.gear[aria-current="page"] { background: var(--cr-red); }
.share-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--sunk); }
.preview summary { cursor: pointer; color: var(--link); font-size: 14px; }
.preview pre { margin: 8px 0 0; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); font-size: 14px; line-height: 1.5; }
.last-line { text-align: center; letter-spacing: 0.12em; }
.rsvp.highlight { box-shadow: 0 0 0 3px var(--cr-red); animation: nudge 1.2s ease-in-out 2; }
@keyframes nudge { 50% { transform: scale(1.015); } }
.chip[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }

.mvp-card { border-color: color-mix(in srgb, #F5D547 55%, var(--line)); }
.mvp-card h2 { font-size: 30px; }
.mvp-team { display: grid; gap: 6px; }
.mvp-ranking { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

.year-nav { gap: 2px; }
.year-nav .btn { min-height: 36px; padding: 0 10px; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--sunk); min-width: 0; }
.tile b { font-family: var(--font-display); font-size: 24px; text-transform: uppercase; line-height: 1.05; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin-inline: -4px; }
.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.standings th, .standings td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.standings thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.standings th[scope="row"], .standings thead th:nth-child(2) { text-align: left; }
.standings tbody th { font-weight: 700; }
.standings tr.me { background: color-mix(in srgb, var(--cr-blue) 10%, transparent); }
.standings .num { color: var(--muted); font-family: var(--font-display); font-size: 17px; }
.forms { display: inline-flex; gap: 3px; vertical-align: middle; }
.form { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 700; color: #FFFFFF; }
.form-G { background: #17784A; }
.form-E { background: #6B7690; }
.form-P { background: #B42318; }

.no-scroll { overflow: hidden; }
.reveal { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overflow-x: hidden; background: radial-gradient(circle at 50% 20%, #0B1E5C, #040A1E 70%); color: #FFFFFF; padding-bottom: env(safe-area-inset-bottom, 0px); }
.reveal-inner { min-height: 100%; }
.reveal-body { padding-block: 20px 32px; display: grid; gap: 16px; }
.reveal-body .eyebrow { opacity: 0.75; }
.reveal-body h2 { font-size: clamp(32px, 9vw, 48px); font-weight: 800; }
.reveal-teams { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; }
.reveal-col { display: grid; gap: 6px; align-content: start; }
.reveal-head { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 3px solid var(--team); }
.reveal-head svg { width: 34px; height: 34px; flex: none; }
.reveal-head b { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; overflow-wrap: anywhere; }
.reveal-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); border-left: 4px solid var(--team); animation: card-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.reveal-card b { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.reveal-card .pos { color: #FFFFFF; background: rgba(255, 255, 255, 0.16); }
.reveal-card .pmedia { font-size: 18px; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.92) rotateX(60deg); } to { opacity: 1; transform: none; } }
.reveal-stamp { justify-self: center; font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: 0.04em; color: #5CC48A; border: 3px solid #5CC48A; border-radius: 12px; padding: 4px 16px; transform: rotate(-4deg); animation: stamp 0.4s ease-out both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.8); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
.reveal .btn-quiet { color: #C9D2E6; }
.reveal.skip .reveal-card, .reveal.skip .reveal-stamp { animation: none; }
@media (max-width: 420px) { .reveal-card { grid-template-columns: 1fr auto; } .reveal-card .pos { display: none; } }

/* ---------- 1.1.1: auditoría de pantallas chicas ---------- */
.me-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.me-initial { display: none; }
.me-who { flex-basis: 100%; font-size: 14px; }
.year-nav .btn { min-width: 40px; }
.link { min-height: 36px; display: inline-flex; align-items: center; }
/* En teléfonos chicos el nombre de la mejenga manda: el chip queda en la inicial (el nombre completo va en el menú). */
@media (max-width: 420px) {
  .me-chip { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  .me-initial { display: inline; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
  .me-name { display: none; }
  .me-chip:has(.me-name-always) { width: auto; padding: 0 10px; border-radius: 99px; }
  .me-name-always { display: inline; }
}
/* Camisetas con tamaño propio donde el contenedor no se lo da (portada y marcador). */
.group-card svg, .score-team svg { width: 28px; height: 28px; flex: none; }
/* A 320-400 px, «PORTEROS» y «DEFENSA» no caben en cuatro columnas. */
@media (max-width: 400px) { .team-stats { grid-template-columns: repeat(2, 1fr); } }
/* En computadora, abrir el sorteo esconde la barra de desplazamiento: sin esto la página brinca 15 px. */
html { scrollbar-gutter: stable; }
