:root {
    --paf-bg: #050a16;
    --paf-bg-2: #0b1220;
    --paf-panel: rgba(15, 24, 43, 0.78);
    --paf-panel-strong: rgba(16, 26, 48, 0.94);
    --paf-line: rgba(148, 163, 184, 0.22);
    --paf-line-strong: rgba(38, 198, 249, 0.34);
    --paf-text: #f8fbff;
    --paf-muted: #9fb0c8;
    --paf-blue: #123a70;
    --paf-cyan: #26c6f9;
    --paf-violet: #6d5dfb;
    --paf-green: #16a34a;
    --paf-gold: #c9a227;
    --tenant-primary: #123a70;
    --tenant-secondary: #26c6f9;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
    color: var(--paf-text);
    background:
        linear-gradient(130deg, rgba(38, 198, 249, 0.10), transparent 30%),
        linear-gradient(160deg, rgba(109, 93, 251, 0.12), transparent 42%),
        linear-gradient(150deg, #050a16 0%, #071324 56%, #050a16 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
}

button, input, textarea, select {
    font: inherit;
}

#app {
    min-height: 100vh;
}

.loading-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(125deg, rgba(38, 198, 249, 0.16), transparent 32%),
        linear-gradient(145deg, #050a16, #071527 58%, #050a16);
}

.loading-card {
    width: min(430px, 100%);
    padding: 26px;
    border: 1px solid var(--paf-line);
    border-radius: var(--radius-lg);
    background: rgba(15, 24, 43, 0.9);
    box-shadow: var(--shadow);
}

.loading-brand, .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.loading-brand strong,
.brand-copy span {
    display: block;
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.loading-brand small,
.brand-copy small {
    display: block;
    margin-top: 4px;
    color: var(--paf-cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.loading-card p {
    margin: 24px 0 14px;
    color: var(--paf-muted);
}

.loading-track {
    overflow: hidden;
    height: 8px;
    border: 1px solid rgba(38, 198, 249, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.loading-bar {
    display: block;
    width: var(--blazor-load-percentage, 18%);
    min-width: 18%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--paf-violet), var(--paf-cyan));
    transition: width 0.2s ease;
}

.loading-progress-text {
    margin-top: 10px;
    color: var(--paf-muted);
    font-size: 12px;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Cargando");
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 1px solid rgba(38, 198, 249, 0.42);
    border-radius: 9px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(109, 93, 251, 0.44), rgba(18, 58, 112, 0.5));
    box-shadow: inset 0 0 18px rgba(38, 198, 249, 0.16);
    font-family: Consolas, "Courier New", monospace;
    font-size: 17px;
    font-weight: 900;
}

.liga-shell {
    min-height: 100vh;
    color: var(--paf-text);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 66px;
    padding: 12px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid var(--paf-line);
    background: rgba(5, 10, 22, 0.88);
    backdrop-filter: blur(18px);
}

.brand {
    min-width: max-content;
    color: #ffffff;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--paf-muted);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
    color: #ffffff;
    border-color: rgba(38, 198, 249, 0.24);
    background: rgba(38, 198, 249, 0.08);
}

.content {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 72px;
}

.hero,
.page-hero,
.state-panel,
.match-detail,
.roster-hero {
    border: 1px solid var(--paf-line);
    border-radius: var(--radius-lg);
    background: var(--paf-panel);
    box-shadow: var(--shadow);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(390px, 1.04fr);
    gap: 30px;
    align-items: stretch;
    min-height: 560px;
    padding: clamp(28px, 5vw, 58px);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(125deg, color-mix(in srgb, var(--tenant-primary) 34%, transparent), transparent 42%),
        linear-gradient(180deg, rgba(38, 198, 249, 0.08), transparent 36%);
    pointer-events: none;
}

.hero-copy,
.scoreboard-panel {
    position: relative;
    z-index: 1;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.module-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: var(--paf-cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.module-lockup img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.08);
}

.hero h1,
.page-hero h1,
.match-detail h1,
.roster-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.96;
    font-weight: 900;
    letter-spacing: 0;
}

.hero p {
    max-width: 600px;
    margin: 22px 0 0;
    color: var(--paf-muted);
    font-size: 18px;
    line-height: 1.7;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(38, 198, 249, 0.35);
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(135deg, var(--paf-violet), var(--paf-cyan));
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(38, 198, 249, 0.14);
}

.button.secondary {
    color: var(--paf-text);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.scoreboard-panel {
    min-height: 380px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(38, 198, 249, 0.24);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(38, 198, 249, 0.12), transparent 34%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 78px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 64px),
        #07111f;
    background-size: cover;
    background-position: center;
}

.scoreboard-panel.has-image {
    background-size: cover;
    background-position: center;
}

.scoreboard-panel.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 10, 22, 0.42), rgba(5, 10, 22, 0.86));
}

