:root {
    --red: #ff2424;
    --red-dim: rgba(255, 36, 36, 0.72);
    --match-w: 220px;
    --elbow-w: 36px;
    --ink: #f4f4f4;
    --muted: #9a9a9a;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    color: var(--ink);
    background: #07080d;
    font-family: Oswald, "Arial Narrow", sans-serif;
}

button, input, textarea, select { font: inherit; color: inherit; }

a { color: inherit; }

.sky {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.08) 24%, rgba(0, 0, 0, 0.05) 62%, rgba(0, 0, 0, 0.28) 100%),
        url("../img/skyline.jpg") center 36% / cover no-repeat;
    pointer-events: none;
    z-index: 0;
}

.streaks { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; height: 820px; }

.streaks i {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    box-shadow: 0 0 12px #ff0000;
}

.streaks i:nth-child(1) { top: 86px; left: -30px; width: 240px; transform: rotate(32deg); }
.streaks i:nth-child(2) { top: 150px; left: 18px; width: 180px; transform: rotate(32deg); }
.streaks i:nth-child(3) { top: 92px; right: -20px; width: 230px; transform: rotate(-32deg); }
.streaks i:nth-child(4) { top: 168px; right: 24px; width: 160px; transform: rotate(-32deg); }

.topbar, .page, .fineprint, .toast { position: relative; z-index: 2; }

.topbar {
    display: flex;
    align-items: center;
    gap: 22px;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 92px;
}

.crown svg, .hero-crown svg {
    fill: var(--red);
    stroke: none;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.9));
}

.brand .crown svg { width: 28px; height: 18px; display: block; }

.brand-name {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 32px;
    letter-spacing: 0.08em;
    line-height: 1;
}

.topnav {
    display: flex;
    justify-content: center;
    gap: 26px;
    flex: 1;
}

.topnav a {
    text-decoration: none;
    color: #f2f2f2;
    letter-spacing: 0.18em;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.topnav a.active {
    text-shadow: 0 0 12px rgba(255, 30, 30, 0.95);
}

.top-actions { display: flex; align-items: center; gap: 12px; }

.manage-link {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 13px;
    text-decoration: none;
    color: #ffb4b4;
}

.rp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.14em;
    font-size: 13px;
    padding: 8px 16px;
    border: 1px solid var(--red);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(255, 0, 0, 0.35), inset 0 0 10px rgba(255, 0, 0, 0.18);
    background: rgba(40, 0, 0, 0.45);
}

.hero { text-align: center; padding: 18px 16px 6px; }

.kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0;
    letter-spacing: 0.46em;
    font-size: 13px;
    font-weight: 500;
}

.kicker i {
    width: 46px;
    height: 2px;
    background: var(--red);
    box-shadow: 0 0 8px #ff0000;
}

.hero-crown { position: relative; z-index: 2; height: 28px; }
.hero-crown svg { width: 58px; height: 34px; margin-top: 2px; }

.hero h1 {
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.95;
}

.metal {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(72px, 9vw, 112px);
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #fff 0%, #e6e6e6 32%, #9a9a9a 48%, #fff 52%, #6a6a6a 70%, #dedede 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 3px 0 #1a1a1a) drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
}

.brush {
    font-family: "Bebas Neue", Impact, sans-serif;
    text-transform: uppercase;
    font-size: clamp(52px, 6.2vw, 82px);
    letter-spacing: 0.14em;
    color: #ff1a1a;
    margin-top: 6px;
    line-height: 1;
    text-shadow: 0 0 14px rgba(255, 0, 0, 0.95), 0 0 32px rgba(255, 0, 0, 0.45);
}

.subtitle {
    margin: 12px 0 0;
    letter-spacing: 0.38em;
    font-size: 14px;
    font-weight: 500;
}

.tabs {
    position: relative;
    width: min(860px, calc(100% - 24px));
    margin: 22px auto 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 13px;
    padding: 9px 18px;
    color: #f3f3f3;
}

