@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap");

:root {
    --bg: #03060f;
    --panel: #0a1020;
    --panel-soft: #0e1730;
    --panel-border: #1a2743;
    --ink: #d8e5ff;
    --ink-muted: #6f819f;
    --accent: #2be6ff;
    --accent-2: #39ffb6;
    --warn: #ff6f6f;
    --gold: #ffcf4a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Chakra Petch", "Rajdhani", sans-serif;
}

.hub-backdrop,
.hub-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.hub-backdrop {
    background:
        radial-gradient(circle at 13% 7%, rgba(61, 142, 255, 0.23), transparent 34%),
        radial-gradient(circle at 82% 13%, rgba(51, 255, 213, 0.18), transparent 34%),
        radial-gradient(circle at 52% 100%, rgba(67, 91, 255, 0.15), transparent 46%);
}

.hub-noise {
    opacity: 0.1;
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.4) 1px,
        transparent 1px
    );
    background-size: 3px 3px;
}

.admin-jump-btn {
    position: fixed;
    top: 0.78rem;
    right: 1.1rem;
    z-index: 35;
    text-decoration: none;
    border: 1px solid #3f5582;
    border-radius: 10px;
    background: rgba(9, 18, 37, 0.88);
    color: #cfe6ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
}

.admin-jump-btn:hover {
    border-color: #63bcff;
    color: #ffffff;
}

.hub-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(6, 11, 23, 0.82);
    backdrop-filter: blur(10px);
}

