:root {
    color-scheme: dark;
    --bg: #060907;
    --panel: #10160f;
    --panel-2: #141c12;
    --surface-high: #1b2418;
    --line: #22301f;
    --line-strong: #33472d;
    --text: #EAF5E4;
    --muted: #8FA087;
    --muted-dim: #5f6f58;
    --lime: #9CFF3D;
    --lime-2: #C9FF7A;
    --lime-glow: rgba(156, 255, 61, .22);
    --lime-border: rgba(156, 255, 61, .38);
    --orange: #FF7A1A;
    --cyan: #35E6D9;
    --gold: #FFD24C;
    --silver: #C9D6E0;
    --bronze: #E0894A;
    --danger: #ff6b6b;
    --ink: #04140a;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow: 0 4px 32px rgba(0,0,0,.55);
    --shadow-lime: 0 0 26px var(--lime-glow);
    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --font-heading: 'Orbitron', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Rajdhani', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-pixel: 'Press Start 2P', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 14% 0%, rgba(156,255,61,.08), transparent 40%),
        radial-gradient(circle at 90% 8%, rgba(53,230,217,.06), transparent 35%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0px, rgba(255,255,255,.012) 1px, transparent 1px, transparent 42px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0px, rgba(255,255,255,.012) 1px, transparent 1px, transparent 42px);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: .01em; margin-top: 0; }
p { margin-top: 0; }

.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;
}

.wrap { margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

/* focus visible en toda la app */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* -------- Header -------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: rgba(6,9,7,.9);
    backdrop-filter: blur(10px);
}
.header-inner {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 14px clamp(18px, 4vw, 40px);
}
.brand { display: inline-flex; grid-column: 1; justify-self: start; align-items: center; flex-shrink: 0; }
.brand-logo {
    display: block;
    width: 118px;
    height: 46px;
    object-fit: contain;
    object-position: left center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: transparent;
    cursor: pointer;
}
.nav-toggle > span:not(.sr-only) { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--text); transition: transform var(--transition), opacity var(--transition); }
.nav-toggle[aria-expanded="true"] > span:not(.sr-only):nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] > span:not(.sr-only):nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] > span:not(.sr-only):nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: contents; }
.main-nav { display: flex; grid-column: 2; justify-self: start; gap: 24px; color: var(--muted); font-weight: 600; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--lime); }
.header-actions, .hero-actions { display: flex; align-items: center; gap: 10px; }
.header-actions { grid-column: 3; justify-self: end; }
.header-actions form { margin: 0; }
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: 14px; font-weight: 600;
    padding: 0 4px;
}
.user-chip strong { color: var(--text); }

/* Botones con icono del header. .btn-store lleva icono + texto siempre. .btn-icon (Perfil,
   Salir) se muestra como icono solo en desktop para ganar espacio, y como icono + texto en
   el menu mobile (donde los botones son full-width y el texto los hace legibles). */
.btn-store svg, .btn-icon svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.btn-store { gap: 8px; }
.btn-icon { gap: 8px; padding: 0; width: 44px; }
.btn-icon .btn-icon-text { display: none; }

/* -------- Botones -------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-primary { background: linear-gradient(135deg, var(--lime), #6fe61f); color: var(--ink); box-shadow: 0 0 18px var(--lime-glow); }
.btn-primary:hover { box-shadow: var(--shadow-lime); transform: translateY(-1px); }
.btn-dark { background: var(--surface-high); color: var(--text); border-color: var(--line); }
.btn-dark:hover { border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--lime); color: var(--lime); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* -------- Kicker / badges -------- */
.kicker {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--orange); font-family: var(--font-heading);
    font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
    margin-bottom: 12px;
}
.kicker svg { width: 15px; height: 15px; flex-shrink: 0; }
.eyebrow, .section-kicker { color: var(--lime); font-weight: 800; text-transform: uppercase; font-family: var(--font-heading); font-size: 12.5px; letter-spacing: .08em; margin-bottom: 12px; display: inline-block; }
.lvl-tag {
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 5px 7px;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap;
}

