/* Game-specific extra styles */
.ax-game-primary {
    min-width: 0;
}

/* Responsive iframe wrapper */
#ax-game-frame-wrap.active {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 0 0 var(--ax-radius-lg) var(--ax-radius-lg);
    overflow: hidden;
}

#ax-game-iframe {
    display: block;
    width: 100%;
    border: none;
    transition: height 0.2s ease;
}

/* ── Native Fullscreen API (:fullscreen) ──────────────────────── */
.ax-game-player-wrap:fullscreen,
.ax-game-player-wrap:-webkit-full-screen,
.ax-game-player-wrap:-moz-full-screen,
.ax-game-player-wrap:-ms-fullscreen {
    background: #000;
    display: flex;
    flex-direction: column;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
}

.ax-game-player-wrap:fullscreen #ax-game-frame-wrap,
.ax-game-player-wrap:-webkit-full-screen #ax-game-frame-wrap,
.ax-game-player-wrap:fullscreen #ax-game-iframe,
.ax-game-player-wrap:-webkit-full-screen #ax-game-iframe {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* ── CSS Fullscreen Fallback (.ax-css-fullscreen) ─────────────── */
/* Used when native Fullscreen API is blocked (cross-origin iframes) */
.ax-game-player-wrap.ax-css-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    width: 100vw !important;
    height: 100dvh !important;   /* dvh = dynamic viewport height (mobile-safe) */
    background: #000 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.ax-game-player-wrap.ax-css-fullscreen .ax-game-player-header {
    flex-shrink: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
}

.ax-game-player-wrap.ax-css-fullscreen #ax-game-frame-wrap,
.ax-game-player-wrap.ax-css-fullscreen #ax-game-frame-wrap.active {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
}

.ax-game-player-wrap.ax-css-fullscreen #ax-game-iframe {
    width: 100% !important;
    height: 100% !important;
}

/* Lock scroll when CSS fullscreen is active */
body.ax-body-fullscreen {
    overflow: hidden !important;
}

/* ── Fullscreen button active state ───────────────────────────── */
#ax-fullscreen-trigger {
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
#ax-fullscreen-trigger:hover {
    background: var(--ax-primary);
    color: #fff;
    transform: scale(1.1);
}

/* Loading spinner over placeholder */
#ax-game-placeholder.loading {
    position: relative;
}

#ax-game-placeholder.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.7);
    z-index: 10;
}