/* Quiniela — hoja de estilos (mobile-first) */

:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --ink: #131715;
  --ink-2: #39413c;
  --muted: #69716c;
  --line: #e2e5e0;
  --line-strong: #cfd4ce;
  --accent: #0f6b3f;
  --accent-hover: #0b5a34;
  --accent-ink: #ffffff;
  --accent-soft: #e5f1ea;
  --live: #d0281c;
  --warn: #a35a00;
  --error-bg: #fdecea;
  --error-ink: #9b1c13;

  --mx: #0f6b3f;
  --ucl: #14245a;

  --exact-bg: #0f6b3f; --exact-ink: #ffffff;
  --diff-bg: #cfe8d9;  --diff-ink: #0b4d2d;
  --result-bg: #fbecc9; --result-ink: #6e4708;
  --miss-bg: #eceeeb;  --miss-ink: #6b726d;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 1px 1px rgba(16, 24, 20, .04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Inter', Arial, sans-serif;
  --tabbar-h: 60px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d100e;
    --surface: #161a18;
    --surface-2: #1b201d;
    --ink: #e8ece9;
    --ink-2: #c4cbc6;
    --muted: #8f9893;
    --line: #262c28;
    --line-strong: #343b37;
    --accent: #2e9e66;
    --accent-hover: #37b075;
    --accent-soft: #15291f;
    --live: #ff5a4c;
    --warn: #e2a54a;
    --error-bg: #3a1714;
    --error-ink: #ffb4ab;
    --mx: #2e9e66;
    --ucl: #5d78d6;
    --exact-bg: #2e9e66; --exact-ink: #06150d;
    --diff-bg: #1c3a2a;  --diff-ink: #9fdcb9;
    --result-bg: #3a2e14; --result-ink: #f1cd85;
    --miss-bg: #232825;  --miss-ink: #8f9893;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dot-sep { color: var(--line-strong); margin: 0 2px; }
.ok { color: var(--accent); }
.err { color: var(--error-ink); }

/* ── Barra superior ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  max-width: 880px; margin: 0 auto;
  height: 56px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; color: var(--accent); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: .01em; }
.topnav { display: none; gap: 4px; }
.topnav a { color: var(--muted); font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.topnav a.is-active { color: var(--ink); }
.topbar__user { margin-left: auto; }
.avatar-link { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.avatar-link:hover { text-decoration: none; }
.avatar-link__name { display: none; }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar--sm { width: 26px; height: 26px; }
.avatar--lg { width: 52px; height: 52px; }
.avatar--initials {
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 12px;
}
.avatar--sm.avatar--initials { font-size: 10px; }
.avatar--lg.avatar--initials { font-size: 18px; }

/* ── Barra inferior (móvil) ─────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.is-active { color: var(--accent); }

/* ── Página ─────────────────────────────────────── */
.page { max-width: 880px; margin: 0 auto; padding: 20px var(--gutter) 32px; }

.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; }
.flash--success { background: var(--accent-soft); color: var(--accent); }
.flash--error { background: var(--error-bg); color: var(--error-ink); }

/* ── Botones y formularios ──────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.form { display: grid; gap: 14px; }
.form--inline { margin-top: 16px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form--inline .field { flex: 1 1 200px; }
.form__grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: 12px; color: var(--muted); }
.input {
  width: 100%; min-height: 44px; padding: 0 12px;
  font: 16px var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── Auth ───────────────────────────────────────── */
