@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #090616;
    --panel: rgba(31, 21, 78, 0.62);
    --panel-soft: rgba(46, 32, 109, 0.48);
    --line: rgba(179, 142, 255, 0.2);
    --line-strong: rgba(207, 183, 255, 0.36);
    --text: #f4f6ff;
    --muted: rgba(223, 227, 255, 0.72);
    --purple: #9e67ff;
    --violet: #7a6bff;
    --blue: #65b8ff;
    --blue-deep: #4c63ff;
    --shadow: 0 30px 90px rgba(2, 6, 28, 0.55);
    --success: #79ffd4;
    --danger: #ff8ea6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
    background: var(--bg);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

html.page-ready {
    opacity: 1;
    transform: translateY(0);
}

html.page-exit {
    opacity: 0;
    transform: translateY(12px);
}

body {
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(158, 103, 255, 0.24), transparent 30%),
        radial-gradient(circle at top right, rgba(101, 184, 255, 0.1), transparent 34%),
        radial-gradient(circle at bottom center, rgba(122, 107, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #090616, #140c33 46%, #090616);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

.shape {
    position: fixed;
    border-radius: 999px;
    filter: blur(160px);
    pointer-events: none;
    z-index: 0;
    animation: drift 16s infinite alternate ease-in-out;
}

.shape-1 {
    width: 34rem;
    height: 34rem;
    background: linear-gradient(45deg, rgba(158, 103, 255, 0.98), rgba(120, 92, 255, 0.88));
    top: -7rem;
    left: -12rem;
}

.shape-2 {
    width: 30rem;
    height: 30rem;
    background: linear-gradient(45deg, rgba(120, 92, 255, 0.9), rgba(101, 184, 255, 0.68));
    right: -10rem;
    bottom: -8rem;
    animation-duration: 22s;
}

.shape-3 {
    width: 18rem;
    height: 18rem;
    background: linear-gradient(45deg, rgba(166, 116, 255, 0.58), rgba(104, 110, 255, 0.42));
    top: 36%;
    left: 42%;
    animation-duration: 19s;
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    to {
        transform: translate3d(72px, 108px, 0) rotate(140deg);
    }
}

.glass-panel {
    position: relative;
    background: linear-gradient(180deg, rgba(31, 21, 78, 0.68), rgba(19, 13, 53, 0.8));
    border: 1px solid var(--line);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    box-shadow: var(--shadow), inset 1px 1px 0 rgba(255, 255, 255, 0.16), inset -1px -1px 0 rgba(106, 119, 255, 0.15);
    overflow: hidden;
}

.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.16), transparent 34%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.glass-panel:hover::before {
    opacity: 1;
}

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.42s cubic-bezier(0.19, 1, 0.22, 1), border-color 0.25s ease;
}

.landing-shell,
.app-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
}

