/* Mobile play experience — VibeX Games v2.9.0
 * Cross-origin embeds use inline tall player — never fixed black immersive shell.
 */

.v-engine-start {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.v-engine-start__label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0b0b10;
}

.v-mobile-blocked,
.v-mobile-blocked__inner {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 280px;
    padding: 28px 20px;
    background: linear-gradient(165deg, #14141c 0%, #09090f 100%);
}

.v-mobile-blocked__inner {
    max-width: 420px;
    gap: 12px;
}

.v-mobile-blocked__inner > i {
    font-size: 2.4rem;
    color: #d7ff45;
}

.v-mobile-blocked__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #f7f4ff;
}

.v-mobile-blocked__text {
    margin: 0;
    color: #a39aad;
    line-height: 1.55;
}

.v-mobile-blocked__btn {
    display: inline-flex;
    margin-top: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #d7ff45;
    color: #0b0b10;
    font-weight: 800;
    text-decoration: none;
}

.v-orient-gate {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    background: rgba(6, 6, 10, 0.92);
    backdrop-filter: blur(8px);
    padding: 24px;
}

.v-orient-gate[hidden] { display: none !important; }

.v-orient-gate__card {
    text-align: center;
    max-width: 320px;
}

.v-orient-phone {
    width: 64px;
    height: 110px;
    margin: 0 auto 18px;
    border: 3px solid #d7ff45;
    border-radius: 12px;
    position: relative;
    animation: v-phone-tilt 1.6s ease-in-out infinite;
}

.v-orient-phone__screen {
    position: absolute;
    inset: 10px 8px 14px;
    background: linear-gradient(145deg, rgba(215, 255, 69, 0.35), rgba(215, 255, 69, 0.08));
    border-radius: 4px;
}

.v-orient-phone--landscape {
    animation-name: v-phone-to-landscape;
}

.v-orient-phone--portrait {
    width: 110px;
    height: 64px;
    animation-name: v-phone-to-portrait;
}

@keyframes v-phone-to-landscape {
    0%, 20% { transform: rotate(0deg); }
    45%, 70% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

@keyframes v-phone-to-portrait {
    0%, 20% { transform: rotate(90deg); }
    45%, 70% { transform: rotate(0deg); }
    100% { transform: rotate(90deg); }
}

.v-orient-gate__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #f7f4ff;
}

.v-orient-gate__text {
    margin: 0 0 16px;
    color: #a39aad;
}

.v-orient-gate__skip {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: #f7f4ff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.v-mobile-playbar {
    display: none;
}

