/* css/parts/game.css - v69 (Fix definitivo Color Pulsación) */

/* --- 0. BASE --- */
html, body {
    -webkit-text-size-adjust: 100%;
}

/* --- 1. CONTENEDOR PRINCIPAL (FONDO TRANSPARENTE) --- */
/* Dejamos el fondo transparente para que se vea el desenfoque (blur) del modo foco */
#game-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centrado vertical en escritorio */
    width: 100%;
    
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0;
    
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    
    background: transparent; 
    pointer-events: none; /* Permite clics solo en la tarjeta */
    
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Wrapper para controlar el ancho máximo */
.game-card-wrapper {
    width: 100%;
    max-width: 460px; /* Ancho ideal tipo App */
    pointer-events: auto; /* Reactivamos clics aquí */
    margin: auto; 
}

/* --- 2. TARJETA DEL JUEGO (DISEÑO PRO) --- */
.game-card {
    background: #ffffff;
    border-radius: 32px; /* Curvas modernas */
    padding: 25px 30px 40px 30px;
    
    /* Sombra potente para efecto flotante */
    box-shadow: 
        0 20px 60px -10px rgba(0, 0, 0, 0.15), 
        0 10px 20px -10px rgba(0, 0, 0, 0.05);
    
    border: 1px solid rgba(255,255,255,0.6);
    position: relative;
    text-align: left;
    overflow: hidden; 
    
    /* Textura interna sutil (papel) */
    background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3h1v1H1V3zm2-2h1v1H3V1z' fill='%23f1f5f1' fill-opacity='0.5' fill-rule='evenodd'/%3E%3C/svg%3E");
    
    transform: translateZ(0); 
}

/* Decoración inferior (Estilo vegetación sutil) */
.card-decoration-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 12px;
    background: #e8f5e9;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    z-index: 0;
}

/* --- 3. CABECERA --- */
.daily-header-area {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.daily-mode-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #1b4d1b;
    font-weight: 800;
    display: flex; align-items: center; gap: 8px;
}

.header-right-group {
    display: flex; align-items: center; gap: 10px;
}

.counter-badge-mini {
    font-size: 0.85rem; font-weight: 800;
    color: #14532d; background: #dcfce7;
    padding: 5px 12px; border-radius: 20px;
}

