:root {
    --bg-base: #08090c;
    --bg-elevated: rgba(24, 24, 28, 0.72);
    --bg-elevated-strong: rgba(34, 34, 38, 0.9);
    --surface-soft: rgba(255, 255, 255, 0.055);
    --surface-hover: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text-primary: rgba(255, 255, 255, 0.96);
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.48);
    --accent: #2997ff;
    --accent-soft: rgba(41, 151, 255, 0.18);
    --success: #32d74b;
    --danger: #ff453a;
    --warning: #ffd60a;
    --shadow-lg: 0 25px 80px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 14px 35px rgba(0, 0, 0, 0.32);
    --blur-strong: blur(32px);
    --blur-soft: blur(18px);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-pill: 999px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: #050608;
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(41, 151, 255, 0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 25%),
        linear-gradient(180deg, #0c0c0f 0%, #090a0d 35%, #050608 100%);
    background-attachment: fixed;
    background-color: #050608;
    overscroll-behavior-y: none;
}

body.is-navigating {
    cursor: progress;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -2;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.75;
}

body::before {
    top: 4rem;
    right: -5rem;
    width: 14rem;
    height: 14rem;
    background: rgba(41, 151, 255, 0.12);
}

body::after {
    bottom: 4rem;
    left: -3rem;
    width: 12rem;
    height: 12rem;
    background: rgba(255, 255, 255, 0.09);
}

a {
    color: inherit;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.site-shell {
    position: relative;
    min-height: 100vh;
}

.site-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent 14%),
        linear-gradient(to top, rgba(255, 255, 255, 0.03), transparent 18%);
    mask-image: linear-gradient(180deg, black, transparent 82%);
    pointer-events: none;
    z-index: -1;
}

.glass-surface {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
    border: 1px solid var(--border-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--shadow-md);
    backdrop-filter: var(--blur-soft);
    -webkit-backdrop-filter: var(--blur-soft);
}

.main-navbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 2000;
    padding: 1rem 1rem 0;
}

.modal {
    z-index: 3000;
}

.modal-backdrop {
    z-index: 2990;
}

.navbar-frame {
    width: min(1180px, calc(100% - 1rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    position: relative;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: start;
}

.side-menu-toggle,
.navbar-title {
    min-height: 62px;
    border-radius: var(--radius-pill);
}

.side-menu-toggle {
    width: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.side-menu-toggle:hover,
.side-menu-toggle:focus-visible {
    transform: translateY(-1px) scale(1.01);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.12);
}

.side-menu-toggle i {
    font-size: 1.35rem;
}

.navbar-title {
    padding: 0 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    justify-self: end;
    min-width: 220px;
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem;
    min-height: 64px;
    border-radius: var(--radius-pill);
    justify-self: center;
}

.desktop-nav .nav-link,
.mobile-dock .nav-link,
.side-menu .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.desktop-nav .nav-link {
    min-height: 52px;
    padding: 0.8rem 1.1rem;
    font-size: 0.96rem;
    font-weight: 500;
    white-space: nowrap;
}

.desktop-nav .nav-link:hover,
.mobile-dock .nav-link:hover,
.side-menu .nav-link:hover,
.desktop-nav .nav-link.active,
.mobile-dock .nav-link.active {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.25);
}

.desktop-nav .nav-link.active,
.mobile-dock .nav-link.active {
    color: var(--accent);
}

.side-menu {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    width: min(340px, calc(100vw - 2rem));
    padding: 1rem;
    border-radius: 34px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.985);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    z-index: 2100;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
        rgba(18, 18, 22, 0.86);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 24px 60px rgba(0, 0, 0, 0.42);
}

.side-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0.35rem 1rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-menu-header h6 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.close-menu {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-radius: 50%;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.12);
}

.side-menu .navbar-nav {
    gap: 0.45rem;
}

.side-menu .nav-item {
    list-style: none;
}

.side-menu .nav-link {
    justify-content: flex-start;
    min-height: 58px;
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.side-menu .nav-link i {
    width: 1.1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.side-menu .nav-link span {
    flex: 1;
}

.side-menu .nav-link::after {
    content: "\f054";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.28);
    transition: transform 0.25s ease, color 0.25s ease;
}

.side-menu .nav-link:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.side-menu .nav-link:hover::after {
    transform: translateX(2px);
    color: rgba(255, 255, 255, 0.55);
}

.page-container {
    width: min(1180px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 8.2rem 0 8rem;
}

.page-section {
    padding: 1.35rem 0;
}

.card,
.list-group-item,
.modal-content,
.table-responsive,
.iframe-container,
.game-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-md) !important;
    backdrop-filter: var(--blur-soft);
    -webkit-backdrop-filter: var(--blur-soft);
}

.card-body,
.modal-body,
.modal-header,
.modal-footer {
    color: inherit !important;
}

.table,
.table * {
    color: var(--text-primary) !important;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-secondary) !important;
    font-weight: 600;
}

.table td,
.table th {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(255, 255, 255, 0.035) !important;
}

.table-hover tbody tr:hover > * {
    background: rgba(255, 255, 255, 0.06) !important;
}