/* HUD corner brackets, usar con moderacion */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 12px; height: 12px; opacity: .75; transition: width var(--transition), height var(--transition); pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-top: 2px solid var(--lime); border-left: 2px solid var(--lime); }
.hud::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.hud:hover::before, .hud:hover::after { width: 18px; height: 18px; }

.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.status-badge.is-open { color: var(--lime); border-color: var(--lime-border); background: var(--lime-glow); }
.status-badge.is-soon { color: var(--orange); border-color: rgba(255,122,26,.35); background: rgba(255,122,26,.1); }
.status-badge.is-none { color: var(--muted); }

/* -------- Hero -------- */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: min(82vh, 720px);
    padding: 64px clamp(18px, 5vw, 40px) 48px;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 85% 110%, var(--lime-glow), transparent 45%);
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    pointer-events: none;
    background-color: var(--bg);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(6,9,7,.94) 0%, rgba(6,9,7,.7) 45%, rgba(6,9,7,.4) 100%),
        radial-gradient(circle at 85% 110%, var(--lime-glow), transparent 45%);
}
.hero > .wrap { position: relative; z-index: 2; width: 100%; }
.sponsor-strip > span { display: block; flex: 0 0 100%; }
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
    .pending-dot { animation: none; }
}
.sponsor-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.sponsor-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px dashed var(--line);
    border-radius: 999px;
    padding: 7px 15px;
    color: var(--text);
    background: var(--panel);
    font-weight: 700;
}
.sponsor-pill-logo { min-width: 94px; padding: 7px 13px; }
.sponsor-pill img {
    display: block;
    width: auto;
    max-width: 132px;
    height: 28px;
    object-fit: contain;
}
.hero-content { max-width: 780px; position: relative; z-index: 2; }
.hero h1 { font-size: clamp(34px, 6vw, 38px); line-height: 1.06; margin-bottom: 20px; max-width: 760px; }
.hero h1 .accent { color: transparent; background: linear-gradient(90deg, var(--lime), var(--cyan)); -webkit-background-clip: text; background-clip: text; }
.hero p:not(.eyebrow) { color: var(--muted); font-size: 19px; max-width: 560px; margin-bottom: 26px; }
.combo { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--cyan); font-family: var(--font-heading); font-size: 11.5px; letter-spacing: .06em; }
.combo .dot { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 8px var(--cyan); animation: pulse-dot 1.6s infinite; }

/* -------- Stat strip -------- */
.stat-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.stat-row { display: flex; justify-content: space-between; padding: 20px 0; flex-wrap: wrap; gap: 16px; }
.stat { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 130px; text-align: center; }
.stat b { font-family: var(--font-heading); font-size: 25px; color: var(--lime); }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* -------- Secciones -------- */
.section { padding: 64px clamp(18px, 5vw, 40px); position: relative; }
.section h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 34px; }
.section-dark { background: var(--panel); border-block: 1px solid var(--line); }

.feature-grid, .competition-grid, .points-grid, .tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.feature-grid article {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow); transition: transform var(--transition), border-color var(--transition);
}
.feature-grid article:hover { transform: translateY(-3px); border-color: var(--lime-border); }
.feature-grid span { font-family: var(--font-heading); font-size: 30px; color: rgba(156,255,61,.35); font-weight: 800; }
.feature-grid h3 { font-size: 18px; margin: 8px 0; }
.feature-grid p { color: var(--muted); font-size: 14.5px; margin: 0; }

.competition-card {
    display: block;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; position: relative; overflow: hidden;
    box-shadow: var(--shadow); transition: transform var(--transition), border-color var(--transition);
}
.competition-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--lime), var(--cyan)); }
.competition-card:hover, .competition-card:focus-visible { transform: translateY(-3px); border-color: var(--lime-border); }
.competition-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 54px; margin-bottom: 8px; }
.competition-card .comp-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); font-weight: 700; }
.competition-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(234,245,228,.14);
    border-radius: var(--radius-xs);
    background-color: rgb(227, 228, 227);
}
.competition-logo img {
    display: block;
    max-width: 42px;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.competition-card h3 { font-size: 18px; margin: 0 0 4px; }
.competition-card .country { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.competition-card.has-pending { border-color: var(--lime-border); }
.pending-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 2px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 3px 9px; border-radius: 999px;
    color: var(--lime);
    background: rgba(155, 226, 60, .08);
    border: 1px solid var(--lime-border);
}
.pending-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 6px var(--lime); animation: pending-pulse 1.6s ease-in-out infinite; }
@keyframes pending-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.6); } }

