/* Portal estático. Paleta compartida con client/src/pages/Auth.module.css. */
:root {
  --bg: #141917; --bg-alt: #111614; --panel: #171d1a;
  --ink: #efeed5; --ink-soft: #b9c7ac; --ink-mute: #9ba991;
  --gold: #d8ba75; --gold-soft: #cebd86;
  --line: #2b3329; --line-soft: #394331; --field: #1c241e;
  --ok: #8fbf7a; --err: #d98d7a;
  --medal-1: #e9c96a; --medal-2: #a6b3bb; --medal-3: #c99969;
  --head: Impact, "Haettenschweiler", "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink-soft); font: 15px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
::selection { background: var(--gold); color: var(--bg); }
.skip { position: absolute; left: -9999px; background: var(--gold); color: var(--bg); padding: 10px 16px; z-index: 20; }
.skip:focus { left: 12px; top: 12px; }
.wrap { width: min(1180px, 100% - 64px); margin-inline: auto; }
.wrap--narrow { width: min(760px, 100% - 64px); }
.kicker { font-size: 10px; font-weight: 600; letter-spacing: 2.4px; color: var(--gold-soft); margin: 0 0 12px; text-transform: uppercase; }

/* Marca y navegación */
.brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; letter-spacing: 2px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; width: 35px; height: 41px; font: 29px var(--head); flex-shrink: 0; box-shadow: inset 0 0 0 3px var(--bg); background: #d8ba7512; }
.brand span { font-size: 10px; color: var(--ink-soft); letter-spacing: 3px; }
.brand--sm { font-size: 17px; }
.brand--sm b { width: 28px; height: 33px; font-size: 23px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 13px max(32px, calc((100% - 1180px) / 2)); background: #141917f5; border-top: 2px solid var(--gold); border-bottom: 1px solid var(--line-soft); }
.topbar__brand { text-decoration: none; display: flex; }
.topbar__nav { display: flex; gap: 26px; margin: 0 auto 0 30px; }
.topbar__nav a, .topbar__login { text-decoration: none; font-size: 12px; white-space: nowrap; transition: color .15s; }
.topbar__nav a:hover, .topbar__login:hover { color: var(--gold); }
.topbar__auth { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.topbar__register, .btn-cta, .cta { text-decoration: none; background: var(--gold); color: var(--bg); font-size: 13px; font-weight: 700; padding: 10px 18px; border: 1px solid var(--gold); border-radius: 3px; white-space: nowrap; box-shadow: inset 0 1px #fff3, 0 3px 0 #88713e; transition: background .15s, transform .15s, box-shadow .15s; }
.topbar__register:hover, .btn-cta:hover, .cta:hover { background: #e5cb8d; box-shadow: inset 0 1px #fff3, 0 3px 0 #88713e, 0 0 20px #d8ba7514; }
.topbar__register:active, .btn-cta:active, .cta:active { transform: translateY(2px); box-shadow: inset 0 1px #fff3, 0 1px 0 #88713e; }

/* Portada: barrio a la izquierda, acceso a la derecha. */
.hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); margin-top: 28px; border: 1px solid var(--line-soft); }
.hero__art { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 24px 34px 20px; min-height: 410px; border-right: 1px solid var(--line-soft); background: linear-gradient(90deg, #14191765, #14191700), url('/assets/district.svg') center / cover; }
.hero__art::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, #0000000c 3px 4px); }
.hero__edition { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 8px; letter-spacing: 1.5px; color: var(--ink-mute); }
.hero__edition > span:last-child { margin-left: auto; }
.signal { width: 6px; height: 6px; background: var(--gold); box-shadow: 0 0 8px #d8ba7540; }
.hero__copy { margin: auto 0; padding: 32px 0; }
.hero__copy h1 { font: 400 clamp(44px, 5.4vw, 72px)/1.02 var(--head); letter-spacing: .5px; color: var(--ink); margin: 16px 0 20px; }
.hero__copy h1 span { color: var(--gold); }
.lede { max-width: 340px; font-size: 14px; line-height: 1.8; margin: 0; }
.hero__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid #b9c7ac26; font-size: 8px; letter-spacing: 1.7px; }
.hero__foot a { font-size: 11px; letter-spacing: 0; text-decoration: none; color: var(--gold); }
.hero__foot a span { padding-left: 8px; }
.hero__panel { display: grid; place-items: center; padding: 30px; background: linear-gradient(135deg, #22291e80, var(--panel)); }
.panel { width: 100%; max-width: 360px; }
.panel__eyebrow { display: inline-block; font-size: 9px; letter-spacing: 1.8px; color: var(--gold); border: 1px solid #d8ba7540; padding: 3px 8px; margin: 0 0 18px; }
.panel__title { font: 400 34px/1.15 var(--head); color: var(--ink); margin: 0 0 12px; }
.panel__intro { font-size: 13px; margin: 0 0 16px; }
.panel__invite { font-size: 11px; color: var(--gold-soft); margin: 0 0 14px; }
.btn-cta { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 16px; }
.btn-cta span { font-size: 18px; line-height: 1; }
.panel__alt { font-size: 12px; margin: 16px 0 0; }
.panel__alt a { color: var(--ink); }
.panel__legal { font-size: 10px; line-height: 1.8; color: var(--ink-mute); margin: 20px 0 0; }
.portal-strip { display: flex; align-items: center; gap: 28px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; color: var(--ink-mute); }
.portal-strip b { font-size: 16px; color: var(--gold); font-variant-numeric: tabular-nums; margin-right: 5px; }
.portal-strip__note { margin-left: auto; }

/* Secciones */
.section { padding: 64px 0; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.section--leagues { border-top: 0; padding-top: 38px; padding-bottom: 48px; }
.section--alt { background: var(--bg-alt); }
.section__heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section__title { font: 400 clamp(30px, 3.2vw, 42px)/1.12 var(--head); letter-spacing: .3px; color: var(--ink); margin: 0 0 16px; }
.section__lede { max-width: 62ch; font-size: 14px; margin: 0 0 28px; }
.data-tools { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; }
.data-status { margin: 0; font-size: 10px; color: var(--ink-mute); }
.data-status[data-state='ready']::before { content: ''; display: inline-block; width: 5px; height: 5px; background: var(--ok); margin-right: 7px; vertical-align: middle; }
.data-status[data-state='error'] { color: var(--err); }
.refresh { padding: 6px 10px; background: transparent; border: 1px solid var(--line-soft); border-radius: 3px; font-size: 11px; color: var(--ink-soft); cursor: pointer; }
.refresh:hover:enabled { color: var(--gold); border-color: var(--gold); }
.refresh:disabled { cursor: wait; opacity: .55; }
.refresh span { padding-left: 6px; }
.no-script { border: 1px solid var(--gold-soft); padding: 12px; font-size: 13px; }

/* Tablas de liga */
.league-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.league-card { min-width: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-soft); border-top: 2px solid #857344; border-radius: 3px; overflow: hidden; }
.league-card__head { display: flex; align-items: center; gap: 14px; padding: 18px 16px; background: linear-gradient(110deg, #d8ba7508, transparent); }
.league-card__icon { display: grid; place-items: center; flex: 0 0 36px; height: 40px; border: 1px solid #d8ba7540; color: var(--gold); font: 26px var(--head); }
.league-card__head h3 { font: 400 24px/1.15 var(--head); color: var(--ink); margin: 0 0 4px; }
.league-card__head p { color: var(--ink-mute); font-size: 10px; margin: 0; }
.league-card__foot { font-size: 10px; color: var(--ink-mute); padding: 12px 16px; margin-top: auto; border-top: 1px solid var(--line); }
.rank-columns { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-block: 1px solid var(--line); background: #0b100e66; color: var(--ink-mute); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.rank-columns span:first-child { flex: 0 0 24px; text-align: center; }
.rank-columns span:last-child { margin-left: auto; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.league-card > .rank-list { min-height: 352px; }
.rank-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; transition: background .15s; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:nth-child(even) { background: #ffffff02; }
.rank-row.rank-1 { --medal: var(--medal-1); background: linear-gradient(90deg, #e9c96a0c, transparent); }
.rank-row.rank-2 { --medal: var(--medal-2); }
.rank-row.rank-3 { --medal: var(--medal-3); }
.rank-row:hover { background: #d8ba750d; }
.rank-num { display: grid; place-items: center; flex: 0 0 24px; height: 24px; font: 14px var(--head); color: var(--ink-mute); }
:is(.rank-1, .rank-2, .rank-3) .rank-num { color: var(--medal); border: 1px solid currentColor; border-radius: 3px; }
:is(.rank-1, .rank-2, .rank-3) .rank-name__main { color: var(--medal); }
.flag { flex: 0 0 22px; text-align: center; font-size: 16px; line-height: 1; }
.crest { flex: 0 0 22px; width: 22px; height: 24px; padding: 2px; border-radius: 3px; }
.rank-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rank-name__main { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name__meta { color: var(--ink-mute); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { flex: 0 0 auto; font-size: 11px; color: var(--gold-soft); white-space: nowrap; }
.rank-loading, .rank-empty { padding: 32px 24px; color: var(--ink-mute); font-size: 12px; text-align: center; }
.rank-loading { min-height: 352px; background: repeating-linear-gradient(0deg, transparent 0 43px, var(--line) 43px 44px); }
.rank-empty { max-width: 30ch; margin: 40px auto; }

/* Jugadores: sólo puesto, nombre, club y nivel. */
.player-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.ranking-intro { padding-top: 12px; }
.ranking-intro .section__title { font-size: clamp(36px, 3.5vw, 48px); }
.ranking-intro .section__lede { max-width: 65ch; }
.text-link { display: inline-flex; gap: 24px; font-size: 12px; font-weight: 600; color: var(--gold); text-decoration: none; border-bottom: 1px solid #d8ba7555; padding-bottom: 6px; }
.text-link:hover { border-color: var(--gold); }
.ranking-board { min-width: 0; border: 1px solid var(--line-soft); border-radius: 3px; background: var(--panel); overflow: hidden; }
.ranking-board__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 8px; font-size: 10px; letter-spacing: 1.5px; color: var(--gold); border-top: 2px solid #857344; }
.ranking-board__head h3 { margin: 0; color: var(--ink); font: 400 27px/1.2 var(--head); letter-spacing: .3px; }
.ranking-board__description { min-height: 52px; margin: 0; padding: 0 16px 14px; color: var(--ink-mute); font-size: 12px; }
.ranking-board__period { padding: 12px 16px; margin: 0; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 11px; }
.ranking-board__period:empty { display: none; }
.rank-list--wide .rank-row { min-height: 57px; gap: 14px; padding: 8px 16px; font-size: 13px; }
.rank-list--wide .rank-value { padding: 3px 9px; border: 1px solid var(--line-soft); border-radius: 3px; }
.rank-list--wide { min-height: 570px; }
.rank-list--wide:has(.rank-empty) { min-height: 220px; }
.rank-list--wide .rank-loading { min-height: 570px; background-size: auto 57px; }

/* Juego, estado y preguntas */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 3px; padding: 22px; }
.card__num { font: 26px var(--head); color: var(--gold); }
.card h3 { color: var(--ink); font-size: 16px; margin: 16px 0 10px; font-weight: 600; }
.card p { margin: 0; font-size: 13px; line-height: 1.8; }
.status-list { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 0; }
.status-list li { position: relative; padding: 14px 0 14px 30px; font-size: 13px; border-top: 1px solid var(--line); }
.status-list li::before { position: absolute; left: 0; top: 14px; font-size: 13px; font-weight: 700; }
.status-list li b { color: var(--ink); font-weight: 600; }
.status-list .done::before { content: '✓'; color: var(--ok); }
.status-list .wip::before { content: '◐'; color: var(--gold); }
.status-list .todo::before { content: '○'; color: var(--ink-mute); }
.cta { display: inline-block; padding: 12px 24px; }
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
details summary { cursor: pointer; padding: 16px 0; color: var(--ink); font-size: 14px; font-weight: 550; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border: 1px solid var(--line-soft); color: var(--gold); font-size: 18px; line-height: 1; }
details[open] summary::after { content: '−'; border-color: var(--gold); }
details summary:hover { color: var(--gold); }
details p { margin: 0 36px 18px 0; font-size: 13px; max-width: 62ch; }
details p a { color: var(--ink); }
.foot { border-top: 1px solid var(--line-soft); padding: 28px 0; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 28px; }
.foot__copy { margin: 0; font-size: 11px; color: var(--ink-mute); flex: 1 1 220px; }
.foot__legal { display: flex; gap: 20px; }
.foot__legal a { font-size: 11px; color: var(--ink-mute); text-decoration: none; }
.foot__legal a:hover { color: var(--gold); }
/* ── Páginas legales (terminos.html, privacidad.html) ─────────────────────── */
.legal { padding: clamp(48px, 8vw, 90px) 0 80px; }
.legal .updated { font-size: 12px; color: var(--ink-mute); margin: -8px 0 36px; }
.legal h2 {
  font-family: var(--head); font-weight: 400; color: var(--ink);
  font-size: 22px; letter-spacing: .3px; margin: 44px 0 14px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { color: var(--ink); font-size: 15px; margin: 22px 0 8px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.8; }
.legal ul, .legal ol { padding-left: 22px; margin: 10px 0; }
.legal li { margin: 4px 0; }
.legal strong { color: var(--ink); }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal .back { display: inline-block; margin-bottom: 30px; font-size: 13px; color: var(--ink-mute); text-decoration: none; }
.legal .back:hover { color: var(--gold-soft); }

/* Tablet y móvil: tablas completas, sin scroll horizontal. */
@media (max-width: 1000px) {
  .topbar__nav { margin-left: 0; gap: 20px; }
  .hero__art { padding-inline: 26px; }
  .hero__edition > span:last-child { display: none; }
  .hero__panel { padding: 24px; }
  .league-card__head { gap: 10px; padding-inline: 12px; }
  .league-card__head h3 { font-size: 21px; }
  .league-card__icon { flex-basis: 28px; height: 34px; font-size: 22px; }
  .rank-row { gap: 7px; padding-inline: 10px; }
  .rank-columns { padding-inline: 10px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap, .wrap--narrow { width: calc(100% - 36px); }
  .topbar { padding: 12px 18px; }
  .topbar__nav { display: none; }
  .hero { grid-template-columns: 1fr; margin-top: 18px; }
  .hero__art { min-height: 330px; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 22px 26px; }
  .hero__copy { padding-block: 28px; }
  .hero__copy h1 { font-size: clamp(42px, 8.5vw, 64px); }
  .hero__panel { padding: 26px; }
  .panel { max-width: none; }
  .panel__title { font-size: 30px; }
  .panel__legal { margin-top: 16px; }
  .portal-strip { justify-content: space-between; gap: 12px; font-size: 10px; }
  .portal-strip b { display: block; font-size: 18px; }
  .portal-strip__note { display: none; }
  .section { padding: 44px 0; }
  .section__heading { display: block; }
  .data-tools { padding: 0 0 16px; justify-content: space-between; }
  .league-grid { grid-template-columns: 1fr; gap: 20px; }
  .league-card__head { padding: 16px; gap: 14px; }
  .league-card__head h3 { font-size: 25px; }
  .league-card__icon { flex-basis: 36px; height: 40px; }
  .rank-row { padding-inline: 16px; gap: 12px; font-size: 13px; }
  .rank-columns { padding-inline: 16px; }
  .league-card > .rank-list { min-height: 0; }
  .player-rankings { grid-template-columns: 1fr; gap: 24px; }
  .ranking-intro { padding-top: 0; }
  .ranking-intro .section__lede { max-width: 45ch; margin-bottom: 18px; }
  .rank-list--wide { min-height: 0; }
}
@media (max-width: 480px) {
  .topbar { gap: 8px; padding-inline: 14px; }
  .topbar .brand { font-size: 14px; gap: 7px; letter-spacing: 1px; }
  .topbar .brand span { display: none; }
  .topbar__auth { gap: 12px; }
  .topbar__register { padding: 9px 10px; font-size: 11px; }
  .topbar__login { font-size: 11px; }
  .hero__art, .hero__panel { padding-inline: 20px; }
  .hero__copy h1 { font-size: clamp(34px, 10.8vw, 42px); }
  .hero__foot { letter-spacing: 1px; font-size: 7px; }
  .hero__foot a { flex-shrink: 0; }
  .cards { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .ranking-board__head { font-size: 9px; letter-spacing: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
