body, html {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling */
}

#parent-container {
    position: fixed; /* Keep it fixed at the top */
    top: 0; /* Distance from the top */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Center correction */
    width: 90%; /* Responsive width */
    max-width: 320px; /* Max width for larger screens */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Base styles for the ad */
.adsbygoogle {
    width: 100%; /* Fill the parent container */
    height: auto; /* Maintain aspect ratio */
    max-height: 90px; /* Limit max height */
    box-sizing: border-box; /* Include padding/border in dimensions */
    display: inline-block; /* Ensure the ad displays correctly */
}

/* Media queries for smaller landscape games */
@media (max-width: 480px) and (orientation: landscape) {
    #parent-container {
        width: 80%; /* Smaller width for smaller screens */
        max-width: 280px; /* Adjust max width for better fit */
    }

    .adsbygoogle {
        max-height: 50px; /* Adjust max height for smaller screens */
    }
}

/* Media query for portrait mode */
@media (max-width: 480px) and (orientation: portrait) {
    #parent-container {
        display: none; /* Hide ad in portrait mode */
    }
}
