.game-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.game-modal[hidden] { display: none; }

.game-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.game-modal__dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: min(1600px, 95vw);
    background: #0a0a12;
    border: 1px solid rgba(122,92,255,0.4);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    animation: game-in 0.3s ease;
}

@keyframes game-in {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.game-modal__close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(122,92,255,0.5);
    transition: transform 0.2s ease;
    z-index: 3;
}

.game-modal__close:hover {
    transform: rotate(90deg);
}

.game-modal__close svg {
    width: 20px;
    height: 20px;
}

.game-modal__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.game-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

body.game-modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .game-modal {
        padding: 12px;
    }
    .game-modal__dialog {
        padding: 10px;
    }
    .game-modal__close {
        top: -12px;
        right: -12px;
        width: 36px;
        height: 36px;
    }
    .game-modal__frame {
        aspect-ratio: 3 / 4;
    }
}
