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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    color: white;
    position: relative;
}

.container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Меню */
.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px 50px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.menu-title {
    font-size: clamp(2em, 5vw, 3em);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-over-title {
    color: #ff6b6b;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: clamp(1em, 3vw, 1.2em);
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    min-width: 200px;
}

.menu-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.menu-button.primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    font-size: clamp(1.2em, 3.5vw, 1.5em);
    padding: 18px 50px;
}

.menu-button.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    font-size: 0.9em;
    margin-top: 20px;
}

.high-score {
    margin-top: 20px;
    padding: 15px 30px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.high-score p {
    font-size: clamp(1em, 3vw, 1.3em);
    font-weight: bold;
    color: #FFD700;
    margin: 0;
}

/* Инструкции */
.instructions {
    text-align: left;
    max-width: 500px;
}

.instructions p {
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    margin: 10px 0;
    line-height: 1.6;
}

.instructions strong {
    color: #FFD700;
}

/* Настройки */
.settings {
    width: 100%;
    max-width: 400px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
}

.setting-item span {
    font-size: clamp(1em, 3vw, 1.2em);
    font-weight: bold;
}

.toggle-btn {
    padding: 8px 20px;
    background: #4ade80;
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.off {
    background: #ef4444;
}

.toggle-btn:hover {
    transform: scale(1.05);
}

/* Game Over экран */
.final-score-text {
    font-size: clamp(1.3em, 4vw, 2em);
    margin: 20px 0;
    font-weight: bold;
}

.final-score-text span {
    color: #FFD700;
    font-size: 1.2em;
}

.new-record {
    font-size: clamp(1.2em, 3.5vw, 1.8em);
    color: #FFD700;
    animation: recordBlink 1s ease-in-out infinite;
    margin: 20px 0;
}

@keyframes recordBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.score, .lives {
    font-size: clamp(0.9em, 2vw, 1.1em);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.sound-btn {
    padding: 10px 20px;
    font-size: clamp(1.2em, 3vw, 1.5em);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px;
}

.sound-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-btn.muted {
    opacity: 0.5;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .menu {
        min-width: 90vw;
        padding: 30px 20px;
    }
    
    .menu-button {
        min-width: 150px;
        padding: 12px 30px;
    }
}

#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hidden {
    display: none;
}

