:root {
    --bg: #0B1E33;
    --bg-deep: #071624;
    --surface: rgba(255, 255, 255, 0.055);
    --border: rgba(255, 255, 255, 0.12);
    --text: #F0F6FC;
    --muted: rgba(240, 246, 252, 0.66);
    --faint: rgba(240, 246, 252, 0.42);
    --accent: #00A3FF;
    --cta: #FFD700;
    --success: #38A169;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: radial-gradient(circle at 50% -10%, rgba(0, 163, 255, 0.22), transparent 34%), linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.08));
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.page-shell {
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 18px 18px 56px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -18px -18px 16px;
    padding: 14px 18px;
    background: rgba(11, 30, 51, 0.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
    width: min(1160px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.brand img {
    width: clamp(126px, 34vw, 190px);
    height: auto;
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.035);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 22px;
    align-items: stretch;
    padding: 30px 0 24px;
}

body.tournament-disabled .hero {
    grid-template-columns: 1fr;
}

body.tournament-disabled .quick-panel,
body.tournament-disabled .status-strip,
body.tournament-disabled main {
    display: none;
}

body.tournament-disabled .ghost-link[href="#schedule"] {
    display: none;
}

body.tournament-disabled .hero-main {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.tournament-disabled .live-dot {
    background: var(--faint);
    box-shadow: none;
}

.hero-main,
.quick-panel,
.section-panel {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hero-main {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 42px);
}

.hero-main::after {
    content: '';
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 340px;
    height: 340px;
    border: 34px solid rgba(255, 215, 0, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 163, 255, 0.13);
    border: 1px solid rgba(0, 163, 255, 0.28);
    color: #9DDAFF;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cta);
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.12);
}

h1 {
    margin: 22px 0 12px;
    max-width: 720px;
    font-size: clamp(2.2rem, 7vw, 4.75rem);
    line-height: 0.96;
    font-weight: 900;
    letter-spacing: 0;
}

.hero-subtitle {
    max-width: 640px;
    margin: 0 0 24px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.16rem);
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.meta-tile {
    min-height: 78px;
    padding: 13px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.meta-label {
    color: var(--faint);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.meta-value {
    margin-top: 4px;
    color: white;
    font-weight: 800;
}

.quick-panel {
    padding: 18px;
}

.search-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.search-box { position: relative; }

.search-box svg {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--faint);
}

.search-box input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px 12px 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    outline: none;
    color: white;
    background: rgba(0, 0, 0, 0.22);
}

.search-box input:focus {
    border-color: rgba(0, 163, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.13);
}

.jump-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.jump-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.82);
    font-weight: 750;
}

.jump-list span { color: var(--cta); }

.quick-live {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.quick-live-row {
    padding: 10px 12px;
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(255, 215, 0, 0.08);
}

.quick-live-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 850;
}

.quick-live-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
}

.quick-live-teams span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-live-score {
    flex-shrink: 0;
    color: var(--cta);
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 22px;
}

.status-card {
    min-height: 82px;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.status-card strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--cta);
}

.status-card span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.section { margin-top: 22px; }

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

.section-header h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.15;
}

.section-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.section-panel { padding: 16px; }
.match-list { display: grid; gap: 10px; }

.match-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 86px;
    padding: 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.match-card.live {
    border-color: rgba(255, 215, 0, 0.38);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), rgba(255, 255, 255, 0.055));
}

.match-time {
    color: var(--muted);
    font-weight: 900;
}

.match-time span {
    display: block;
    margin-top: 4px;
    color: var(--faint);
    font-size: 0.76rem;
    font-weight: 750;
}

.teams {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.team-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 850;
}

.team-seed {
    color: var(--faint);
    font-weight: 750;
}

.score {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 44px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: white;
    font-size: 1.15rem;
    font-weight: 900;
}

.sets {
    margin-top: 4px;
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge.live {
    color: #0B1E33;
    background: var(--cta);
}

.badge.finished {
    color: white;
    background: rgba(56, 161, 105, 0.26);
}

.badge.scheduled {
    color: #9DDAFF;
    background: rgba(0, 163, 255, 0.16);
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 850;
    cursor: pointer;
}

.tab-button.active {
    color: #0B1E33;
    border-color: var(--cta);
    background: var(--cta);
}

.schedule-grid,
.group-grid,
.playoff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

th, td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

th {
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.18);
}

td {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

tbody tr:last-child td { border-bottom: 0; }

.place {
    width: 34px;
    color: var(--cta);
    font-weight: 900;
}

.group-title {
    margin: 0 0 10px;
    color: white;
    font-size: 1.1rem;
}

.round {
    display: grid;
    gap: 10px;
}

.round h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bracket-match {
    min-height: 112px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.052);
}

.bracket-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 800;
}

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

.footer {
    margin-top: 28px;
    padding: 22px 0 0;
    color: var(--faint);
    font-size: 0.88rem;
    text-align: center;
}

@media (max-width: 880px) {
    .hero,
    .schedule-grid,
    .group-grid,
    .playoff {
        grid-template-columns: 1fr;
    }

    .status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page-shell { padding: 14px 12px 44px; }

    .topbar {
        margin: -14px -12px 10px;
        padding: 12px;
    }

    .ghost-link {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .hero { padding-top: 18px; }
    .hero-main, .quick-panel, .section-panel { border-radius: 14px; }
    .hero-main { padding: 22px; }
    .hero-meta { grid-template-columns: 1fr; }
    .section-header { display: block; }
    .section-note { margin-top: 5px; }

    .match-card {
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: start;
    }

    .match-time {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .score { min-width: 58px; }
    table { min-width: 560px; }
}
