:root {
    --main-bg: #000;
    --main-blue: #00aeef;
    --main-mauve: #ec008c;
    --white: #fff;
    --glass-bg: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
    --light: #f8f9fa;
}
body, html {
    overflow-x: hidden;
    width: 100%;
}

.snake-page{
  background-color: var(--main-bg);
    background-image: url("/imgs/body-bg.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 20px;
}

.puzzle-container {
    text-align: center;
    padding: 30px;
    backdrop-filter: blur(15px);
    background-color: var(--glass-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
        grid-column: 2;
    justify-self: center;
    margin: 0 !important;
    width: 100%;
    max-width: 550px;
        z-index: 1;
    position: relative;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--main-blue), var(--main-mauve));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scores {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 10px;
    margin: 15px 0;
}

.score-box {
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.score-box label {
    font-size: 11px;
    color: #aaa;
}

.score-box strong {
    font-size: 18px;
    color: var(--white);
}

canvas {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    border: 2px solid var(--glass-border);
    margin: 15px 0;
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.2);
    display: block;
    margin-left: auto;
    margin-right: auto;
    height: auto;
    max-width: 100%;
}

.mode-select {
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 12px 25px;
    min-width: 120px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

button:hover {
    background: var(--main-blue);
    box-shadow: 0 0 15px var(--main-blue);
    transform: translateY(-2px);
}

button.active {
    background: var(--main-mauve);
    border-color: var(--main-mauve);
    box-shadow: 0 0 20px rgba(236, 0, 140, 0.4);
}

.mobile-controls {
    margin-top: 10px;
}

.mobile-controls button {
    margin: 5px;
    width: 50px;
    height: 40px;
}

.status p {
    color: var(--light);
}
#pauseBtn {
    border-color: var(--main-blue);
}

#pauseBtn:hover {
    background: var(--main-blue);
    box-shadow: 0 0 15px var(--main-blue);
}
.game-page-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    align-items: start;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 90px 40px 40px 40px;
}
@media (max-width: 1100px) {
    .game-page-wrapper {
        grid-template-columns: 1fr; /* عمود واحد للعبة والسايدبار */
        padding-top: 100px;
    }

    .puzzle-container {
        grid-column: 1;
        order: 1; /* اللعبة أولاً */
    }

    .games-sidebar {
        grid-column: 1;
        order: 2; /* السايدبار تحت اللعبة */
        position: static;
        width: 100%;
        max-width: 550px;
        margin: 20px auto;
    }
}

/* الموبايل */
@media (max-width: 600px) {
    .puzzle-container {
        padding: 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .score-box strong {
        font-size: 16px;
    }

    /* إظهار أزرار التحكم في الموبايل فقط */
    .mobile-controls {
        display: block;
    }

    .mode-select button {
        padding: 10px;
        min-width: 80px;
        font-size: 12px;
    }
}
.games-sidebar {
    /* حذف أي grid-column: 3 قديمة */
    width: 100%;
    max-width: 320px;
    background: transparent;
    margin: 0 auto;
}

/* عند العرض على الجوال أو التابلت */
@media (max-width: 1100px) {
    .games-sidebar {
        position: static;
        display: block;
        max-width: 100%;
        text-align: center;
    }

    .sidebar-games {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
}