.btn {
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding-inline: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(180deg, #1f8fff, #0a84ff) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 28px rgba(10, 132, 255, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #38a1ff, #178cff) !important;
}

.btn-outline-light,
.btn-outline-info,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning {
    background: rgba(255, 255, 255, 0.04) !important;
    border-width: 1px !important;
}

.btn-outline-light {
    color: var(--text-primary) !important;
    border-color: var(--border-soft) !important;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
}

.btn-outline-danger {
    color: #ff8d86 !important;
    border-color: rgba(255, 69, 58, 0.34) !important;
}

.btn-outline-danger:hover {
    background: rgba(255, 69, 58, 0.18) !important;
    color: #ffd5d2 !important;
}

.btn-outline-success {
    color: #7dff93 !important;
    border-color: rgba(50, 215, 75, 0.28) !important;
}

.btn-outline-success:hover {
    background: rgba(50, 215, 75, 0.16) !important;
    color: #d5ffdc !important;
}

.btn-outline-info {
    color: #82d2ff !important;
    border-color: rgba(130, 210, 255, 0.3) !important;
}

.btn-outline-info:hover {
    background: rgba(130, 210, 255, 0.18) !important;
    color: #dff5ff !important;
}

.btn-outline-warning {
    color: #ffe684 !important;
    border-color: rgba(255, 214, 10, 0.28) !important;
}

.btn-outline-warning:hover {
    background: rgba(255, 214, 10, 0.18) !important;
    color: #fff9db !important;
}

.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-info,
.btn-check:checked + .btn-outline-light,
.btn-check:checked + .btn-outline-success,
.btn-check:checked + .btn-outline-warning,
.btn-check:checked + .btn-outline-danger {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 30px rgba(0, 0, 0, 0.25);
}

.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(180deg, #36a3ff, #0a84ff) !important;
}

.btn-check:checked + .btn-outline-info {
    background: linear-gradient(180deg, #54d0ff, #0fb6ff) !important;
}

.btn-check:focus + .btn {
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.16) !important;
}

.badge {
    border-radius: var(--radius-pill);
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 54px;
    background: rgba(255, 255, 255, 0.045) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(41, 151, 255, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.16) !important;
}

.input-group > .form-control {
    border-left: 0 !important;
}

.input-group-text {
    color: var(--text-secondary) !important;
    border-right: 0 !important;
}

.alert {
    border-radius: 20px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(255, 69, 58, 0.14);
    border-color: rgba(255, 69, 58, 0.22);
    color: #ffe4e2;
}

.text-muted,
.small,
small {
    color: var(--text-muted) !important;
}

.home-hero {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 15rem);
    padding: 1rem 0 2rem;
}

.hero-panel {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(2.2rem, 5vw, 4rem);
    border-radius: 42px;
    background: transparent;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.6rem;
}

.hero-title {
    margin: 0;
    font-size: clamp(3rem, 8vw, 5.1rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    font-weight: 700;
    text-wrap: balance;
}

.hero-divider {
    width: min(100%, 680px);
    height: 1px;
    margin: 2rem auto 1.6rem;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.hero-subtitle {
    margin: 0 auto;
    max-width: 700px;
    color: var(--text-secondary);
    font-size: clamp(1.1rem, 2.8vw, 1.75rem);
    line-height: 1.28;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.mobile-dock-wrap {
    position: fixed;
    inset: auto 0 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    padding: 0 0.85rem calc(env(safe-area-inset-bottom, 0px) + 0.85rem);
}

.mobile-dock {
    width: min(520px, calc(100vw - 1.7rem));
    margin: 0;
    padding: 0.45rem;
    border-radius: 30px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.28rem;
}

.mobile-dock .nav-item {
    flex: 1 1 0;
    display: flex;
}

.mobile-dock .nav-link {
    min-height: 72px;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.7rem 0.35rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.05;
    text-align: center;
}

.mobile-dock .nav-link i {
    font-size: 1.35rem;
    width: 1.35rem;
}

.mobile-dock .nav-link.active {
    background: rgba(255, 255, 255, 0.08);
}

.fullscreen-game {
    background:
        radial-gradient(circle at top, rgba(41, 151, 255, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(7, 8, 10, 0.98), rgba(4, 5, 7, 0.98)) !important;
}

.popup-message {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%) translateY(12px);
    min-width: min(90vw, 320px);
    padding: 1rem 1.25rem;
    border-radius: 20px;
    background: rgba(17, 17, 20, 0.88);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1200;
}

.popup-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.popup-message.error {
    border-color: rgba(255, 69, 58, 0.32);
}

.popup-message.info {
    border-color: rgba(41, 151, 255, 0.3);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: inline-flex;
    }

    .mobile-dock-wrap {
        display: none;
    }

    .page-container {
        padding-top: 8.8rem;
        padding-bottom: 3rem;
    }

    .side-menu {
        width: min(360px, calc(100vw - 3rem));
    }
}

@media (max-width: 991.98px) {
    .page-container {
        padding-top: 7.6rem;
        padding-bottom: 8.8rem;
    }

    .navbar-title {
        padding-inline: 1.2rem;
        min-height: 56px;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    body {
        min-height: 100dvh;
    }

    .main-navbar {
        padding: calc(env(safe-area-inset-top, 0px) + 0.45rem) 0.85rem 0;
    }

    .navbar-frame {
        width: 100%;
        grid-template-columns: auto 1fr;
        gap: 0.7rem;
    }

    .side-menu-toggle {
        width: 56px;
        min-height: 56px;
    }

    .desktop-nav {
        display: none !important;
    }

    .navbar-title {
        font-size: 1rem;
        justify-self: end;
        min-width: 0;
        padding-inline: 0.95rem;
        max-width: calc(100vw - 6.2rem);
    }

    .hero-panel {
        padding-inline: 0.5rem;
    }

    .hero-subtitle {
        max-width: 95%;
    }

    .card,
    .table-responsive,
    .modal-content {
        border-radius: 24px !important;
    }

    .side-menu {
        width: min(330px, calc(100vw - 1rem));
        max-height: min(72dvh, 560px);
        overflow-y: auto;
        border-radius: 30px;
    }

    .side-menu .nav-link {
        min-height: 54px;
        padding: 0.85rem 0.95rem;
        font-size: 0.94rem;
    }

    .mobile-dock .nav-link.active {
        transform: none;
    }
}
