:root {
    --page-bg: #dfe7f3;
    --shell: #191d4a;
    --shell-2: #20265d;
    --panel: rgba(45, 50, 105, 0.82);
    --panel-soft: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --muted: #b8c1f6;
    --blue: #0077ff;
    --cyan: #22d3ee;
    --pink: #ff21cf;
    --green: #41e46d;
    --radius-xl: 26px;
    --radius-lg: 18px;
    --shadow: 0 28px 70px rgba(10, 18, 65, 0.28);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.9), transparent 22%),
        linear-gradient(135deg, #e9eff8 0%, var(--page-bg) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-shell {
    width: min(1560px, calc(100% - 24px));
    min-height: min(900px, calc(100vh - 24px));
    margin: 12px auto;
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 18px;
    background:
        radial-gradient(circle at 70% 12%, rgba(74, 84, 180, 0.38), transparent 30%),
        linear-gradient(145deg, #171b47 0%, #202559 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 18px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.48rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-decoration: none;
    padding: 10px 12px;
}

.logo span:last-child {
    color: #dfe8ff;
}

.logo-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 15px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: linear-gradient(90deg, var(--pink), var(--blue));
    transform: translateX(3px);
}

.premium-card {
    margin-top: auto;
    min-height: 210px;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 230, 53, 0.28), transparent 34%),
        rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.premium-card .bolt {
    font-size: 3.2rem;
    filter: drop-shadow(0 10px 22px rgba(255, 211, 61, 0.5));
}

.premium-card strong {
    font-size: 1.05rem;
}

.premium-card span {
    color: var(--muted);
    font-size: 0.86rem;
}