.tabs svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tabs a.active {
    color: #fff;
    border: 1px solid var(--red);
    background: rgba(90, 0, 0, 0.38);
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.4), inset 0 0 12px rgba(255, 0, 0, 0.18);
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.past-link { color: #ffb0b0 !important; }

.board-scroll {
    width: min(1440px, calc(100% - 20px));
    margin: 18px auto 8px;
    overflow-x: auto;
    padding: 10px 4px 16px;
}

.board {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    width: max-content;
    margin: 0 auto;
}

.density-3 { --match-w: 176px; --elbow-w: 30px; }
.density-4 { --match-w: 158px; --elbow-w: 24px; }

.side { display: flex; flex-direction: column; align-items: center; }

.side-labels { display: flex; align-items: end; margin-bottom: 8px; }

.side-label {
    width: var(--match-w);
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: #f5f5f5;
}

.side-gap { width: var(--elbow-w); }

.side-body { display: flex; flex-direction: column; }

.pair { display: flex; align-items: stretch; }

.pair > .match,
.pair > .leaf {
    align-self: center;
    flex: none;
}

.pair-kids { display: flex; flex-direction: column; }

.pair-kids > * {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.pair-left .pair-kids > * { justify-content: flex-end; }
.pair-right .pair-kids > * { justify-content: flex-start; }

.elbow {
    width: var(--elbow-w);
    position: relative;
    flex: none;
}

.pair-left .elbow::before,
.pair-right .elbow::before {
    content: "";
    position: absolute;
    top: 25%;
    bottom: 25%;
    width: 16px;
    border-top: 2px solid var(--red);
    border-bottom: 2px solid var(--red);
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.9));
}

.pair-left .elbow::before { left: 0; border-right: 2px solid var(--red); }
.pair-right .elbow::before { right: 0; border-left: 2px solid var(--red); }

.pair-left .elbow::after,
.pair-right .elbow::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    background: var(--red);
    box-shadow: 0 0 8px #ff1a1a;
}

.pair-left .elbow::after { left: 16px; right: 0; }
.pair-right .elbow::after { right: 16px; left: 0; }

.match {
    width: var(--match-w);
    height: auto;
    flex: none;
    margin: 4px 0;
    background: rgba(8, 0, 0, 0.78);
    border: 1px solid rgba(255, 40, 40, 0.9);
    border-radius: 7px;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.32), inset 0 0 10px rgba(255, 0, 0, 0.06);
    overflow: hidden;
    padding: 0;
    text-align: left;
}

button.match { cursor: pointer; display: block; }
button.match:hover, button.match:focus-visible {
    box-shadow: 0 0 18px rgba(255, 40, 40, 0.75);
    outline: none;
}

.match.inner-match { position: relative; }

.side-left .match.inner-match::after,
.side-right .match.inner-match::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 26px;
    height: 2px;
    background: var(--red);
    box-shadow: 0 0 8px #ff1a1a;
}

.side-left .match.inner-match::after { left: 100%; }
.side-right .match.inner-match::after { right: 100%; }

.slot {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 8px;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    letter-spacing: 0.03em;
    font-size: 14px;
}

.slot + .slot { border-top: 1px solid rgba(255, 255, 255, 0.06); }

.shield svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--red);
    stroke-width: 1.7;
    display: block;
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.8));
}

.name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score { min-width: 1.2ch; text-align: right; font-variant-numeric: tabular-nums; }

.slot.winner .name, .slot.winner .score { color: #fff; }
.slot.loser .name, .slot.loser .score, .slot.bye .name, .slot.pending .name { color: var(--muted); }
.slot.pending .score, .slot.bye .score { color: #777; }

.final-col {
    width: var(--match-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
}

.trophy-wrap { width: 148px; margin-bottom: 2px; filter: drop-shadow(0 0 16px rgba(255, 0, 0, 0.45)); }
.trophy-svg { width: 100%; height: auto; display: block; }

.champion {
    margin: 0 0 4px;
    color: #ff4d4d;
    letter-spacing: 0.12em;
    font-size: 13px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.final-title {
    margin: 0 0 6px;
    letter-spacing: 0.22em;
    font-size: 12px;
}

.final-col .match { margin-top: 0; }

.stats {
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 22px auto 28px;
    padding: 14px 22px;
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 40, 40, 0.7);
    border-radius: 16px;
    box-shadow: 0 0 22px rgba(255, 0, 0, 0.22);
}

.stat { display: flex; align-items: center; gap: 10px; min-width: 120px; }

.stat-icon {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--red);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.8));
}

