/* =================================================================
   GAME POPUP - RESPONSIVE DESIGN
   Based on RESPONSIVE-DESIGN-GUIDE.md principles
   ================================================================= */

/* CSS Variables for Popup */
:root {
    --popup-brown: #543e1e;
    --popup-beige: #f5f0e8;
    --popup-page: #fff8d9;
    --popup-green: #2b6015;
    --popup-dark-brown: #3a2918;
    --popup-scrollbar-track: #f5f0e8;
}

/* =================================================================
   POPUP OVERLAY & CONTAINER
   ================================================================= */

.game-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    z-index: 2000;
}

.game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(85vw, 90vw, 95vw);  /* Fluid width */
    height: clamp(70vh, 80vh, 85vh);  /* Fluid height */
    background: var(--popup-brown);
    border-radius: clamp(10px, 1.5vw, 15px);
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(0,0,0,0.3);
    padding: clamp(10px, 1.5vw, 15px);
    z-index: 2001;
    display: flex;
    position: relative;
}

/* Game tabs inside container's brown border area */
.game-tabs {
    position: absolute;
    left: clamp(12px, 1.5vw, 20px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.5vh, 18px);
    z-index: 2002;
    width: clamp(100px, 12vw, 140px);
}

.game-tab {
    background: var(--popup-beige);
    border: 2px solid #203599;
    color: var(--popup-brown);
    padding: clamp(10px, 1.2vh, 14px) clamp(14px, 1vw, 18px);
    border-radius: clamp(8px, 1vw, 12px) 0 0 clamp(8px, 1vw, 12px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transform-origin: left center;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.game-tab:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.game-tab[aria-selected="true"] {
    background: #203599;
    color: var(--popup-beige);
    border-color: var(--popup-beige);
    transform: translateX(3px);
}

/* Slightly adjust for very large screens */
@media screen and (min-width: 2560px) {
    .game-tabs {
        left: clamp(20px, 2.5vw, 30px);
        gap: clamp(15px, 2vh, 22px);
    }
    .game-tab {
        padding: clamp(12px, 1.5vh, 16px) clamp(16px, 1.2vw, 20px);
    }
}

.game-pages-wrapper {
    width: calc(100% - clamp(50px, 6vw, 80px));
    margin-left: auto;
    height: 100%;
    background: var(--popup-beige);
    border-radius: clamp(6px, 1vw, 8px);
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    position: relative;
}

.game-scroll {
    display: flex;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    scroll-behavior: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--popup-brown) var(--popup-scrollbar-track);
}

.game-scroll::-webkit-scrollbar {
    display: block;
    height: clamp(8px, 1vw, 12px);
}

.game-scroll::-webkit-scrollbar-track {
    background: var(--popup-scrollbar-track);
    border-radius: 6px;
}

.game-scroll::-webkit-scrollbar-thumb {
    background: var(--popup-brown);
    border-radius: 6px;
    border: 2px solid var(--popup-scrollbar-track);
}

.game-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--popup-dark-brown);
}

.game-page {
    width: 600%;
    height: 100%;
    padding: clamp(15px, 2vh, 25px);
    background: var(--popup-beige);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    scroll-snap-align: none;
}

/* =================================================================
   TYPOGRAPHY - FLUID SIZING
   ================================================================= */

.gameTitle,
.gameHeroTitle,
.gameEnemyTitle {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(3.5rem, 12vh, 10rem);
    color: #203599;
    line-height: 1.1;
}

.gamePurposeTitle,
.gameObjectiveTitle,
.gameApproachTitle,
.gameDurationTitle,
.gameStoryTitle,
.gameMishTitle,
.gameSlicTitle {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 5vh, 5rem);
    color: #203599;
    line-height: 1.3;
}

.gameDescription,
.gameObjectiveDescription,
.gameApproachDescription,
.gameDurationDescription,
.gameStoryDescription,
.gameMishDescription1,
.gameMishDescription2,
.gameSlicDescription1,
.gameSlicDescription2 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 2.5vh, 5rem);
    color: #203599;
    line-height: 1.5;
    margin-top: clamp(10px, 1.5vh, 20px);
}

/* =================================================================
   INTRO SECTION
   ================================================================= */

.gameMish1{
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: 101%;
    z-index: 10;
    object-fit: cover;
}

.gameTitle{
    position: absolute;
    top: 20%;
    left: 50vw;
    font-size: clamp(3.5rem, 12vh, 10rem);
    z-index: 11;
    text-align: right;
}

.gamePurposeTitle{
    position: absolute;
    top: 7%;
    left: 83vw;
    z-index: 11;
}

.gameDescription{
    position: absolute;
    top: 15%;
    left: 83vw;
    z-index: 11;
}

.gameObjectiveTitle{
    position: absolute;
    top: 63%;
    left: 83vw;
    z-index: 11;
}

.gameObjectiveDescription{
    position: absolute;
    top: 71%;
    left: 83vw;
    z-index: 11;
}

.gameApproachTitle{
    position: absolute;
    top: 7%;
    left: 120vw;
    z-index: 11;
}

