:root {
  --page: #0b1020;
  --page-glow: #17234b;
  --surface: rgba(20, 29, 53, .88);
  --surface-solid: #141d35;
  --surface-raised: #1b2745;
  --header: rgba(15, 23, 42, .82);
  --text: #f5f7ff;
  --muted: #9ba9c5;
  --line: rgba(148, 163, 184, .22);
  --accent: #ef4444;
  --accent-hover: #fb7185;
  --accent-soft: rgba(239, 68, 68, .16);
  --positive: #4ade80;
  --negative: #fb7185;
  --input: rgba(8, 15, 32, .72);
  --shadow: 0 18px 50px rgba(0, 0, 0, .25);
  --scroll-track: #0d1428;
  --scroll-thumb: #526586;
  --scroll-thumb-hover: #7590bd;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--scroll-track); border-radius: 999px; }
*::-webkit-scrollbar-thumb { border: 2px solid var(--scroll-track); border-radius: 999px; background: var(--scroll-thumb); }
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
*::-webkit-scrollbar-corner { background: var(--scroll-track); }
html { height: 100%; background: var(--page); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 4% -10%, var(--page-glow), transparent 36rem),
    radial-gradient(circle at 96% 0, rgba(90, 83, 185, .15), transparent 30rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.container { width: min(1340px, calc(100% - 40px)); margin: 0 auto; }
.app-main { display: flex; height: 100vh; flex-direction: column; padding: 12px 0 14px; overflow: hidden; }
.app-content { min-height: 0; flex: 1; overflow: auto; padding: 8px 2px 24px; scrollbar-gutter: stable; }
.site-footer, .login-footer { flex: none; margin-top: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.site-footer strong, .login-footer strong { color: var(--text); }

/* Navegación */
.league-toolbar {
  flex: none;
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  margin-bottom: 12px;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--header);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
}
.league-identity, .header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.league-identity { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.league-identity > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: 34px; height: 34px; flex: none; object-fit: contain; }
.league-switcher { display: block; min-width: 0; }
.league-switcher select { width: min(260px, 25vw); padding: 7px 28px 7px 8px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-raised); color: var(--text); color-scheme: dark; font-weight: 750; cursor: pointer; }
.league-switcher select:hover { border-color: var(--line); background: rgba(38,54,91,.95); }
.league-switcher select:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.league-switcher option { background: #17233e; color: #f5f7ff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.menu-icon { display: none; color: var(--muted); font-size: 20px; }
.league-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  background: linear-gradient(145deg, #27385f, #1b2948);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}
.league-nav { display: flex; align-items: center; justify-content: center; gap: 3px; }
.league-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.league-nav a:hover { color: var(--text); background: rgba(255,255,255,.07); transform: translateY(-1px); }
.league-nav a.active { border-color: rgba(239,68,68,.38); color: #fff; background: var(--accent-soft); }
.nav-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.header-actions { justify-content: flex-end; }
.settings-link, .contact-link, .logout-button { display: flex; align-items: center; gap: 5px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font-size: inherit; font-weight: 650; text-decoration: none; }
.settings-link:hover, .contact-link:hover, .logout-button:hover { box-shadow: none; color: var(--text); transform: none; }
.inline { display: inline; }
@media (min-width: 1121px) {
  .league-nav { position: absolute; left: 50%; transform: translateX(-50%); }
}

/* Estructura y tarjetas */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 25px; }
.hero h1 { margin: 0 0 7px; font-size: clamp(29px, 4vw, 41px); line-height: 1.06; letter-spacing: -.045em; }
.hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; }
.detail { align-items: center; }
.back { margin: -9px 0 20px; }
.back a { color: var(--muted); font-weight: 650; text-decoration: none; }
.back a:hover { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28, 40, 70, .92), var(--surface));
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 16px; font-size: 17px; letter-spacing: -.02em; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin: -1px -1px 17px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-title h2 { margin: 0; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }
.empty a { color: var(--accent-hover); }
.big-balance { font-size: clamp(23px, 3vw, 34px); font-weight: 850; letter-spacing: -.04em; }

/* Formularios */
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
label > span { color: var(--muted); font-size: 12px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--input);
  color: var(--text);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(239,68,68,.7); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 110px; resize: vertical; }
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: #fff;
  box-shadow: 0 7px 16px rgba(225,29,72,.2);
  font-weight: 760;
  text-align: center;
  text-decoration: none;
  transition: transform .18s, filter .18s, box-shadow .18s;
}
button:hover, .button-link:hover { filter: brightness(1.1); box-shadow: 0 10px 20px rgba(225,29,72,.3); transform: translateY(-1px); }
button.is-loading, input.is-loading { position: relative; min-width: 42px; color: transparent !important; pointer-events: none; }
button.is-loading::after { position: absolute; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; content: ''; animation: button-spin .65s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.quiet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  transition: border-color .18s, color .18s, background .18s, transform .18s;
}
.quiet-link:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.06); color: var(--text); transform: translateY(-1px); }
.hint, .formula { margin: 0; color: var(--muted); font-size: 12px; }
.radio-option { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.02); cursor: pointer; }
.radio-option:hover { border-color: rgba(255,255,255,.25); }
.radio-option input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.radio-option span { display: grid; gap: 3px; }
.radio-option small { color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-card { width: min(100%, 960px); margin-right: auto; margin-left: auto; }
.settings-card fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.settings-card legend { margin-bottom: 2px; color: var(--text); font-size: 14px; font-weight: 780; }
.league-settings-fieldset { gap: 13px !important; }
.league-settings-list { display: grid; gap: 14px; }
.league-settings-item { display: grid; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.league-settings-item h2 { margin: 0; color: var(--text); font-size: 16px; letter-spacing: -.02em; }
.theme-light .league-settings-item { background: rgba(248,250,252,.76); }

/* Tablas */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(4, 9, 21, .22); font-size: 11px; font-weight: 800; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.045); }
td a { font-weight: 750; text-decoration: none; }
td a:hover { color: var(--accent-hover); }
.sort-header { min-height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-header:hover { box-shadow: none; color: var(--accent-hover); transform: none; }
.sort-header::after { content: ' ↕'; opacity: .5; }
.sort-header[aria-sort='ascending']::after { content: ' ↑'; opacity: 1; }
.sort-header[aria-sort='descending']::after { content: ' ↓'; opacity: 1; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.muted-value { color: var(--muted); }
.current-team-warning { position: relative; display: inline-block; margin-left: 5px; vertical-align: middle; }
.current-team-warning summary { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #fbbf24; cursor: help; font-size: 14px; list-style: none; }
.current-team-warning summary::-webkit-details-marker { display: none; }
.current-team-warning-tooltip { position: absolute; z-index: 4; right: 0; bottom: calc(100% + 8px); display: none; width: 235px; padding: 9px 10px; border: 1px solid rgba(251,191,36,.35); border-radius: 9px; background: var(--surface-solid); box-shadow: 0 12px 28px rgba(0,0,0,.28); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.4; white-space: normal; }
.current-team-warning:hover .current-team-warning-tooltip,
.current-team-warning:focus-within .current-team-warning-tooltip,
.current-team-warning[open] .current-team-warning-tooltip { display: block; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; }

/* Avisos y filtros */
.alert-success, .alert-error { margin: 0 0 18px; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-size: 13px; }
.alert-success { border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.1); color: #bbf7d0; }
.alert-error { border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); color: #fecdd3; }
.movement-filters { display: grid; grid-template-columns: minmax(190px, 1.6fr) repeat(4, minmax(125px, 1fr)) auto; align-items: end; gap: 12px; margin-bottom: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7, 12, 27, .23); }
.movement-filters label { min-width: 0; }
.movement-filters input, .movement-filters select { padding: 9px 10px; }
.filter-reset { min-height: 39px; padding: 8px 13px; }
.movement-empty { margin: 14px 0 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.summary-card { display: grid; gap: 8px; min-height: 132px; padding: 18px; }
.summary-card > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-card strong { overflow: hidden; color: var(--text); font-size: 18px; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.summary-card b { align-self: end; color: var(--muted); font-size: 12px; font-weight: 650; }
.participant-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.participant-chart-card { margin-bottom: 20px; }

/* Inicio y ligas */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .52fr); align-items: start; gap: 24px; }
.home-content { min-width: 0; }
.home-hero { position: relative; overflow: hidden; max-width: none; margin: 4px 0 24px; padding: clamp(26px, 5vw, 48px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(120deg, #1d294a, #171d3a 52%, #351e39); box-shadow: var(--shadow); }
.home-hero::after { position: absolute; top: -90px; right: -50px; width: 330px; height: 330px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 76px rgba(255,255,255,.02); content: ''; }
.home-hero > div { position: relative; z-index: 1; }
.home-hero h1 { max-width: 620px; font-size: clamp(34px, 5vw, 52px); }
.home-hero p { max-width: 720px; font-size: 16px; }
.home-feature-list { display: grid; gap: 7px; max-width: 760px; margin: 20px 0 0; padding-left: 20px; color: var(--text); font-size: 15px; }
.home-feature-list li::marker { color: var(--accent); }
.home-feature-ending { margin-top: 17px !important; color: var(--text) !important; font-weight: 780; }
.home-explainer { margin-bottom: 35px; }
.home-explainer .card { position: relative; overflow: hidden; }
.home-explainer .card::before { display: block; width: 36px; height: 4px; margin-bottom: 15px; border-radius: 9px; background: var(--accent); content: ''; }
.home-explainer p, .section-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.home-explainer .card { display: grid; gap: 13px; }
.home-explainer .card h2 { margin-bottom: 0; }
.home-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: home-step; color: var(--muted); line-height: 1.6; }
.home-steps li { position: relative; min-height: 30px; padding-left: 43px; counter-increment: home-step; }
.home-steps li::before { position: absolute; top: 1px; left: 0; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); content: counter(home-step) 'º'; font-size: 12px; font-weight: 850; }
.home-step-example { display: block; margin-top: 9px; color: var(--text); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 0 15px; }
.section-heading h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.03em; }
.home-leagues { position: sticky; top: 100px; }
.league-list { display: grid; gap: 15px; }
.league-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 112px; border-left: 4px solid #64748b; }
.league-card.default-league { border-left-color: var(--accent); }
.league-card h3 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.02em; }
.league-card form { display: block; flex: none; }
.league-meta { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.league-unavailable { max-width: 500px; margin: 9px 0 0; color: var(--negative); font-size: 12px; font-weight: 700; }
.league-actions { display: flex; align-items: center; gap: 9px; flex: none; }

/* Equipos iniciales */
.initial-player-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.initial-player-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.initial-player-list li:last-child { border-bottom: 0; }
.initial-player-list strong { color: var(--text); font-size: 12px; }
.pending-price { color: var(--muted) !important; }
.pending-player-button { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.pending-player-dialog { width: min(420px, calc(100% - 28px)); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: 0 25px 70px rgba(0,0,0,.48); color: var(--text); }
.pending-player-dialog::backdrop { background: rgba(3,8,20,.68); backdrop-filter: blur(3px); }
.pending-player-dialog form { padding: 22px; }
.pending-player-dialog-heading { margin-bottom: 5px; }
.pending-player-dialog h3 { margin: 0 0 5px; font-size: 19px; letter-spacing: -.03em; }
.pending-player-dialog p { margin: 0; color: var(--muted); font-size: 13px; }
.pending-player-dialog .pending-player-id { margin-top: 7px; color: var(--text); font-size: 12px; font-weight: 700; }
.pending-player-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.pending-player-dialog .dialog-cancel { border-color: var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.pending-player-dialog .dialog-cancel:hover { background: rgba(255,255,255,.06); box-shadow: none; color: var(--text); }
.initial-team-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 13px; border: 1px solid rgba(74,222,128,.2); border-radius: 11px; background: rgba(74,222,128,.07); font-weight: 780; }
.initial-team-total strong { color: var(--positive); }
.initial-team-guide { margin: -4px 0 18px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 13px; line-height: 1.55; }
.initial-team-guide summary { display: flex; align-items: center; min-height: 42px; padding: 10px 14px; color: var(--text); font-weight: 760; cursor: pointer; list-style: none; }
.initial-team-guide summary::-webkit-details-marker { display: none; }
.initial-team-guide summary::after { margin-left: auto; color: var(--muted); content: '+'; font-size: 19px; font-weight: 500; }
.initial-team-guide[open] summary { border-bottom: 1px solid var(--line); }
.initial-team-guide[open] summary::after { content: '−'; }
.initial-team-guide ol { display: grid; gap: 8px; margin: 14px 18px 10px 35px; padding: 0; }
.initial-team-guide p { margin: 0; padding: 0 14px 14px; }

/* Estadísticas */
.stats-tabs { display: inline-flex; gap: 4px; margin: 0 0 21px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,12,27,.3); }
.stats-tab { min-height: 36px; padding: 7px 16px; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; font-weight: 780; }
.stats-tab:hover { background: rgba(255,255,255,.06); box-shadow: none; color: var(--text); transform: none; }
.stats-tab.active { background: var(--accent-soft); box-shadow: none; color: var(--text); }
.stats-panel[hidden] { display: none; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin: 0 0 20px; }
.stat-card { display: grid; gap: 7px; min-height: 138px; padding: 18px; border-top: 3px solid var(--accent); border-radius: 16px; }
.stat-card:nth-child(2) { border-top-color: var(--positive); }
.stat-card:nth-child(3) { border-top-color: #60a5fa; }
.stat-card:nth-child(4) { border-top-color: #fbbf24; }
.stat-card:nth-child(5) { border-top-color: #c084fc; }
.stat-card > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { overflow: hidden; color: var(--text); font-size: 16px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.stat-card b { align-self: end; color: var(--positive); font-size: 16px; }
.chart-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; }
.chart-card { min-width: 0; }
.chart-heading { margin-bottom: 17px; }
.chart-heading h2 { margin-bottom: 5px; }
.chart-heading p, .stats-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.chart-plot { position: relative; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: rgba(4,9,21,.2); }
.evolution-chart { display: block; width: 100%; min-width: 0; cursor: crosshair; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 10px; margin-top: 13px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; min-height: auto; padding: 4px 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; box-shadow: none; color: var(--muted); font-size: 12px; font-weight: 650; }
.chart-legend-item:hover { border-color: var(--line); background: rgba(255,255,255,.05); box-shadow: none; color: var(--text); transform: none; }
.chart-legend-item[aria-pressed='false'] { opacity: .38; text-decoration: line-through; }
.chart-legend i, .chart-tooltip i { display: block; flex: none; width: 9px; height: 9px; border-radius: 50%; }
.chart-tooltip { position: absolute; z-index: 1; width: min(340px, calc(100% - 16px)); padding: 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(8, 13, 28, .97); box-shadow: 0 16px 35px rgba(0,0,0,.38); color: var(--text); font-size: 13px; pointer-events: none; backdrop-filter: blur(12px); }
.chart-tooltip-date { display: block; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.chart-tooltip-values { display: grid; gap: 7px; }
.chart-tooltip-values span { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.chart-tooltip-values em { overflow: hidden; color: var(--muted); font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.chart-tooltip-values b { font-size: 12px; }
.stats-note { margin-top: 16px; }

/* Acceso */
.login-body { display: grid; height: 100vh; place-items: center; background: radial-gradient(circle at 20% 0, #26376d, transparent 34rem), radial-gradient(circle at 100% 100%, #4a213d, transparent 38rem), #0a1020; }
.login-shell { width: min(510px, 100%); max-height: 100vh; padding: 26px; overflow: auto; }
.login-card { padding: clamp(25px, 5vw, 39px); border: 1px solid var(--line); border-radius: 24px; background: rgba(18,27,51,.9); box-shadow: 0 26px 80px rgba(0,0,0,.38); backdrop-filter: blur(18px); }
.login-logo { display: block; width: 74px; height: 74px; margin: 0 auto 4px; object-fit: contain; }
.login-card h1 { margin: 17px 0 6px; font-size: 31px; letter-spacing: -.04em; }
.login-subtitle, .login-help { color: var(--muted); }
.login-help { margin: 15px 0 0; font-size: 12px; line-height: 1.55; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 25px 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,9,21,.28); }
.tab { min-height: 38px; padding: 7px; background: transparent; box-shadow: none; color: var(--muted); font-size: 12px; }
.tab:hover { background: rgba(255,255,255,.06); box-shadow: none; color: var(--text); transform: none; }
.tab.active { background: var(--surface-raised); box-shadow: 0 3px 9px rgba(0,0,0,.18); color: #fff; }
.login-panel { display: none; }
.login-panel.active { display: block; }
.token-help { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,9,21,.2); color: var(--muted); font-size: 12px; line-height: 1.55; }
.token-help summary { display: flex; align-items: center; min-height: 39px; padding: 9px 12px; color: var(--text); font-weight: 760; cursor: pointer; list-style: none; }
.token-help summary::-webkit-details-marker { display: none; }
.token-help summary::after { margin-left: auto; color: var(--muted); content: '+'; font-size: 18px; font-weight: 500; }
.token-help[open] summary { border-bottom: 1px solid var(--line); }
.token-help[open] summary::after { content: '−'; }
.token-help ol { display: grid; gap: 7px; margin: 13px 14px 9px 31px; padding: 0; }
.token-help p { margin: 0; padding: 0 14px 13px; color: var(--negative); font-weight: 650; }
.token-help kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-raised); color: var(--text); font: inherit; font-weight: 750; }
.theme-light .token-help { background: rgba(248,250,252,.75); }
.contact-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; background: rgba(4,9,21,.2); color: var(--muted); }
.contact-panel summary { display: flex; align-items: center; min-height: 42px; padding: 10px 14px; color: var(--text); font-weight: 780; cursor: pointer; list-style: none; }
.contact-panel summary::-webkit-details-marker { display: none; }
.contact-panel summary::after { margin-left: auto; color: var(--muted); content: '+'; font-size: 19px; font-weight: 500; }
.contact-panel[open] summary { border-bottom: 1px solid var(--line); }
.contact-panel[open] summary::after { content: '−'; }
.contact-panel > p { margin: 14px 14px 0; font-size: 13px; }
.contact-panel form { padding: 14px; }
.home-contact { margin-top: 0; }
.theme-light .contact-panel { background: rgba(248,250,252,.75); }
.contact-dialog { width: min(470px, calc(100% - 28px)); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: 0 25px 70px rgba(0,0,0,.48); color: var(--text); }
.contact-dialog::backdrop { background: rgba(3,8,20,.68); backdrop-filter: blur(3px); }
.contact-dialog form { padding: 22px; }
.contact-dialog-heading { margin-bottom: 5px; }
.contact-dialog h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.03em; }
.contact-dialog p { margin: 0; color: var(--muted); font-size: 13px; }
.contact-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.contact-dialog .dialog-cancel { border-color: var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.contact-dialog .dialog-cancel:hover { background: rgba(255,255,255,.06); box-shadow: none; color: var(--text); }
.login-contact-button { display: block; width: auto; margin: 18px auto 0; border-color: rgba(96,165,250,.52); background: rgba(59,130,246,.16); box-shadow: none; color: #c9e0ff; }
.login-contact-button:hover { border-color: #60a5fa; background: rgba(59,130,246,.28); box-shadow: 0 9px 20px rgba(37,99,235,.2); color: #fff; }
.theme-light .login-contact-button { border-color: rgba(37,99,235,.38); background: rgba(59,130,246,.1); color: #1d4ed8; }
.theme-light .login-contact-button:hover { border-color: #2563eb; background: rgba(59,130,246,.17); color: #1e3a8a; }

/* Tema claro */
body.theme-light {
  --page: #f5f7fb;
  --page-glow: #dce8ff;
  --surface: rgba(255,255,255,.92);
  --surface-solid: #ffffff;
  --surface-raised: #eef3fc;
  --scroll-track: #e8edf5;
  --scroll-thumb: #94a3b8;
  --scroll-thumb-hover: #64748b;
  --header: rgba(255,255,255,.87);
  --text: #18213a;
  --muted: #64708a;
  --line: rgba(71,85,105,.17);
  --accent-soft: rgba(239,68,68,.1);
  --input: #fff;
  --shadow: 0 15px 35px rgba(30,41,59,.08);
  background: radial-gradient(circle at 0 0, #dbeafe, transparent 34rem), radial-gradient(circle at 100% 0, #fae8ff, transparent 34rem), var(--page);
}
.theme-light .league-toolbar { box-shadow: 0 10px 28px rgba(30,41,59,.1); }
.theme-light .league-avatar { border-color: rgba(71,85,105,.16); background: linear-gradient(145deg, #e1eafe, #f6f8fc); }
.theme-light .league-switcher select { background: #f8fafc; color: var(--text); color-scheme: light; }
.theme-light .league-switcher select:hover { background: rgba(226,232,240,.92); }
.theme-light .league-switcher option { background: #fff; color: #18213a; }
.theme-light .league-nav a.active { color: #be123c; }
.theme-light .card { background: linear-gradient(145deg, #fff, rgba(250,252,255,.92)); }
.theme-light .table-wrap, .theme-light .chart-plot, .theme-light .movement-filters { background: rgba(248,250,252,.75); }
.theme-light th { background: rgba(226,232,240,.42); }
.theme-light tbody tr:hover { background: rgba(226,232,240,.55); }
.theme-light .badge { background: rgba(226,232,240,.75); color: #536177; }
.theme-light .alert-success { color: #166534; }
.theme-light .alert-error { color: #be123c; }
.theme-light .home-hero { background: linear-gradient(120deg, #e3edff, #fff 53%, #ffe8ee); }
.theme-light .chart-tooltip { border-color: rgba(71,85,105,.2); background: rgba(255,255,255,.98); box-shadow: 0 16px 35px rgba(30,41,59,.18); }
.theme-light .stats-tabs { background: rgba(255,255,255,.72); }
.theme-light .quiet-link:hover { border-color: rgba(71,85,105,.35); background: rgba(226,232,240,.65); }
.theme-light .login-body { background: radial-gradient(circle at 20% 0, #d9e8ff, transparent 34rem), radial-gradient(circle at 100% 100%, #ffe0e8, transparent 38rem), #f4f7fd; }
.theme-light .login-card { background: rgba(255,255,255,.88); }

@media (max-width: 1120px) {
  .league-toolbar { grid-template-columns: minmax(170px,1fr) auto; }
  .league-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .participant-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .movement-filters { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .movement-filters label:first-child { grid-column: span 2; }
  .home-layout { grid-template-columns: minmax(0, 1fr) minmax(290px, .48fr); gap: 18px; }
}
@media (max-width: 820px) {
  .container { width: min(100% - 28px, 1340px); }
  .app-main { padding-top: 8px; }
  .league-toolbar { top: 8px; margin-bottom: 8px; padding: 8px 10px; border-radius: 15px; }
  .league-nav a { flex: none; padding: 0 11px; }
  .nav-icon { width: 15px; height: 15px; }
  .grid, .home-explainer, .league-list { grid-template-columns: 1fr; }
  .home-layout { grid-template-columns: 1fr; }
  .home-leagues { position: static; }
  .summary-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  .chart-card, .card { border-radius: 15px; }
  .movement-filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .movement-filters label:first-child { grid-column: 1 / -1; }
  .filter-reset { width: 100%; }
  .hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .container { width: min(100% - 22px, 1340px); }
  .league-toolbar { grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
  .league-identity { font-size: 12px; }
  .league-switcher select { width: min(170px, 42vw); }
  .menu-icon { display: none; }
  .settings-link span { display: none; }
  .contact-link span { display: none; }
  .logout-button { padding: 0; }
  .league-nav { gap: 2px; }
  .league-nav a { gap: 4px; min-height: 36px; padding: 0 9px; font-size: 11px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 14px; }
  .card { padding: 16px; }
  .home-hero { padding: 28px 21px; border-radius: 17px; }
  .home-hero h1 { font-size: 34px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card { min-height: 120px; padding: 15px; }
  .movement-filters { grid-template-columns: 1fr; }
  .movement-filters label:first-child { grid-column: auto; }
  th, td { padding: 11px 12px; }
  .chart-plot { padding: 3px; }
  .chart-tooltip { font-size: 12px; }
  .league-card { align-items: flex-start; flex-direction: column; }
  .stats-tab { padding: 7px 14px; }
  .login-shell { padding: 15px; }
  .login-card { border-radius: 20px; }
}
