:root {
    --bg: #0f1220;
    --card: #171a2b;
    --card-2: #1c2034;
    --text: #eef1ff;
    --muted: #a9b0c7;
    --brand: #6c7cff;
    --accent: #00d4ff;
    --good: #2bd576;
    --warn: #ffb020;
    --bad: #ff5d5d;
    --stroke: #262a40;
    --chip: #232843;
    --sidebar: #0d1020;
    --shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 0px;
}

::-webkit-scrollbar-track {
    background: #161616;
}

::-webkit-scrollbar-thumb {
    background-color: #343434;
    border: none;
}

html,
body {
    height: 100%;
    margin: 0;
    background: linear-gradient(180deg, #0b0e1b 0%, #10142a 100%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

.app {
    display: grid;
    grid-template-columns: 1fr 300px;
    min-height: 100dvh;
}

.sidebar {
    background: #0b0e1b;
    border-left: 1px solid var(--stroke);
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    margin-bottom: 14px;
}

.brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    display: grid;
    place-items: center;
    color: #0d1020;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.brand h1 {
    font-size: 18px;
    line-height: 20px;
    line-height: 1.2;
    margin: 0;
}

.search {
    position: relative;
    margin: 8px 0 18px 0;
}

.search input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--stroke);
    color: var(--text);
    outline: none;
}

.search .fa-magnifying-glass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 20px;
    margin-top: 8px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    border: 1px solid transparent;
}

.menu a .fa {
    width: 18px;
    text-align: center;
}

.menu a.active {
    background: var(--chip);
    border-color: var(--stroke);
}

.menu a:hover {
    background: var(--card-2);
}

.filters {
    margin-top: 18px;
    border-top: 1px dashed var(--stroke);
    padding-top: 16px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    padding: 8px 12px;
    border-radius: 24px;
    background: var(--chip);
    color: var(--text);
    border: 1px solid var(--stroke);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.chip.active {
    background: var(--brand);
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(16, 20, 42, .72);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--stroke);
}

.header a {
    display: block;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 16px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-name {
    font-weight: 700;
    line-height: 20px;
}

.header-sub {
    font-size: 12px;
    line-height: 14px;
    color: var(--muted);
}

.header-title .mini-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    display: grid;
    place-items: center;
    color: #0d1020;
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    border: 1px solid var(--stroke);
    background: var(--card);
    color: var(--text);
    line-height: 20px;
    padding: 10px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.icon-btn i {
    width: 14px;
    height: 16px;
}

.icon-btn:hover {
    background: var(--card-2);
}

.menu-toggle {
    display: none;
}

.content {
    padding-bottom: 50px;
}

.preview {
    position: relative;
    width: 100%;
    max-height: 600px;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #2d3356, #3a4275);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0e1225d9;
    backdrop-filter: blur(10px);
}

.play-btn {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #0d1020;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 124, 255, 0.4);
}

.game-section {
    padding: 16px 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.game-section p {
    padding: 2px 0;
    margin: 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.section-content {
    color: var(--muted);
    line-height: 1.7;
    font-size: 16px;
}

.game-iframe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    border: none;
    z-index: 100;
    background: var(--bg);
}

.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 101;
    background: var(--bad);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100dvh;
        width: 300px;
        transform: translateX(100%);
        transition: transform .25s ease;
        z-index: 20;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .scrim {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
        z-index: 15;
    }

    .scrim.show {
        opacity: 1;
        pointer-events: auto;
    }

    .menu-toggle {
        display: inline-flex;
    }
}