/* Botón X de cerrar */
.btn-close-game {
    width: 32px; height: 32px;
    background: #f1f5f9; color: #94a3b8;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 1rem; cursor: pointer;
    transition: background 0.2s;
}
.btn-close-game:hover { background: #fee2e2; color: #c0392b; }

/* Barra de tiempo */
.daily-timer-wrapper { display: flex; align-items: center; gap: 10px; }
.timer-icon { color: #2d5a27; font-size: 1rem; }
.daily-timer-track {
    flex: 1; height: 10px; background: #e2e8f0; border-radius: 10px; overflow: hidden;
}
.timer-fill-green {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #4ade80, #16a34a);
    border-radius: 10px; transition: width 0.1s linear;
}
.timer-fill-green.is-danger {
    background: linear-gradient(90deg, #f87171, #dc2626);
    animation: dangerPulse 0.6s infinite;
}

/* --- 4. TAGS --- */
.game-meta-tags {
    display: flex; justify-content: center; gap: 8px; margin-bottom: 25px;
}
.game-tag {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 6px 12px; border-radius: 8px;
    background: #fff; border: 1px solid #e2e8f0; color: #64748b;
    box-shadow: 0 2px 0 rgba(0,0,0,0.03);
}
.tag-info { color: #d97706; background: #fffbeb; border-color: #fcd34d; }

/* --- 5. PREGUNTA --- */
.question-text {
    font-family: 'Crimson Pro', serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1e293b;
    margin-bottom: 25px; margin-top: 0;
    text-align: center;
    min-height: 60px;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; position: relative;
}

/* --- 6. OPCIONES (BOTONES APP) --- */
#options-grid {
    display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 25px; position: relative; z-index: 2;
}

.opt-btn {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-bottom: 4px solid #e2e8f0; /* Efecto 3D */
    border-radius: 16px; 
    padding: 16px 20px;
    text-align: center;
    font-size: 1.05rem; font-weight: 600; color: #475569;
    cursor: pointer; transition: transform 0.1s, border-color 0.1s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none; /* Evitar bordes de foco nativos */
}

/* FIX DEFINITIVO: Estado ACTIVO/PULSADO (NEUTRO)
   Usamos :not(.correct):not(.wrong) para que solo aplique gris 
   MIENTRAS no se sepa si es correcta o incorrecta.
   El !important asegura que machaca cualquier otro estilo verde heredado.
*/
.opt-btn:not(.correct):not(.wrong):active, 
.opt-btn:not(.correct):not(.wrong):focus {
    background: #f1f5f9 !important; /* Gris neutro forzado */
    border-color: #cbd5e1 !important;
    border-bottom-color: #94a3b8 !important;
    color: #1e293b !important;
    
    transform: translateY(2px);
    border-bottom-width: 2px;
    margin-bottom: 2px; 
    box-shadow: none !important;
}

.opt-btn.correct { 
    background: #ecfdf5 !important; border-color: #22c55e !important; 
    border-bottom-color: #15803d !important; color: #14532d !important; 
}
.opt-btn.wrong { 
    background: #fef2f2 !important; border-color: #ef4444 !important; 
    border-bottom-color: #b91c1c !important; color: #7f1d1d !important; 
}

/* --- 7. COMODINES --- */
.wildcards-box-wrapper {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px;
    padding: 10px 20px; display: inline-flex; align-self: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    position: relative; z-index: 2;
    margin: 0 auto; 
}
.wildcards-area { display: flex; align-items: center; gap: 8px; }
.wildcards-text-label { font-size: 0.7rem; font-weight: 800; color: #94a3b8; margin-right: 10px; }

.naipe-card {
    width: 32px; height: 32px; background: #fff; border: 2px solid #e2e8f0;
    border-radius: 8px; display: flex; justify-content: center; align-items: center;
    cursor: pointer;
}
.naipe-card.active { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 3px 0 rgba(245,158,11,0.2); }
.naipe-card.active i { color: #f59e0b; }
.naipe-card.used { opacity: 0.5; background: #f1f5f9; border-color: #f1f5f9; cursor: default; }

/* --- 8. MODAL DE REPORTE (RESTAURADO) --- */
/* Estilos recuperados del CSS antiguo para que vibre y se vea igual */

.report-textarea { 
    width: 100%; box-sizing: border-box; 
    padding: 12px; border: 1px solid #ddd; 
    border-radius: 10px; font-family: inherit; 
    resize: none; background: #fafafa; 
    margin-bottom: 10px; /* Separación con los botones */
}

/* Animación de vibración (Shake) recuperada */
@keyframes shake { 
    10%, 90% { transform: translate3d(-1px, 0, 0); } 
    20%, 80% { transform: translate3d(2px, 0, 0); } 
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 
    40%, 60% { transform: translate3d(4px, 0, 0); } 
}

.error-shake { 
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; 
    border-color: #c0392b !important; 
    background: #fff5f5 !important; 
}

/* Botón de reporte (Banderita) */
.btn-report-issue {
    position: absolute;
    top: 15px; left: 15px;
    width: 32px; height: 32px;
    background: #fff5f5; color: #e74c3c;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.btn-report-issue:hover { transform: scale(1.1); background: #ffebee; }

/* --- 9. MODALES Y UTILIDADES --- */
@keyframes dangerPulse { 0%,100%{opacity:1} 50%{opacity:0.7} }

#modal-body { 
    border-radius: 24px !important; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important;
    position: relative; 
    background: #fff;
    padding: 25px; /* Padding recuperado */
}

/* Botones del modal (Estilos originales) */
.btn-modal-jueblo { 
    width: 100%; padding: 14px; border-radius: 50px; 
    background: #2d5a27 !important; color: #fff !important; 
    font-weight: 800; border: none; cursor: pointer;
    box-shadow: 0 4px 0 #1e3d1a; margin-top: 10px;
}
.btn-modal-gris { 
    width: 100%; padding: 14px; border-radius: 50px; 
    background: #ecf0f1 !important; color: #7f8c8d !important; 
    font-weight: 800; border: none; cursor: pointer;
    box-shadow: 0 4px 0 #bdc3c7; margin-top: 10px;
}
.btn-modal-jueblo:active, .btn-modal-gris:active { transform: translateY(4px); box-shadow: none; }

/* --- 10. ADAPTACIÓN MÓVIL --- */
@media (max-width: 600px) {
    #game-view {
        padding: 0;
        align-items: stretch; 
        background: #fff; /* Fondo blanco sólido en móvil para rendimiento */
        position: relative; 
        height: auto;
        min-height: 100vh;
    }

    .game-card-wrapper { max-width: 100%; margin: 0; }

    .game-card {
        border-radius: 0; /* Tarjeta a sangre en móvil */
        box-shadow: none; 
        border: none;
        padding: 20px;
        min-height: 100vh;
    }
    
    .question-text { font-size: 1.4rem; }
    .opt-btn { padding: 15px; font-size: 1rem; }
    .wildcards-box-wrapper { width: 100%; justify-content: center; box-sizing: border-box; }
}

/* Fix iOS Blur */
#game-view, #game-view * { -webkit-filter: none; filter: none; backdrop-filter: none; }