:root {
    font-family: 'Kanit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color-scheme: dark;
    --bg: #020202;
    --panel: rgba(14, 14, 14, 0.9);
    --white: #f8f8f8;
    --muted: rgba(248, 248, 248, 0.65);
    --green: #52ff9c;
    --outline: rgba(255, 255, 255, 0.16);
    --glow-white: 0 0 18px rgba(255, 255, 255, 0.22);
    --glow-green: 0 0 14px rgba(82, 255, 156, 0.55);
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.06), transparent 60%),
                radial-gradient(circle at 80% 0%, rgba(82, 255, 156, 0.08), transparent 55%),
                var(--bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 72px;
    padding: 0 clamp(24px, 6vw, 72px);
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--outline);
    box-shadow: var(--glow-white);
}

.menu-button {
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 1px solid var(--outline);
    background: rgba(255, 255, 255, 0.04);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: var(--glow-white);
}

.menu-button span {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--white);
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.menu-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.25);
}

.brand {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.status-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.status-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: var(--glow-green);
}

.status-text {
    color: var(--white);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    padding: 110px 32px 40px;
    background: var(--panel);
    border-right: 1px solid var(--outline);
    box-shadow: var(--glow-white);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    z-index: 4;
    backdrop-filter: blur(12px);
}

.sidebar__content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar__content h2 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar__content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar__content li {
    width: 100%;
}

.sidebar__content a {
    display: block;
    width: 100%;
    color: rgba(248, 248, 248, 0.82);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 15px 20px;
    border-radius: 18px;
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.sidebar__content a:hover {
    background: rgba(255, 255, 255, 0.92);
    color: #141414;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.45);
}

.sidebar__content a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #141414;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.45);
}

.welcome {
    padding: clamp(48px, 6vw, 120px) clamp(36px, 6vw, 80px);
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s ease, padding 0.4s ease;
}

.page-layout {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.welcome__copy {
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.welcome__copy h1 {
    margin: 0 0 6px;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 600;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.35);
}

.page-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 36px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.18);
}

.page-title {
    margin: 0;
    font-size: clamp(2.6rem, 6vw, 3.8rem);
    font-weight: 600;
    text-shadow: 0 0 36px rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
}


.settings-page {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: center;
}

.settings-page .settings-title {
    width: 100%;
    text-align: center;
    margin: clamp(40px, 10vw, 80px) 0 0;
    font-size: clamp(2.8rem, 7vw, 4rem);
    font-weight: 600;
    text-shadow: 0 0 36px rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
}

.game-embed-layout {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    width: 100%;
}

.game-embed-panel {
    width: 100%;
    flex: 1;
    background: rgba(20, 20, 20, 0.92);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: clamp(18px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.game-embed-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.game-embed-header__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-embed-header__info h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 600;
    text-shadow: 0 0 32px rgba(255, 255, 255, 0.4);
}

.game-embed-header__info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.06em;
}

.game-embed-pill {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    color: #141414;
    letter-spacing: 0.22em;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.game-embed-header__controls {
    display: flex;
    gap: 16px;
}

.control-btn {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.18);
}

.control-btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 32px rgba(255, 255, 255, 0.35);
}

.control-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
}

.game-embed-frame {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 0 28px rgba(255, 255, 255, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    background: radial-gradient(circle at 10% 10%, rgba(120, 255, 200, 0.08), transparent 60%),
                radial-gradient(circle at 60% 0%, rgba(120, 190, 255, 0.08), transparent 55%),
                rgba(10, 10, 10, 0.96);
    flex: 1;
}

.game-embed-frame iframe {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: none;
    border-radius: inherit;
}
.page-search {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 12px 10px 22px;
    border-radius: 999px;
    background: rgba(24, 24, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 28px rgba(255, 255, 255, 0.26);
    width: 100%;
    position: relative;
}

.page-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    outline: none;
}

.page-search input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.page-search__divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.24);
    margin: 0 12px;
    border-radius: 999px;
}

.page-search__button {
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-search__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 32px rgba(255, 255, 255, 0.75);
}

.page-search__icon {
    position: relative;
    width: 18px;
    height: 18px;
}

.page-search__icon::before,
.page-search__icon::after {
    content: "";
    position: absolute;
}

.page-search__icon::before {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 10, 10, 0.85);
    border-radius: 50%;
    top: 0;
    left: 0;
}

.page-search__icon::after {
    width: 8px;
    height: 2px;
    background: rgba(10, 10, 10, 0.85);
    border-radius: 999px;
    transform: rotate(45deg);
    bottom: -3px;
    right: -2px;
}

.page-search input:focus + .page-search__button,
.page-search__button:focus-visible {
    box-shadow: 0 0 36px rgba(255, 255, 255, 0.8);
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.time,
.date {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--muted);
}

.game-shelf {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(18px, 2.5vw, 32px);
    padding: clamp(18px, 3vw, 36px);
    transition: max-width 0.35s ease, padding 0.35s ease, gap 0.35s ease;
}

@media (max-width: 1024px) {
    .game-shelf {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .game-shelf {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .game-shelf {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.game-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.game-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    transition: transform 0.3s ease;
}

.game-tile__placeholder {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(50, 50, 50, 0.9));
}

.game-tile__label {
    position: absolute;
    inset: auto 6px 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.68);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    text-align: center;
}

.game-tile:hover .game-tile__label,
.game-tile:focus-visible .game-tile__label {
    opacity: 1;
    transform: translateY(0);
}

.game-tile:hover img {
    transform: scale(1.03);
}

.game-tile:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 6px;
}

.game-shelf--filtering {
    max-width: min(820px, 100%);
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(160px, min(220px, 100%)));
    justify-content: center;
    justify-items: center;
    gap: clamp(24px, 3vw, 40px);
}

.game-tile--hidden {
    opacity: 0;
    transform: scale(0.75);
    filter: blur(4px);
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

.game-tile[hidden] {
    display: none !important;
}

.game-shelf--empty::after {
    content: "No games found";
    grid-column: 1 / -1;
    justify-self: center;
    align-self: center;
    font-size: 1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(20, 20, 20, 0.6);
    padding: 16px 32px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.15);
    opacity: 0;
    animation: shelfEmptyFade 0.35s ease forwards;
}

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

.sidebar {
    transform: translateX(-100%);
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

body.sidebar-open .welcome {
    transform: translateX(220px);
}

body.sidebar-open .welcome.page-layout {
    transform: translateX(0);
}

body.sidebar-open .top-bar .menu-button span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

body.sidebar-open .top-bar .menu-button span:nth-child(2) {
    opacity: 0;
}

body.sidebar-open .top-bar .menu-button span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 820px) {
    body.sidebar-open .welcome {
        transform: translateX(0);
    }

    .sidebar {
        width: min(82vw, 320px);
    }

    .welcome {
        padding: clamp(40px, 14vw, 96px) clamp(28px, 10vw, 96px);
        transform: translateX(0);
    }
}

@media (max-width: 540px) {
    .top-bar {
        padding: 0 clamp(18px, 5vw, 40px);
    }

    .brand {
        font-size: 1.1rem;
    }

    .status-indicator {
        font-size: 0.8rem;
    }

    .welcome__copy h1 {
        font-size: clamp(1.9rem, 8vw, 2.6rem);
    }
}
