* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    background: #000;
    display: block;
}

.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.menu h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-buttons button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: #4ecdc4;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-buttons button:hover {
    background: #45b7aa;
    transform: translateY(-2px);
}

#touch-controls {
    position: absolute;
    display: none;
    z-index: 10;
}

#touch-controls.portrait {
    flex-direction: column;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 20px;
    justify-content: space-between;
    align-items: center;
}

#touch-controls.landscape {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    justify-content: space-between;
}

.control-group {
    display: flex;
    gap: 20px;
}

.d-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
}

.d-pad-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    user-select: none;
}

.touch-button {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    user-select: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 2.5rem;
    border-radius: 20px;
    border: 2px solid #4ecdc4;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.3);
    min-width: 350px;
    max-width: 90%;
    text-align: center;
}

.menu-content {
    min-width: 400px;
}

.dialog-content {
    min-width: 350px;
}

.modal-content h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: #ff6b6b;
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.score-display {
    margin: 1.5rem 0;
    font-size: 1.3rem;
    color: #fff;
}

.score-display span {
    font-weight: bold;
    color: #ff6b6b;
    font-size: 1.5rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    margin-top: 1.5rem;
}

.menu-buttons button,
.dialog-buttons button {
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    width: 100%;
}

.menu-buttons button:hover,
.dialog-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #45b7aa, #3aa99c);
}

.primary-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff5252) !important;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff3838) !important;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4) !important;
}

.settings-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: 500;
}

.settings-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #34495e;
    outline: none;
    -webkit-appearance: none;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4ecdc4;
    cursor: pointer;
    border: 2px solid #fff;
}

.settings-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #4ecdc4;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .modal-content h1 {
        font-size: 2.5rem;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
    
    .menu-buttons button,
    .dialog-buttons button {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