.auth { max-width: 380px; margin: 12px auto 0; }
.auth__title { font-size: 30px; }
.auth__lead { color: var(--muted); margin: 6px 0 22px; }
.auth__alt { margin-top: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.google-slot { min-height: 44px; display: flex; justify-content: center; }
.google-error { margin-top: 8px; color: var(--error-ink); font-size: 14px; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Inicio ─────────────────────────────────────── */
.hero { padding: 8px 0 24px; }
.hero__title { font-size: 34px; max-width: 16ch; }
.hero__lead { color: var(--ink-2); margin-top: 10px; max-width: 46ch; }
.hero__actions { display: grid; gap: 10px; margin-top: 22px; max-width: 340px; }
.greeting { margin-bottom: 18px; }
.greeting h1 { font-size: 28px; }
.greeting p { color: var(--muted); margin-top: 2px; }

.pool-list { display: grid; gap: 14px; }
.pool-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.pool-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--mx); }
.pool-card--champions::before { background: var(--ucl); }
.pool-card__link { display: block; padding: 16px 16px 12px 20px; color: inherit; }
.pool-card__link:hover { text-decoration: none; }
.pool-card__head { display: flex; justify-content: space-between; align-items: center; }
.pool-card__players { font-size: 12px; color: var(--muted); }
.pool-card__title { font-size: 23px; margin-top: 10px; }
.pool-card__round { margin-top: 3px; color: var(--ink-2); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pool-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }
.pool-card__stats div { display: grid; gap: 1px; }
.pool-card__stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pool-card__stats dd { margin: 0; font: 700 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.pool-card__stats dd small { font-size: 14px; color: var(--muted); font-weight: 600; }
.pool-card__stats dd.is-warn { color: var(--warn); }
.pool-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px 12px 20px; background: var(--surface-2); border-top: 1px solid var(--line);
}
.pool-card__note { font-size: 13px; color: var(--ink-2); }

