/* play-page.css - Styles specific to game play pages */

/* Added :root variables for easier theming and consistency */
:root {
    /* Define these based on your actual global styles */
    --primary-bg-color: #121212;  /* Example: Dark theme main background */
    --secondary-bg-color: #1e1e1e; /* Example: Dark theme secondary background */
    --secondary-bg-color-rgb: 30, 30, 30; /* RGB equivalent of --secondary-bg-color */
    --tertiary-bg-color: #2a2a2a;  /* Example: Dark theme tertiary background */
    --primary-text-color: #e0e0e0; /* Example: Light text for dark themes */
    --secondary-text-color: #b0b0b0;/* Example: Dimmer text */
    --accent-color: #17a2b8;       /* Example: An accent color (e.g., Bootstrap 'info' cyan) */
    --link-color: #007bff;         /* Example: Standard link blue, from original play button */

    /* Game Page Specific Variables */
    --options-bar-height: 56px;    /* Height of the options bar below the iframe */

    /* Button Styling Variables */
    --button-text-color: white;
    --button-border-radius: 8px;
    --button-icon-gap: 8px;

    --play-button-bg-color: var(--link-color); /* Play button specific BG */
    --play-button-hover-bg-color: #0056b3; /* Darker shade of link-color for hover */
    --play-button-padding: 12px 24px;

    --option-button-bg-color: var(--tertiary-bg-color);
    --option-button-hover-bg-color: var(--accent-color);
    --option-button-hover-text-color: var(--primary-bg-color); /* Text color on hover, e.g. dark text on light accent */
    --option-button-padding: 8px 15px;
    --option-button-border-color: rgba(255,255,255,0.15);
    --option-button-hover-border-color: var(--accent-color);
}


/* Main wrapper for play page content (game + ads) */
.play-page-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Ad container styling */
.ad-container {
    flex: 0 0 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white; /* Keep as is if external ads require white BG */
}
.ad-container .adsbygoogle {
    width: 100%;
    min-height: 250px;
}


/* Game and Description Area (central column) */
.game-and-description-area {
    flex-grow: 1;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Game Area Styling */
.game-area {
    width: 100%;
}

/* 1. MODIFIED FOR IFRAME RATIO AND TOOLBAR POSITION */
#game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* This ratio now includes space for the options bar */
    background-color: var(--secondary-bg-color);
    border-radius: 10px;
    overflow: hidden; /* Crucial for keeping children within rounded bounds */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex; /* For centering play button and initial image */
    justify-content: center;
    align-items: center;
}

/* 3. MODIFIED FOR ROUNDED IMAGE */
#game-image {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 15px; /* Significantly more rounded */
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* 1. MODIFIED FOR IFRAME RATIO AND TOOLBAR POSITION */
#game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--options-bar-height)); /* Iframe stops above options bar */
    border: none;
    background-color: #000;
    /* Top corners will be clipped by #game-container's overflow:hidden and border-radius */
}
#game-iframe[src]:not([src=""]) {
    z-index: 2; /* Bring iframe to front when game is playing */
}


/* 2. MODIFIED FOR BUTTON STYLING (Play Button) */
#play-btn {
    position: absolute; /* Centered by #game-container flex properties */
    z-index: 2;
    background-color: var(--play-button-bg-color);
    color: var(--button-text-color);
    border: none;
    padding: var(--play-button-padding);
    font-size: 1.2em;
    font-weight: 600;
    border-radius: var(--button-border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#play-btn:hover {
    background-color: var(--play-button-hover-bg-color);
    transform: scale(1.05);
}

/* 1. MODIFIED FOR TOOLBAR POSITION & 2. BUTTON STYLING */
#options-bar {
    position: absolute;
    bottom: 0; /* Sits at the very bottom of #game-container */
    left: 0;
    width: 100%;
    height: var(--options-bar-height); /* Defined height */
    background-color: rgba(var(--secondary-bg-color-rgb), 0.9);
    backdrop-filter: blur(5px); /* Optional: frosted glass effect */
    color: var(--primary-text-color);
    padding: 0 15px; /* Horizontal padding for button alignment */
    display: flex;
    justify-content: flex-end;
    align-items: center; /* Vertically center buttons */
    gap: 10px;
    z-index: 3; /* Above game iframe */
    box-sizing: border-box;
    /* border-top: 1px solid var(--tertiary-bg-color); /* Optional: if visual separation is needed */
    /* Bottom corners will be clipped by #game-container's overflow:hidden and border-radius */
}