@media (max-width: 900px) {
    .v-play-context--mobile .v-play-engine {
        border-radius: 16px;
    }

    .v-play-context--mobile .v-player-wrapper {
        aspect-ratio: 16 / 10;
        min-height: min(52vh, 420px);
        max-height: min(72vh, 640px);
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        /* touch-action:none breaks cross-origin iframe input on iOS/Android */
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
    }

    .v-play-context--mobile .v-player-wrapper iframe {
        touch-action: auto;
        pointer-events: auto;
    }

    .v-play-context--mobile .v-engine-hud {
        padding: 12px 14px 14px;
        gap: 12px;
    }

    .v-play-context--mobile .v-game-title {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .v-play-context--mobile .v-hud-actions {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .v-play-context--mobile .v-action-node {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .v-play-context--mobile .breadcrumbs {
        margin-bottom: 10px;
    }
}

/* Desktop-only immersive (local / same-origin games) */
body.is-playing-immersive {
    overflow: hidden;
    overscroll-behavior: none;
    background: #000;
}

body.is-playing-immersive .site-header,
body.is-playing-immersive .site-footer,
body.is-playing-immersive .v-play-chrome,
body.is-playing-immersive .game-tooltip {
    display: none !important;
}

body.is-playing-immersive .site-main,
body.is-playing-immersive .site-container,
body.is-playing-immersive .v-play-context,
body.is-playing-immersive .v-play-engine {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

body.is-playing-immersive .v-player-wrapper.v-game-running {
    position: fixed;
    inset: 0;
    z-index: 4000;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 0;
    background: #111;
    -webkit-overflow-scrolling: touch;
}

body.is-playing-immersive .v-player-wrapper.v-game-running iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

/* Mobile inline player — all cross-origin embeds (Playgama, GD, GamePix, Famobi…) */
body.is-mobile-playing,
body.is-playgama-mobile {
    overscroll-behavior: contain;
}

body.is-mobile-playing .site-header,
body.is-mobile-playing .site-footer,
body.is-mobile-playing .v-play-chrome,
body.is-mobile-playing .game-tooltip,
body.is-mobile-playing .breadcrumbs,
body.is-playgama-mobile .site-header,
body.is-playgama-mobile .site-footer,
body.is-playgama-mobile .v-play-chrome,
body.is-playgama-mobile .game-tooltip,
body.is-playgama-mobile .breadcrumbs {
    display: none !important;
}

body.is-mobile-playing .site-main,
body.is-mobile-playing .site-container,
body.is-mobile-playing .v-play-context,
body.is-mobile-playing .v-play-engine,
body.is-playgama-mobile .site-main,
body.is-playgama-mobile .site-container,
body.is-playgama-mobile .v-play-context,
body.is-playgama-mobile .v-play-engine {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.is-mobile-playing .v-player-wrapper.v-mobile-running,
body.is-mobile-playing .v-player-wrapper.v-playgama-running,
body.is-playgama-mobile .v-player-wrapper.v-playgama-running {
    position: relative;
    z-index: 20;
    width: 100%;
    min-height: calc(100dvh - 56px);
    height: calc(100dvh - 56px);
    max-height: none;
    aspect-ratio: unset;
    border-radius: 0;
    background: #0b0b10;
    overflow: hidden;
}

body.is-mobile-playing .v-player-wrapper.v-mobile-running iframe,
body.is-mobile-playing .v-player-wrapper.v-playgama-running iframe,
body.is-playgama-mobile .v-player-wrapper.v-playgama-running iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    touch-action: auto;
    pointer-events: auto;
    z-index: 2;
}

.v-embed-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    gap: 12px;
    background: #12121a;
    color: #f7f4ff;
    pointer-events: none;
}

.v-embed-loading[hidden] { display: none !important; }

.v-embed-loading__spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(215, 255, 69, 0.2);
    border-top-color: #d7ff45;
    animation: v-spin 0.9s linear infinite;
}

.v-embed-loading__text {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #a39aad;
}

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

.v-playgama-fallback {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 64px;
    z-index: 5;
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(9, 9, 14, 0.92);
    color: #f7f4ff;
    text-align: center;
}

.v-playgama-fallback[hidden] { display: none !important; }

.v-playgama-fallback p {
    margin: 0;
    font-size: 0.9rem;
    color: #a39aad;
}

.v-playgama-fallback__btn,
.v-playgama-fallback__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
}

.v-playgama-fallback__btn {
    border: 0;
    background: #d7ff45;
    color: #0b0b10;
    cursor: pointer;
}

.v-playgama-fallback__link {
    border: 1px solid rgba(255,255,255,.2);
    color: #f7f4ff;
}

.v-playhop-launch {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 24px 18px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(215, 255, 69, 0.12), transparent 55%),
        linear-gradient(165deg, #16161f 0%, #0d0d14 100%);
    color: #f7f4ff;
    text-align: center;
}

.v-playhop-launch__inner {
    display: grid;
    gap: 12px;
    justify-items: center;
    max-width: 360px;
}

.v-playhop-launch__thumb {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.v-playhop-launch__title {
    margin: 0;
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.v-playhop-launch__text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #a39aad;
}

.v-playhop-launch__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 4px;
    padding: 12px 22px;
    border-radius: 14px;
    background: #d7ff45;
    color: #0b0b10;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.01em;
}

html.v-mobile-inline-ready body {
    /* early paint hint before DOMContentLoaded body class */
}

body.is-mobile-playing .v-mobile-playbar,
body.is-playgama-mobile .v-mobile-playbar {
    display: flex;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    align-items: center;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(9, 9, 14, 0.92);
    color: #fff;
}

body.is-mobile-playing .v-mobile-playbar__btn,
body.is-playgama-mobile .v-mobile-playbar__btn {
    pointer-events: auto;
}

/* Never apply fixed immersive shell on mobile — causes black iframe */
@media (max-width: 900px) {
    body.is-playing-immersive .v-player-wrapper.v-game-running {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: calc(100dvh - 56px) !important;
        min-height: calc(100dvh - 56px) !important;
    }
}

body.is-playing-immersive .v-mobile-playbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4010;
    align-items: center;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78) 35%);
    color: #fff;
    pointer-events: none;
}

body.is-playing-immersive .v-mobile-playbar > * {
    pointer-events: auto;
}

html.v-orient-locked,
html.v-orient-locked body {
    overflow: hidden;
}
