/* Стили для игр */
.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;
}

.available-signs-container {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.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;
    }

    .route-options-grid {
        grid-template-columns: 1fr;
    }
}

@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;
}

/* Светофорный тренажёр */
.traffic-game-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    align-items: center;
    margin: 20px 0;
}

.traffic-light {
    background: #1f2937;
    border-radius: 18px;
    padding: 16px;
    display: grid;
    gap: 12px;
    justify-items: center;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

.traffic-light-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #374151;
    opacity: 0.4;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.traffic-light-circle.active.red {
    background: #ef4444;
    opacity: 1;
}

.traffic-light-circle.active.yellow {
    background: #f59e0b;
    opacity: 1;
}

.traffic-light-circle.active.green {
    background: #22c55e;
    opacity: 1;
}

.traffic-panel {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(31, 41, 55, 0.12);
}

.game-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.9rem;
    margin: 16px 0 10px;
}

.game-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}

.game-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    transition: width 0.4s ease;
}

.game-summary {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #fef3c7;
    border: 1px dashed #f59e0b;
    text-align: center;
    font-size: 0.9rem;
}

.game-summary.show {
    display: grid;
    gap: 6px;
}

.traffic-status {
    font-weight: bold;
    margin-bottom: 12px;
}

.traffic-stats {
    display: flex;
    gap: 20px;
    margin: 12px 0;
    font-size: 0.9rem;
    color: #334155;
}

/* Опасно или безопасно */
.safety-card {
    background: #ffffff;
    border: 2px dashed rgba(31, 41, 55, 0.12);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.safety-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.safety-text {
    font-size: 1.1rem;
    color: #1f2937;
}

/* Маршрутный выбор */
.route-scenario-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
}

.route-scenario-title {
    margin-bottom: 8px;
    color: #1e3a8a;
}

.route-scenario-text {
    color: #1f2937;
    line-height: 1.5;
}

.route-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin: 10px 0 12px;
}

.route-option-btn {
    text-align: left;
    min-height: 74px;
    white-space: normal;
}

.route-option-btn.correct {
    border-color: #22c55e;
    background: #dcfce7;
    color: #14532d;
}

.route-option-btn.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    color: #7f1d1d;
}

@media (max-width: 768px) {
    .traffic-game-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .traffic-panel {
        width: 100%;
    }
}

/* 2026-03 compact question areas */
.violation-scene {
    min-height: 0;
    height: clamp(190px, 30vh, 250px);
}

.intersection-map {
    min-height: 0;
    height: clamp(210px, 33vh, 290px);
}

.sign-question,
.violation-text {
    font-size: 0.96rem;
    line-height: 1.35;
}

@media (max-width: 768px) {
    .violation-scene {
        height: clamp(160px, 24vh, 210px) !important;
        margin: 12px 0 !important;
    }

    .intersection-map {
        height: clamp(170px, 27vh, 235px) !important;
        margin: 12px 0 !important;
    }

    .sign-question,
    .violation-text {
        font-size: 0.9rem;
    }
}
