body {
    margin: 0;
    padding: 0;
    background-color: #2c3e50;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    background-color: #87CEEB; /* لون السماء */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
}

#ui {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    color: #FFD700;
    font-size: 32px;
    font-weight: bold;
}

.ui-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#hearts-container {
    display: flex;
    gap: 5px;
    font-size: 36px;
}

.heart {
    transition: opacity 0.3s;
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(100%);
}

#controls-text {
    display: none; /* إخفاء النص القديم في وجود أزرار اللمس */
}

/* أزرار اللمس */
.touch-overlay {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    pointer-events: none; /* الحاوية لا تعيق اللمس */
    z-index: 100;
}

.dpad, .actions {
    display: flex;
    gap: 15px;
    pointer-events: auto; /* الأزرار نفسها تستقبل اللمس */
}

.touch-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* منع زوم الشاشة عند الضغط */
}

.touch-btn:active, .touch-btn.active {
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0.95);
}
