@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

/* شاشة القائمة الرئيسية */
.menu-container, .win-container, .lose-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    border: 4px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.game-title {
    font-size: 2.5rem;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.game-subtitle {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 40px;
}

.menu-buttons, .win-buttons, .lose-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    padding: 15px 30px;
    background: linear-gradient(45deg, #0066ff, #0099ff);
    color: white;
    border: 3px solid #00ffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.menu-btn:hover {
    background: linear-gradient(45deg, #0099ff, #00ccff);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* شاشة اللعبة */
#gameScreen {
    flex-direction: column;
    padding: 20px;
}

.game-info {
    display: flex;
    flex-direction: column; /* تغيير الاتجاه إلى عمودي */
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #00ffff;
    text-align: center; /* توسيط النص */
    line-height: 1.2; /* تحسين تباعد الأسطر */
}

#gameCanvas {
    border: 4px solid #00ffff;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    max-width: 100vw;
    max-height: 60vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* أزرار التحكم للموبايل */
.mobile-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #333, #555);
    color: white;
    border: 2px solid #00ffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.control-btn:active {
    background: linear-gradient(45deg, #555, #777);
    transform: scale(0.95);
}

/* شاشات الفوز والخسارة */
.win-title {
    font-size: 2rem;
    color: #00ff00;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.lose-title {
    font-size: 2rem;
    color: #ff0000;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.win-subtitle, .lose-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-subtitle {
        font-size: 0.8rem;
    }
    
    .menu-btn {
        font-size: 0.8rem;
        padding: 12px 24px;
    }
    
    #gameCanvas {
        width: 90vw;
        height: auto;
    }
    
    .game-info {
        font-size: 0.6rem;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .menu-container, .win-container, .lose-container {
        padding: 20px;
        margin: 20px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        font-size: 0.7rem;
        padding: 10px 20px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}



/* تأثيرات الحركة */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.control-btn:active {
    background: linear-gradient(45deg, #555, #777);
    transform: scale(0.95);
    animation: pulse 0.2s ease;
}

/* تحسينات إضافية للعبة */
#gameCanvas {
    transition: all 0.3s ease;
}

.game-info {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

