* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
}

.game-container {
    margin-bottom: 20px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
}

.controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

#upBtn {
    grid-column: 2;
    grid-row: 1;
}

#leftBtn {
    grid-column: 1;
    grid-row: 2;
}

#downBtn {
    grid-column: 2;
    grid-row: 3;
}

#rightBtn {
    grid-column: 3;
    grid-row: 2;
}

.controls button {
    padding: 15px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls button:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.9);
}

.instructions {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* للتأكد من أن اللعبة تعمل على الشاشات الصغيرة */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls {
        max-width: 150px;
    }
    
    .controls button {
        padding: 12px;
        font-size: 1.2rem;
    }
}