.main-content {
    min-width: 0;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.search-wrap {
    width: min(100%, 560px);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0 14px;
    color: var(--muted);
}

.search-bar {
    width: 100%;
    height: 50px;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-weight: 700;
}

.search-bar::placeholder {
    color: #ccd3ff;
}

.profile-zone {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell,
.avatar-placeholder {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-weight: 900;
}

.avatar-placeholder {
    background: linear-gradient(135deg, #fc5cff, #1e8bff);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
}

.section-kicker {
    font-size: 1.22rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.hero-main {
    width: 100%;
    min-width: 0;
}

.hero-card {
    min-height: 310px;
    width: 100%;
    display: block;
    overflow: hidden;
    position: relative;
    border-radius: 18px;
    background: var(--hero-image) center / cover;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-card::after {
    display: none;
}

.hero-card:hover,
.hero-card:focus {
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.hero-overlay {
    position: relative;
    z-index: 1;
    min-height: 310px;
    display: flex;
    justify-content: flex-end;
    align-items: end;
    gap: 18px;
    padding: 22px;
}

.hero-overlay h1 {
    font-size: clamp(1.55rem, 3vw, 3.1rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.hero-overlay p {
    max-width: 560px;
    color: #dce4ff;
    font-weight: 700;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}

.ghost-btn,
.play-now-btn,
.play-fullscreen-btn,
.close-modal-btn,
.fullscreen-modal-btn {
    border: 0;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.ghost-btn,
.play-now-btn {
    padding: 10px 14px;
    font-size: 0.84rem;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.12);
}

.play-now-btn {
    background: var(--green);
    color: #062211;
}

.ghost-btn:hover,
.play-now-btn:hover,
.play-fullscreen-btn:hover,
.close-modal-btn:hover,
.fullscreen-modal-btn:hover {
    transform: translateY(-2px);
}

.invite-card {
    min-height: 230px;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gift {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 18px;
    font-size: 2rem;
    background: linear-gradient(135deg, #ff7b32, #ff1fcf);
}

.invite-card h2 {
    font-size: 1.28rem;
    line-height: 1.18;
    margin-bottom: 12px;
}

.invite-card p {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.55;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.section-title-row h2 {
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.slider-buttons {
    display: flex;
    gap: 10px;
}

.slider-buttons span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.3rem;
    font-weight: 900;
}

.slider-buttons span:last-child {
    background: linear-gradient(135deg, #2e7bff, #ff20d0);
}

.category-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    text-align: center;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-chip:hover,
.category-chip.active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.game-card {
    min-width: 0;
    display: block;
    color: var(--text);
    text-decoration: none;
}

.thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    background: #080b29;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.thumbnail-wrapper img,
.hover-preview {
    width: 100%;
    height: 100%;
}

.thumbnail-wrapper img {
    display: block;
    object-fit: cover;
    transition: none;
}

.hover-preview {
    position: absolute;
    inset: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.2s ease;
    background: #000;
}

.preview-chip,
.play-chip {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 950;
    padding: 6px 9px;
    backdrop-filter: blur(10px);
}

.preview-chip {
    left: 10px;
    bottom: 10px;
    opacity: 0;
    transform: translateY(8px);
    color: white;
    background: rgba(13, 18, 56, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.play-chip {
    right: 10px;
    top: 10px;
    color: #07132c;
    background: rgba(255, 255, 255, 0.9);
}

.game-card:hover .thumbnail-wrapper img,
.game-card:focus .thumbnail-wrapper img {
    transform: none;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 2px 0;
}

.game-dot {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.11);
    font-size: 0.78rem;
}

.game-info h3 {
    max-width: 100%;
    overflow: hidden;
    color: #f9fbff;
    font-size: 0.95rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating {
    display: block;
    margin-top: 2px;
    color: #ffd76b;
    font-size: 0.78rem;
    font-weight: 800;
}

.game-frame-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(5, 8, 31, 0.95);
}

.modal-box {
    width: min(100%, 1500px);
    height: min(100%, 920px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: #050816;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.modal-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    background: #171b47;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    overflow: hidden;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.close-modal-btn,
.fullscreen-modal-btn {
    padding: 9px 12px;
}

.close-modal-btn {
    background: #ff3d70;
}

.fullscreen-modal-btn {
    background: #2388ff;
}

#activeGameIframe {
    width: 100%;
    flex: 1;
    border: 0;
    background: #000;
}

.game-page-body {
    background:
        radial-gradient(circle at 18% 5%, rgba(68, 90, 255, 0.24), transparent 26%),
        linear-gradient(135deg, #101541 0%, #1b2050 100%);
}

.game-page-shell {
    width: min(1700px, 100%);
    margin: 0 auto;
    padding: 22px;
}

.back-home {
    display: inline-flex;
    margin-bottom: 16px;
    color: white;
    font-weight: 900;
    text-decoration: none;
}

.game-play-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: start;
}

.game-stage {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #070a24;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.game-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #1d235d, #253080);
}

.game-stage-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.game-stage-title img {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e6ecff;
    font-size: 0.7rem;
    font-weight: 950;
    text-transform: uppercase;
}

.game-stage-title h1 {
    margin: 7px 0 4px;
    font-size: clamp(1.35rem, 2.4vw, 2.4rem);
    line-height: 1;
}

.game-stage-title p {
    max-width: 720px;
    color: var(--muted);
    font-weight: 700;
}

.play-fullscreen-btn {
    flex: 0 0 auto;
    padding: 13px 16px;
    background: linear-gradient(90deg, var(--blue), var(--pink));
}

.page-game-iframe {
    display: block;
    width: 100%;
    height: calc(100vh - 150px);
    min-height: 560px;
    border: 0;
    background: #000;
}

.side-related {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--line);
}

.side-related h2 {
    font-size: 1rem;
}

.related-card {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
}

.related-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.related-card span {
    display: block;
    overflow: hidden;
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1150px) {
    .site-shell {
        grid-template-columns: 220px minmax(0, 1fr);
        width: min(100% - 28px, 1100px);
        padding: 18px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .invite-card {
        min-height: auto;
    }

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

    .game-play-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-related {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .side-related h2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    body {
        background: #151945;
    }

    .site-shell {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        grid-template-columns: 1fr;
        border-radius: 0;
        padding: 14px;
    }

    .sidebar {
        gap: 14px;
    }

    .logo {
        justify-content: center;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 8px 12px;
    }

    .premium-card {
        display: none;
    }

    .top-header {
        align-items: stretch;
        flex-direction: column;
    }

    .search-wrap {
        width: 100%;
    }

    .profile-zone {
        display: none;
    }

    .hero-card,
    .hero-overlay {
        min-height: 250px;
    }

    .hero-layout {
        display: flex;
        flex-direction: column;
    }

    .invite-card {
        width: 100%;
    }

    .hero-overlay {
        align-items: start;
        flex-direction: column;
        justify-content: end;
    }

    .hero-actions {
        width: 100%;
    }

    .ghost-btn,
    .play-now-btn {
        flex: 1;
        text-align: center;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .modal-box {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .game-page-shell {
        padding: 12px;
    }

    .game-stage-header {
        align-items: stretch;
        flex-direction: column;
    }

    .game-stage-title img {
        width: 58px;
        height: 58px;
    }

    .page-game-iframe {
        height: calc(100vh - 210px);
        min-height: 480px;
    }

    .side-related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.game-page-body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    background: #000;
}

.game-page-body .game-page-shell {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
}

.game-page-body .game-play-layout {
    display: block;
    width: 100%;
    height: 100%;
}

.game-page-body .game-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
}

.game-floating-controls {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    opacity: 0.28;
    transition: opacity 0.18s ease;
}

.game-floating-controls:hover,
.game-floating-controls:focus-within {
    opacity: 1;
}

.game-floating-controls .back-home,
.game-floating-controls .play-fullscreen-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    border-radius: 14px;
    color: white;
    background: rgba(6, 8, 24, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    font-size: 1.25rem;
    line-height: 1;
}

.game-floating-controls .play-fullscreen-btn {
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.88), rgba(255, 33, 207, 0.88));
}

.game-page-body .page-game-iframe {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    border: 0;
    background: #000;
}

.game-page-body .side-related,
.game-page-body .game-stage-header {
    display: none;
}
