/* Hidden games overlay */
.hidden {
    display: none !important;
}

.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;
}

.hidden-games-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #080b12;
    color: #f8fafc;
}

.hidden-games-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden-games-header {
    min-height: 76px;
    padding: 14px clamp(14px, 3vw, 28px);
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) minmax(220px, 420px) auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(8, 11, 18, 0.96);
}

.hidden-games-heading h2 {
    margin: 0;
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: 0;
}

.hidden-games-heading p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.hidden-games-search input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 8px;
    padding: 0 14px;
    background: #111827;
    color: #f8fafc;
    font: inherit;
}

.hidden-games-search input:focus {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.hidden-games-back,
.hidden-games-exit {
    height: 42px;
    border: 1px solid rgba(248, 250, 252, 0.2);
    border-radius: 8px;
    padding: 0 16px;
    background: #1f2937;
    color: #f8fafc;
    font-weight: 700;
    cursor: pointer;
}

.hidden-games-exit {
    background: #b91c1c;
    border-color: #ef4444;
}

.hidden-games-back:hover,
.hidden-games-exit:hover {
    filter: brightness(1.08);
}

.hidden-games-overlay.is-player .hidden-games-header {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    padding: 12px clamp(16px, 2vw, 24px);
}

.hidden-games-overlay.is-player .hidden-games-heading {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.hidden-games-overlay.is-player .hidden-games-heading h2 {
    font-size: 1.12rem;
    opacity: 0.55;
}

.hidden-games-overlay.is-player .hidden-games-heading p {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.82;
}

.hidden-games-overlay.is-player .hidden-games-search {
    display: none;
}

.hidden-games-overlay.is-player .hidden-games-back {
    grid-column: 2;
    grid-row: 1;
}

.hidden-games-overlay.is-player .hidden-games-exit {
    grid-column: 3;
    grid-row: 1;
}

.hidden-games-overlay.is-player .hidden-games-back,
.hidden-games-overlay.is-player .hidden-games-exit {
    width: auto;
    min-width: 76px;
    max-width: 120px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: #4f46e5;
    box-shadow: 0 10px 24px rgba(30, 27, 75, 0.38);
}

.hidden-games-overlay.is-player .hidden-games-exit {
    min-width: 64px;
    max-width: 72px;
    background: #4338ca;
}

.hidden-games-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(18px, 3vw, 32px);
    scrollbar-gutter: stable;
}

.hidden-games-main::-webkit-scrollbar {
    width: 10px;
}

.hidden-games-main::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8);
}

.hidden-games-main::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.55);
    border: 2px solid rgba(15, 23, 42, 0.8);
    border-radius: 999px;
}

.hidden-games-main::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.85);
}

.hidden-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
}

.hidden-game-card {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 0;
    background: #111827;
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hidden-game-card:hover,
.hidden-game-card:focus-visible {
    transform: translateY(-3px);
    border-color: #38bdf8;
    background: #162033;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.34);
}

.hidden-game-card:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.hidden-game-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.86rem;
}

.hidden-game-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden-game-media span {
    padding: 10px;
    text-align: center;
}

.hidden-game-title,
.hidden-game-code {
    display: block;
    padding: 10px 12px 0;
}

.hidden-game-title {
    min-height: 58px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.28;
}

.hidden-game-code {
    padding-top: 4px;
    padding-bottom: 14px;
    color: #38bdf8;
    font-size: 0.98rem;
    font-weight: 700;
}

.hidden-games-empty,
.hidden-games-error {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    padding: 18px;
    background: #111827;
    color: #cbd5e1;
}

.hidden-games-error {
    margin-bottom: 14px;
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.hidden-games-player {
    height: calc(100vh - 76px - clamp(28px, 6vw, 56px));
    min-height: 360px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    overflow: hidden;
    background: #020617;
}

.hidden-games-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #020617;
}

.hidden-games-overlay.is-player .hidden-games-main {
    padding: 0;
    overflow: hidden;
    scrollbar-gutter: auto;
}

.hidden-games-overlay.is-player .hidden-games-player {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

.hidden-games-play-layout {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 208px;
    background: #020617;
}

.hidden-games-stage {
    min-width: 0;
    min-height: 0;
    border-left: 1px solid rgba(79, 70, 229, 0.3);
    border-right: 1px solid rgba(79, 70, 229, 0.3);
    background: #000;
}

.hidden-games-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.hidden-games-side-rail {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #0b1224;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 140, 248, 0.8) rgba(15, 23, 42, 0.8);
}

.hidden-games-side-rail::-webkit-scrollbar {
    width: 8px;
}

.hidden-games-side-rail::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8);
}

.hidden-games-side-rail::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.85);
    border-radius: 999px;
}

.hidden-games-rail-card {
    display: block;
    width: 100%;
    min-height: 218px;
    padding: 0;
    border: 1px solid rgba(99, 102, 241, 0.34);
    border-radius: 14px;
    overflow: hidden;
    background: #111827;
    color: #cbd5e1;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.24);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.hidden-games-rail-card:hover,
.hidden-games-rail-card:focus-visible {
    transform: translateY(-2px);
    border-color: #60a5fa;
    background: #172033;
}

.hidden-games-rail-card:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.hidden-games-rail-media {
    display: block;
    width: 100%;
    height: 164px;
    background: #0f172a;
    overflow: hidden;
}

.hidden-games-rail-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hidden-games-rail-title {
    display: block;
    padding: 10px 12px 12px;
    min-height: 42px;
    font-size: 0.82rem;
    line-height: 1.25;
}

@media (max-width: 720px) {
    .hidden-games-header {
        grid-template-columns: auto 1fr auto;
    }

    .hidden-games-search {
        grid-column: 1 / -1;
    }

    .hidden-games-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 14px;
    }

    .hidden-game-title {
        min-height: 56px;
        font-size: 0.94rem;
    }

    .hidden-games-player {
        height: calc(100vh - 130px - 28px);
        min-height: 300px;
    }
}

@media (max-width: 980px) {
    .hidden-games-play-layout {
        grid-template-columns: 1fr;
    }

    .hidden-games-side-rail {
        display: none;
    }

    .hidden-games-overlay.is-player .hidden-games-heading p {
        max-width: 42vw;
    }
}
