/* ============================================================
   ASIN - Estilos del minijuego de plataformas (Misión 1)
   y de las pantallas de decisión / transmisión final
   ============================================================ */

.m1-platformer-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.15);
    position: relative;
    line-height: 0; /* evita espacio extra bajo el canvas */
}

.m1-platformer-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

.m1-loading-msg {
    color: #00f0ff;
    font-family: monospace;
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

/* Título del bloque dentro del modal de pregunta */
.m1-question-title {
    color: #ffc94d;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.m1-virus-stat {
    color: #c9a0ff;
    font-weight: bold;
    margin: 0.5rem 0;
}

.m1-continue-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #00c9e0, #0a6f9c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.15s ease;
}

.m1-continue-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Controles táctiles (tablet / celular) */
.m1-touch-controls {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.m1-touch-btn {
    pointer-events: all;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(0, 240, 255, 0.6);
    background: rgba(11, 18, 32, 0.65);
    color: #00f0ff;
    font-size: 1.4rem;
    font-family: monospace;
    user-select: none;
    touch-action: none;
}

.m1-touch-btn:active {
    background: rgba(0, 240, 255, 0.25);
}

.m1-touch-jump {
    width: 64px;
    height: 64px;
}

/* Modal de preguntas de la Misión 1 (gemas de conocimiento) */
.m1-question-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}

.m1-question-box {
    background: #101a30;
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 14px;
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.m1-question-text {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.m1-question-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.m1-opt-btn {
    background: #1a2740;
    border: 1.5px solid #3a5a8a;
    color: #ffffff;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.92rem;
    transition: background 0.15s ease;
}

.m1-opt-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.18);
}

.m1-opt-btn.correct {
    background: rgba(76, 217, 100, 0.25);
    border-color: #4cd964;
}

.m1-opt-btn.incorrect {
    background: rgba(255, 77, 109, 0.2);
    border-color: #ff4d6d;
}

.m1-opt-btn:disabled {
    cursor: default;
}

.m1-question-feedback {
    margin-top: 1rem;
    color: #b9f4ff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.m1-question-feedback.ok {
    color: #8affc0;
}

.m1-question-feedback.bad {
    color: #ffc94d;
}

/* Escenas reveladas / puntos de decisión (Misión 2 y 3) */
.reveal-scenario {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 10px;
    padding: 1.2rem;
    margin: 1rem 0;
    text-align: left;
}

.reveal-text {
    color: #e2f8ff;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.reveal-question {
    color: #fff;
    margin-bottom: 0.8rem;
}

.reveal-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.reveal-option-btn {
    background: #1a2740;
    border: 1.5px solid #3a5a8a;
    color: #ffffff;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 500;
}

.reveal-option-btn:hover:not(:disabled) {
    background: #24345a;
    border-color: #4a7ac0;
}

.reveal-option-btn.correct {
    background: #1e5c3a;
    border-color: #4cd964;
    color: #ffffff;
}

.reveal-option-btn.incorrect {
    background: #5c2330;
    border-color: #ff4d6d;
    color: #ffffff;
}

.reveal-feedback {
    margin-top: 0.8rem;
    color: #b9f4ff;
    font-size: 0.9rem;
}

/* Misión 3: tarjetas de equipo y talentos del jugador */
.m3-team-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.m3-team-card {
    border: 2px solid;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
}

.m3-card-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.m3-card-condition {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-bottom: 0.5rem;
}

.m3-card-talents {
    text-align: left;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    padding-left: 1.1rem;
}

.m3-card-role {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.m3-player-talents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
}

.m3-talent-btn {
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #e2f8ff;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
}

.m3-talent-btn.selected {
    background: rgba(0, 240, 255, 0.3);
    border-color: #00f0ff;
}

.m3-talent-icon {
    margin-right: 0.35rem;
}

/* Misión 4: transmisión final y promesa */
.m4-broadcast-content {
    margin-top: 1rem;
}

.m4-broadcast-question {
    color: #fff;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.m4-promise-label {
    color: #00f0ff;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.m4-promise-text {
    color: #e2f8ff;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* ============================================================
   MISIÓN 2 — Ver lo Invisible
   ============================================================ */
.m2-intro-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}
.m2-intro-progress {
    font-size: 0.82rem;
    color: #7aa0c0;
    font-family: monospace;
}

