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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Arial', sans-serif;
    touch-action: none;
}

#gameCanvas {
    display: block;
    background: #000;
}

#score {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

#controlInfo {
    position: absolute;
    top: 60px;
    left: 20px;
    color: #fff;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.5s;
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    display: none;
    z-index: 20;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
}

#gameOver p {
    margin: 20px 0;
    font-size: 24px;
}

#restartButton,
#permissionButton {
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#restartButton {
    margin-top: 0;
}

#permissionButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    display: none;
    z-index: 30;
}

#restartButton:hover,
#permissionButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#permissionButton:hover {
    transform: translate(-50%, -50%) translateY(-2px);
}

#restartButton:active,
#permissionButton:active {
    transform: translateY(0);
}

#tiltIndicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
    opacity: 0.5;
    display: none;
}

/* ====== СТАРТОВЫЙ ЭКРАН ====== */
#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #000 100%);
}

.game-title {
    font-size: 72px;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 10px #667eea,
        0 0 20px #667eea,
        0 0 40px #764ba2;
    margin-bottom: 60px;
    letter-spacing: 8px;
}

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

.menu-buttons button {
    padding: 18px 60px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 250px;
}

.menu-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.menu-buttons button:active {
    transform: translateY(0);
}

#leaderboardButton {
    background: linear-gradient(135deg, #4a4a6a 0%, #2a2a4a 100%);
    box-shadow: 0 4px 15px rgba(74, 74, 106, 0.4);
}

#leaderboardButton:hover {
    box-shadow: 0 8px 25px rgba(74, 74, 106, 0.6);
}

.hint {
    margin-top: 40px;
    color: #888;
    font-size: 16px;
}

/* ====== GAME OVER ДОРАБОТКИ ====== */
#finalScore {
    font-size: 36px;
    color: #667eea;
    margin: 10px 0;
}

#gameOver .menu-buttons {
    flex-direction: row;
    gap: 15px;
    margin-top: 20px;
}

#menuButton {
    background: linear-gradient(135deg, #4a4a6a 0%, #2a2a4a 100%) !important;
}

/* Скрываем счёт до начала игры */
#score {
    display: none;
}

#score.visible {
    display: block;
}

/* ====== АДАПТИВ ДЛЯ МОБИЛЬНЫХ ====== */
@media (max-width: 600px) {
    .game-title {
        font-size: 36px;
        letter-spacing: 4px;
    }
    
    .menu-buttons button {
        padding: 15px 40px;
        font-size: 18px;
        min-width: 200px;
    }
    
    #gameOver .menu-buttons {
        flex-direction: row;
        gap: 15px;
        margin-top: 20px;
        align-items: center;
    }

}