.hub-header-inner {
    width: min(1400px, 96vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.hub-brand {
    text-decoration: none;
    font-family: "Rajdhani", sans-serif;
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    letter-spacing: 0.07em;
    font-weight: 700;
}

.brand-primary {
    color: var(--accent-2);
}

.brand-secondary {
    color: #fff;
}

.hub-tabs {
    display: inline-flex;
    border: 1px solid var(--panel-border);
    border-radius: 11px;
    overflow: hidden;
    background: rgba(13, 24, 45, 0.8);
}

.hub-tab {
    color: var(--ink-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.hub-tab:hover {
    color: var(--ink);
}

.hub-tab.is-active {
    color: #06132b;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    font-weight: 700;
}

.account-zone {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.account-email {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.inline-form {
    margin: 0;
}

.ghost-btn,
.primary-btn,
.secondary-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.52rem 0.85rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ghost-btn {
    background: transparent;
    border-color: #2e3d5f;
    color: var(--ink);
}

.ghost-btn:hover {
    border-color: #4c638e;
}

.primary-btn {
    background: linear-gradient(120deg, #1ad8ff, #27f0b0);
    color: #041228;
}

.primary-btn:hover {
    filter: brightness(1.06);
}

.secondary-btn {
    background: #0f1b35;
    border-color: #2a3a5f;
    color: #d9e7ff;
}

.secondary-btn:hover {
    border-color: #4e648f;
}

.hub-main {
    width: min(1400px, 96vw);
    margin: 1.2rem auto 2.6rem;
    position: relative;
    z-index: 2;
}

.hub-main-guest {
    min-height: 88vh;
    display: grid;
    place-items: center;
}

.flash-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.flash {
    border: 1px solid;
    border-radius: 10px;
    padding: 0.62rem 0.82rem;
    font-size: 0.88rem;
}

.flash-success {
    border-color: rgba(57, 255, 182, 0.4);
    background: rgba(14, 81, 68, 0.23);
    color: #8bfad0;
}

.flash-error {
    border-color: rgba(255, 117, 117, 0.45);
    background: rgba(95, 24, 35, 0.25);
    color: #ffabb5;
}

.flash-info {
    border-color: rgba(70, 186, 255, 0.42);
    background: rgba(14, 53, 91, 0.26);
    color: #abdfff;
}

.auth-shell {
    width: min(460px, 94vw);
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background: linear-gradient(165deg, rgba(14, 24, 46, 0.92), rgba(7, 13, 27, 0.95));
    padding: 2rem;
    box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.85);
    animation: slideIn 0.36s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-label {
    margin: 0;
    font-size: 0.73rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.auth-shell h1 {
    margin: 0.45rem 0 0.55rem;
    font-family: "Rajdhani", sans-serif;
    font-size: 2rem;
}

.auth-subtitle {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.auth-form {
    margin-top: 1.3rem;
    display: grid;
    gap: 0.55rem;
}

.auth-form label {
    margin-top: 0.45rem;
    color: #9fb2d0;
    font-size: 0.86rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid #2b3c60;
    border-radius: 10px;
    background: #0a1227;
    color: var(--ink);
    padding: 0.72rem 0.82rem;
    font: inherit;
}

.auth-form input:focus,
.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 230, 255, 0.16);
}

.auth-form .primary-btn {
    margin-top: 0.85rem;
}

.auth-footer {
    margin: 1rem 0 0;
    color: var(--ink-muted);
    font-size: 0.92rem;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
}

.matches-shell {
    display: grid;
    gap: 1rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

.overline {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.section-heading h1 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-family: "Rajdhani", sans-serif;
}

.stats-strip {
    display: flex;
    gap: 0.5rem;
}

.chip {
    font-size: 0.78rem;
    border: 1px solid #283a63;
    background: #0b152b;
    color: #92a7c8;
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
}

.chip-live {
    border-color: rgba(255, 111, 111, 0.42);
    color: #ff9090;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.6rem;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(10, 17, 34, 0.88);
    padding: 0.62rem;
}

.search-input,
.filter-select {
    border: 1px solid #293b61;
    border-radius: 9px;
    background: #0a1227;
    color: var(--ink);
    padding: 0.62rem 0.72rem;
    font: inherit;
}

.matches-list {
    display: grid;
    gap: 0.52rem;
}

.match-row {
    display: grid;
    grid-template-columns: 140px 1fr 130px 145px 78px;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: linear-gradient(100deg, rgba(12, 20, 39, 0.95), rgba(20, 24, 46, 0.92));
    padding: 0.75rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.match-row:hover {
    transform: translateY(-1px);
    border-color: #3a5f97;
    box-shadow: 0 12px 28px -20px rgba(90, 147, 255, 0.6);
}

.match-row-live {
    border-color: rgba(57, 255, 182, 0.5);
    box-shadow: 0 0 22px -15px rgba(57, 255, 182, 0.75);
}

.match-row-meta {
    display: grid;
    gap: 0.42rem;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    width: max-content;
    padding: 0.23rem 0.52rem;
    border-radius: 999px;
    border: 1px solid;
}

.state-live {
    color: #ff9898;
    border-color: rgba(255, 109, 109, 0.5);
    background: rgba(110, 27, 41, 0.42);
}

.state-finished {
    color: #9db3d8;
    border-color: rgba(81, 100, 138, 0.6);
    background: rgba(25, 37, 63, 0.45);
}

.state-failed {
    color: #ffb5b5;
    border-color: rgba(255, 129, 129, 0.5);
    background: rgba(96, 22, 32, 0.42);
}

.match-date {
    color: #8094b9;
    font-size: 0.76rem;
}

.match-row-duel {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.team-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-name-left {
    color: var(--gold);
}

.team-name-right {
    color: #49a4ff;
}

.score-cluster {
    min-width: 72px;
    text-align: center;
    font-size: 1.02rem;
    color: #f8cc52;
    letter-spacing: 0.03em;
}

.match-row-map {
    color: #a8bae0;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-align: right;
}

.match-row-result {
    color: #87d1ff;
    font-size: 0.83rem;
    text-align: right;
}

.match-row-action {
    color: #6cecff;
    text-align: right;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.empty-card {
    border: 1px dashed #2f456d;
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--ink-muted);
}

.empty-card h2 {
    margin: 0;
    color: #bbcff3;
    font-size: 1.1rem;
}

.empty-card p {
    margin: 0.4rem 0 0;
}

.detail-shell {
    display: grid;
    gap: 0.95rem;
}

.back-link {
    width: fit-content;
    color: #9fc9ff;
    text-decoration: none;
    font-size: 0.9rem;
}

.live-header {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: linear-gradient(120deg, rgba(10, 18, 35, 0.96), rgba(14, 19, 38, 0.9));
    padding: 0.88rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.team-col {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.team-col.right {
    justify-content: flex-end;
}

.team-name-big {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
}

.team-side {
    margin: 0.08rem 0 0;
    font-size: 0.73rem;
    color: #7f92b3;
}

.team-bullet {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.team-bullet-left {
    background: var(--gold);
}

.team-bullet-right {
    background: #1e8cff;
}

.center-col {
    text-align: center;
}

.scoreline {
    display: inline-flex;
    align-items: center;
    gap: 0.62rem;
    font-family: "Rajdhani", sans-serif;
}

.score-left,
.score-right {
    font-size: 2rem;
    font-weight: 700;
}

.score-left {
    color: var(--gold);
}

.score-right {
    color: #4ea9ff;
}

.status-dot {
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    border: 1px solid #476188;
    color: #9bb1d5;
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
}

.status-dot.is-live {
    color: #ffacac;
    border-color: rgba(255, 120, 120, 0.66);
    background: rgba(126, 36, 48, 0.43);
}

.match-meta-line {
    margin: 0.18rem 0 0;
    color: #8496b6;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.arena-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.8rem;
}

.stream-card,
.scoreboard-card,
.round-log-card {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(8, 16, 32, 0.96), rgba(6, 11, 23, 0.94));
}

.stream-card {
    padding: 0.8rem;
    display: grid;
    gap: 0.68rem;
    grid-column: 1 / -1;
}

.live-pill {
    width: fit-content;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255, 103, 103, 0.56);
    color: #ff9797;
    background: rgba(122, 31, 45, 0.42);
    padding: 0.17rem 0.46rem;
}

.live-pill.ended {
    border-color: rgba(88, 113, 153, 0.65);
    color: #93a9ce;
    background: rgba(32, 46, 75, 0.46);
}

.stream-surface {
    border: 1px solid #1c2d4d;
    border-radius: 10px;
    min-height: 420px;
    background:
        radial-gradient(circle at center, rgba(51, 96, 255, 0.15), rgba(9, 17, 36, 0.92) 62%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 35%, rgba(0, 0, 0, 0.23));
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1rem;
    overflow: hidden;
}

.stream-surface-live {
    padding: 0;
    place-items: stretch;
}

.stream-embed {
    width: 100%;
    height: 100%;
    min-height: 420px;
    border: 0;
}

.stream-title {
    margin: 0.8rem 0 0;
    font-size: 0.98rem;
    color: #d5e8ff;
}

.stream-subtitle {
    margin: 0.18rem 0 0;
    color: #7d91b7;
    font-size: 0.8rem;
}

.stream-link-row {
    margin-top: -0.1rem;
}

.stream-link {
    color: #67d9ff;
    text-decoration: none;
    font-size: 0.84rem;
}

.stream-link:hover {
    color: #9cecff;
}

.rounds-row {
    display: flex;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.round-pill {
    border: 1px solid #2d436d;
    color: #9fc2ef;
    text-decoration: none;
    padding: 0.25rem 0.52rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.round-pill:hover {
    border-color: #5d84c9;
}

.round-pill.is-active {
    color: #051228;
    border-color: transparent;
    background: linear-gradient(115deg, #41dbff, #31f7b7);
    font-weight: 700;
}

.round-empty {
    color: #7d90b0;
    font-size: 0.82rem;
}

.scoreboard-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 520px;
    grid-column: 2;
    grid-row: 2;
}

.scoreboard-header {
    padding: 0.8rem;
    border-bottom: 1px solid #1d2f4f;
}

.scoreboard-header h2 {
    margin: 0;
    font-size: 1.12rem;
}

.scoreboard-header p {
    margin: 0.18rem 0 0;
    color: #7e93b8;
    font-size: 0.84rem;
}

.score-table-wrap {
    overflow: auto;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.score-table th,
.score-table td {
    padding: 0.52rem 0.65rem;
    border-bottom: 1px solid #162541;
    text-align: right;
}

.score-table th:first-child,
.score-table td:first-child {
    text-align: left;
}

.score-table th {
    color: #6f84aa;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.player-cell {
    color: #d8e9ff;
}

.kd-cell.good {
    color: #4ff0b8;
    font-weight: 700;
}

.kd-cell.bad {
    color: #ff8c9b;
    font-weight: 700;
}

.empty-row {
    text-align: center !important;
    color: #7b90b3;
    padding: 1.3rem 0.6rem !important;
}

.round-log-card {
    padding: 0.82rem;
    min-height: 520px;
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-rows: auto 1fr;
}

.round-log-card h3 {
    margin: 0;
    font-size: 1rem;
}

.round-log-card p {
    margin: 0.2rem 0 0;
    color: #7f92b5;
    font-size: 0.8rem;
}

.log-list {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.5rem;
    max-height: 100%;
    overflow: auto;
}

.log-item {
    border: 1px solid #1d2f4f;
    border-radius: 10px;
    background: #0a1428;
    padding: 0.45rem 0.55rem;
}

.log-index {
    color: #7ea8db;
    font-size: 0.72rem;
}

.log-item pre {
    margin: 0.26rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #cde3ff;
    font-family: "Chakra Petch", sans-serif;
    font-size: 0.8rem;
}

@media (max-width: 1100px) {
    .match-row {
        grid-template-columns: 124px 1fr 110px;
        grid-template-areas:
            "meta duel action"
            "meta map result";
    }

    .match-row-meta {
        grid-area: meta;
    }

    .match-row-duel {
        grid-area: duel;
    }

    .match-row-map {
        grid-area: map;
        text-align: left;
    }

    .match-row-result {
        grid-area: result;
        text-align: left;
    }

    .match-row-action {
        grid-area: action;
    }

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

    .scoreboard-card {
        min-height: 360px;
        grid-column: auto;
        grid-row: auto;
    }

    .round-log-card {
        min-height: 320px;
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 760px) {
    .admin-jump-btn {
        top: 0.6rem;
        right: 0.6rem;
        padding: 0.38rem 0.62rem;
    }

    .hub-header-inner {
        width: 94vw;
        flex-wrap: wrap;
    }

    .account-zone {
        width: 100%;
        justify-content: space-between;
    }

    .filters-row {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .match-row-map,
    .match-row-result,
    .match-row-action {
        text-align: left;
    }

    .live-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .team-col,
    .team-col.right {
        justify-content: center;
    }

    .stream-surface {
        min-height: 300px;
    }
}
