/* Стили для игр */
.game-content {
    margin-top: 20px;
    animation: fadeIn 0.5s;
}

.game-instruction {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
}

.game-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-hint {
    background: #e6fffa;
    border: 2px solid #4fd1c7;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 209, 199, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 209, 199, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 209, 199, 0); }
}

/* Стили для игры "Найди нарушителя" */
.violation-scene {
    width: 100%;
    height: 350px;
    background-color: #f7fafc;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    position: relative;
    margin: 20px 0;
    overflow: hidden;
}

.scene-character {
    position: absolute;
    font-size: 2rem;
    transition: all 0.3s;
    z-index: 10;
}

.violation-options-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.violation-option {
    padding: 15px 25px;
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    min-width: 180px;
}

.violation-option:hover {
    background-color: #ebf8ff;
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.violation-option.correct {
    background-color: #c6f6d5;
    border-color: #48bb78;
    color: #22543d;
    animation: bounce 0.5s;
}

.violation-option.incorrect {
    background-color: #fed7d7;
    border-color: #f56565;
    color: #742a2a;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Стили для игры "Собери велосипедиста" */
.bicycle-equipment {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.equipment-item {
    background-color: white;
    border: 3px solid #cbd5e0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.equipment-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.equipment-item.selected {
    background-color: #bee3f8;
    border-color: #4a90e2;
    transform: scale(1.05);
}

.equipment-item.correct {
    background-color: #c6f6d5;
    border-color: #48bb78;
    animation: celebrate 0.5s;
}

.equipment-item.incorrect {
    background-color: #fed7d7;
    border-color: #f56565;
    animation: shake 0.5s;
}

.equipment-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.equipment-name {
    font-weight: bold;
    margin: 5px 0;
    font-size: 1rem;
}

.required-badge {
    background: #f56565;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.optional-badge {
    background: #a0aec0;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 8px 0;
}

.equipment-hint {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 8px;
    line-height: 1.3;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Стили для игры "Расставь знаки" */
.intersection-map {
    width: 100%;
    height: 400px;
    background-color: #f7fafc;
    border: 3px solid #cbd5e0;
    border-radius: 15px;
    position: relative;
    margin: 30px 0;
    overflow: hidden;
}

.road-horizontal {
    position: absolute;
    width: 100%;
    height: 80px;
    background-color: #4a5568;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.road-vertical {
    position: absolute;
    width: 80px;
    height: 100%;
    background-color: #4a5568;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.placement-zone {
    position: absolute;
    border: 4px dashed #4a90e2;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.placement-zone:hover {
    background-color: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
}

.placement-zone.correct {
    border-color: #48bb78;
    background-color: rgba(72, 187, 120, 0.1);
}

.placement-zone.incorrect {
    border-color: #f56565;
    background-color: rgba(245, 101, 101, 0.1);
}

.zone-hint {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #4a90e2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    z-index: 3;
}

.traffic-sign {
    width: 60px;
    height: 60px;
    background-color: white;
    border: 3px solid #2d3748;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: grab;
    transition: all 0.3s;
    user-select: none;
    z-index: 4;
}

.traffic-sign:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.traffic-sign:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.available-signs {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 15px;
}

.sign-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #cbd5e0;
    min-width: 140px;
    transition: all 0.3s;
}

.sign-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sign-name {
    font-size: 1rem;
    font-weight: bold;
    color: #2d3748;
    text-align: center;
}

.sign-hint {
    font-size: 0.85rem;
    color: #4a5568;
    text-align: center;
    max-width: 130px;
    line-height: 1.3;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .violation-scene {
        height: 250px;
    }

    .scene-character {
        font-size: 1.5rem;
    }

    .violation-option {
        padding: 12px 20px;
        min-width: 140px;
        font-size: 0.9rem;
    }

    .bicycle-equipment {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .equipment-item {
        padding: 15px;
        min-height: 130px;
    }

    .equipment-icon {
        font-size: 2rem;
    }

    .intersection-map {
        height: 300px;
    }

    .placement-zone {
        border-width: 3px;
    }

    .traffic-sign {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .available-signs {
        gap: 15px;
        padding: 15px;
    }

    .sign-container {
        min-width: 120px;
        padding: 12px;
    }

    .game-hint {
        font-size: 0.85rem;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .bicycle-equipment {
        grid-template-columns: repeat(2, 1fr);
    }

    .violation-options-container {
        flex-direction: column;
        align-items: center;
    }

    .violation-option {
        width: 100%;
        max-width: 250px;
    }

    .available-signs {
        flex-direction: column;
        align-items: center;
    }

    .sign-container {
        width: 100%;
        max-width: 200px;
    }
}

/* Эффекты для всех игр */
.success-animation {
    animation: success 1s ease;
}

@keyframes success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

/* Индикатор правильности */
.correct-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 100;
}

.incorrect-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background: #f56565;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 100;
}