/* 2. MODIFIED FOR BUTTON STYLING (Options Bar Buttons) */
#options-bar #fullscreen-btn,
#options-bar #new-page-btn {
    background-color: var(--option-button-bg-color);
    color: var(--primary-text-color);
    border: 1px solid var(--option-button-border-color);
    padding: var(--option-button-padding);
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 6px; /* Slightly less rounded than play button */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex; /* To align text and pseudo-element icon */
    align-items: center;
}

#options-bar #fullscreen-btn:hover,
#options-bar #new-page-btn:hover {
    background-color: var(--option-button-hover-bg-color);
    color: var(--option-button-hover-text-color);
    border-color: var(--option-button-hover-border-color);
    transform: translateY(-2px); /* Subtle lift effect */
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Adding icons using Font Awesome pseudo-elements */
#options-bar #fullscreen-btn::before,
#options-bar #new-page-btn::before {
    font-family: "Font Awesome 6 Free", "FontAwesome"; /* From your HTML's Font Awesome link */
    font-weight: 900; /* For solid icons */
    font-size: 1em; /* Relative to button font size, adjust if needed */
    margin-right: var(--button-icon-gap);
}

#options-bar #fullscreen-btn::before {
    content: "\f065"; /* fa-expand */
}

#options-bar #new-page-btn::before {
    content: "\f35d"; /* fa-external-link-alt */
}


/* Description Area Styling - Kept as is from original, seems reasonable */
.description {
    background-color: var(--secondary-bg-color);
    padding: 25px;
    border-radius: 10px;
    color: var(--secondary-text-color);
    line-height: 1.7;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.description h1 {
    color: var(--primary-text-color);
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tertiary-bg-color);
    font-weight: 600;
}
.description p {
    margin-bottom: 15px;
    font-size: 0.95em;
}
.description p b {
    color: var(--primary-text-color);
    font-weight: 600;
}
.description a {
    color: var(--accent-color); /* Or var(--link-color) for consistency */
    text-decoration: underline;
}
.description a:hover {
    color: var(--primary-text-color); /* Or a lighter shade of accent/link */
}


/* Responsive adjustments for play page */
@media screen and (max-width: 1200px) {
    .ad-container {
        flex-basis: 160px;
    }
    .game-and-description-area {
        max-width: 700px;
    }
}

@media screen and (max-width: 992px) { /* Tablet */
    .play-page-content-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .ad-container {
        flex-basis: auto;
        width: 100%;
        max-width: 728px;
        min-height: 90px;
        margin-bottom: 20px;
        order: 1; /* Example order, adjust as needed */
    }
    .ad-side-left { order: 1; }
    .game-and-description-area {
        order: 2;
        width: 100%;
        max-width: 100%;
    }
    .ad-side-right { order: 3; }

    #game-container {
        aspect-ratio: 16 / 10; /* Or keep 16/9, adjust based on preference for tablets */
    }
}

@media screen and (max-width: 767px) { /* Mobile */
    .play-page-content-wrapper {
        padding: 15px;
        padding-right: calc(var(--sidebar-width, 0px) + 15px); /* Keep original sidebar calc, add fallback for --sidebar-width */
    }
    .ad-side-left, .ad-side-right {
        display: none; /* Common to hide side ads on mobile */
    }

    /* Override variables for mobile if needed */
    :root {
        --options-bar-height: 50px; /* Slightly smaller bar on mobile */
        --option-button-padding: 6px 10px;
        --button-icon-gap: 6px;
    }

    #options-bar {
        padding: 0 10px; /* Less padding inside bar */
        gap: 8px; /* Less gap between buttons */
    }
    #options-bar #fullscreen-btn,
    #options-bar #new-page-btn {
        font-size: 0.8em; /* Smaller text on mobile buttons */
    }

    .description h1 {
        font-size: 1.5em;
    }
    .description p {
        font-size: 0.9em;
    }
}

@media screen and (max-width: 480px) { /* Small Mobile */
     .play-page-content-wrapper {
        padding-right: calc(var(--sidebar-width, 0px) + 10px);
        padding-left: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    #play-btn {
        padding: 10px 20px; /* Smaller play button */
        font-size: 1em;
    }

    /* Optional: Icon-only buttons on very small screens (e.g., < 400px) */
    /* This trick hides text by setting font-size to 0 on button, then resets for icon */
    /* @media screen and (max-width: 400px) {
        #options-bar #fullscreen-btn,
        #options-bar #new-page-btn {
            font-size: 0;
            padding: var(--option-button-padding);
        }
        #options-bar #fullscreen-btn::before,
        #options-bar #new-page-btn::before {
            font-size: 1.2rem; 
            margin-right: 0;
        }
    } */
}