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

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

body {
    font-family: 'Orbitron', sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    transition: opacity 0.3s ease;
}

.menu-container {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Космический фон */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(2px 2px at 20% 30%, white, transparent),
                radial-gradient(2px 2px at 60% 70%, white, transparent),
                linear-gradient(to bottom, #000428, #004e92);
    background-size: 200% 200%;
    animation: starsMove 120s linear infinite;
    z-index: -2;
}

.nebula-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(255, 119, 198, 0.2), transparent 50%);
    animation: nebulaFloat 60s ease-in-out infinite;
    z-index: -1;
}

@keyframes starsMove {
    from { background-position: 0 0; }
    to { background-position: -200% -200%; }
}

@keyframes nebulaFloat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Заголовок */
.menu-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,78,146,0.3));
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.menu-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 8px;
}

.glow-text {
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff;
    animation: glowPulse 2s ease-in-out infinite;
}

.pulse-text {
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff;
    animation: pulsePulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

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

.menu-subtitle {
    color: #00ffff;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Игры */
.menu-main {
    flex: 1;
    padding: 40px 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(0,78,146,0.5));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.6);
}

.game-card.highlight-card {
    border: 3px solid #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    background: linear-gradient(135deg, rgba(20,0,20,0.9), rgba(0,78,146,0.5));
}

.game-card.featured-game {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 250px;
    background: linear-gradient(135deg, rgba(30,0,30,0.95), rgba(0,100,200,0.6));
    border: 4px solid #ff00ff;
    animation: featuredPulse 3s infinite ease-in-out;
}

@keyframes featuredPulse {
    0% { box-shadow: 0 0 20px rgba(255, 0, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 255, 0.7); }
    100% { box-shadow: 0 0 20px rgba(255, 0, 255, 0.4); }
}

.game-card.featured-game .game-card-bg {
    width: 300px;
    height: 100%;
    min-height: 250px;
}

.game-card.featured-game .game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-card.featured-game .game-title {
    font-size: 2.5rem;
}

.game-card.featured-game .game-description {
    font-size: 1.2rem;
}

.game-card.highlight-card .game-title {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.game-card.highlight-card .play-btn {
    background: #ff00ff;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.game-card.highlight-card .play-btn:hover {
    background: #fff;
    color: #ff00ff;
}

.game-card-bg {
    height: 150px;
    background: linear-gradient(135deg, rgba(0,255,255,0.1), rgba(255,0,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-icon {
    font-size: 4rem;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8));
}

.game-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: particlesFloat 20s linear infinite;
}

@keyframes particlesFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

.game-info {
    padding: 20px;
}

.game-title {
    color: #00ffff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.game-description {
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1.4;
}

.game-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #00ffff;
}

.play-btn {
    width: 100%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border: none;
    color: #000;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.5);
}

/* Футер */
.menu-footer {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,78,146,0.3));
    border-top: 2px solid rgba(0, 255, 255, 0.3);
    padding: 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-info {
    color: #ccc;
    font-size: 0.9rem;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(0,78,146,0.5));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    margin: 10% auto;
    padding: 30px;
    width: 80%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    color: #00ffff;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #ff00ff;
}

.setting-item {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #00ffff;
    font-weight: 500;
}

.setting-item select,
.setting-item input[type="checkbox"] {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    color: #00ffff;
    margin-bottom: 10px;
    font-size: 1rem;
}

.stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Адаптивность */
@media (max-width: 768px) {
    .menu-title {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card-bg {
        height: 120px;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
