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

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

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

.game-modal__panel {
    position: relative;
    background: var(--onyx-card);
    border: 1px solid var(--onyx-border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 1024px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.game-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--onyx-border);
    gap: 12px;
}

.game-modal__title {
    font-family: var(--font-michroma);
    font-size: 18px;
    color: #fff;
    margin: 0;
    line-height: 1.25;
}

.game-modal__close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.game-modal__close:hover { background: rgba(255,255,255,0.1); color: var(--onyx-gold); }

.game-modal__body {
    position: relative;
    background: #000;
    flex: 1;
    min-height: 300px;
    aspect-ratio: 16 / 10;
    display: block;
}

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

.game-modal__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 1;
    transition: opacity 0.25s ease;
}
.game-modal.is-loaded .game-modal__loader { opacity: 0; pointer-events: none; }

.game-modal__spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--onyx-gold);
    border-radius: 50%;
    animation: onyx-spin 0.9s linear infinite;
}

@keyframes onyx-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .game-modal { padding: 12px; }
    .game-modal__panel { max-height: 92vh; }
    .game-modal__body { aspect-ratio: 3 / 4; min-height: 420px; }
    .game-modal__title { font-size: 15px; }
}
