/* ===================================== */
/* RESET */
/* ===================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #111;
    font-family: Arial, sans-serif;
    direction: rtl;
    color: white;
}

/* ===================================== */
/* TOP BAR */
/* ===================================== */

#topBar {
    height: 60px;
    background: #1a1a1a;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 20px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
}

/* ===================================== */
/* LAYOUT */
/* ===================================== */

#layout {
    display: flex;
    height: calc(100vh - 60px);
}

/* ===================================== */
/* SIDEBAR (GRID مربعات) */
/* ===================================== */

#sidebar {
    width: 240px;
    background: #07ecec;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;

    padding: 10px;
    overflow-y: auto;
}

.gameItem {
    width: 100%;
    aspect-ratio: 1 / 1;

    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;

    background: #222;
}

.gameItem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================================== */
/* MAIN */
/* ===================================== */

#main {
    flex: 1;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
    background-color: #00f4e0;

    gap: 10px;

    padding-right: 5px; /* 🔥 المطلوب */
}

/* ===================================== */
/* GAME WRAPPER */
/* ===================================== */

#gameWrapper {
    position: relative;

    width: 70%;
    max-width: 1200px;

    aspect-ratio: 16 / 9;

    background: black;

    border-radius: 10px;
    overflow: hidden;

    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===================================== */
/* CONTROLS */
/* ===================================== */

#controls {
    width: 70%;
    max-width: 1200px;

    display: flex;
    justify-content: center;
    gap: 15px;
}

.barBtn {
    width: 50px;
    height: 50px;

    border-radius: 50%;
    background: #333;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

/* ===================================== */
/* TITLE */
/* ===================================== */

#gameTitle {
    width: 70%;
    max-width: 1200px;
}

/* ===================================== */
/* AD BAR */
/* ===================================== */

#adBar {
    width: 70%;
    max-width: 1200px;

    height: 100px;

    background: #1a1a1a;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
}

/* ===================================== */
/* FULLSCREEN */
/* ===================================== */

#gameWrapper.fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 9999;
}

/* ===================================== */
/* RESPONSIVE */
/* ===================================== */

@media (max-width: 900px) {

    #sidebar {
        display: none;
    }

    #gameWrapper,
    #controls,
    #gameTitle,
    #adBar {
        width: 95%;
    }

}