.container {
    max-width: 1376px !important;
}

body {
    background-color: white;
    font-family: 'Fredoka One';
    cursor: default;
}

.font-outfit-reg {
    font-family: 'Outfit', regular;
}

@font-face {
    font-family: 'QuranErafont';
    src: url('../assets/fonts/quranera-font/QuranErafont.eot');
    src: url('../assets/fonts/quranera-font/QuranErafont.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/quranera-font/QuranErafont.woff') format('woff'), url('../assets/fonts/quranera-font/QuranErafont.ttf') format('truetype'), url('../assets/fonts/quranera-font/QuranErafont.svg#QuranErafont') format('svg');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'HafsQuranEra';
    src: local('HafsQuranEra'), local('HafsQuranEra-Regular'), url('../assets/fonts/Hafs/HafsQuranEra.eot');
    src: url('../assets/fonts/Hafs/HafsQuranEra.eot');
    src: url('../assets/fonts/Hafs/HafsQuranEra.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/Hafs/HafsQuranEra.woff') format('woff'), url('../assets/fonts/Hafs/HafsQuranEra.ttf') format('truetype'), url('../assets/fonts/Hafs/HafsQuranEra.svg#HafsQuranEra') format('svg');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'QuranEraV3';
    src: url('../assets/fonts/quraneraV3/QuranEraV3.eot');
    src: url('../assets/fonts/quraneraV3/QuranEraV3.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/quraneraV3/QuranEraV3.woff') format('woff'), url('../assets/fonts/quraneraV3/QuranEraV3.ttf') format('truetype'), url('../assets/fonts/quraneraV3/QuranEraV3.svg#QuranEraFontv3') format('svg');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'QuranEraV2';
    src: url('../assets/fonts/quraneraV2/Quran Era Font v2.eot');
    src: url('../assets/fonts/quraneraV2/Quran Era Font v2.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/quraneraV2/Quran Era Font v2.woff') format('woff'), url('../assets/fonts/quraneraV2/Quran Era Font v2.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Kids Rock DEMO';
    src: url('../assets/fonts/KidsRockDEMO-Regular1.eot'); /* IE9 */
    src: url('../assets/fonts/KidsRockDEMO-Regular1.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/KidsRockDEMO-Regular1.woff2') format('woff2'), url('../assets/fonts/KidsRockDEMO-Regular.woff') format('woff'), url('../assets/fonts/KidsRockDEMO-Regular.ttf') format('truetype'), url('../assets/fonts/KidsRockDEMO-Regular.svg#KidsRockDEMO-Regular') format('svg');
    font-weight: normal;
    font-style: normal;
}

.play-btn {
    background-color: #70CE67;
    box-shadow: 0px 6px 0px 0px #4F9A48;
    min-width: 130px;
    padding: 8px 48px;

    &.play-btn:hover {
        background-color: #5FAF57;
        padding: 8px 48px;
        border-radius: 12px;
        box-shadow: 0px 6px 0px 0px #8FDC88;
        color: white;
    }
}

.games-holder {
    display: flex;
    justify-content: space-between;
}

.game-item {
    max-width: 350px;

    button {
        font-family: 'Outfit', ExtraBold;
    }
}

.game-item-poster {
    padding: 17px;
    border-radius: 25px;
    background-color: #E8F7E4;
    margin-bottom: 30px;

    img {
        border-radius: 18px;
    }
}

.game-item-gameTitle {
    color: #65727D;
    font-family: 'Outfit', meduim;
}

.game-item-gameZone {
    margin-bottom: 30px;
    color: #FAA106;
}

.zone-title {
    font-size: 48px;
    margin-bottom: 58px;
}

.games-container {
    margin-top: 30px;
    padding-top: 0 !important;
    margin-bottom: 0px;
}

.bottom-box {
    font-size: 30px;
    margin-bottom: 88px
}

.bottom-box-holder {
    background-color: #FFF3E1;
    border-radius: 64px;
    padding: 71px 100px;
    max-width: 1200px;
}

.bottom-box-text {
    margin-bottom: 88px;
}

.mobile-break {
    display: none;
}

p {
    line-height: 1.8;
}

@media (max-width: 480px) {
    .game-item-gameZone {
        margin-bottom: 10px;
        color: #FAA106;
    }

    .games-holder {
        display: block;
    }

    .game-item {
        margin-top: 50px;
    }

    .game-item-poster {
        margin-bottom: 3px;
    }

    .zone-title {
        font-size: 28px;
        color: #3D464C;
        margin-bottom: 27px;
    }

    .zone-title-2 {
        color: #3D464C;
    }

    .zone-title-3 {
        color: #3D464C;
    }

    .zone-title-4 {
        color: #3D464C;
    }

    .npm {
        padding-top: 0 !important;
    }

    .bottom-box {
        font-size: 22px !important;
        margin-bottom: 31px;
    }

    .bottom-box-holder {
        padding: 50px 20px;
        background-color: #FFF3E1;
        justify-items: center;
    }

    .mobile-break {
        display: block;
    }

    .orange-m {
        color: #FFA000;
    }

    .bottom-box-text {
        font-size: 14px;
        margin-bottom: 31px;
    }

    .bottom-box-noCommit {
        color: #29323A;
    }

    .bottom-box-btn {
        max-width: 300px;
    }

    .frame-game .game-container {
        margin: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000; /* Black background for letterboxing */
    }

    .frame-game .frame {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        background-color: #000;
        background-image: none; /* Optional: hide loader bg on mobile */
    }

    .frame-game .frame-in {
        width: 100%;
        height: 100%;
    }

    .frame-game .close-btn {
        top: 15px;
        right: 20px;
        z-index: 10000;
        color: #fff; /* Make it visible against the game background */
        background: rgba(0,0,0,0.5);
        padding: 5px 15px;
        border-radius: 10px;
    }
}

.frame-game {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #00000063;
    z-index: 9999;
    margin-top: -80px;

    .game-container {
        display: table;
        margin-left: auto;
        margin-right: auto;
        background-color: #ffffff;
        border-radius: 30px;
        position: relative;

        .frame {
            width: 980px;
            height: 600px;
            display: block;
            margin: 28px;
            position: relative;
            background-image: url(../image/games/loader.gif);
            background-repeat: no-repeat;
            background-position: center;
            background-color: #3db8ff;
            background-size: contain;
            border-radius: 20px;

            .frame-in {
                width: 980px;
                height: 600px;
                display: block;
                overflow: hidden;
                position: relative;
                top: 0;
                left: 0;
                z-index: 4;
            }
        }

        .close-btn {
            position: absolute;
            top: -3px;
            right: 30px;
            font-weight: 900;
            font-size: 23px;
            color: #858A8E;
            cursor: pointer;
            user-select: none;
        }
    }

    #game-container {
        overflow: hidden;
        width: 100%;
        height: 100%;
        border-radius: 20px;
        background-image: url(../image/games/loader.gif);
        background-repeat: no-repeat;
        background-position: center;
        background-color: #000000;
        background-size: contain;
    }
}

    /* --- DEFINITIVE MOBILE FULLSCREEN & CENTERING --- */

    /* Applied via JS to override desktop styles on mobile/tablets */
    .frame-game.mobile-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
        background-color: #3db8ff !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

        /* Strip desktop layout from all nested wrappers */
        .frame-game.mobile-active .game-container,
        .frame-game.mobile-active .frame,
        .frame-game.mobile-active .frame-in {
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
            display: flex !important;
            align-items: center;
            justify-content: center;
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            border: none !important;
            border-radius: 0 !important;
            background: #000000 !important;
        }

        /* Force the Phaser Canvas to center and retain its 980x600 ratio */
        .frame-game.mobile-active #game-container canvas {
            margin: 0 auto !important;
            max-width: 100% !important;
            max-height: 100% !important;
            object-fit: contain !important;
        }

        /* Fix the Close Button for mobile */
        .frame-game.mobile-active .close-btn {
            position: absolute;
            top: 15px;
            right: 25px;
            z-index: 100000;
            color: #fff;
            background: rgba(0,0,0,0.4);
            padding: 5px 15px;
            border-radius: 10px;
        }

/* Rotate Overlay Styles */
#rotate-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3d464c;
    color: white;
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

    #rotate-overlay h2 {
        margin-top: 20px;
        font-size: 22px;
        font-family: 'Fredoka', sans-serif;
    }

    #rotate-overlay p {
        margin-top: 10px;
        font-size: 14px;
        color: #a0aab2;
        font-family: 'Fredoka', sans-serif;
    }

/* Show overlay ONLY on mobile/tablets when held vertically */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    .frame-game.mobile-active #rotate-overlay {
        display: flex;
    }

    .frame-game.mobile-active .game-container {
        display: none !important;
    }
}

@media only screen and (max-width: 768px), (max-height: 500px) {
    .frame-game {
        padding-bottom: env(safe-area-inset-bottom) !important;
        padding-top: env(safe-area-inset-top) !important;
        height: 100dvh !important;
        flex-direction: column;
    }

    #game-container {
        flex: 1;
        width: 100% !important;
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}