.scoreboard-header,
.scoreboard-list,
.score-empty {
    position: relative;
    z-index: 1;
}

.scoreboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.scoreboard-header span,
.tournament-card span,
.result-row span,
.fixture-teams span,
.team-card span,
.player-card span,
.match-detail header span,
.roster-hero span {
    color: var(--paf-cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scoreboard-header strong {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: #ffffff;
    background: rgba(38, 198, 249, 0.12);
}

.scoreboard-list,
.result-list,
.match-list {
    display: grid;
    gap: 12px;
}

.match-card,
.fixture-row,
.result-row,
.tournament-card,
.team-card,
.player-card {
    border: 1px solid var(--paf-line);
    border-radius: var(--radius);
    color: inherit;
    background: rgba(255, 255, 255, 0.055);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.match-card:hover,
.fixture-row:hover,
.result-row:hover,
.tournament-card:hover,
.team-card:hover,
.player-card:hover {
    transform: translateY(-2px);
    border-color: var(--paf-line-strong);
    background: rgba(38, 198, 249, 0.08);
}

.match-card {
    display: block;
    padding: 16px;
}

.match-card > span {
    color: var(--paf-muted);
    font-size: 12px;
}

.match-card div {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
}

.match-card strong:last-child,
.teams strong:last-child {
    text-align: right;
}

.match-card b,
.fixture-score b,
.result-row b,
.teams span {
    display: inline-grid;
    place-items: center;
    min-width: 64px;
    min-height: 38px;
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(135deg, var(--tenant-primary), var(--paf-cyan));
    font-size: 18px;
    font-weight: 950;
}

.score-empty,
.empty-state,
.state-panel {
    padding: 26px;
    color: var(--paf-muted);
}

.score-empty,
.empty-state {
    border: 1px dashed rgba(38, 198, 249, 0.28);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.045);
}

.score-empty strong,
.empty-state strong,
.state-panel h1,
.state-panel h2 {
    display: block;
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
}

.score-empty p,
.empty-state p,
.state-panel p {
    margin: 0;
}

.state-pulse {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border: 1px solid rgba(38, 198, 249, 0.5);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(109, 93, 251, 0.5), rgba(38, 198, 249, 0.2));
}

.error-state {
    border-color: rgba(248, 113, 113, 0.34);
}

.section {
    margin-top: 42px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.05;
    font-weight: 900;
}

.section-heading a,
.back-link {
    color: var(--paf-cyan);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.tournament-strip,
.tournament-grid,
.team-grid,
.player-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tournament-grid,
.team-grid,
.player-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tournament-card {
    padding: 18px;
}

.tournament-card h2,
.tournament-card h3,
.team-card h2,
.player-card h2 {
    margin: 10px 0 6px;
    color: #ffffff;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 900;
}

.tournament-card p,
.team-card p,
.player-card p {
    margin: 0;
    color: var(--paf-muted);
}

.tournament-card small {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-top: 16px;
    padding: 0 9px;
    border-radius: 999px;
    color: #dfffee;
    background: rgba(22, 163, 74, 0.16);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.league-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
    gap: 18px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--paf-line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.055);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 13px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: #dce7f7;
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--paf-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

td strong {
    color: #ffffff;
}

tbody tr:hover {
    background: rgba(38, 198, 249, 0.055);
}

.rank {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    color: #ffffff;
    background: rgba(38, 198, 249, 0.12);
    font-weight: 900;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr auto 76px auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
}

.result-list.full .result-row {
    grid-template-columns: minmax(160px, 0.9fr) minmax(160px, 1fr) 84px minmax(160px, 1fr);
}

.result-row strong:last-child {
    text-align: right;
}

.page-hero {
    min-height: 210px;
    display: flex;
    align-items: end;
    padding: clamp(26px, 5vw, 46px);
}

.page-hero p {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--paf-muted);
    font-size: 17px;
    line-height: 1.65;
}

.fixture-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 100px minmax(160px, 0.55fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
}

.fixture-date {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(38, 198, 249, 0.1);
}

.fixture-date strong {
    color: #ffffff;
}

.fixture-date span,
.fixture-score span,
.fixture-venue {
    color: var(--paf-muted);
    font-size: 12px;
}

.fixture-teams {
    display: grid;
    gap: 5px;
}

.fixture-teams strong {
    color: #ffffff;
}

.fixture-score {
    display: grid;
    gap: 4px;
    justify-items: center;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.shield,
.avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border: 1px solid rgba(38, 198, 249, 0.24);
    border-radius: var(--radius);
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(38, 198, 249, 0.18), rgba(109, 93, 251, 0.24)),
        #07111f center / cover no-repeat;
    font-weight: 950;
}