/* Seccion "Mis predicciones": acordeon (details/summary) con los partidos ya resueltos. */
.mypred-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mypred-total { font-family: var(--font-heading); font-weight: 800; color: var(--gold); font-size: 15px; }
.pred-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; overflow: hidden; }
.pred-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.pred-head::-webkit-details-marker { display: none; }
.pred-head .caret { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--transition); flex-shrink: 0; }
.pred-item[open] .pred-head .caret { transform: rotate(45deg); }
.pred-title { flex: 1; min-width: 0; }
.pred-title strong { display: block; font-size: 16px; }
.pred-title span { color: var(--muted); font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.pts { color: var(--gold); border-color: rgba(255,210,76,.4); background: rgba(255,210,76,.08); }
.chip.exact { color: var(--lime); border-color: var(--lime-border); background: rgba(155,226,60,.08); }
.pred-body { border-top: 1px solid var(--line); padding: 4px 18px 14px; }
.mrow { display: grid; grid-template-columns: 1fr auto 1fr auto; grid-template-areas: "home scores away pill"; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.mrow:last-of-type { border-bottom: 0; }
.mrow .team { grid-area: home; font-size: 13.5px; }
.mrow .team.away { grid-area: away; text-align: right; }
.mrow .scores { grid-area: scores; display: flex; align-items: center; gap: 14px; justify-self: center; font-family: var(--font-heading); }
.sc { min-width: 68px; text-align: center; }
.sc small { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.sc b { font-size: 16px; }
.mrow .pill { grid-area: pill; justify-self: end; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.mrow .pill.exact { color: var(--ink); background: linear-gradient(135deg, var(--lime), #6fe61f); border-color: transparent; }
.mrow .pill.win { color: var(--lime); border-color: var(--lime-border); background: rgba(155,226,60,.08); }
.mrow .pill.miss { color: var(--muted); }
.pred-more { display: inline-flex; margin-top: 12px; background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); padding: 8px 16px; font-family: var(--font-heading); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.pred-more:hover { border-color: var(--lime); color: var(--lime); }
@media (max-width: 600px) {
    .mrow { grid-template-columns: 1fr 1fr; grid-template-areas: "home away" "scores scores" "pill pill"; row-gap: 10px; }
    .mrow .scores { justify-self: start; }
    .mrow .pill { justify-self: start; }
}
.competition-card .comp-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.competition-card .next-date { color: var(--muted); font-size: 12.5px; }

.prize-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.prize-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px 16px 20px; text-align: center; position: relative;
}
.prize-card.gold { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,210,76,.16); }
.prize-card.silver { border-color: var(--silver); }
.prize-card.bronze { border-color: var(--bronze); }
.prize-card .ribbon { position: absolute; top: 0; left: 16px; width: 20px; height: 30px; background: var(--orange); clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%); }
.prize-card.gold .ribbon { background: var(--gold); }
.prize-card.silver .ribbon { background: var(--silver); }
.prize-card.bronze .ribbon { background: var(--bronze); }
.prize-image {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 8px 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-high);
    overflow: hidden;
}
.prize-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.prize-card span { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 12.5px; color: var(--orange); margin: 12px 0 4px; }
.prize-card h3 { font-size: 16px; margin: 6px 0; }
.prize-card p { color: var(--muted); font-size: 13px; margin: 0; }

.empty-state {
    border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px;
    text-align: center; color: var(--muted); background: var(--panel);
}
.empty-state strong { color: var(--text); display: block; margin-bottom: 6px; font-family: var(--font-heading); font-size: 15px; }

.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--panel); padding: 18px 0; }
.marquee div { display: flex; align-items: center; gap: 14px; width: max-content; animation: marquee 26s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse-dot { 50% { opacity: .25; } }

/* -------- Ranking -------- */
.table-scroll { overflow-x: auto; }
.ranking-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 560px; }
.ranking-table > div {
    display: grid;
    grid-template-columns: 70px minmax(160px, 1fr) 110px 120px 100px;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.ranking-table > div:last-child { border-bottom: none; }
.ranking-head { background: linear-gradient(90deg, var(--lime-glow), rgba(53,230,217,.08)); color: var(--lime); font-weight: 800; font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ranking-table strong { color: var(--text); }
.ranking-actions,
.ranking-summary,
.ranking-search div {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.ranking-actions { margin-top: 18px; }
.ranking-page { display: grid; gap: 22px; }
.ranking-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.ranking-tabs a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 12px;
}
.ranking-tabs a.is-active {
    border-color: var(--lime-border);
    color: var(--lime);
    background: var(--lime-glow);
}
.ranking-search {
    display: grid;
    gap: 8px;
    max-width: 720px;
}
.ranking-search label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.ranking-search input {
    min-width: min(100%, 320px);
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    background: var(--surface-high);
    color: var(--text);
}
.ranking-search input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 3px var(--lime-glow);
}
.ranking-summary {
    justify-content: space-between;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}
.ranking-summary h2 { margin: 0; }
.ranking-summary span { color: var(--muted); font-weight: 700; }

.points-grid article { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.points-grid strong { display: block; font-family: var(--font-heading); font-size: 42px; color: var(--lime); text-shadow: 0 0 20px var(--lime-glow); }
.points-grid span { color: var(--muted); font-size: 14px; }

/* -------- Fixture / predicciones -------- */
.page-hero { padding: 56px clamp(18px, 5vw, 40px) 30px; background: var(--panel); border-bottom: 1px solid var(--line); }
.page-hero.compact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); }
.fixture-shell { padding: 30px clamp(18px, 5vw, 40px) 64px; }
.fixture-shell form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.fixture-list { display: grid; gap: 14px; }
.match-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color var(--transition); }
.match-card.is-locked { opacity: .68; }
.match-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.lock-label { color: var(--orange); font-weight: 700; }
.match-row { display: grid; grid-template-columns: minmax(110px, 1fr) 64px 28px 64px minmax(110px, 1fr); align-items: center; gap: 10px; }
.team-label,
.table-team-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.team-label strong,
.table-team-label span { min-width: 0; overflow-wrap: anywhere; }
.team-label-away { justify-content: flex-end; text-align: right; }
.team-crest {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(234,245,228,.08);
}
.match-row input, .auth-panel input, .token-form input {
    width: 100%;
    min-height: 46px;
    font-size: 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    background: var(--surface-high);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.match-row input:focus, .auth-panel input:focus, .token-form input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 3px var(--lime-glow);
}
.match-row input { text-align: center; font-weight: 800; }
.match-row input:disabled { opacity: .6; cursor: not-allowed; }
.versus { color: var(--muted); text-align: center; font-family: var(--font-heading); font-size: 12px; }
.live-panel { position: sticky; top: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.fixture-inprogress { margin-top: 34px; }
.inprogress-prediction { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.inprogress-prediction strong { color: var(--text); font-family: var(--font-heading); }
.live-vs { color: var(--muted); font-family: var(--font-heading); font-size: 12px; text-align: center; }
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: pulse-dot 1.3s infinite;
}
.live-badge.is-waiting { color: var(--muted); }
.live-badge.is-waiting .live-dot { background: var(--muted-dim); box-shadow: none; animation: none; }

.fixture-results { margin-top: 34px; }
.section-heading-inline { margin-bottom: 16px; }
.section-heading-inline h2 { font-size: clamp(22px, 3vw, 30px); margin: 0; }
.result-card { display: grid; gap: 14px; }
.result-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
    align-items: center;
    gap: 12px;
}
.real-score {
    min-width: 74px;
    padding: 7px 12px;
    border: 1px solid var(--lime-border);
    border-radius: var(--radius-xs);
    color: var(--lime);
    background: rgba(156,255,61,.08);
    font-family: var(--font-heading);
    font-weight: 800;
    text-align: center;
}
.result-toggle { justify-self: start; min-height: 36px; padding-inline: 14px; }
.result-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.result-detail p { margin: 0; color: var(--muted); }
.result-detail span { display: block; font-size: 12px; }
.result-detail strong { color: var(--text); font-family: var(--font-heading); }
.results-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}
.results-pager p { margin: 0; }
.results-pager-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-high); overflow: hidden; margin: 16px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); transition: width .2s ease; }
.error-text, .flash-error { color: var(--danger); }
.tables-grid table { width: 100%; border-collapse: collapse; }
.tables-grid th, .tables-grid td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
.standings-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* -------- Modal de autenticacion -------- */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: start center;
    padding: clamp(18px, 6vh, 56px) 18px 18px;
    overflow-y: auto;
    background: rgba(3,5,3,.78);
    backdrop-filter: blur(3px);
}
.auth-modal.is-open { display: grid; }
.auth-dialog { position: relative; width: min(500px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; overflow-x: hidden; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
/* Los adornos .hud se posicionan en -1px para pisar el borde, pero como este dialogo es un
   contenedor con scroll ese pixel generaba barras de scroll en ambos ejes (con overflow-y
   auto, el eje X tambien pasa a auto). Dentro del modal se dibujan por dentro del borde. */
.auth-dialog.hud::before { top: 0; left: 0; }
.auth-dialog.hud::after { bottom: 0; right: 0; }
.auth-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding-right: 2px; }
.auth-dialog-header .eyebrow { margin-bottom: 4px; }
.auth-dialog-header h2 { font-size: 22px; margin: 0; }
.modal-close { flex: 0 0 auto; width: 36px; height: 36px; background: transparent; border: 1px solid var(--line); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; border-radius: var(--radius-xs); }
.modal-close:hover { color: var(--lime); }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab { flex: 1; min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-high); color: var(--text); cursor: pointer; font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.auth-tab.is-active { background: linear-gradient(135deg, var(--lime), #6fe61f); color: var(--ink); }
.auth-panel { display: none; }
.auth-panel.is-active { display: grid; gap: 10px; }
.auth-panel h2 { font-size: 20px; }
.auth-panel label { display: grid; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
/* Pares de campos cortos (DNI/Telefono, Contrasena/Confirmar) en dos columnas: es lo que
   permite que el formulario de registro entre en pantalla sin scroll. */
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Fila de checkbox (seguir en Instagram): horizontal, neutralizando los estilos de input
   del modal para que el checkbox no ocupe todo el ancho ni mida 46px de alto. */
.auth-panel label.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    line-height: 1.45;
}
.auth-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--lime);
    cursor: pointer;
}
.auth-check a { color: var(--cyan); font-weight: 700; }
.auth-check a:hover { color: var(--lime); }
/* Pantallas de poca altura (celulares chicos, mobile apaisado): se compacta todavia mas para
   que el registro siga entrando sin scroll. No se toca el font-size de 16px de los inputs
   porque es lo que evita el zoom automatico de iOS al enfocar un campo. */
@media (max-height: 740px) {
    .auth-modal { padding-top: 12px; }
    .auth-dialog { padding: 16px; max-height: calc(100vh - 24px); }
    .auth-dialog-header { margin-bottom: 12px; }
    .auth-tabs { margin-bottom: 12px; }
    .auth-tab { min-height: 38px; }
    .auth-panel.is-active { gap: 8px; }
    .auth-panel input:not([type="checkbox"]) { min-height: 42px; }
    .auth-check { font-size: 13px; }
}
.muted { color: var(--muted); }

/* -------- Flash / verificacion -------- */
.flash { margin: 18px clamp(18px, 5vw, 40px); padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.flash-ok { color: var(--lime); border-color: var(--lime-border); }
.token-form { display: flex; gap: 10px; width: min(560px, 100%); }
.verify-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.verify-card.ok { border-color: var(--lime-border); }

/* -------- Pantalla de verificacion de correo -------- */
/* Es una pantalla de una sola accion (el usuario no puede seguir hasta verificar), asi que
   se centra el panel y se guia el proximo paso en vez de usar el layout de seccion normal. */
.verify-page {
    display: grid;
    place-items: center;
    min-height: 68vh;
    padding: clamp(28px, 7vh, 64px) clamp(18px, 5vw, 40px);
}
.verify-panel {
    width: min(520px, 100%);
    padding: clamp(24px, 5vw, 36px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.verify-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--lime-glow);
    border: 1px solid var(--lime-border);
}
.verify-icon svg { width: 30px; height: 30px; color: var(--lime); }
.verify-panel h1 { font-size: clamp(24px, 4vw, 30px); margin-bottom: 12px; }
.verify-lead { color: var(--muted); margin-bottom: 8px; font-size: 15px; }
.verify-email {
    padding: 11px 14px;
    margin-bottom: 22px;
    background: var(--surface-high);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}
.verify-steps {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: paso;
    text-align: left;
}
.verify-steps li {
    counter-increment: paso;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 14.5px;
}
.verify-steps li::before {
    content: counter(paso);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--lime-glow);
    color: var(--lime);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 12px;
}
.verify-steps strong { color: var(--text); }
.verify-actions { display: grid; gap: 10px; margin-bottom: 16px; }
.verify-actions form { margin: 0; }
.verify-hint { margin: 0; color: var(--muted-dim); font-size: 13px; line-height: 1.5; }
@media (min-width: 560px) {
    .verify-actions { grid-template-columns: 1fr 1fr; }
}
.form-stack { display: grid; gap: 14px; margin-top: 18px; max-width: 320px; }
.form-stack form { margin: 0; }
.auth-card { max-width: 460px; }
.auth-card .auth-panel { display: grid; gap: 12px; }
.auth-card .auth-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.auth-link { display: inline-block; margin-top: 4px; color: var(--cyan); font-weight: 600; font-size: 13.5px; }
.auth-link:hover { color: var(--lime); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.profile-grid .auth-panel { display: grid; gap: 12px; margin-top: 8px; }
.profile-grid .auth-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.profile-grid p { margin-bottom: 8px; }

/* -------- Mini ligas -------- */
.mini-form {
    display: grid;
    gap: 16px;
    max-width: 760px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.mini-form label, .mini-copy, .mini-filter label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.mini-form input, .mini-form textarea, .mini-copy input, .mini-filter select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    background: var(--surface-high);
    color: var(--text);
}
.mini-form textarea { padding-block: 12px; resize: vertical; }
.mini-form fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.mini-form legend {
    padding: 0 8px;
    color: var(--lime);
    font-family: var(--font-heading);
    font-size: 12px;
    text-transform: uppercase;
}
.mini-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mini-check {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px !important;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    color: var(--text) !important;
    background: var(--panel-2);
}
.mini-check input { width: auto; min-height: auto; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.mini-league-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.mini-side-panel { display: grid; gap: 14px; }
.mini-side-panel h2 { font-size: 17px; margin: 0; }
.mini-member-list { display: grid; gap: 8px; }
.mini-member-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.mini-member-list span { color: var(--muted); font-size: 13px; }
.mini-main-panel { display: grid; gap: 16px; min-width: 0; }
.mini-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.mini-ranking-table > div { grid-template-columns: 70px minmax(160px, 1fr) 110px 120px 100px; }
.mini-league-copy { max-width: 680px; margin-bottom: 24px; }
.mini-league-actions { margin-top: 24px; }

/* -------- Footer -------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px clamp(18px, 5vw, 40px); color: var(--muted); font-size: 13.5px; }
.site-footer .footer-inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.site-footer strong { color: var(--text); font-family: var(--font-heading); font-size: 13px; }
.site-footer a:hover { color: var(--lime); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* -------- Responsive -------- */
/* El header lleva ahora mas contenido (link a la tienda + acciones de usuario), asi que
   colapsa al menu hamburguesa antes que el resto del contenido para no encimar el nav con
   las acciones en pantallas medianas. */
@media (max-width: 1200px) {
    .header-inner {
        display: flex;
        justify-content: space-between;
    }
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 16px;
        padding: 18px clamp(18px, 4vw, 40px) 22px;
        background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .site-nav.is-open { display: flex; }
    .main-nav { flex-direction: column; gap: 14px; }
    .header-actions { flex-direction: column; align-items: stretch; }
    .header-actions .btn { width: 100%; }
    .header-actions form { width: 100%; }
    /* En el menu mobile los botones son full-width: mostrar el texto de Perfil/Salir. */
    .btn-icon { padding: 0 20px; }
    .btn-icon .btn-icon-text { display: inline; }
}

@media (max-width: 860px) {
    .fixture-shell form { grid-template-columns: 1fr; }
    .live-panel { position: static; }
    .mini-league-layout { grid-template-columns: 1fr; }
    .ranking-table > div { grid-template-columns: 40px 1fr 64px 76px 64px; font-size: 13px; padding: 12px 14px; }
    .match-row { grid-template-columns: 1fr 56px 22px 56px 1fr; font-size: 14px; }
}

/* Ranking en mobile: cada fila pasa a tarjeta (posicion + nombre arriba, stats etiquetados
   debajo). Asi se elimina el scroll horizontal que escondia la columna Puntaje. */
@media (max-width: 640px) {
    .table-scroll { overflow-x: visible; }
    .ranking-table,
    .mini-ranking-table { min-width: 0; }
    .ranking-table > .ranking-head { display: none; }
    .ranking-table > div,
    .mini-ranking-table > div {
        position: relative;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px 12px;
        /* Padding izquierdo reservado para el badge de posicion, que va absoluto:
           asi el nombre del participante dispone del ancho completo de la tarjeta. */
        padding: 14px 14px 14px 46px;
        font-size: 14px;
    }
    .ranking-table > div > :nth-child(1) {
        position: absolute;
        left: 14px;
        top: 13px;
        font-family: var(--font-heading);
        font-weight: 800;
        color: var(--lime);
    }
    .ranking-table > div > :nth-child(2) {
        grid-column: 1 / -1;
        font-weight: 700;
        overflow-wrap: anywhere;
    }
    .ranking-table > div > [data-label] {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .ranking-table > div > [data-label]::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--muted);
    }
}

@media (max-width: 560px) {
    .auth-modal {
        padding: 12px;
        place-items: start center;
    }
    .auth-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 18px;
    }
    .auth-tabs {
        gap: 6px;
    }
    .auth-tab {
        min-height: 40px;
        padding-inline: 8px;
        font-size: 11px;
    }
    .sponsor-strip {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px 8px;
        align-items: center;
        max-width: 320px;
        margin-inline: auto;
        margin-bottom: 18px;
    }
    .sponsor-strip > span {
        grid-column: 1 / -1;
        text-align: center;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .sponsor-strip > .sponsor-pill {
        grid-column: span 2;
        width: 100%;
        min-width: 0;
        min-height: 28px;
        padding: 4px 7px;
        border-color: rgba(234,245,228,.18);
        background: rgba(6,9,7,.2);
    }
    .sponsor-strip > .sponsor-pill:nth-last-child(2):nth-child(3n + 2) {
        grid-column: 2 / span 2;
    }
    .sponsor-strip > .sponsor-pill:nth-last-child(2):nth-child(3n + 2) + .sponsor-pill {
        grid-column: 4 / span 2;
    }
    .sponsor-strip > .sponsor-pill:nth-last-child(1):nth-child(3n + 2) {
        grid-column: 3 / span 2;
    }
    .sponsor-pill-logo {
        padding: 4px 7px;
    }
    .sponsor-pill img {
        max-width: 82px;
        height: 18px;
    }
    /* Carga de goles en mobile: cada equipo con su input en su propia fila y alineados,
       en vez de una unica fila horizontal que desbordaba y dejaba el input visitante suelto.
       [escudo] Equipo local        [gol]
       [escudo] Equipo visitante    [gol] */
    .match-row {
        grid-template-columns: minmax(0, 1fr) 64px;
        column-gap: 12px;
        row-gap: 12px;
    }
    .match-row .versus { display: none; }
    .match-row > .team-label:first-child { grid-column: 1; grid-row: 1; }
    .match-row > input:first-of-type { grid-column: 2; grid-row: 1; }
    .match-row > input:last-of-type { grid-column: 2; grid-row: 2; }
    .match-row > .team-label-away {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row-reverse;
        justify-content: flex-end;
        text-align: left;
    }
    .result-row {
        grid-template-columns: 1fr auto;
    }
    .result-row .team-label-away {
        grid-column: 1 / -1;
        justify-content: flex-start;
        text-align: left;
    }
    .token-form { flex-direction: column; }
    .stat-row { justify-content: flex-start; }
    .stat { min-width: 45%; }
}

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