body {
    margin: 0;
    background: #0d1117;
    color: white;
    font-family: Poppins, sans-serif;
}

header {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.snake-game-container {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #111 100%);
    border: 2px solid #00e7ff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 231, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 50;
} 

.snake-game-container p {
    margin: 0 0 10px 0;
    color: #00e7ff;
    text-align: center;
}

.snake-game-container canvas {
    display: block;
    margin: 0 auto;
    background: radial-gradient(circle at 20% 20%, #05111a, #000);
    border: 1px solid #00e7ff;
    border-radius: 6px;
}

/* HUD for snake game */
.snake-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}
.snake-hud .hud-left, .snake-hud .hud-right { display:flex; gap:10px; align-items:center; }
.snake-hud .hud-item { color: #bffcf5; background: rgba(255,255,255,0.02); padding:6px 10px; border-radius:8px; font-weight:600; }

/* Obstacles and powerups */
.obstacle { background: linear-gradient(180deg,#333 0%,#111 100%); border:1px solid rgba(255,255,255,0.04); }
.powerup { width:18px; height:18px; display:inline-block; border-radius:4px; box-shadow:0 6px 18px rgba(0,0,0,0.6); }
.powerup.gold { background: radial-gradient(circle,#ffd54f,#ff8f00); }
.powerup.slow { background: linear-gradient(180deg,#8ec5ff,#3a8ee6); }
.powerup.shield { background: linear-gradient(180deg,#b2ff59,#7cb342); }

/* Particles drawn on canvas (no CSS needed), but allow gentle overlay */
.snake-game-container .hud-glow { pointer-events:none; position:absolute; inset:0; z-index:40; mix-blend-mode: screen; opacity:0.08; }

/* strong visual for lives */
#lives { color: #ff6b6b; font-weight:800 }
#level { color: #ffd54f; font-weight:700 }
#highScore { color: #9ad7ff }

/* Mute button small tweaks */
#muteBtn { padding:6px 8px; }

@media (max-width:768px) {
  .snake-hud { flex-direction: column; align-items:flex-start }
}


.snake-game-container .btn, .snake-game-container .control-btn {
    background: #00e7ff;
    padding: 10px 14px;
    border-radius: 5px;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    border: none;
    cursor: pointer;
}

.snake-game-container .controls {
    margin-top: 10px;
}

.snake-game-container .button-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.snake-game-container .score {
    margin-top: 8px;
    color: #00e7ff;
    text-align: center;
} 

.snake-game-container:hover {
    box-shadow: 0 0 30px rgba(0, 231, 255, 0.5);
    transform: translateY(calc(-50% - 5px));
}

/* Game Over overlay */
.game-over-screen {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 60;
}
.game-over-screen.visible {
    display: flex;
}
.game-over-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #111 100%);
    border: 2px solid #ff5252;
    padding: 18px;
    border-radius: 10px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    color: #fff;
}
.game-over-modal h2 {
    margin: 0 0 8px;
    color: #ff5252;
}
.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
} 

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #00e7ff;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #fff;
}

.hero {
    height: 95vh;
    display: flex;
    align-items: center;
    padding: 60px;
    position: relative;
  
}

.hero-image {
    position: absolute;
    top: 27%;
    left: 50px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.9;
    transform: translateY(-50%);
}

.hero-text h2 {
    font-size: 50px;
    margin: 0;
}

.hero-text span {
    color: #00e7ff;
}

.btn {
    display: inline-block;
    margin-top: 20px;
    background: #00e7ff;
    padding: 12px 25px;
    border-radius: 6px;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #00c4d1;
    transform: translateY(-2px);
}

footer {
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    background: #111;
}

#bgCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}
.qoidalar {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    position: relative;
    padding: 14px 22px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%);
    box-shadow: 0 8px 30px rgba(0, 231, 255, 0.05), inset 0 1px 0 rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
    overflow: hidden;
    color: #bfefff;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.qoidalar::before {
    content: "";
    position: absolute;
    left: -40%;
    top: -30%;
    width: 180%;
    height: 160%;
    background: radial-gradient(circle at 20% 20%, rgba(0,231,255,0.08), transparent 15%),
                radial-gradient(circle at 80% 80%, rgba(138,43,226,0.06), transparent 18%);
    transform: rotate(-12deg);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.qoidalar:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 50px rgba(0, 231, 255, 0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}

.qoidalar span {
    display: inline-block;
    background: linear-gradient(90deg, #00e7ff, #8a2be2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    box-shadow: 0 6px 22px rgba(0,231,255,0.06);
    transition: transform 0.3s ease;
}

.qoidalar .sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff, rgba(255,255,255,0));
    border-radius: 50%;
    opacity: 0.9;
    animation: sparkle 2.2s infinite ease-in-out;
    pointer-events: none;
}

.qoidalar .sparkle:nth-child(1){ left: 15%; top: 10%; animation-delay: 0s; }
.qoidalar .sparkle:nth-child(2){ left: 85%; top: 30%; animation-delay: 0.6s; }
.qoidalar .sparkle:nth-child(3){ left: 60%; top: 70%; animation-delay: 1.2s; }

@keyframes sparkle {
    0%   { transform: scale(0.6) translateY(0); opacity: 0.6; }
    50%  { transform: scale(1.4) translateY(-6px); opacity: 1; }
    100% { transform: scale(0.6) translateY(0); opacity: 0.6; }
}
/* Prevent page scroll while playing the game */
.game-playing {
    overflow: hidden;
    touch-action: none;
}



@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    nav a {
        margin: 0 10px;
        font-size: 14px;
    }

    .snake-game-container {
        position: static;
        width: 100%;
        margin: 20px auto;
    }

    .hero {
        flex-direction: column;
        padding: 30px;
        height: auto;
        min-height: 100vh;
    }

    .hero-image {
        position: static;
        transform: none;
        margin-bottom: 30px;
        width: 200px;
        height: 200px;
    }

    .hero-text h2 {
        font-size: 32px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 15px;
    }

    .hero {
        padding: 15px;
    }

    .hero-image {
        width: 150px;
        height: 150px;
    }

    .hero-text h2 {
        font-size: 24px;
    }

    nav a {
        margin: 5px;
        font-size: 12px;
    }
}