.league-tag {
  display: inline-block; padding: 3px 8px; border-radius: 5px;
  font: 700 11px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.league-tag--liga-mx { background: var(--mx); color: #fff; border-color: transparent; }
.league-tag--champions { background: var(--ucl); color: #fff; border-color: transparent; }

.live-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--live); font-weight: 600; font-size: 12px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.scoring-strip { margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.scoring-strip h2 { font-size: 19px; }
.scoring-strip ul { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.scoring-strip li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.scoring-strip b { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font: 700 18px var(--font-display); background: var(--accent-soft); color: var(--accent); }
.scoring-strip a { font-size: 14px; font-weight: 600; }

.empty-note { color: var(--muted); padding: 24px 0; text-align: center; }

/* ── Encabezado de quiniela ─────────────────────── */
.pool-head { margin-bottom: 14px; }
.pool-head__top { display: flex; justify-content: space-between; align-items: center; }
.pool-head__pot { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pool-head__title { font-size: 26px; margin: 8px 0 14px; }

.segmented {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  flex: 1; text-align: center; white-space: nowrap;
  padding: 8px 12px; border-radius: 7px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.join-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--accent-soft); border-radius: var(--radius-sm);
}
.join-banner p { font-weight: 500; font-size: 14px; color: var(--ink); }

/* ── Navegación de jornada ──────────────────────── */
.round-nav {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px;
}
.round-nav__arrow { height: 54px; display: grid; place-items: center; color: var(--ink); }
.round-nav__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round-nav__arrow.is-disabled { color: var(--line-strong); }
.round-nav__select { position: relative; text-align: center; display: grid; padding: 6px 0; cursor: pointer; }
.round-nav__select select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 16px; }
.round-nav__name { font: 700 19px/1.15 var(--font-display); }
.round-nav__name::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); }
.round-nav__dates { font-size: 12px; color: var(--muted); }

.subtabs { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.subtabs a { padding: 10px 0; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { text-decoration: none; color: var(--ink); }
.subtabs a.is-active { color: var(--ink); border-color: var(--accent); }
.subtabs__score { margin-left: auto; font-size: 13px; color: var(--muted); }
.subtabs__score b { font: 700 18px var(--font-display); color: var(--ink); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ── Partidos ───────────────────────────────────── */
.day-head { font: 600 13px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 20px 0 8px; }
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.match {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px 10px;
}
.match--live { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); }
.match__meta { display: flex; justify-content: center; gap: 8px; font-size: 12px; color: var(--muted); min-height: 18px; text-align: center; flex-wrap: wrap; }
.match__status { font-weight: 600; font-variant-numeric: tabular-nums; }
.match__note { color: var(--muted); }
.match__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-align: center; }
.team--home .team__logo { order: -1; }
.team__name {
  font-weight: 600; font-size: 13.5px; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.team__logo { width: 30px; height: 30px; object-fit: contain; flex: none; }
.team__logo--blank { border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }

.match__center { display: grid; justify-items: center; }
.score { font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; min-width: 72px; text-align: center; letter-spacing: .02em; }
.score span { color: var(--muted); margin: 0 4px; font-weight: 500; }
.score--empty { font-size: 14px; color: var(--muted); font-family: var(--font); font-weight: 500; }
.match--live .score { color: var(--live); }
.score__pens { font-size: 11px; color: var(--muted); margin-top: 2px; }

.score-inputs { display: flex; align-items: center; gap: 4px; }
.score-input {
  width: 44px; height: 48px; padding: 0;
  text-align: center; font: 700 24px var(--font-display); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  -moz-appearance: textfield;
}
.score-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.score-sep { color: var(--muted); font-weight: 600; }

.match__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; min-height: 22px; font-size: 13px; }
.match__lock { color: var(--muted); }
.save-state { color: var(--muted); }
.save-state.is-saved { color: var(--accent); }
.save-state.is-saving { color: var(--muted); }
.save-state.is-error { color: var(--error-ink); }
.my-pick { color: var(--ink-2); }
.my-pick b { font-variant-numeric: tabular-nums; }

.pts-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px;
  font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
  background: var(--miss-bg); color: var(--miss-ink);
}
.pts-chip--sm { min-width: 26px; height: 22px; padding: 0 6px; }
.pts-chip--exact { background: var(--exact-bg); color: var(--exact-ink); }
.pts-chip--diff { background: var(--diff-bg); color: var(--diff-ink); }
.pts-chip--result { background: var(--result-bg); color: var(--result-ink); }
.pts-chip--miss { background: var(--miss-bg); color: var(--miss-ink); }
.pts-chip.is-live { outline: 1.5px dashed currentColor; outline-offset: 1px; }

.others { margin-top: 8px; border-top: 1px solid var(--line); }
.others summary { padding: 9px 0 1px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; list-style: none; }
.others summary::-webkit-details-marker { display: none; }
.others summary::after { content: ' +'; }
.others[open] summary::after { content: ' −'; }
.others__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.others__list li { display: grid; grid-template-columns: 1fr auto 34px; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 14px; }
.others__list li.is-me { background: var(--accent-soft); }
.others__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.others__pick { font-weight: 600; font-variant-numeric: tabular-nums; }

.save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 10px 10px 10px 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
.save-bar__count { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.fine-print { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ── Tablas ─────────────────────────────────────── */
.standings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
.standings table, .rules-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  text-align: left; padding: 10px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.standings td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.standings tr:last-child td { border-bottom: 0; }
.standings tr.is-me td { background: var(--accent-soft); }
.c-rank { width: 36px; text-align: center !important; color: var(--muted); font-weight: 600; }
.is-leader .c-rank { color: var(--accent); }
.c-name a { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 500; min-width: 0; }
.c-name__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.c-num { text-align: right !important; width: 64px; }
.c-pts { font: 700 18px var(--font-display); width: 70px; padding-right: 14px !important; }
.live-delta { display: block; font: 600 11px var(--font); color: var(--accent); }
.c-hide-sm { display: none; }

.pot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.pot div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.pot dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pot dd { margin: 0; font: 700 20px var(--font-display); font-variant-numeric: tabular-nums; }

/* ── Participante ───────────────────────────────── */
.player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.player__id { display: flex; align-items: center; gap: 14px; }
.player__name { font-size: 22px; }
.player__stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.player__stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.player__stats dd { margin: 0; font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; }
.history { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.history li { display: grid; grid-template-columns: 1fr 40px 40px 34px; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history__teams { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__pick, .history__real { text-align: center; font-variant-numeric: tabular-nums; }
.history__pick { font-weight: 700; }
.history__real { color: var(--muted); }

/* ── Tarjetas genéricas / perfil ────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card__title { font-size: 20px; margin: 6px 0 4px; }
.card__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.link-list { list-style: none; margin: 10px 0 0; padding: 0; }
.link-list li a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.link-list li:last-child a { border-bottom: 0; }
.logout { margin-top: 8px; }

/* ── Reglas ─────────────────────────────────────── */
.prose { max-width: 640px; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 10px; }
.prose .lead { font-size: 16px; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 20px; display: grid; gap: 6px; }
.rules-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 12px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.rules-table th, .rules-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.rules-table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.rules-table tr:last-child td { border-bottom: 0; }
.rules-table small { font-weight: 400; }

/* ── Error ──────────────────────────────────────── */
.empty { text-align: center; padding: 48px 0; display: grid; gap: 14px; justify-items: center; }
.empty__code { font: 700 56px var(--font-display); color: var(--line-strong); }
.empty__title { font-size: 22px; }

/* ── Admin ──────────────────────────────────────── */
.admin-head { margin-bottom: 14px; display: grid; gap: 10px; }
.admin-head h1 { font-size: 26px; }
.back { font-size: 14px; font-weight: 600; }
.admin-list { list-style: none; padding: 0; margin: 6px 0 0; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-list li:last-child { border-bottom: 0; }
.admin-list li > div:first-child { display: grid; min-width: 0; }
.admin-list .muted { font-size: 13px; overflow-wrap: anywhere; }
.admin-list__actions { display: flex; gap: 6px; }
.tag-btn {
  min-height: 34px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  font: 600 13px var(--font); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong);
}
.tag-btn--ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-btn--danger { color: var(--error-ink); }
.status-tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.status-tag--live { color: var(--live); }
.status-tag--final { color: var(--accent); background: var(--accent-soft); }
.status-tag--canceled, .status-tag--postponed { color: var(--error-ink); background: var(--error-bg); }
.admin-matches { list-style: none; padding: 0; margin: 0; }
.admin-matches__head { display: flex; justify-content: space-between; font-size: 13px; }
.admin-matches__teams { margin: 6px 0 10px; }
.result-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.input--score { width: 52px; text-align: center; padding: 0; }
.result-form select.input { width: auto; }

/* ── Pantallas medianas y grandes ───────────────── */
@media (min-width: 640px) {
  body { padding-bottom: 0; font-size: 15px; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .avatar-link__name { display: inline; }
  .page { padding-top: 28px; }
  .hero { padding: 24px 0 32px; }
  .hero__title { font-size: 44px; }
  .pool-list { grid-template-columns: 1fr 1fr; }
  .team { flex-direction: row; gap: 10px; }
  .team--home { justify-content: flex-end; text-align: right; }
  .team--away { justify-content: flex-start; text-align: left; }
  .team--home .team__logo { order: 0; }
  .team__name { font-size: 16px; -webkit-line-clamp: 1; }
  .score-input { width: 52px; height: 52px; }
  .match { padding: 12px 18px; }
  .c-hide-sm { display: table-cell; }
  .c-name__text { max-width: none; }
  .save-bar { bottom: 14px; }
}

@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .team__name { font-size: 12.5px; }
  .score-input { width: 40px; height: 44px; font-size: 21px; }
  .pool-card__stats dd { font-size: 21px; }
  .form__grid { grid-template-columns: 1fr; }
}

/* ── Animaciones ────────────────────────────────── */
:root {
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Entrada de página y elementos escalonados (--i lo pone app.js) */
.page > * { animation: viewIn .5s var(--ease) both; }
.stagger > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 80ms); }
.standings tbody tr { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 120ms); }

.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span { display: inline-block; animation: lineUp .9s var(--ease) both; }
.hero__title .line:nth-child(2) > span { animation-delay: .1s; }
.hero__title .line:nth-child(3) > span { animation-delay: .2s; }
.hero__lead { animation: fadeUp .8s .3s var(--ease) both; }
.hero__actions { animation: fadeUp .8s .45s var(--ease) both; }
.greeting h1 { animation: fadeUp .6s var(--ease) both; }
.greeting p { animation: fadeUp .6s .1s var(--ease) both; }

/* Logo: la cancha se dibuja al cargar */
.brand__mark { transition: transform .5s var(--spring); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.08); }
.brand__mark .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s .25s var(--ease) forwards; }
.brand__mark .draw:nth-of-type(3) { animation-delay: .5s; }
.brand__mark .draw:nth-of-type(4) { animation-delay: .7s; }

/* Interacción */
.btn { transition: transform .18s var(--ease), background-color .15s, border-color .15s, box-shadow .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn--primary:hover { box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.pool-card, .match, .card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.pool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16, 24, 20, .10); }
.match.is-editable:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.segmented a, .subtabs a, .tabbar a { transition: color .2s, background-color .2s, box-shadow .2s; }
.tabbar a:active svg { transform: scale(.88); }
.tabbar svg { transition: transform .15s var(--spring); }
.tabbar a.is-active svg { animation: pop .45s var(--spring); }
.round-nav__arrow svg { transition: transform .2s var(--spring); }
.round-nav__arrow:not(.is-disabled):hover svg { transform: translateX(var(--dx, 0)) scale(1.15); }
.round-nav__arrow:first-child { --dx: -3px; }
.round-nav__arrow:last-child { --dx: 3px; }
.score-input { transition: border-color .2s, background-color .2s, transform .2s var(--spring); }
.score-input:focus { transform: scale(1.06); }

/* Avisos */
.flash { animation: toastIn .5s var(--spring) both; }

/* Guardado: el marcador hace un pequeño rebote */
.match.just-saved .score-input { animation: pop .45s var(--spring); border-color: var(--accent); }
.save-state.is-saved::before { content: ''; display: inline-block; width: 9px; height: 5px; margin-right: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(-45deg); animation: pop .4s var(--spring); }

/* Puntos */
.pts-chip:not([hidden]) { animation: pop .5s var(--spring) both; animation-delay: .25s; }
.pts-chip--exact { position: relative; overflow: hidden; }
.pts-chip--exact::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 1.2s .8s var(--ease);
}

/* ¡Gol! */
.match.goal { animation: goalFlash 1.6s var(--ease); }
.match.goal .score { animation: goalBump .7s var(--spring); }

/* Pronósticos de todos */
.others[open] .others__list { animation: fadeUp .35s var(--ease); }
.others[open] .others__list li { animation: rise .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }

/* Tabla: líder */
.is-leader .c-rank { animation: pop .6s .4s var(--spring) both; }

@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes lineUp { from { transform: translateY(110%) rotate(3deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes shine { to { transform: translateX(120%); } }
@keyframes goalBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes goalFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); }
  30% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--live) 15%, transparent); background: color-mix(in srgb, var(--live) 7%, var(--surface)); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .brand__mark .draw { stroke-dashoffset: 0; }
}

/* ── Vista previa «Ver como» ────────────────────── */
.preview-bar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 19; background: #1d2a6b; color: #fff; animation: slideDown .4s var(--ease) both; }
.preview-bar__inner { max-width: 880px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.preview-bar__inner p { flex: 1; min-width: 0; }
.preview-bar__hint { opacity: .75; }
.preview-bar__eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; display: block; animation: blink 4s infinite; transform-origin: center; }
.preview-bar__exit { background: #fff; color: #1d2a6b; min-height: 32px; }
@media (max-width: 480px) { .preview-bar__hint { display: none; } }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