.shield.large {
    width: 86px;
    height: 86px;
    font-size: 22px;
}

.avatar {
    border-radius: 50%;
}

.match-detail,
.roster-hero {
    padding: clamp(24px, 5vw, 46px);
}

.match-detail header,
.team-title {
    margin-top: 18px;
}

.match-detail h1 {
    margin-top: 8px;
    font-size: clamp(32px, 5vw, 58px);
}

.teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: center;
    margin: 34px 0;
    color: #ffffff;
    font-size: clamp(26px, 4vw, 46px);
    font-weight: 950;
}

.teams span {
    min-width: 92px;
    min-height: 52px;
    font-size: 24px;
}

dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px 22px;
    margin: 0;
}

dt {
    color: var(--paf-muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

dd {
    margin: 0;
    color: #ffffff;
}

.team-title {
    display: flex;
    align-items: center;
    gap: 18px;
}

.team-title p {
    margin: 8px 0 0;
    color: var(--paf-muted);
}

.player-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.muted {
    color: var(--paf-muted);
}

#blazor-error-ui {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: none;
    padding: 14px 44px 14px 16px;
    border: 1px solid rgba(248, 113, 113, 0.38);
    border-radius: var(--radius);
    color: #fff;
    background: rgba(76, 13, 24, 0.96);
    box-shadow: var(--shadow);
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: 850;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 1rem;
    border-radius: var(--radius);
    color: white;
    background: #7f1d1d;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 1000px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .hero,
    .league-dashboard {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .tournament-strip,
    .tournament-grid,
    .team-grid,
    .player-grid {
        grid-template-columns: 1fr 1fr;
    }

    .fixture-row,
    .result-row,
    .result-list.full .result-row {
        grid-template-columns: 1fr;
    }

    .result-row strong:last-child,
    .match-card strong:last-child {
        text-align: left;
    }

    .fixture-score {
        justify-items: start;
    }
}

@media (max-width: 640px) {
    .content {
        width: min(100% - 24px, 1200px);
        padding-top: 20px;
    }

    .site-nav a {
        padding: 0 9px;
        font-size: 12px;
    }

    .hero,
    .page-hero,
    .match-detail,
    .roster-hero {
        padding: 20px;
    }

    .hero h1,
    .page-hero h1,
    .match-detail h1,
    .roster-hero h1 {
        font-size: 38px;
        line-height: 1;
    }

    .hero p,
    .page-hero p {
        font-size: 15px;
    }

    .match-card div,
    .teams,
    .tournament-strip,
    .tournament-grid,
    .team-grid,
    .player-grid {
        grid-template-columns: 1fr;
    }

    .teams strong:last-child {
        text-align: left;
    }

    .team-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