.landing-shell {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.app-shell {
    padding: 1.75rem 0 3rem;
}

.topbar {
    border-radius: 28px;
    padding: 1.35rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.compact-topbar {
    margin-bottom: 0.25rem;
}

.topbar h1,
.hero-card h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-card {
    width: min(800px, 100%);
    padding: 3rem;
    border-radius: 32px;
}

.hero-card p,
.modal-copy,
.panel-copy,
.detail-subline,
.match-meta,
.empty-copy,
.stat-copy,
.player-link {
    color: var(--muted);
}

.hero-card p {
    margin-top: 1rem;
    max-width: 48rem;
    font-size: 1.04rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.76rem;
    color: rgba(219, 223, 255, 0.64);
    margin-bottom: 0.95rem;
}

.hero-actions,
.top-actions,
.game-nav {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.pill-button,
.nav-link,
.download-button,
.page-button,
.modal-close {
    border-radius: 999px;
    border: 1px solid rgba(181, 190, 255, 0.2);
    background: linear-gradient(180deg, rgba(158, 103, 255, 0.22), rgba(76, 99, 255, 0.12));
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pill-button,
.nav-link,
.download-button,
.page-button {
    min-height: 48px;
    padding: 0 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    cursor: pointer;
}

.pill-button:hover,
.nav-link:hover,
.download-button:hover,
.page-button:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: linear-gradient(180deg, rgba(158, 103, 255, 0.4), rgba(93, 118, 255, 0.22));
    box-shadow: 0 14px 34px rgba(74, 45, 150, 0.34);
}

.nav-link.active,
.page-button.is-active {
    background: linear-gradient(135deg, rgba(158, 103, 255, 0.58), rgba(101, 184, 255, 0.18));
    border-color: rgba(198, 202, 255, 0.32);
}

.action-button {
    appearance: none;
}

.content-grid,
.admin-grid {
    margin-top: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.content-grid {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.admin-grid {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.list-panel,
.detail-panel,
.auth-panel,
.admin-card,
.status-panel {
    border-radius: 28px;
    padding: 1.35rem;
}

.list-panel,
.detail-panel {
    min-height: 72vh;
}

.panel-heading,
.detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.panel-heading {
    margin-bottom: 1rem;
}

.subtle-pill,
.match-pill,
.access-banner {
    border-radius: 999px;
    border: 1px solid rgba(181, 190, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.5rem 0.85rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.access-banner {
    margin-top: 1.25rem;
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
}

.access-banner.unlocked {
    color: var(--success);
    border-color: rgba(121, 255, 212, 0.22);
}

.match-list {
    display: grid;
    gap: 0.85rem;
}

.match-card {
    padding: 1rem;
    border-radius: 22px;
    background: var(--panel-soft);
    border: 1px solid rgba(167, 175, 255, 0.12);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.match-card:hover,
.match-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(193, 199, 255, 0.22);
    background: rgba(73, 52, 154, 0.42);
}

.match-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.match-topline h3 {
    font-size: 1.02rem;
}

.match-meta,
.detail-subline {
    margin-top: 0.45rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-empty,
.empty-state {
    min-height: 100%;
    display: grid;
    place-content: center;
    gap: 0.8rem;
    text-align: center;
}

.detail-card {
    display: grid;
    gap: 1.25rem;
}

.score-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.score-badge {
    border-radius: 22px;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(177, 183, 255, 0.14);
}

.score-badge strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.8rem;
}

.team-card {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(177, 183, 255, 0.12);
    overflow: hidden;
}

.team-card header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-badge {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(226, 229, 255, 0.58);
}

.scoreboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.scoreboard th,
.scoreboard td {
    border-top: 1px solid rgba(177, 183, 255, 0.1);
    padding: 0.85rem 1rem;
    text-align: left;
}

.scoreboard th {
    color: rgba(220, 223, 255, 0.58);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 0.75rem;
    font-weight: 500;
}

.scoreboard td:not(:first-child),
.scoreboard th:not(:first-child) {
    text-align: center;
}

.player-link {
    text-decoration: none;
}

.player-link:hover {
    color: #ffffff;
}

.download-button {
    width: fit-content;
    min-height: 52px;
}

.locked-button {
    background: linear-gradient(180deg, rgba(66, 69, 103, 0.6), rgba(44, 46, 69, 0.82));
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 18, 0.74);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    width: min(520px, calc(100% - 2rem));
    margin: 6vh auto 0;
    padding: 1.4rem;
    border-radius: 28px;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.stack-form {
    display: grid;
    gap: 0.95rem;
    margin-top: 1rem;
}

.stack-form label {
    display: grid;
    gap: 0.45rem;
}

.stack-form span {
    color: rgba(233, 236, 255, 0.8);
    font-size: 0.92rem;
}

.stack-form input {
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(183, 189, 255, 0.18);
    background: rgba(10, 12, 33, 0.82);
    color: var(--text);
    padding: 0 1rem;
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.key-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.key-duration-input {
    width: 5.5rem;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(183, 189, 255, 0.18);
    background: rgba(10, 12, 33, 0.82);
    color: var(--text);
    padding: 0 0.75rem;
    font: inherit;
    outline: none;
}

.small-button {
    min-height: 40px;
    padding: 0 0.9rem;
}

.danger-button {
    background: linear-gradient(180deg, rgba(255, 92, 140, 0.24), rgba(120, 23, 58, 0.2));
}

.top-spaced-xs {
    margin-top: 0.45rem;
}

.stack-form input:focus {
    border-color: rgba(156, 164, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(120, 134, 255, 0.12);
}

.form-feedback {
    min-height: 1.25rem;
    color: var(--muted);
}

.status-panel {
    margin-top: 1.5rem;
}

.status-success {
    border-color: rgba(121, 255, 212, 0.22);
}

.status-error {
    border-color: rgba(255, 142, 166, 0.22);
}

.auth-panel,
.admin-card {
    margin-top: 1.5rem;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.admin-table td:first-child,
.admin-table th:first-child {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.hidden {
    display: none !important;
}

.site-footer {
    margin-top: 1.5rem;
    padding: 0.35rem 0 0.75rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.site-footer a:hover {
    color: #ffffff;
}

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #c8d1ff;
}

@media (max-width: 980px) {
    .content-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .list-panel,
    .detail-panel {
        min-height: unset;
    }
}

@media (max-width: 720px) {
    .topbar,
    .hero-card,
    .list-panel,
    .detail-panel,
    .auth-panel,
    .admin-card {
        padding: 1rem;
    }

    .panel-heading,
    .detail-header {
        flex-direction: column;
    }

    .score-strip {
        grid-template-columns: 1fr;
    }
}