/* Hint de linterna (objeto encontrado) */
.m2-collect-hint {
    max-width: 800px;
    margin: 0.6rem auto 0;
    background: #12233d;
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0.7rem 1rem;
    display: none;
}

/* Fase de armado de lentes */
.m2-assemble {
    text-align: center;
    padding: 1rem 0;
}
.m2-assemble h3 { color: #00f0ff; margin-bottom: 1rem; }
.m2-piece-tray {
    max-width: 620px;
    margin: 0 auto 1.2rem;
}
.m2-tray-label { color: #cbd5e1; font-size: 0.85rem; margin-bottom: 0.5rem; }
.m2-tray-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}
.m2-tray-piece {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: #1a2740;
    border: 1.5px solid #3a5a8a;
    color: #ffffff;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 90px;
}
.m2-tray-piece.selected {
    background: rgba(0, 240, 255, 0.28);
    border-color: #00f0ff;
}
.m2-tray-piece.used {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
}
.m2-tray-emoji { font-size: 1.6rem; }

.m2-glasses-frame {
    max-width: 420px;
    margin: 0 auto;
}
.m2-piece-info {
    max-width: 520px;
    margin: 1rem auto 0;
    color: #b9f4ff;
    font-size: 0.9rem;
    min-height: 2.5em;
}

/* Punto de decisión de la Misión 2 */
.m2-decision { padding: 1rem 0; }
.m2-decision-question {
    color: #00f0ff;
    font-weight: bold;
    margin: 1rem 0 0.8rem;
    line-height: 1.5;
    font-size: 1.02rem;
}
.m2-decision-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 700px;
    margin: 0 auto;
}
.m2-decision-feedback {
    max-width: 700px;
    margin: 1rem auto 0;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.m2-decision-feedback.ok { background: rgba(76, 217, 100, 0.15); color: #8affc0; border: 1px solid rgba(76,217,100,0.4); }
.m2-decision-feedback.bad { background: rgba(255, 201, 77, 0.12); color: #ffc94d; border: 1px solid rgba(255,201,77,0.4); }
.m2-decision-next { display: block; margin-top: 1rem; }

.m3-section-title {
    color: #00f0ff;
    text-align: center;
    margin-bottom: 1rem;
}

/* ============================================================
   MISIÓN 4 — Código Secreto (incisos, promesa, insignia, finales)
   ============================================================ */
.opt-letter {
    display: inline-block;
    font-weight: bold;
    color: #00f0ff;
    margin-right: 0.4rem;
}
.reveal-option-btn .opt-letter { color: #7fe0ff; }
.m4-opt-btn .opt-letter { color: #00f0ff; }

/* Promesa del agente */
.m4-promise-block {
    background: #12233d;
    border: 1px solid rgba(0, 240, 255, 0.45);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin: 1rem auto;
    max-width: 640px;
    text-align: center;
}
.m4-promise-line {
    color: #e2f8ff;
    line-height: 1.5;
    margin: 0.35rem 0;
    font-size: 0.98rem;
}
.m4-promise-block.small .m4-promise-line { font-size: 0.85rem; opacity: 0.95; }

/* Insignia de agente ASIN */
.m4-badge {
    display: flex;
    justify-content: center;
    margin: 1.4rem 0;
}
.m4-badge-inner {
    background: radial-gradient(circle at 50% 35%, #1a4a7a, #0a1f3a);
    border: 3px solid #ffd447;
    border-radius: 50%;
    width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 212, 71, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 212, 71, 0.5); }
    50% { box-shadow: 0 0 50px rgba(255, 212, 71, 0.85); }
}
.m4-badge-star { font-size: 2.6rem; }
.m4-badge-text { color: #ffd447; font-weight: bold; font-size: 1.05rem; letter-spacing: 1px; margin-top: 0.2rem; }
.m4-badge-sub { color: #cfe8ff; font-size: 0.7rem; margin-top: 0.2rem; text-align: center; padding: 0 0.5rem; }

/* Textos del final */
.m4-ending-emoji { font-size: 3.5rem; margin-bottom: 0.5rem; }
.m4-ending-title { color: #00f0ff; margin-bottom: 1rem; }
.m4-ending-text {
    color: #e2f8ff;
    line-height: 1.6;
    max-width: 640px;
    margin: 0.7rem auto;
    font-size: 0.96rem;
}
.m4-final-quote {
    color: #ffd447;
    font-style: italic;
    max-width: 600px;
    margin: 1.2rem auto;
    font-size: 0.95rem;
}

/* Fondos según el final */
.mission-complete.ending-star { background: radial-gradient(circle at 50% 0%, rgba(26,147,111,0.18), transparent 70%); }
.mission-complete.ending-training { background: radial-gradient(circle at 50% 0%, rgba(224,145,43,0.15), transparent 70%); }
.mission-complete.ending-normality { background: radial-gradient(circle at 50% 0%, rgba(120,120,120,0.2), transparent 70%); filter: grayscale(35%); }

/* ============================================================
   CORRECCIÓN DE CONTRASTE — textos sobre cajas de fondo CLARO
   (las cajas de misión usan fondo blanco/gris claro, así que
    estos textos deben ser oscuros para leerse bien)
   ============================================================ */

/* Escenario y pregunta de los puntos de decisión (van en la caja de diálogo clara) */
.m2-decision-scenario,
#m3-decision-scenario,
#m4-decision-scenario,
.dialogue-text {
    color: #1f2b3e !important;
}

/* Pregunta de decisión: azul oscuro legible */
.m2-decision-question {
    color: #1a4b7a !important;
}

/* Feedback de decisión sobre fondo claro cuando no tiene modificador */
.m2-decision-feedback {
    color: #1f2b3e;
}
.m2-decision-feedback.ok { color: #1e7a45 !important; }
.m2-decision-feedback.bad { color: #9a6b00 !important; }

/* Tarjetas de talentos del equipo (M3) — fondo claro */
.m3-team-card, .m3-card-condition, .m3-card-talents, .m3-card-talents li, .m3-card-role {
    color: #2d3748 !important;
}

/* Botones de talento del jugador (M3) — dar fondo oscuro sólido */
.m3-talent-btn {
    background: #1a2740 !important;
    color: #ffffff !important;
    border: 1.5px solid #3a5a8a !important;
}
.m3-talent-btn.selected {
    background: #1e5c3a !important;
    border-color: #4cd964 !important;
}

/* Bandeja de piezas (M2) — etiqueta e info sobre fondo claro */
.m2-tray-label { color: #2d3748 !important; }
.m2-piece-info { color: #2d3748 !important; }
.m2-intro-progress { color: #4a6178 !important; }

/* Hint de la linterna (M2) va sobre el canvas oscuro: se deja claro */
.m2-collect-hint { color: #ffffff; }

/* Textos del quiz de símbolos (M4) — paneles con fondo OSCURO, texto claro */
.m4-q-text { color: #ffffff !important; }
.m4-q-num { color: #7fd8ff !important; }
.m4-panel-label { color: #e2f8ff !important; }
.m4-feedback { color: #d8ffe0 !important; }

/* Botones de opción del quiz M4 — fondo oscuro sólido */
.m4-opt-btn {
    background: #1a2740 !important;
    color: #ffffff !important;
    border: 1.5px solid #3a5a8a !important;
}
.m4-opt-btn.correct { background: #1e5c3a !important; border-color: #4cd964 !important; }
.m4-opt-btn.incorrect { background: #5c2330 !important; border-color: #ff4d6d !important; }

/* Textos del final (M4) van sobre la pantalla; asegurar oscuro sobre caja clara */
.m4-ending-text { color: #2d3748 !important; }
.m4-ending-title { color: #1a4b7a !important; }
.m4-final-quote { color: #9a6b00 !important; }

/* Botón flotante de silencio de audio */
.asin-mute-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(0, 240, 255, 0.5);
    background: rgba(10, 20, 35, 0.85);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}
.asin-mute-btn:hover { transform: scale(1.08); background: rgba(20, 35, 60, 0.95); }
.asin-mute-btn.muted { opacity: 0.6; border-color: rgba(255, 107, 107, 0.6); }

/* ============================================================
   SELECCIÓN DE PERSONAJE PREDEFINIDO
   ============================================================ */
.char-select-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}
.char-select-label {
    display: block;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.8rem;
    text-align: center;
}
.char-select-row {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    flex-wrap: wrap;
}
.char-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border: 3px solid #ccc;
    border-radius: 12px;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
    width: 90px;
}
.char-preset-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.char-preset-btn.selected {
    box-shadow: 0 0 0 3px rgba(76, 217, 100, 0.4);
    background: #f0fff5;
}
.char-preset-img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}
.char-preset-name {
    font-size: 0.7rem;
    color: #2d3748;
    text-align: center;
    font-weight: 600;
}
.char-select-hint {
    text-align: center;
    color: #718096;
    font-size: 0.82rem;
    margin-top: 0.8rem;
    font-style: italic;
}

/* ============================================================
   CURSORES PERSONALIZADOS (solo en dispositivos con mouse)
   ============================================================ */
@media (pointer: fine) {
    body {
        cursor: url('../assets/images/cursors/pointer.png') 4 2, auto;
    }
    /* Cursor de mano al pasar sobre elementos interactivos */
    button, a, .btn, .char-preset-btn, .ac-swatch, .ac-arrow,
    .m1-opt-btn, .reveal-option-btn, .m4-opt-btn, .m2-tray-piece,
    .m3-talent-btn, .m2-slot, [onclick], .gem-option, .ac-chip,
    input[type="button"], select, .btn-option, label[for] {
        cursor: url('../assets/images/cursors/hand.png') 10 2, pointer;
    }
    /* Cursor "agarrando" al presionar */
    button:active, .btn:active, .char-preset-btn:active {
        cursor: url('../assets/images/cursors/hand_grab.png') 10 2, pointer;
    }
}

/* ============================================================
   MODAL DE PISTAS MEJORADO
   ============================================================ */
.hint-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}
.hint-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: hintPop 0.25s ease;
}
@keyframes hintPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.hint-modal-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.hint-ebro {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00c9e0;
}
.hint-modal-header h3 { color: #1a4b7a; font-size: 1.05rem; margin: 0; }
.hint-modal-intro { color: #4a6178; font-weight: bold; margin-bottom: 0.5rem; }
.hint-modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2rem;
}
.hint-modal-list li {
    color: #2d3748;
    line-height: 1.5;
    padding: 0.5rem 0 0.5rem 1.8rem;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}
.hint-modal-list li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 0.5rem;
}

/* ============================================================
   MENÚ DE PAUSA
   ============================================================ */
.pause-fab {
    position: fixed;
    top: 12px;
    right: 64px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(0, 240, 255, 0.5);
    background: rgba(10, 20, 35, 0.85);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}
.pause-fab:hover { transform: scale(1.08); }

.pause-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.pause-panel {
    background: linear-gradient(160deg, #14294a, #0a1526);
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 18px;
    padding: 2rem 1.8rem;
    width: 300px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.pause-title {
    color: #00f0ff;
    text-align: center;
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}
.pause-btn {
    width: 100%;
    text-align: center;
}
.pause-audio-btn {
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(0,240,255,0.4);
    color: #fff;
    border-radius: 8px;
    padding: 0.7rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}
.pause-audio-btn:hover { background: rgba(255,255,255,0.15); }
.pause-exit-btn {
    background: #5c2330;
    color: #fff;
    border: 1.5px solid #ff6b6b;
}
.pause-exit-btn:hover { background: #7a2f40; filter: brightness(1.1); }

/* ============================================================
   CARNÉ DE AGENTE ASIN
   ============================================================ */
.agent-card-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}
.agent-card {
    width: 340px;
    max-width: 92%;
    background: linear-gradient(160deg, #1a4b7a 0%, #0d2947 100%);
    border-radius: 14px;
    border: 2px solid #00c9e0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    overflow: hidden;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
}
.agent-card-header {
    background: rgba(0, 201, 224, 0.15);
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(0, 201, 224, 0.4);
    text-align: center;
}
.agent-card-logo {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #00e0ff;
}
.agent-card-sub {
    display: block;
    font-size: 0.6rem;
    color: #b8d8e8;
    margin-top: 0.2rem;
}
.agent-card-body {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
}
.agent-card-photo {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #fff;
    border: 2px solid #00c9e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.agent-card-photo svg { width: 100%; height: 100%; }
.agent-card-img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.agent-card-photo-empty { font-size: 2.5rem; }
.agent-card-info { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.agent-card-field {
    display: flex;
    flex-direction: column;
    font-size: 0.62rem;
    color: #8fc4e0;
    letter-spacing: 0.5px;
}
.agent-card-field strong {
    font-size: 0.82rem;
    color: #fff;
    letter-spacing: 0.5px;
}
.agent-card-active { color: #4cd964 !important; }
.agent-card-footer {
    background: rgba(0,0,0,0.25);
    text-align: center;
    padding: 0.4rem;
    border-top: 1px solid rgba(0, 201, 224, 0.3);
}
.agent-card-seal {
    font-size: 0.65rem;
    color: #ffd447;
    letter-spacing: 2px;
    font-weight: bold;
}

/* ============================================================
   DESCIFRADOR INTERACTIVO M4 (formar EMPATÍA)
   ============================================================ */
.m4-target-word {
    font-size: 1.6rem;
    letter-spacing: 6px;
    color: #ffd447;
    display: inline-block;
    margin-top: 0.4rem;
}
.m4-code-display {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.m4-code-cell {
    width: 46px;
    height: 52px;
    border: 2px solid #3a5a8a;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.m4-code-cell.filled { border-color: #00c9e0; background: rgba(0,201,224,0.12); }
.m4-code-cell.ok { border-color: #4cd964; background: rgba(76,217,100,0.25); }
.m4-code-cell.bad { border-color: #ff4d6d; background: rgba(255,77,109,0.25); animation: shakeCell 0.4s; }
@keyframes shakeCell {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.m4-code-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    font-family: monospace;
}
.m4-bank-label {
    color: #e2f8ff;
    font-size: 0.9rem;
    margin: 0.8rem 0 0.5rem;
}
.m4-symbol-bank {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.m4-symbol-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    width: 56px;
    padding: 0.5rem 0.3rem;
    background: #14294a;
    border: 2px solid #3a5a8a;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s;
}
.m4-symbol-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: #00c9e0; }
.m4-symbol-choice.used { opacity: 0.3; }
.m4-symbol-face { font-size: 1.5rem; }
.m4-symbol-letter { font-size: 0.9rem; font-weight: bold; color: #7fd8ff; font-family: monospace; }
.m4-decode-feedback {
    max-width: 460px;
    margin: 0.8rem auto;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}
.m4-decode-feedback.ok { background: rgba(76,217,100,0.15); border: 1px solid #4cd964; color: #d8ffe0; }
.m4-decode-feedback.bad { background: rgba(255,77,109,0.12); border: 1px solid #ff4d6d; color: #ffd3da; }
.m4-decode-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

/* ============================================================
   INTRODUCCIÓN: espera de narración y evaluación inicial
   ============================================================ */
.narration-wait {
    color: #4a6178;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0.5rem 0;
}
.btn-continue.btn-waiting {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Evaluación inicial (preguntas de sí/no) */
.intro-quiz {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.8rem;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    text-align: center;
}
.intro-quiz-title {
    color: #1a4b7a;
    margin: 0 0 0.4rem;
}
.intro-quiz-sub {
    color: #4a6178;
    font-size: 0.9rem;
    margin-bottom: 1.4rem;
}
.intro-quiz-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.intro-quiz-item {
    background: #f4faff;
    border: 1px solid #cfe6f5;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    text-align: left;
}
.intro-quiz-q {
    color: #1f2b3e;
    font-weight: 600;
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
}
.intro-quiz-opts {
    display: flex;
    gap: 0.6rem;
}
.intro-quiz-btn {
    flex: 1;
    background: #ffffff;
    border: 2px solid #7fb8d4;
    color: #1f5a75;
    font-weight: 700;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.12s ease;
}
.intro-quiz-btn:hover { transform: translateY(-2px); }
.intro-quiz-btn.selected {
    background: #0090b8;
    border-color: #0090b8;
    color: #ffffff;
}

/* ============================================================
   DIÁLOGO SECUENCIAL (presentación de Ebro/Norman y briefing M1)
   ============================================================ */
.story-dialogue {
    max-width: 760px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}
.story-scene-img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    background: #eef6fb;
    display: block;
}
.story-box { padding: 1.4rem 1.6rem 1.6rem; }
.story-speaker-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}
.story-portrait {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0090b8;
    flex-shrink: 0;
}
.story-speaker {
    color: #1a4b7a;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
}
.story-text-window {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.1rem;
}
.story-text {
    color: #1f2b3e;
    line-height: 1.65;
    font-size: 0.98rem;
    margin: 0;
    white-space: pre-line;
}
.story-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.story-progress {
    color: #4a6178;
    font-size: 0.85rem;
    font-family: monospace;
}

/* ============================================================
   BRIEFING M2: elenco de personajes y piezas de los lentes
   ============================================================ */
.story-cast {
    display: flex;
    justify-content: center;
    gap: 1.4rem;
    padding: 1.2rem 1rem 0.4rem;
    background: #eef6fb;
    flex-wrap: wrap;
}
.story-cast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 96px;
}
.story-cast-img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0090b8;
    background: #fff;
}
/* Vicente y Andrea se ven BORROSOS: así el jugador entiende
   por qué hacen falta los Lentes de la Empatía. */
.story-cast-img.blurred {
    filter: blur(4px);
    border-color: #9bb8c9;
}
.story-cast-name {
    color: #1f2b3e;
    font-weight: 700;
    font-size: 0.82rem;
}
.story-cast-tag {
    color: #1f5a75;
    background: #d6ecf7;
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
}

/* Piezas de los Lentes de la Empatía (aparecen una a una) */
.story-pieces {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}
.story-piece {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: #f4faff;
    border: 1px solid #cfe6f5;
    border-left: 4px solid #0090b8;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    opacity: 0;
    animation: pieceAppear 0.5s ease forwards;
}
@keyframes pieceAppear {
    0%   { opacity: 0; transform: translateX(-14px); }
    100% { opacity: 1; transform: translateX(0); }
}
.story-piece-icon { font-size: 1.6rem; line-height: 1; }
.story-piece-info { flex: 1; }
.story-piece-name { color: #1a4b7a; font-size: 0.95rem; }
.story-piece-part {
    color: #4a6178;
    font-size: 0.8rem;
    font-style: italic;
    margin-left: 0.3rem;
}
.story-piece-desc {
    color: #2d3748;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0.2rem 0 0;
}

/* ============================================================
   M2 · REVELACIÓN: ¡Lentes de la Empatía puestos!
   Los compañeros pasan de borrosos a nítidos.
   ============================================================ */
.m2-reveal {
    text-align: center;
    padding: 1rem 0;
}
.m2-reveal-head { margin-bottom: 1.2rem; }
.m2-reveal-glasses {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 0.3rem;
}
.m2-reveal-head h3 {
    color: #1a4b7a;
    margin: 0 0 0.3rem;
}
.m2-reveal-sub {
    color: #4a6178;
    font-size: 0.92rem;
    margin: 0;
}
.m2-reveal-cast {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.m2-reveal-item {
    width: 165px;
    background: #f4faff;
    border: 1px solid #cfe6f5;
    border-radius: 12px;
    padding: 0.9rem 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.m2-reveal-img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4cd964;
    background: #fff;
    /* Transición suave de borroso a nítido: el "efecto lentes" */
    transition: filter 0.9s ease, border-color 0.9s ease;
}
.m2-reveal-img.blurred {
    filter: blur(5px);
    border-color: #9bb8c9;
}
.m2-reveal-name {
    color: #1f2b3e;
    font-weight: 700;
    font-size: 0.95rem;
}
.m2-reveal-tag {
    color: #1f5a75;
    background: #d6ecf7;
    border-radius: 10px;
    padding: 0.1rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
}
.m2-reveal-desc {
    color: #2d3748;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.35rem 0 0;
}

/* ============================================================
   M3 · CIERRE DE EBRO (antes de las preguntas)
   ============================================================ */
.m3-closing { text-align: center; padding: 1rem 0; }
.m3-closing-head { margin-bottom: 1rem; }
.m3-closing-icon { font-size: 2rem; display: block; margin-bottom: 0.3rem; }
.m3-closing-head h3 { color: #1a4b7a; margin: 0; }
.m3-closing-team {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 1.1rem 0;
}
.m3-closing-member {
    background: #eef6fb;
    border: 1px solid #cfe6f5;
    border-radius: 14px;
    padding: 0.35rem 0.8rem;
    color: #1f5a75;
    font-size: 0.82rem;
    font-weight: 600;
}

/* ============================================================
   M4 · SÍMBOLOS REUNIDOS (paso previo al transductor)
   ============================================================ */
.m4-ready { text-align: center; padding: 1rem 0; }
.m4-ready-head { margin-bottom: 1rem; }
.m4-ready-icon { font-size: 2.2rem; display: block; margin-bottom: 0.3rem; }
.m4-ready-head h3 { color: #00e0ff; margin: 0; }
.m4-ready-symbols {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.3rem;
}
.m4-ready-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #14294a;
    border: 2px solid #00c9e0;
    border-radius: 10px;
    font-size: 1.5rem;
}
