/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e, #16213e);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Фоновые частицы */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particles::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00ff88, transparent),
        radial-gradient(2px 2px at 40px 70px, #00d4ff, transparent),
        radial-gradient(1px 1px at 90px 40px, #ff6b6b, transparent),
        radial-gradient(1px 1px at 130px 80px, #ffd93d, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: particlesMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes particlesMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, -200px); }
}

/* Заголовок */
.main-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    position: relative;
    z-index: 2;
}

.logo-section {
    animation: fadeInDown 1s ease-out;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.main-title {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #00ff88, #00d4ff, #ff6b6b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

.main-subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Игровые карточки */
.games-section {
    flex: 1;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

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

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: slideInUp 1s ease-out;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: #00ff88;
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.2);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

/* Иконки игр */
.game-icon {
    width: 120px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.belaz-icon {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.ferrari-icon {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.belaz-body, .ferrari-body {
    width: 80%;
    height: 50%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    position: absolute;
    top: 25%;
    left: 10%;
}

.belaz-wheels, .ferrari-wheels {
    position: absolute;
    bottom: 5px;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.wheel {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    border: 2px solid #666;
    animation: wheelSpin 2s linear infinite;
}

/* Информация об игре */
.game-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #00ff88;
}

.game-description {
    color: #a0a0a0;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

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

.game-stats {
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.difficulty-bar {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.difficulty-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ff6b6b);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Кнопка игры */
.play-button {
    position: relative;
    background: linear-gradient(45deg, #00ff88, #00d4ff);
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.3);
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.play-button:hover .button-glow {
    left: 100%;
}

/* Футер */
.main-footer {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.controls-info h4 {
    color: #00ff88;
    margin-bottom: 1rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

.action {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.settings-section {
    display: flex;
    gap: 1rem;
}

.settings-btn, .about-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.settings-btn:hover, .about-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: #00ff88;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-body {
    margin-bottom: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #a0a0a0;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.setting-group select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.modal-footer {
    text-align: right;
}

.save-btn {
    background: linear-gradient(45deg, #00ff88, #00d4ff);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

/* Анимации */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes wheelSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .controls-info {
        order: 2;
    }
    
    .settings-section {
        order: 1;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 2rem 1rem 1rem;
    }
    
    .games-section {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .game-icon {
        width: 100px;
        height: 60px;
    }
}

/* Стили для новых игр */
.chess-icon {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chess-symbol {
    font-size: 3rem;
    animation: chessRotate 4s linear infinite;
}

.mk-icon {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mk-symbol {
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Анимации для новых игр */
@keyframes mkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes chessRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
