* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #111;
    overflow: hidden;
}

/* Main game area */
#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 600px;
    margin: 0 auto;
    overflow: hidden;
    background-color: #000;
}


#wd{
    display: none;
}

/* Background */
#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #001f3d;
    background-image: url(assets1/star.png);
    background-size: cover;
}

/* Moon */
#moon {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 150px;
    height: 150px;
    background-color: #f0e68c;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(230, 225, 225, 0.8);
}

/* Spaceship */
#spaceship {
    position: absolute;
    width: 35px;
    height: 28px;
    border-radius: 50%;
    background-image: url('assets1/s.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Score and Level */
#score, #level {
    position: absolute;
    top: 20px;
    font-size: 20px;
    color: yellow;
}
#score { left: 20px; }
#level { right: 20px; }

/* Kill counter */
#kills {
    position: absolute;
    top: 50px;
    left: 20px;
    font-size: 20px;
    color: lightgreen;
}

/* Obstacles */
.obstacle {
    position: absolute;
    width: 11px;
    height: 11px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}
.obstacle::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 51px solid #fff;
}

/* Bullets */
.bullet {
    position: absolute;
    width: 4px;
    height: 12px;
    background-color: rgba(104, 189, 238, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px #c2e9f5;
}

/* Game over screen */
#game-over-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: block;
    justify-content: center;
    align-items: center;
    color: white;
    transition: all 0.5s ease;
    z-index: 1000;
    display: none; /* Hidden initially */
}
#game-over-screen:hover { transform: scale(1.05); }

#game-over-message {
    text-align: center;
    background-color: #f314a9;
    padding: 30px;
    border-radius: 10px;
}
#game-over-message h2 { font-size: 30px; margin-bottom: 10px; }
#game-over-message p  { font-size: 20px; }
#restart-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 10px;
}
#restart-button:hover { background-color: #45a049; }

/* Start button */
#start-button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 50px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,114,255,0.5);
    transition: all 0.3s ease;
    z-index: 1000;
}
#start-button:hover {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    box-shadow: 0 10px 25px rgba(0,114,255,0.7);
    transform: translate(-50%, -50%) scale(1.05);
}
#start-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Moving animation for obstacles */
@keyframes move {
    0% { top: -15px; }
    100% { top: 600px; }
}

/* Mobile Portrait Mode Warning */
@media (max-width: 420px) and (orientation: landscape) {
    body::before {
        content: "Please rotate your device to portrait mode";
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.9);
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        z-index: 9999;
    }
    #game-container {
        display: none !important;
    }
}

/* ——————————————
   Fully responsive on phones
   —————————————— */
@media (max-width: 480px) {
    /* make the game fill the viewport */
    #game-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none;
        margin: 0;
    }

    /* adjust elements if needed */
    #spaceship {
        width: 28px;
        height: 22px;
    }
    .obstacle {
        width: 8px;
        height: 8px;
    }
    .bullet {
        width: 3px;
        height: 9px;
    }
    #score, #level, #kills {
        font-size: 18px;
    }
    #moon {
        width: 120px;
        height: 120px;
        top: 30px;
        right: 30px;
    }
}

/* Default (tablet/desktop) */
@media (min-width: 481px) {
    #game-container {
        width: 800px;
        height: 600px;
        margin: 0 auto;
    }
}

/* Prevent zooming on mobile */
html {
    touch-action: pan-x pan-y;
    height: 100%;
}

/* Prevent blue highlight on tap */
* {
    -webkit-tap-highlight-color: transparent;
}
