/* LP Desafío de Lectura - Estilos */

.desafio-lectura-wrapper {
    margin: 30px 0;
    padding: 0;
}

.desafio-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(15px, 3vw, 25px);
    margin: 0;
}

/* TARJETAS DE JUEGO */
.desafio-game-card {
    background: white;
    border-radius: 15px;
    padding: clamp(15px, 3vw, 25px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.desafio-game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.desafio-game-card.desafio-completado {
    opacity: 0.8;
    pointer-events: none;
}

/* TÍTULOS DE JUEGO */
.desafio-game-title {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.desafio-game-title h3 {
    margin: 0;
    font-size: 20px !important;
    font-weight: 600;
}

.desafio-game-icon {
    font-size: 4rem;
}

/* DISPLAYS DE INFORMACIÓN */
.desafio-timer-display {
    text-align: center;
    margin-bottom: 10px;
    color: #464646;
    background: #e6e6e6;
    padding: 8px;
}

/* INSTRUCCIONES */
.desafio-instructions {
    padding: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    line-height: 1.5;
}

/* BOTONES */
.desafio-submit-btn,
.classification-btn {
    background: #3498db;
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.desafio-submit-btn:hover,
.classification-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.desafio-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.desafio-button-container {
    text-align: center;
    margin: 15px 0;
}

/* JUEGO 1: ORDEN CRONOLÓGICO */
.chronos-events-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.chronos-event-item {
    background: #ecf0f1;
    padding: 12px 15px;
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    user-select: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.5;
}

.chronos-event-item:hover {
    background: #d5dbdb;
}

.chronos-event-item.selected {
    border-color: #3498db;
    background: #e8f4f8;
}

.chronos-event-item.correct {
    border-color: #27ae60;
    background: #d5f4e6;
}

.chronos-event-item.incorrect {
    border-color: #e74c3c;
    background: #fadbd8;
}

/* JUEGO 2: CAUSA Y EFECTO */
.cause-effect-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 0;
}

.causes-section,
.effects-section {
    flex: 1;
}

.causes-section h4,
.effects-section h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 16px;
}

.cause-item,
.effect-item {
    background: #ecf0f1;
    padding: 12px 15px;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.cause-item:hover,
.effect-item:hover {
    background: #d5dbdb;
}

.cause-item.selected {
    border-color: #e67e22;
    background: #fdebd0;
}

.cause-item.matched,
.effect-item.matched {
    border-color: #27ae60;
    background: #d5f4e6;
}

/* JUEGO 3: CONTEXTO */
.context-questions {
    margin-bottom: 0;
}

.context-question {
    background: #b4d8fc;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 0;
}

.context-question h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.4;
    font-weight: 600;
    font-size: 16px;
}

.context-options {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
    display: grid;
    gap: 10px;
}

.context-option {
    background: #ecf0f1;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.5;
}

.context-option:hover {
    background: #d5dbdb;
}

.context-option.selected {
    border-color: #3498db;
    background: #e8f4f8;
}

.context-option.correct {
    border-color: #27ae60;
    background: #d5f4e6;
}

.context-option.incorrect {
    border-color: #e74c3c;
    background: #fadbd8;
}

/* JUEGO 4: HECHO VS OPINIÓN */
.statements-container {
    margin-bottom: 0;
}

.statement-item-wrapper {
    background: #f8f9fa;
    padding: 15px 5px 15px 15px;
    margin-top: 8px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}


.statement-text {
    flex: 1;
    line-height: 1.5;
    color: #2c3e50;
}

.statement-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.statement-btn {
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 45px;
    background: white;
}

.statement-btn.fact-btn {
    color: #3498db;
    border-color: #3498db;
}

.statement-btn.fact-btn:hover:not(:disabled) {
    background: #3498db;
    color: white;
}

.statement-btn.opinion-btn {
    color: #e67e22;
    border-color: #e67e22;
}

.statement-btn.opinion-btn:hover:not(:disabled) {
    background: #e67e22;
    color: white;
}

.statement-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estilos cuando se clasifica */
.statement-item-wrapper.classified .statement-btn.selected {
    opacity: 1;
}

.statement-item-wrapper.classified .statement-btn.fact-btn.selected {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.statement-item-wrapper.classified .statement-btn.opinion-btn.selected {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
}

/* Estilos de correcto/incorrecto */
.statement-item-wrapper.correct {
    border-color: #27ae60;
    background: #d5f4e6;
}

.statement-item-wrapper.incorrect {
    border-color: #e74c3c;
    background: #fadbd8;
}

/* Responsive: layout vertical en móviles */
@media (max-width: 580px) {
    .statement-item-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .statement-buttons {
        justify-content: center;
        margin-top: 10px;
    }
}

/* JUEGO 5: SOPA DE LETRAS */
.word-search-words-list {
    margin-bottom: 20px;
    text-align: center;
}

.word-search-words-list strong {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
}

.words-to-find {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.word-to-find {
    background: #ecf0f1;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 12px;
    transition: all 0.3s ease;
}

.word-to-find.found {
    background: #27ae60;
    color: white;
    text-decoration: line-through;
}

.word-search-grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.copy-la-patria {
    font-size: 10px;
    text-align: right;
    padding-right: 5px;
    padding-top: 5px;
}

.word-search-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #34495e;
    padding: 2px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    aspect-ratio: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.word-search-cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.word-search-cell:hover {
    background: #e8f4f8;
    transform: scale(1.1);
}

.word-search-cell.selected {
    background: #3498db;
    color: white;
}

.word-search-cell.partial-found {
    background: #a8e6cf;
    color: #2c3e50;
}

.word-search-cell.partial-found:hover {
    background: #8fd9bf;
}

.word-search-cell.found {
    background: #27ae60;
    color: white;
    cursor: default;
}

.word-search-cell.found:hover {
    transform: none;
    background: #27ae60;
}

/* MENSAJES DE RESULTADO */
.desafio-result {
    margin-top: 10px;
}

.result-message {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    line-height: 1.5;
}

.result-message.success {
    background: #ff6900 !important;
}

.result-message.error {
    background: #fadbd8;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.result-message.info {
    background: #e8f4f8;
    color: #3498db;
    border: 2px solid #3498db;
}

/* RESPONSIVE */
@media (min-width: 769px) {
    .cause-effect-container {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .desafio-games-grid {
        gap: 15px;
    }
    
    .classification-btn {
        min-width: 100px;
        padding: 12px 15px;
    }
}