.gameApproachDescription{
    position: absolute;
    top: 15%;
    left: 120vw;
    z-index: 11;
}

.gameDurationTitle{
    position: absolute;
    top: 63%;
    left: 120vw;
    z-index: 11;
}

.gameDurationDescription{
    position: absolute;
    top: 71%;
    left: 120vw;
    z-index: 11;
}

.gameStoryTitle{
    position: absolute;
    top: 7%;
    left: 150vw;
    z-index: 11;
}

.gameStoryDescription{
    position: absolute;
    top: 15%;
    left: 150vw;
    z-index: 11;
}

/* =================================================================
   HERO SECTION
   ================================================================= */

.gameMish2{
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: 101%;
    z-index: 10;
    object-fit: cover;
}

.gameHeroTitle{
    position: absolute;
    top: 20%;
    left: 50vw;
    font-size: clamp(3.5rem, 12vh, 10rem);
    z-index: 11;
}

.gameMishTitle{
    position: absolute;
    top: 7%;
    left: 83vw;
    z-index: 11;
}

.gameMishDescription1{
    position: absolute;
    top: 15%;
    left: 83vw;
    z-index: 11;
}

.gameMishDescription2{
    position: absolute;
    top: 14.5%;
    left: 120vw;
    z-index: 11;
}

.gameMishProg{
    position: absolute;
    bottom: 15%;
    left: 83vw;
    width: auto;
    height: 30%;
    z-index: 10;
}   

.gameMish3{
    position: absolute;
    top: 2%;
    left: 150vw;
    width: auto;
    height: 95%;
    z-index: 10;
}

/* =================================================================
   ENEMY SECTION
   ================================================================= */

.gameSlic1{
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: 101%;
    z-index: 10;
    object-fit: cover;
}

.gameEnemyTitle{
    position: absolute;
    top: 20%;
    left: 50vw;
    font-size: clamp(3.5rem, 12vh, 10rem);
    z-index: 11;
}

.gameSlicTitle{
    position: absolute;
    top: 7%;
    left: 83vw;
    z-index: 11;
}

.gameSlicDescription1{
    position: absolute;
    top: 15%;
    left: 83vw;
    z-index: 11;
}

.gameSlicProg{
    position: absolute;
    top: 0;
    left: 22vw;
    width: auto;
    height: 90%;
    z-index: 10;
}

.gameSlicDescription2{
    position: absolute;
    top: 15%;
    left: 180vw;
    z-index: 11;
}

.gameSlic2{
    position: absolute;
    bottom: 0;
    left: 120vw;
    width: auto;
    height: 100%;
    z-index: 10;
}

/* =================================================================
   CLOSE BUTTON
   ================================================================= */

.close-game-btn {
    font-family: 'Libre Baskerville', serif;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: clamp(30px, 4vw, 40px);
    cursor: pointer;
    color: var(--popup-brown);
    z-index: 2004;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.close-game-btn:hover {
    color: var(--popup-brown);
    transform: rotate(90deg);
}

/* =================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================= */

/* Large Desktop (1920px+) */
@media screen and (min-width: 1920px) {
    /* Add specific adjustments for large desktop */
}

/* Extra Large Desktop (2560px+) */
@media screen and (min-width: 2560px) {
    .game-page {
        width: 650%;
    }

    .gameMishTitle {
        left: 86vw;
    }

    .gameMishDescription1 {
        left: 86vw;
    }

    .gameMishDescription2 {
        left: 125vw;
    }

    .gameMish3 {
        left: 156.5vw;
    }

    .gameSlicDescription2 {
        left: 188vw;
    }

    .gameSlic2 {
        left: 130vw;
        scale: 130%;
    }   

}

/* Medium Desktop (1024px - 1439px) */
@media screen and (max-width: 1439px) {
    .game-container {
        width: 92vw;
        height: 82vh;
    }
}

/* Tablet (768px - 1023px) */
@media screen and (max-width: 1023px) {
    .game-container {
        width: 95vw;
        height: 85vh;
    }
}

/* Mobile (below 768px) */
@media screen and (max-width: 767px) {
    .game-container {
        width: 95vw;
        height: 90vh;
        padding: 10px;
    }
    
    .close-game-btn {
        font-size: 30px;
        top: 5px;
        right: 10px;
    }
}

/* =================================================================
   TOUCH DEVICE OPTIMIZATION
   ================================================================= */

@media (hover: none) and (pointer: coarse) {
    .close-game-btn:hover {
        transform: none;
    }
    
    .close-game-btn {
        padding: 10px;
    }
}

/* =================================================================
   PERFORMANCE
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
    .close-game-btn {
        transition: none;
    }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.page-content {
    margin: 0 auto;
    color: #2a2a2a;
}

/* Individual page styles */
.game-page:nth-child(1) {
    background: var(--popup-page);
    width: 220%;
}

.game-page:nth-child(2) {
    background: var(--popup-page);
    width: 210%;
}

.game-page:nth-child(3) {
    background: var(--popup-page);
    width: 280%;
}

/* .game-page:nth-child(4) {
    background: var(--popup-page);
    width: 515%;
} */