﻿/* ========== ESTILOS DEL MINI-JUEGO ========== */
.game-container {
    max-width: 700px;
    margin: 2rem auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    padding: 3rem 2rem;
    text-align: center;
    border: 4px solid var(--color-deep-green);
}

.game-view {
    display: none;
    animation: fadeIn 0.5s ease;
}

.game-view.active {
    display: block;
}

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

.game-mascot {
    width: 150px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--color-deep-green);
}

#gameStart h3 {
    font-size: 2rem;
    color: var(--color-deep-green);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

#gameStart p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
}

.game-progress {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.game-progress-bar {
    height: 100%;
    background: var(--color-sunset-gold);
    width: 0%;
    transition: width 0.4s ease;
}

#questionText {
    font-size: 1.6rem;
    color: var(--color-deep-green);
    margin-bottom: 2rem;
    font-family: var(--font-heading);
}

.game-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-option-btn {
    background: #f7f5f0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-family: var(--font-body);
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
}

.game-option-btn:hover {
    border-color: var(--color-deep-green);
    background: rgba(123, 160, 91, 0.1);
    transform: translateX(5px);
}

.game-option-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Modo oscuro soporte básico */
body.dark-theme .game-container {
    background: #061020;
    border-color: var(--color-sunset-gold);
}
body.dark-theme #gameStart h3,
body.dark-theme #questionText,
body.dark-theme #gameResult h3 {
    color: #f0f0f0;
}
body.dark-theme #gameStart p,
body.dark-theme .result-desc {
    color: #b0b0b0;
}
body.dark-theme .game-option-btn {
    background: #0a192f;
    border-color: #444;
    color: #e0e0e0;
}
body.dark-theme .game-option-btn:hover {
    border-color: var(--color-sunset-gold);
    background: rgba(255, 152, 0, 0.1);
}

/* ========== ESTILOS DEL CERTIFICADO ========== */
.certificate-container {
    background: #fff;
    padding: 15px;
    border: 2px solid #d4af37;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.certificate-inner {
    border: 8px double #d4af37;
    padding: 2rem;
    position: relative;
    background: #fdfbf7;
}

.certificate-logo {
    height: 60px;
    margin-bottom: 1rem;
}

.certificate-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-deep-green);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.certificate-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.certificate-body h3 {
    font-size: 2.5rem;
    color: var(--color-deep-green);
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.result-image-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--color-deep-green);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

#resultImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-desc {
    font-size: 1.15rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.certificate-footer {
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.signature {
    text-align: center;
    width: 200px;
}

.signature-line {
    border-bottom: 2px solid #333;
    margin-bottom: 0.5rem;
}

.signature p {
    margin: 0;
    font-weight: bold;
    color: #333;
    font-family: var(--font-body);
}

.signature-title {
    font-size: 0.85rem;
    color: #666 !important;
    font-weight: normal !important;
}

.seal {
    font-size: 4rem;
    color: #d4af37;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* Modo oscuro soporte para el certificado */
body.dark-theme .certificate-container {
    background: #061020;
    border-color: var(--color-sunset-gold);
}
body.dark-theme .certificate-inner {
    background: #0a192f;
    border-color: var(--color-sunset-gold);
}
body.dark-theme .certificate-header h2,
body.dark-theme .certificate-body h3 {
    color: var(--color-sunset-gold);
}
body.dark-theme .certificate-subtitle,
body.dark-theme .signature-title {
    color: #aaa !important;
}
body.dark-theme .fake-signature {
    color: #fdfbf7;
}
body.dark-theme .signature p {
    color: #eee;
}
body.dark-theme .signature-line {
    border-color: #eee;
}
body.dark-theme .result-image-wrapper {
    border-color: var(--color-sunset-gold);
}

@media print {
    /* 1. Ocultar todas las secciones principales que no son el juego */
    .header, .footer, .whatsapp-float, .topbar, #google_translate_element2, .lang-dropdown {
        display: none !important;
    }
    
    /* Ocultar todas las secciones excepto el minijuego */
    section:not(#minijuego) {
        display: none !important;
    }
    
    /* 2. Dentro del minijuego, ocultar el encabezado y las otras pantallas */
    #minijuego .section-header, 
    #gameStart, 
    #gameQuestion, 
    .result-actions {
        display: none !important;
    }
    
    /* 3. Resetear márgenes y paddings de los contenedores padre */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    #minijuego {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .container, .game-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important; /* MUY IMPORTANTE: Evita que se corte la mitad */
    }
    
    /* 4. Expandir el certificado a TODA la hoja */
    #gameResult {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .certificate-container {
        width: 100% !important;
        height: auto !important;
        min-height: 250mm !important; /* Altura ideal para una hoja vertical */
        max-width: 185mm !important; /* Ancho máximo para no salir de una hoja A4 vertical */
        margin: 0 auto !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
    }
    
    .certificate-inner {
        width: 100% !important;
        height: 100% !important;
        min-height: 250mm !important;
        border: 8px double #d4af37 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        padding: 10mm !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: center !important;
    }

    .certificate-header {
        width: 100% !important;
    }

    .certificate-logo {
        height: 60px !important;
        margin-bottom: 15px !important;
    }

    .certificate-header h2 {
        font-size: 2.2rem !important;
        margin-bottom: 15px !important;
    }

    .certificate-body {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .certificate-body h3 {
        font-size: 2.6rem !important;
        margin-bottom: 15px !important;
    }

    .result-image-wrapper {
        width: 180px !important;
        height: 180px !important;
        margin: 0 auto 20px auto !important;
    }
    
    .result-desc {
        font-size: 1.1rem !important;
        line-height: 1.5 !important;
        margin: 0 auto 20px auto !important;
        max-width: 90% !important;
    }

    .certificate-footer {
        width: 100% !important;
        margin-top: 20px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-end !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .seal {
        font-size: 3.5rem !important;
    }
    
    /* 5. Forzar orientación Vertical (Portrait) */
    @page {
        size: portrait;
        margin: 1cm; /* Márgenes de impresión al mínimo */
    }
}

/* ========== RESPONSIVE (MÓVIL) ========== */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem 0.5rem;
    }
    .certificate-container {
        padding: 4px;
    }
    .certificate-inner {
        padding: 0.8rem;
        border-width: 2px;
    }
    .certificate-logo {
        height: 30px;
        margin-bottom: 0.3rem;
    }
    .certificate-header h2 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    .certificate-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
        line-height: 1.2;
    }
    .certificate-body h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    .result-image-wrapper {
        width: 80px;
        height: 80px;
        border-width: 2px;
        margin-bottom: 0.5rem;
    }
    .result-desc {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        padding: 0;
    }
    .certificate-footer {
        margin-top: 0.5rem;
        align-items: center;
    }
    .signature {
        width: 100px;
    }
    .signature p {
        font-size: 0.7rem;
    }
    .signature-title {
        font-size: 0.6rem !important;
    }
    .seal {
        font-size: 2rem;
    }
    .result-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 1rem !important;
    }
    .result-actions button {
        margin-left: 0 !important;
        width: 100%;
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}


