:root {
    --bg: #090909;
    --bg-soft: #131313;
    --panel: rgba(15, 15, 15, 0.88);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f5f5f5;
    --muted: #b8b8b8;
    --red: #ff2d2d;
    --red-strong: #c50f0f;
    --red-soft: rgba(255, 45, 45, 0.16);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

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

body {
    background:
        radial-gradient(circle at top left, rgba(255, 45, 45, 0.28), transparent 28%),
        radial-gradient(circle at bottom right, rgba(197, 15, 15, 0.2), transparent 25%),
        linear-gradient(135deg, #060606 0%, #0d0d0d 42%, #170707 100%);
    color: var(--text);
    font-family: "Oxanium", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.theme-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.18;
    pointer-events: none;
}

.site-chrome {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.site-chrome-wide {
    width: min(1640px, calc(100% - 40px));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    padding: 18px 20px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(255, 45, 45, 0.3);
}

.brand strong,
.team-card h3,
.stack-card h3,
.page-header h1,
.hero-copy h1,
.panel h2,
.match-meta strong,
.broadcast-brand strong,
.team-block strong,
.broadcast-killer-card strong {
    font-family: "Rajdhani", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand span,
.topnav a,
.panel p,
.clean-list,
.stack-card p,
.header-pill,
.header-actions,
.eyebrow,
.page-header p {
    color: var(--muted);
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.topnav a {
    font-size: 0.95rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.topnav a:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.page-shell {
    display: grid;
    gap: 24px;
}

.panel {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(25, 25, 25, 0.84), rgba(10, 10, 10, 0.88));
    box-shadow: var(--shadow);
}

.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 45, 45, 0.08), transparent 40%);
    pointer-events: none;
}

.accent-panel {
    background:
        radial-gradient(circle at top right, rgba(255, 45, 45, 0.22), transparent 30%),
        linear-gradient(180deg, rgba(29, 8, 8, 0.9), rgba(10, 10, 10, 0.92));
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-grid,
.content-grid,
.dashboard-grid,
.tournament-grid,
.live-columns {
    display: grid;
    gap: 24px;
}

.hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
}

.hero-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    line-height: 0.95;
}

.hero-copy p {
    width: min(62ch, 100%);
    font-size: 1.06rem;
}

.hero-actions,
.header-actions,
.form-actions,
.result-actions,
.score-inline,
.team-stats,
.topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.hero-actions,
.header-actions,
.form-actions,
.result-actions {
    gap: 12px;
    margin-top: 24px;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.nav-button:hover {
    color: var(--text);
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: linear-gradient(135deg, var(--red), var(--red-strong));
    color: white;
    box-shadow: 0 18px 30px rgba(197, 15, 15, 0.32);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-side {
    display: grid;
    gap: 20px;
}

.hero-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 45, 45, 0.12), rgba(255, 255, 255, 0.02));
}

.compact-logo {
    min-height: 180px;
    margin-bottom: 8px;
}

.compact-logo img {
    width: min(220px, 100%);
}

.hero-logo-wrap img {
    width: min(320px, 100%);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.stat-card strong {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-size: 1.8rem;
}

.content-grid,
.dashboard-grid,
.tournament-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clean-list {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
}

.clean-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.compact-list li {
    padding: 10px 12px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.page-header h1,
.panel h2 {
    margin: 0;
}

.header-pill {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 45, 45, 0.28);
    background: rgba(255, 45, 45, 0.12);
}

.stack-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.stack-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stack-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 45, 45, 0.35);
}

.compact-stack {
    margin-top: 20px;
}

.catalog-card {
    gap: 14px;
}

.catalog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.catalog-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 14px;
}

.is-hidden {
    display: none;
}

.static-card:hover {
    transform: none;
}

.stack-meta {
    text-align: right;
}

.team-card,
.killer-card,
.survivor-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.team-accordion {
    display: block;
}

.team-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.team-summary::-webkit-details-marker {
    display: none;
}

.team-summary-copy {
    flex: 1;
}

.team-summary-copy h3 {
    margin: 0 0 4px;
}

.team-summary-copy p {
    margin: 0;
    color: var(--muted);
}

.team-expand {
    color: var(--muted);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.team-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--red), #411010);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

.team-mark-logo {
    overflow: hidden;
}

.team-mark-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-info {
    flex: 1;
    margin-top: 18px;
}

.team-player-form {
    margin-top: 14px;
    grid-template-columns: 1.3fr 0.7fr auto;
    align-items: end;
}

.team-delete-form {
    margin-top: 14px;
}

.team-edit-form {
    margin-bottom: 16px;
    grid-template-columns: 1.2fr 1fr auto;
    align-items: end;
}

