﻿#game-root {
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 50;
    background: var(--bg-color);
    overflow: hidden;
}
#game-root.active {
    opacity: 1;
    pointer-events: auto;
}
body:has(#game-root.active) #starfield,
body:has(#game-root.active) .vignette {
    visibility: hidden;
}
#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-color);
}
.nav-reveal-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 116px;
    height: 86px;
    z-index: 59;
}
#game-root:not(.active) .nav-reveal-zone {
    pointer-events: none;
}
.game-header {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    display: flex;
    gap: 9px;
    padding: 8px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
        rgba(4, 8, 18, 0.48);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 18px 46px rgba(0,0,0,0.28);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    backdrop-filter: blur(18px) saturate(1.18);
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: top left;
    transition:
        opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 260ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 260ms var(--ease),
        border-color 260ms var(--ease);
    will-change: opacity, filter, transform;
}
.game-header.hidden-controls {
    opacity: 0;
    filter: blur(10px);
    transform: translate3d(-8px, -10px, 0) scale(0.94);
    pointer-events: none;
}
.nav-btn {
    background:
        radial-gradient(circle at 35% 20%, rgba(255,255,255,0.18), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
        rgba(8, 14, 28, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255,255,255,0.9);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 180ms var(--ease),
        border-color 180ms var(--ease),
        color 180ms var(--ease),
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 180ms var(--ease);
    text-decoration: none;
    box-sizing: border-box;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 10px 24px rgba(0,0,0,0.22);
}
.nav-btn svg { width: 19px; height: 19px; }
.nav-btn:hover {
    background:
        radial-gradient(circle at 35% 20%, rgba(255,255,255,0.24), transparent 34%),
        linear-gradient(145deg, rgba(56,189,248,0.2), rgba(168,85,247,0.12)),
        rgba(10, 18, 34, 0.9);
    color: #fff;
    transform: translateY(-1px) scale(1.06);
    border-color: rgba(125, 211, 252, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.16),
        0 14px 30px rgba(0,0,0,0.28),
        0 0 24px rgba(56,189,248,0.18);
}
.nav-btn:active {
    transform: translateY(0) scale(0.97);
}
.nav-btn:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.16),
        0 0 0 3px rgba(56, 189, 248, 0.38),
        0 14px 30px rgba(0,0,0,0.28);
}
.nav-btn[hidden] { display: none; }
.budget-device .nav-btn { -webkit-backdrop-filter: none; backdrop-filter: none; }
#error-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--error);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    z-index: 200;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.no-results-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.35);
    padding: 12px;
}
.no-results-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.01em;
}
.no-results-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}
@media (max-width: 700px) {
    header { margin-top: 70px; margin-bottom: 40px; }
    .subtitle { letter-spacing: 0.4em; }
    .grid { gap: 12px; width: 100%; --rail-edge-pad: 18px; padding: 54px var(--rail-edge-pad) 150px; }
    .card { --card-rest-w: 146px; --card-focus-w: 198px; --card-rest-h: 204px; --card-focus-h: 238px; --card-body-scale-x: 0.737; --card-body-scale-y: 0.817; }
    .card:hover,
    .card:focus-visible { transform: translate3d(0, -11px, 0) scale(1.1); }
    .card::before,
    .card::after,
    .card-art,
    .card-content::before,
    .card-content::after { border-radius: 14px; }
    .card-content { padding: 0 0 20px; }
    .card-icon { top: 14px; width: 100%; height: calc(100% - 76px); margin-bottom: 0; border-radius: 14px; }
    .card:hover .card-icon,
    .card:focus-visible .card-icon { width: 100%; height: calc(100% - 66px); }
    .card-icon i { font-size: 2.95rem; }
    .card-title-inline { bottom: 48px; width: calc(var(--card-rest-w) - 20px); font-size: 0.68rem; }
    .card h2 { left: calc(100% + 12px); bottom: 14px; max-width: 190px; font-size: 0.9rem; padding: 7px 9px; }
    .card:hover h2,
    .card:focus-visible h2,
    .card.is-active h2 { transform: translateX(0) translateY(-3px); }
    .card-start { bottom: 0; width: 82px; height: 46px; }
    .card:hover .card-start,
    .card:focus-visible .card-start,
    .card.is-active .card-start { width: 82px; }
    .card-corner { width: 24px; height: 24px; top: 10px; right: 10px; }
    .controls-container { width: 94%; padding: 0; }
    .filters { gap: 5px; }
    .filter-btn { width: 38px; height: 38px; font-size: 0.82rem; }
}
@keyframes slideUp { 
    from { transform: translate(-50%, 20px); opacity: 0; } 
    to { transform: translate(-50%, 0); opacity: 1; } 
}
