:root {
    --bg: #07040c;
    --panel: rgba(22, 12, 32, 0.92);
    --line: rgba(232, 197, 107, 0.45);
    --gold: #e8c56b;
    --gold-soft: #f3e0a8;
    --magenta: #c46be8;
    --muted: #9a8fb0;
    --win: #f6d889;
    --slot: #120a1c;
    --live: #7cffb2;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: #f7f1ff;
    font-family: Manrope, system-ui, sans-serif;
}
.bg-glow {
    position: fixed;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 0%, rgba(196, 107, 232, 0.18), transparent 42%),
        radial-gradient(circle at 80% 10%, rgba(232, 197, 107, 0.16), transparent 38%);
    pointer-events: none;
    z-index: 0;
}
.cup-header, main, .cup-footer { position: relative; z-index: 1; }
.cup-header {
    text-align: center;
    padding: 36px 20px 12px;
}
.eyebrow {
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--gold);
    font-size: 12px;
    margin: 0 0 8px;
}
h1 {
    font-family: Cinzel, serif;
    font-weight: 900;
    font-size: clamp(28px, 5vw, 52px);
    margin: 0;
    color: var(--gold-soft);
    text-shadow: 0 0 24px rgba(232, 197, 107, 0.25);
}
.cup-meta {
    color: var(--muted);
    margin: 10px 0 18px;
}
.legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: var(--muted);
}
.dot.live { background: var(--live); box-shadow: 0 0 8px var(--live); }
.dot.win { background: var(--gold); }
.dot.wo { background: #ff8b6b; }
.dot.bye { background: #6b7cff; }

.reg-panel {
    max-width: 720px;
    margin: 12px auto 28px;
    background: var(--panel);
    border: 1px solid rgba(232, 197, 107, 0.22);
    border-radius: 16px;
    padding: 18px 22px;
}
.reg-panel h2 {
    font-family: Cinzel, serif;
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--gold);
}
.players {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.player-chip {
    background: var(--slot);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.bracket-wrap {
    overflow-x: auto;
    padding: 12px 24px 48px;
}
.bracket {
    display: flex;
    align-items: stretch;
    min-height: 480px;
    width: max-content;
    margin: 0 auto;
}
.round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 240px;
}
.round-title {
    text-align: center;
    font-family: Cinzel, serif;
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.round-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.match-slot {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 88px;
    padding: 8px 0;
}
.match {
    width: 220px;
    background: var(--panel);
    border: 1px solid rgba(232, 197, 107, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
}
.match.live {
    border-color: var(--live);
    box-shadow: 0 0 18px rgba(124, 255, 178, 0.18);
}
.match.wo { border-color: #ff8b6b; }
.match.bye { border-color: #6b7cff; }
.match.done { border-color: rgba(232, 197, 107, 0.45); }

.slot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--slot);
    font-size: 14px;
    min-height: 40px;
    align-items: center;
}
.slot + .slot { border-top: 1px solid rgba(255,255,255,0.06); }
.slot.winner {
    color: var(--win);
    background: linear-gradient(90deg, rgba(232,197,107,0.16), transparent 70%);
    font-weight: 700;
}
.slot.loser { color: var(--muted); }
.slot .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.slot .tag {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.connectors {
    width: 48px;
    position: relative;
}
.connectors::before,
.connectors::after {
    content: "";
    position: absolute;
    border-color: var(--line);
    border-style: solid;
}
.connectors.even::before {
    left: 0;
    top: 25%;
    width: 50%;
    height: 50%;
    border-width: 0 0 2px 0;
}
.connectors.odd::before {
    left: 0;
    top: 25%;
    width: 50%;
    height: 50%;
    border-width: 2px 0 0 0;
}
.connectors::after {
    left: 50%;
    top: 50%;
    width: 50%;
    height: 0;
    border-width: 2px 0 0 0;
}

.champion {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 220px;
    padding-left: 12px;
}
.trophy {
    background: linear-gradient(180deg, rgba(232,197,107,0.2), rgba(22,12,32,0.92));
    border: 1px solid var(--gold);
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
}
.trophy span {
    display: block;
    font-family: Cinzel, serif;
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 0.16em;
}
.trophy strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 80px 16px;
}
.cup-footer {
    text-align: center;
    color: #6e6480;
    font-size: 12px;
    padding-bottom: 24px;
}

@media (max-width: 720px) {
    .match { width: 190px; }
    .round { min-width: 210px; }
}