.team-section-title {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.player-item {
    display: block !important;
}

.player-inline-form {
    display: grid;
    grid-template-columns: 1.3fr 120px auto;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.player-name-input,
.player-hours-input {
    margin: 0;
}

.player-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.button-danger {
    background: rgba(255, 45, 45, 0.12);
    color: #ffd7d7;
    border: 1px solid rgba(255, 45, 45, 0.22);
}

.mini-form,
.form-grid,
.auth-shell {
    display: grid;
    gap: 14px;
}

.auth-shell {
    place-items: center;
    min-height: calc(100vh - 180px);
}

.auth-panel {
    width: min(560px, 100%);
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin: 16px 0 4px;
}

.alert-error {
    border: 1px solid rgba(255, 45, 45, 0.22);
    background: rgba(255, 45, 45, 0.12);
    color: #ffd2d2;
}

.alert-success {
    border: 1px solid rgba(91, 255, 133, 0.18);
    background: rgba(91, 255, 133, 0.1);
    color: #daf7df;
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 12, 12, 0.94);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
    color: var(--text);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(14px);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    border-color: rgba(255, 45, 45, 0.22);
    background: rgba(40, 10, 10, 0.94);
    color: #ffd2d2;
}

.toast-success {
    border-color: rgba(91, 255, 133, 0.18);
    background: rgba(12, 28, 16, 0.94);
    color: #daf7df;
}

.mini-form {
    margin-top: 24px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.32);
    color: var(--text);
    font: inherit;
}

.file-input {
    padding: 10px 12px;
    line-height: 1.2;
}

.file-input::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.file-input:hover::file-selector-button {
    background: rgba(255, 45, 45, 0.18);
}

.versus-strip {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.versus-center {
    display: grid;
    place-items: center;
    color: var(--red);
    font-weight: 700;
    text-transform: uppercase;
}

.live-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
}

.match-live-grid {
    grid-template-columns: 1fr;
}

.match-live-columns {
    grid-template-columns: minmax(320px, 0.85fr) minmax(480px, 1.15fr);
}

.legs-config {
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
}

.leg-config {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.leg-config.is-hidden {
    display: none;
}

.start-leg-form {
    margin: 16px 0 20px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.survivor-select-grid,
.live-edit-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
}

.survivor-editor {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.mini-field {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.bp-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-input-wrap small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hook-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    color: var(--muted);
}

.live-side {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.survivor-row {
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hook-dots {
    display: flex;
    gap: 8px;
}

.hook-dots span {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
}

.hook-dots .is-on {
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 0 14px rgba(255, 45, 45, 0.5);
}

.killer-card {
    margin: 14px 0 18px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.killer-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
}

.score-inline {
    gap: 10px;
}

.score-inline span {
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--red-soft);
}

.legs-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.leg-card {
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.leg-card header,
.leg-scoreboard {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.leg-scoreboard {
    margin: 18px 0;
}

.leg-team {
    flex: 1;
    min-width: 0;
}

.overlay-page {
    overflow: hidden;
    background: transparent;
}

.broadcast-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding: 18px 22px;
    background:
        linear-gradient(180deg, rgba(10, 10, 10, 0.7), transparent 26%),
        linear-gradient(90deg, rgba(8, 8, 8, 0.3), transparent 28%);
}

.broadcast-top {
    display: grid;
    gap: 14px;
}

.broadcast-brand,
.match-meta,
.broadcast-killer-card,
.team-block {
    backdrop-filter: blur(12px);
}

.broadcast-brand {
    width: fit-content;
    padding: 16px 22px;
    border-radius: 0 0 26px 0;
    background: linear-gradient(135deg, rgba(20, 4, 4, 0.92), rgba(0, 0, 0, 0.72));
    border: 1px solid rgba(255, 45, 45, 0.14);
}

.broadcast-brand span,
.broadcast-killer-card small,
.match-meta small,
.team-block small {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

.broadcast-center {
    display: grid;
    grid-template-columns: 1fr 240px 1fr;
    gap: 18px;
    align-items: start;
}

.team-block,
.match-meta {
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-block {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.74), rgba(22, 22, 22, 0.84));
}

.team-killer {
    box-shadow: inset 4px 0 0 var(--red);
}

.team-survivor {
    box-shadow: inset -4px 0 0 var(--red);
}

.team-block strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(2rem, 3vw, 3rem);
}

.team-stats {
    gap: 8px;
    margin-top: 12px;
}

.team-stats span {
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 45, 45, 0.14);
    color: white;
    font-size: 0.92rem;
}

.match-meta {
    text-align: center;
    background: linear-gradient(180deg, rgba(37, 10, 10, 0.84), rgba(9, 9, 9, 0.82));
}

.broadcast-killer-card {
    position: absolute;
    left: 22px;
    top: 160px;
    display: flex;
    gap: 12px;
    align-items: center;
    width: 260px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(6, 6, 6, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.broadcast-killer-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
}

@media (max-width: 980px) {
    .topbar,
    .page-header,
    .hero-grid,
    .content-grid,
    .dashboard-grid,
    .tournament-grid,
    .live-columns,
    .broadcast-center,
    .leg-card header,
    .leg-scoreboard {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar,
    .page-header {
        align-items: start;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .broadcast-shell {
        padding-bottom: 220px;
    }

    .broadcast-killer-card {
        position: static;
        width: 100%;
        margin-top: 18px;
    }

    .team-edit-form,
    .team-player-form,
    .player-inline-form,
    .leg-config {
        grid-template-columns: 1fr;
    }

    .player-actions {
        justify-content: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .site-chrome {
        width: min(100% - 24px, 1280px);
        padding-top: 12px;
    }

    .topbar,
    .panel,
    .leg-card {
        padding: 18px;
        border-radius: 20px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        font-size: 2.4rem;
    }

    .broadcast-center {
        gap: 12px;
    }

    .team-block strong {
        font-size: 1.6rem;
    }
}