.stat strong {
    display: block;
    font-size: 18px;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.stat small {
    display: block;
    color: #cfcfcf;
    letter-spacing: 0.14em;
    font-size: 10px;
}

.team-grid {
    width: min(1100px, calc(100% - 28px));
    margin: 22px auto 36px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.team-card, .panel, .past-card, .rules, .table-wrap, .login-card {
    background: rgba(6, 0, 0, 0.72);
    border: 1px solid rgba(255, 40, 40, 0.62);
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(255, 0, 0, 0.16);
}

.team-card { padding: 14px 14px 12px; }

.team-card header { display: flex; gap: 10px; align-items: center; }

.team-card h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: 0.04em; }

.team-card header p, .record, .roster { margin: 2px 0 0; color: #c8c8c8; font-size: 13px; letter-spacing: 0.04em; }

.roster { margin: 10px 0 0; padding-left: 18px; }

.roster li + li { margin-top: 3px; }

.table-wrap {
    width: min(980px, calc(100% - 28px));
    margin: 22px auto 40px;
    overflow-x: auto;
}

.standings { width: 100%; border-collapse: collapse; }

.standings th, .standings td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: 0.04em;
}

.standings th {
    color: #ffb4b4;
    font-size: 12px;
    letter-spacing: 0.14em;
    font-weight: 500;
}

.rules {
    width: min(720px, calc(100% - 28px));
    margin: 22px auto 40px;
    padding: 22px 24px;
    line-height: 1.55;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 15px;
}

.rules p { margin: 0 0 14px; }

.empty, .archive-note {
    text-align: center;
    color: #ddd;
    letter-spacing: 0.04em;
}

.archive-note a, .fineprint a { color: #ffb4b4; }

.home-intro, .home-how, .home-live { width: min(820px, calc(100% - 28px)); margin: 18px auto 0; text-align: center; }
.home-lead, .home-how li, .home-live p { color: #d5d5d5; letter-spacing: 0.02em; line-height: 1.55; font-size: 16px; }
.home-lead { margin: 0; }
.home-how { text-align: left; }
.home-how h2, .home-live h2 { margin: 0 0 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; font-size: 15px; }
.home-how ol { margin: 0; padding-left: 18px; }
.home-how li + li { margin-top: 8px; }
.home-live { text-align: center; }
.home-live h2 { font-size: 26px; letter-spacing: 0.06em; text-transform: none; }
.home-intro { text-align: center; margin: 8px auto 0; width: min(760px, calc(100% - 28px)); }
.live-flag {
    display: inline-block;
    margin: 0 0 8px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 12px;
    color: #ffb4b4;
}
.home-intro h2 { margin: 0; font-weight: 500; letter-spacing: 0.08em; font-size: 28px; }

.home-grid {
    width: min(980px, calc(100% - 28px));
    margin: 22px auto 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.home-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    padding: 16px;
    background: rgba(6, 0, 0, 0.72);
    border: 1px solid rgba(255, 40, 40, 0.62);
    border-radius: 14px;
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.14);
}
.home-card:hover { border-color: #ff4d4d; box-shadow: 0 0 18px rgba(255, 0, 0, 0.32); }
.home-card strong { letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.home-card span { color: #cfcfcf; letter-spacing: 0.03em; font-size: 14px; }

.overview { width: min(820px, calc(100% - 28px)); margin: 12px auto 10px; }
.overview-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.overview-facts p, .draw-list li {
    margin: 0;
    padding: 14px 16px;
    background: rgba(6, 0, 0, 0.72);
    border: 1px solid rgba(255, 40, 40, 0.5);
    border-radius: 12px;
}
.overview-facts span, .draw-list span {
    display: block;
    color: #ffb4b4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    margin-bottom: 4px;
}
.overview-action { text-align: center; margin: 16px 0; }
.overview h2 { letter-spacing: 0.12em; font-weight: 500; font-size: 16px; text-transform: uppercase; }
.draw-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.draw-list strong { letter-spacing: 0.04em; font-weight: 500; }

.fineprint {
    text-align: center;
    color: #9a9a9a;
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 8px 16px 28px;
}

.toast {
    width: min(640px, calc(100% - 28px));
    margin: 8px auto 0;
    padding: 10px 14px;
    border-radius: 10px;
    text-align: center;
    background: rgba(0, 40, 16, 0.85);
    border: 1px solid rgba(80, 220, 120, 0.7);
}

.toast.bad {
    background: rgba(50, 0, 0, 0.88);
    border-color: rgba(255, 80, 80, 0.8);
}

.panel, .login-card {
    width: min(860px, calc(100% - 28px));
    margin: 16px auto;
    padding: 18px;
}

.login-card { width: min(440px, calc(100% - 28px)); text-align: center; padding: 32px 24px; }

.login-card h1, .panel h2 { font-weight: 500; letter-spacing: 0.08em; margin: 0 0 8px; }

.panel h2 { font-size: 18px; text-transform: uppercase; }

.lede { color: #d0d0d0; line-height: 1.45; }

.stack { display: grid; gap: 10px; }

label.field { display: grid; gap: 4px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #ffc1c1; }

input, textarea, select {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 60, 60, 0.45);
    border-radius: 8px;
    padding: 10px 12px;
    letter-spacing: 0.03em;
}

textarea { min-height: 110px; resize: vertical; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.15);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }

.btn {
    border: 1px solid rgba(255, 60, 60, 0.7);
    background: transparent;
    border-radius: 999px;
    padding: 9px 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.solid {
    background: #ff2424;
    color: #fff;
    border-color: #ff2424;
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.35);
}

.btn.ghost { color: #fff; }

.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; padding: 12px 18px; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.entrant-list { display: grid; gap: 8px; margin-top: 12px; }

.entrant {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.entrant strong { letter-spacing: 0.04em; }
.entrant p { margin: 3px 0 0; color: #c8c8c8; font-size: 13px; }

.past-list {
    width: min(860px, calc(100% - 28px));
    margin: 12px auto 36px;
    display: grid;
    gap: 12px;
}

.past-card {
    display: block;
    text-decoration: none;
    padding: 16px 18px;
}

.past-card:hover { border-color: #ff4d4d; box-shadow: 0 0 18px rgba(255, 0, 0, 0.32); }

.past-card strong { display: block; font-size: 20px; letter-spacing: 0.05em; font-weight: 500; }
.past-card span { display: block; margin-top: 4px; color: #d0d0d0; letter-spacing: 0.04em; }

dialog {
    width: min(420px, calc(100% - 24px));
    border: 1px solid rgba(255, 40, 40, 0.75);
    border-radius: 16px;
    background: #100204;
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.28);
    padding: 18px;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.62); }

dialog h2 { margin: 0; letter-spacing: 0.08em; font-weight: 500; }

.dialog-copy { color: #d0d0d0; font-size: 14px; }

dialog label { display: grid; grid-template-columns: 1fr 72px; gap: 10px; align-items: center; margin: 8px 0; letter-spacing: 0.03em; }

.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.staff-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.who { display: flex; gap: 10px; align-items: center; }

.avatar, .avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a0000;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 40, 40, 0.6);
}

.hint { color: #c8c8c8; font-size: 14px; line-height: 1.45; }

@media (max-width: 900px) {
    .topbar { flex-wrap: wrap; row-gap: 10px; }
    .brand { flex: 1; }
    .topnav {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        gap: 8px 14px;
    }
    .topnav a { font-size: 12px; letter-spacing: 0.1em; }
    .tabs { width: calc(100% - 12px); }
    .tabs a { letter-spacing: 0.08em; font-size: 12px; padding: 8px 10px; }
    .form-grid, .overview-facts { grid-template-columns: 1fr; }
    .metal { font-size: 72px; filter: drop-shadow(0 4px 0 #1a1a1a); }
    .subtitle { letter-spacing: 0.18em; font-size: 11px; }
    .kicker { letter-spacing: 0.28em; }
    .stats { gap: 14px; width: calc(100% - 16px); padding: 12px; }
    .stat { min-width: 130px; }
}
