* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    text-align: center;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #0a1e3a 0%, #000000 100%);
}

#gameContainer {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#gameHeader {
    width: 100%;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    background: rgba(0, 20, 40, 0.7);
    border-bottom: 2px solid #00a8ff;
}

#gameTitle {
    font-size: 1.5rem;
    color: #00a8ff;
    text-shadow: 0 0 10px #00a8ff;
    font-weight: bold;
}

#score {
    font-size: 1.2rem;
    background: rgba(0, 40, 80, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #00a8ff;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

#pauseBtn {
    padding: 8px 20px;
    font-size: 1rem;
    cursor: pointer;
    background: linear-gradient(to bottom, #00a8ff, #0077b6);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

canvas {
    background-color: #000033;
    display: block;
    border: 3px solid #00a8ff;
    image-rendering: pixelated;
    max-width: 100%;
    max-height: 70vh;
    aspect-ratio: 2/3;
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.4);
}

#restartBtn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    background: linear-gradient(to bottom, #00a8ff, #0077b6);
    color: white;
    border: none;
    border-radius: 30px;
    display: none;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.5);
    transition: all 0.3s;
}

#restartBtn:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
}

#mobileControls {
    display: none;
    margin-top: 20px;
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 100;
}

.controls-row {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 15px;
}

.control-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    border: none;
    border-radius: 50%;
    background: radial-gradient(circle, #003366, #001a33);
    color: #00a8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 0 15px rgba(0, 168, 255, 0.5),
        inset 0 0 10px rgba(0, 168, 255, 0.3);
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.control-btn:active {
    transform: scale(0.9);
    box-shadow: 
        0 0 5px rgba(0, 168, 255, 0.3),
        inset 0 0 15px rgba(0, 168, 255, 0.5);
    background: radial-gradient(circle, #004080, #00264d);
}

#shootBtn {
    background: radial-gradient(circle, #ff3333, #cc0000);
    box-shadow: 
        0 0 15px rgba(255, 51, 51, 0.5),
        inset 0 0 10px rgba(255, 100, 100, 0.3);
    color: white;
}

#shootBtn:active {
    box-shadow: 
        0 0 5px rgba(255, 51, 51, 0.3),
        inset 0 0 15px rgba(255, 100, 100, 0.5);
    background: radial-gradient(circle, #ff4d4d, #b30000);
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    canvas {
        max-height: 60vh;
    }
    
    #mobileControls {
        display: flex;
        flex-direction: row;
        position: fixed;
        bottom: 30px;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 0 20px;
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    #gameTitle {
        font-size: 1.2rem;
    }
    
    #score {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    #pauseBtn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    #mobileControls {
        bottom: 20px;
        gap: 10px;
    }
    
    .controls-row {
        gap: 10px;
    }
    
    #gameTitle {
        display: none;
    }
}

@media (max-height: 600px) {
    canvas {
        max-height: 55vh;
    }
    
    #mobileControls {
        bottom: 15px;
    }
}

/* الرسائل */
#gameMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 20, 40, 0.9);
    padding: 30px 40px;
    border-radius: 15px;
    border: 2px solid #00a8ff;
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.7);
    text-align: center;
    z-index: 200;
    width: 90%;
    max-width: 500px;
}

#messageTitle {
    font-size: 2rem;
    color: #00a8ff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00a8ff;
}

#messageText {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #fff;
    line-height: 1.5;
}

.start-btn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.2rem;
    background: linear-gradient(to bottom, #00a8ff, #0077b6);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.5);
    transition: all 0.3s;
}

.start-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
}

/* تأثيرات النجوم */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* شعار دبي */
.dubai-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%2300a8ff"/><text x="50" y="60" font-family="Arial" font-size="50" text-anchor="middle" fill="white">D</text></svg>');
    background-size: contain;
    z-index: 10;
}

/* عنصر تحكم الصوت */
#soundControl {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0, 40, 80, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #00a8ff;
    cursor: pointer;
    z-index: 10;
}

#soundIcon {
    font-size: 1.5rem;
    color: #00a8ff;
}
#gameContainer {
    width: 100vw; /* بدلاً من 100% */
    height: 100vh;
    max-width: none; /* إزالة الحد الأقصى للعرض */
    max-height: none; /* إزالة الحد الأقصى للارتفاع */
    padding: 0; /* إزالة الحشو */
}

canvas {
    width: 100%;
    height: 80vh;
    max-width: none;
    max-height: none;
    border: none; /* يمكن إزالة الحدود أو تعديلها */
}
@media (max-width: 768px) {
    .control-btn {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
    
    #shootBtn {
        width: 100px;
        height: 100px;
    }
}