/* =====================================================
   ESTILOS GENERALES - LA AVENTURA
   Mobile-first responsive design
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #9333EA;
    --secondary: #2563EB;
    --success: #059669;
    --error: #DC2626;
    --warning: #D97706;
    --bg-light: #F9FAFB;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow);
    overflow: hidden;
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* =====================================================
   CONTENIDO DE LA PRUEBA
   ===================================================== */
.prueba-contenido {
    padding: 2rem 1.5rem;
    border-bottom: 2px solid var(--border);
}

.prueba-contenido h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.prueba-contenido p {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.prueba-contenido strong {
    color: var(--text-dark);
    font-weight: 600;
}

.secuencia {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.numero {
    background: var(--bg-light);
    border: 2px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.imagen-prueba {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px var(--shadow);
}

.nota {
    background: #FEF3C7;
    border-left: 4px solid var(--warning);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

/* =====================================================
   FORMULARIO
   ===================================================== */
.formulario-container {
    padding: 2rem 1.5rem;
}

.formulario {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    min-height: 48px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.btn-validar {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-validar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.btn-validar:active {
    transform: translateY(0);
}

.btn-validar:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =====================================================
   MENSAJES DE ESTADO
   ===================================================== */
.mensaje {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.mensaje.error {
    background: #FEE2E2;
    color: var(--error);
    border-left: 4px solid var(--error);
}

.mensaje.info {
    background: #DBEAFE;
    color: var(--secondary);
    border-left: 4px solid var(--secondary);
}

.mensaje.warning {
    background: #FEF3C7;
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

/* =====================================================
   RESULTADO (CUANDO ACIERTAN)
   ===================================================== */
.resultado-container {
    padding: 2rem 1.5rem;
    background: linear-gradient(to bottom, #ECFDF5, white);
    animation: fadeIn 0.5s ease;
}

.resultado-success {
    text-align: center;
}

.resultado-success h2 {
    color: var(--success);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.resultado-success p {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.siguiente-punto {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.siguiente-punto h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.imagen-siguiente {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-maps {
    display: inline-block;
    background: linear-gradient(135deg, #EA4335 0%, #FBBC04 100%);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

.btn-maps:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 67, 53, 0.4);
}

/* =====================================================
   SPINNER DE CARGA
   ===================================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   ANIMACIONES
   ===================================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =====================================================
   RESPONSIVE - TABLET Y DESKTOP
   ===================================================== */
@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .prueba-contenido,
    .formulario-container {
        padding: 2.5rem 2rem;
    }

    .prueba-contenido h2 {
        font-size: 2rem;
    }

    .numero {
        font-size: 2rem;
        padding: 1.25rem 2rem;
        min-width: 80px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 700px;
    }
}


/* =====================================================
   SOPA DE LETRAS
   ===================================================== */
.sopa-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    overflow-x: auto;
}

.sopa {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    background: #E5E7EB;
    padding: 4px;
    border-radius: 8px;
    max-width: 100%;
}

.celda {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: bold;
    font-size: 1.1rem;
    color: #1F2937;
    min-width: 30px;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .celda {
        font-size: 0.85rem;
        min-width: 24px;
    }
}

/* =====================================================
   SUDOKU
   ===================================================== */
.sudoku-container {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    max-width: 100%;
}

.sudoku {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    border: 4px solid #1F2937;
    background: #1F2937;
    width: fit-content;
    margin: 0 auto;
}

.celda-sudoku {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: bold;
    font-size: 1.8rem;
    color: #1F2937;
    border: 1px solid #9CA3AF;
}

.celda-sudoku:nth-child(3n) {
    border-right: 3px solid #1F2937;
}

.celda-sudoku:nth-child(n+19):nth-child(-n+27),
.celda-sudoku:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid #1F2937;
}

.celda-roja {
    background: #FEE2E2 !important;
}

@media (max-width: 600px) {
    .celda-sudoku {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
}

@media (max-width: 400px) {
    .celda-sudoku {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
}

/* =====================================================
   CRUCIGRAMA
   ===================================================== */
.crucigrama-container {
    max-width: 500px;
    margin: 2rem auto;
}

.fila-crucigrama {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.numero-fila {
    width: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #1F2937;
    text-align: right;
}

.respuesta-fila {
    display: flex;
    gap: 0;
}

.letra-box {
    width: 45px;
    height: 45px;
    border: 2px solid #1F2937;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: white;
    color: #1F2937;
    margin: 0;
}

.letra-box.roja {
    background: #FEE2E2;
    border-color: #DC2626;
}

.letra-box.bloqueada {
    background: #1F2937;
    border-color: #1F2937;
}

.pistas-container {
    margin-top: 3rem;
    background: #F9FAFB;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #E5E7EB;
}

.pistas-container h3 {
    color: #1F2937;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.pista {
    margin-bottom: 0.75rem;
    color: #374151;
    line-height: 1.5;
}

.pista strong {
    color: #1F2937;
    margin-right: 0.5rem;
}

.codigo-resultado {
    background: #DBEAFE;
    border: 2px solid #2563EB;
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: 12px;
    text-align: center;
}

.codigo-resultado h3 {
    color: #1F2937;
    margin-bottom: 1rem;
}

.codigo-letras {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.codigo-letra {
    width: 50px;
    height: 50px;
    background: #FEE2E2;
    border: 3px solid #DC2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #DC2626;
    border-radius: 8px;
}

@media (max-width: 500px) {
    .letra-box {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .numero-fila {
        width: 25px;
        font-size: 1.1rem;
    }

    .codigo-letra {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* =====================================================
   TABLA DE REGIONES CON COLORES 8x8
   ===================================================== */
.tabla-regiones-container {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    max-width: 100%;
    overflow-x: auto;
}

.tabla-regiones {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    border: 4px solid #1F2937;
    background: #1F2937;
    width: fit-content;
    margin: 0 auto;
}

.celda-region {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1F2937;
    padding: 4px;
}

.celda-region img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.region-1 { background: #ff6363; }
.region-2 { background: #72ccff; }
.region-3 { background: #52fea6; }
.region-4 { background: #fbfa65; }
.region-5 { background: #a65afa; }
.region-6 { background: #f6b45d; }
.region-7 { background: #319f4d; }
.region-8 { background: #2e29d4; }

@media (max-width: 600px) {
    .celda-region {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 400px) {
    .celda-region {
        width: 35px;
        height: 35px;
    }
}

/* =====================================================
   SISTEMA DE PREGUNTAS TIPO QUIZ (ESTILO TV)
   ===================================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.pregunta-bloque {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border: none;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.pregunta-bloque::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #fbbf24);
    border-radius: 20px;
    z-index: -1;
}

.pregunta-numero {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1F2937;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 900;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pregunta-texto {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.respuestas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.respuesta-opcion {
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    border: 4px solid #d1d5db;
    border-radius: 15px;
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1F2937;
    text-align: left;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.respuesta-opcion:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(251, 191, 36, 0.4);
}

.respuesta-opcion.correcta {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #047857;
    color: white;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.respuesta-opcion.correcta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.6);
}

.respuesta-opcion.incorrecta {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #991b1b;
    color: white;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.letra-respuesta {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
    border: 3px solid white;
}

.respuesta-opcion.correcta .letra-respuesta,
.respuesta-opcion.incorrecta .letra-respuesta {
    background: white;
    color: #1F2937;
    border-color: transparent;
}

@media (max-width: 600px) {
    .pregunta-bloque {
        padding: 1.5rem;
    }

    .pregunta-numero {
        font-size: 1.1rem;
        padding: 0.6rem 1.2rem;
    }

    .pregunta-texto {
        font-size: 1.1rem;
    }

    .respuestas-grid {
        gap: 1rem;
    }

    .respuesta-opcion {
        padding: 1rem;
        font-size: 1rem;
        min-height: 70px;
    }

    .letra-respuesta {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
        margin-right: 0.75rem;
    }
}

@media (max-width: 400px) {
    .respuestas-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   IMAGEN PRINCIPAL CENTRADA
   ===================================================== */
.imagen-principal-container {
    text-align: center;
    margin-bottom: 2rem;
}

.imagen-principal {
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   BOTÓN "NO ESTOY REGISTRADO"
   ===================================================== */
.btn-no-registrado {
    display: inline-block;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.02em;
}

.btn-no-registrado:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.btn-no-registrado:active {
    transform: translateY(0);
}

/* =====================================================
   MODAL "NO ESTOY REGISTRADO"
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-contenido {
    background: white;
    border-radius: 16px;
    padding: 2rem 1.75rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.25s ease;
}

.modal-texto {
    font-size: 1.05rem;
    color: var(--text-dark);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.modal-cerrar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.modal-cerrar:hover {
    opacity: 0.88;
}
