* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Instrument Serif', serif;
    font-weight: normal;
}

body {
    font-family: 'Instrument Serif', serif;
    background: #e6e2d3;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    font-weight: normal;
}

.contenedor-principal {
    display: flex;
    width: 1800px;
    max-width: 1800px;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    justify-content: center;
}

/* Sección izquierda: Sala */
.seccion-sala {
    width: 1000px;
    background: #d3d3d3;
    border: 2px solid #2a2a3e;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.imagen-sala {
    width: 100%;
    flex: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    border-radius: 0;
    min-height: 300px;
    max-height: 70vh;
    position: relative;
    background-color: #d3d3d3;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    margin-top: 20px;
}

.imagen-sala.drag-over {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.contenido-sala {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #d3d3d3;
}

.botones-accion {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 0 15px 15px 15px;
    justify-content: flex-start;
}

.boton-accion-sala {
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 0;
    color: #000000;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 18px;
    width: 185px;
    word-wrap: break-word;
    line-height: 1.3;
}

.boton-accion-sala:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.boton-accion-sala:active {
    transform: translateY(0);
}

.boton-llave {
    background: #e8dcc6 !important;
    border-color: #d4c4a8 !important;
    color: #000000 !important;
}

.boton-llave:hover {
    background: #f0e4d0 !important;
}

.boton-escudo {
    background: #e8dcc6 !important;
    border-color: #d4c4a8 !important;
    color: #000000 !important;
}

.boton-escudo:hover {
    background: #f0e4d0 !important;
}

/* Botones de desafío por tipo: DESTREZA = violeta pastel, LUCIDEZ = verde pastel, FUERZA = naranja pastel. Texto negro. */
.boton-desafio-destreza {
    background: #e0d4f7 !important;
    border-color: #c4b2e8 !important;
    color: #000000 !important;
}

.boton-desafio-destreza:hover {
    background: #d4c4f0 !important;
}

.boton-desafio-lucidez {
    background: #c8e6d0 !important;
    border-color: #a8d4b4 !important;
    color: #000000 !important;
}

.boton-desafio-lucidez:hover {
    background: #b8ddc4 !important;
}

.boton-desafio-fortaleza {
    background: #ffe0cc !important;
    border-color: #f5c9a8 !important;
    color: #000000 !important;
}

.boton-desafio-fortaleza:hover {
    background: #ffd4b8 !important;
}

.texto-sala {
    background: #d3d3d3;
    border: none;
    border-radius: 0;
    padding: 15px;
    color: #2a2a2a;
    font-size: 18px;
    line-height: 1.6;
    min-height: 80px;
    margin: 0;
}


/* Sección derecha: Stats e Inventario */
.seccion-derecha {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panel de estadísticas */
.panel-stats {
    background: #0f0f1e;
    border: 2px solid #2a2a3e;
    border-radius: 0;
    padding: 10px;
}

/* Título del juego dentro del bloque de Vida */
.titulo-juego-vida {
    text-align: center;
    margin-bottom: 12px;
    color: #e6e2d3;
}

/* Nombre del juego: bien grande y gótico */
.titulo-juego-nombre {
    display: block;
    font-family: 'Manufacturing Consent', serif;
    font-size: 40px;
    line-height: 1.1;
    color: #e6e2d3;
}

/* Autor: debajo del nombre, más pequeño */
.titulo-juego-autor {
    display: block;
    font-family: 'Manufacturing Consent', serif;
    font-size: 20px;
    margin-top: 2px;
    color: #e6e2d3;
}

.stat {
    margin-bottom: 8px;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat label {
    display: block;
    margin-bottom: 3px;
    font-weight: normal;
    color: #fff;
    font-size: 18px;
}

.barra {
    width: 100%;
    height: 16px;
    background: #1a1a2e;
    border: 1px solid #e6e2d3;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.barra-relleno {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 0;
}

#barra-vida {
    /* El color se asigna desde JS según el valor de vida (verde → amarillo → naranja → rojo) */
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.3s ease, background 0.35s ease;
}

/* Destello cuando la barra de vida pierde puntos */
#barra-vida.barra-vida-destello {
    animation: destello-vida 0.45s ease;
}

@keyframes destello-vida {
    0%   { filter: brightness(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
    40%  { filter: brightness(1.9); box-shadow: 0 0 14px 3px rgba(255, 220, 220, 0.9); }
    100% { filter: brightness(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Contenedor de bloques para estadísticas de 0-10 */
.bloques-container {
    display: flex;
    gap: 1px;
    width: 100%;
    height: 16px;
    align-items: center;
    box-sizing: border-box;
}

.bloque-stat {
    flex: 1;
    height: 14px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.bloque-stat.activo {
    border-color: rgba(255, 255, 255, 0.3);
}

.bloque-stat.sabiduria.activo {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.bloque-stat.destreza.activo {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

.bloque-stat.fuerza.activo {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
}

.bloque-stat:not(.activo) {
    background: #1a1a2e;
}

/* Tooltips personalizados */
.barra,
.bloques-container {
    cursor: help;
    position: relative;
}

/* Zonas de Acción del Inventario */
.zonas-accion-inventario {
    display: flex;
    gap: 10px;
}

.zona-accion-inv {
    flex: 1;
    background: #0f0f1e;
    border: 2px solid #2a2a3e;
    border-radius: 0;
    padding: 15px;
}

.zona-accion-inv h3 {
    margin-bottom: 10px;
    color: #e6e2d3;
    text-align: center;
    font-size: 16px;
}

.area-accion-inv {
    min-height: 100px;
    background: #1a1a2e;
    border: 2px dashed #e6e2d3;
    border-radius: 0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    align-content: flex-start;
}

/* Objetos dropeados en Combinar: tamaño fijo para que se vean bien */
#area-combinar .objeto {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    flex-shrink: 0;
}

#area-combinar .objeto .objeto-nombre {
    font-size: 14px;
}

.area-accion-inv.drag-over {
    border-color: #3498db;
    background: #1a2a3e;
}

#area-combinar.drag-over {
    border-color: #3498db;
    background: #1a2a3e;
}

#area-descartar.drag-over {
    border-color: #e74c3c;
    background: #2a1a1e;
}

/* Todo el div (título + área) es zona de drop y se resalta */
#zona-combinar.drag-over {
    border-color: #3498db;
    background: #1a2a3e;
}

#zona-descartar.drag-over {
    border-color: #e74c3c;
    background: #2a1a1e;
}

#zona-vida.drag-over {
    outline: 2px solid #3498db;
    outline-offset: -2px;
    background: #1a2a3e;
}

.texto-ayuda {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 16px;
    margin: auto;
}

/* Inventario */
.inventario {
    flex: 1;
    background: #0f0f1e;
    border: 2px solid #2a2a3e;
    border-radius: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.inventario h3 {
    margin-bottom: 10px;
    color: #fff;
    text-align: center;
}

/* Inventario fijo 3x2 = 6 huecos, mismo tamaño siempre */
.grid-inventario {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    aspect-ratio: 3 / 2;
    gap: 0;
    padding: 0;
    border: 2px solid #2a2a3e;
    border-radius: 0;
}

/* Celda vacía del inventario (hueco disponible) - mismo color para todos */
.inventario-slot-vacio {
    aspect-ratio: 1;
    border: 1px solid #5a5a6e;
    background: #4a4a5e;
    min-height: 0;
}

.grid-inventario.drag-over {
    border-color: #3498db;
    background: #1a2a3e;
}

/* Objeto (Tile) */
.objeto {
    aspect-ratio: 1;
    border: 1px solid #2a2a3e;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    padding: 0;
    overflow: hidden;
}

/* Estilo damero (ajedrez) para el inventario 3x2 - posiciones 1,3,4,6 claras; 2,5 oscuras */
.grid-inventario .objeto:nth-child(1),
.grid-inventario .objeto:nth-child(3),
.grid-inventario .objeto:nth-child(4),
.grid-inventario .objeto:nth-child(6) {
    background: #1a1a2e;
}

.grid-inventario .objeto:nth-child(2),
.grid-inventario .objeto:nth-child(5) {
    background: #0f0f1e;
}

/* Slots vacíos: mismo color para todos, sin damero */
.grid-inventario .inventario-slot-vacio:nth-child(1),
.grid-inventario .inventario-slot-vacio:nth-child(2),
.grid-inventario .inventario-slot-vacio:nth-child(3),
.grid-inventario .inventario-slot-vacio:nth-child(4),
.grid-inventario .inventario-slot-vacio:nth-child(5),
.grid-inventario .inventario-slot-vacio:nth-child(6) {
    background: #4a4a5e;
    border-color: #5a5a6e;
}

.objeto:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

/* Resaltado semitransparente al pasar el mouse: color según el tipo de objeto */
.objeto::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.objeto:hover::after {
    opacity: 1;
}
/* Destreza: violeta pastel al 50% */
.objeto.objeto-tipo-destreza:hover::after {
    background: rgba(212, 196, 240, 0.5);
}
/* Fortaleza: naranja pastel al 50% */
.objeto.objeto-tipo-fortaleza:hover::after {
    background: rgba(255, 212, 184, 0.5);
}
/* Sustento: rosa al 50% */
.objeto.objeto-tipo-sustento:hover::after {
    background: rgba(240, 184, 200, 0.5);
}
/* Sin tipo: gris semitransparente */
.objeto.objeto-tipo-neutro:hover::after {
    background: rgba(128, 128, 128, 0.5);
}

.objeto:active {
    cursor: grabbing;
}

.objeto.dragging {
    opacity: 0.5;
}

/* Contenedor del tile: imagen a corte y nombre superpuesto */
.objeto-contenido {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.objeto .objeto-icono {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.objeto .objeto-icono img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.objeto .icono-emoji-fallback {
    font-size: 28px;
}

/* Nombre del objeto sobre la imagen, alineado a la base; color según tipo (clases) */
.objeto .objeto-nombre {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    font-size: 26px;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 1px #000, 0 1px 1px #000, 1px 0 1px #000, 0 -1px 1px #000, -1px 0 1px #000;
    padding: 4px 4px 6px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* Primera fila: valor (+N o -N) */
.objeto .objeto-nombre-valor {
    display: block;
    font-size: 0.95em;
    line-height: 1.1;
}

/* Segunda fila: nombre del objeto */
.objeto .objeto-nombre-texto {
    display: block;
    line-height: 1.1;
}

/* Destreza: violeta pastel */
.objeto .objeto-nombre.objeto-nombre-destreza {
    color: #d4c4f0;
}

/* FUERZA: naranja pastel (mismo código visual que los desafíos de FUERZA) */
.objeto .objeto-nombre.objeto-nombre-fortaleza {
    color: #ffd4b8;
}

/* Sustento: rosa */
.objeto .objeto-nombre.objeto-nombre-sustento {
    color: #f0b8c8;
}

/* Scrollbar personalizado */
.grid-inventario::-webkit-scrollbar {
    width: 8px;
}

.grid-inventario::-webkit-scrollbar-track {
    background: #0f0f1e;
    border-radius: 0;
}

.grid-inventario::-webkit-scrollbar-thumb {
    background: #3a3a5e;
    border-radius: 0;
}

.grid-inventario::-webkit-scrollbar-thumb:hover {
    background: #4a4a6e;
}

/* Pantalla de portada: imagen central y botón de Inicio */
.pantalla-inicio {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #e6e2d3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

.pantalla-inicio-portada {
    max-width: 90%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.boton-inicio {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 14px 50px;
    border-radius: 0;
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.boton-inicio:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.boton-inicio:active {
    transform: translateY(0);
}

/* Popup de la demo, superpuesto sobre la portada */
.popup-demo {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3100;
    animation: fadeIn 0.3s ease;
}

/* Popup de combinación */
.popup-combinacion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.popup-contenido {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    padding: 30px;
    max-width: 720px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-titulo {
    color: #000000;
    margin-bottom: 20px;
    font-size: 28px;
    text-shadow: none;
}

.popup-mensaje {
    color: #000000;
    margin-bottom: 25px;
    font-size: 18px;
    line-height: 1.6;
}

.popup-mensaje strong {
    font-weight: normal;
    color: #000000;
}

.popup-mensaje .popup-mensaje-naranja {
    color: #c0392b;
}

.popup-mensaje .popup-mensaje-inventario-lleno {
    color: #c0392b;
    font-weight: 500;
}

.popup-mensaje .popup-mensaje-italica {
    font-style: italic;
}

.popup-objeto-resultado {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    padding: 20px;
    margin-bottom: 25px;
}

.popup-objeto-icono {
    font-size: 52px;
    margin-bottom: 10px;
}

.popup-objeto-icono img,
.popup-objeto-png-resultado {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.popup-mensaje .popup-objeto-png {
    width: 36px;
    height: 36px;
    object-fit: contain;
    vertical-align: middle;
}

.popup-objeto-nombre {
    color: #000000;
    font-size: 22px;
    font-weight: normal;
}

.popup-boton {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 12px 30px;
    border-radius: 0;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.popup-boton:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.popup-boton:active {
    transform: translateY(0);
}

.popup-acciones-confirmacion {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.popup-boton-secundario {
    background: #ffffff;
    color: #000000;
}

.popup-boton-secundario:hover {
    background: #f0f0f0;
}

/* Notificación flotante de vida */
.notificacion-vida {
    position: fixed;
    bottom: -100px;
    right: 20px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    padding: 15px 20px;
    color: #000000;
    font-weight: normal;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 200px;
    text-align: center;
    opacity: 0;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

.notificacion-vida.mostrar {
    bottom: 20px;
    opacity: 1;
    transform: translateY(0);
}

.notificacion-vida.ocultar {
    bottom: -100px;
    opacity: 0;
    transform: translateY(20px);
}

/* Pantalla de game over: bloquea el juego, sin botón de aceptar */
.pantalla-game-over {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.pantalla-game-over-contenido {
    text-align: center;
    color: #fff;
    padding: 40px;
    max-width: 560px;
}

.pantalla-game-over-titulo {
    font-size: 36px;
    margin-bottom: 20px;
    color: #e74c3c;
}

.pantalla-game-over-mensaje {
    font-size: 20px;
    line-height: 1.5;
}

/* Botón para reiniciar el juego desde la pantalla de game over */
.pantalla-game-over-boton {
    margin-top: 30px;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: #e74c3c;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.pantalla-game-over-boton:hover {
    background: #c0392b;
}

.pantalla-game-over-boton:active {
    transform: scale(0.97);
}

/* Modal de desafío DESTREZA (mismo estilo que popup: bordes rectos, fondo claro) */
.modal-desafio-destreza {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.modal-desafio-destreza-contenido {
    position: relative;
    background: #e0d4f7;
    color: #000000;
    padding: 30px;
    border-radius: 0;
    max-width: 740px;
    width: 90%;
    border: 2px solid #000000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Overlay que bloquea clics durante la animación del sorteo */
.modal-destreza-overlay-sorteo {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: transparent;
    cursor: wait;
}

/* =========================================================================
   Rediseño de la pantalla de resolución de desafíos (RPG narrativo)
   Estilos compartidos por los modales de DESTREZA y FUERZA (.reto-*)
   ========================================================================= */

/* El contenido puede desplazarse si es más alto que la pantalla */
.modal-desafio-destreza-contenido.reto,
.modal-desafio-fortaleza-contenido.reto {
    max-height: 92vh;
    overflow-y: auto;
    font-family: 'Instrument Serif', serif; /* tipografía estilo libro/fantasía */
}

/* ---- 1. Encabezado ---- */
.reto-encabezado {
    text-align: center;
    margin-bottom: 22px;
}
.reto-tipo {
    margin: 0 0 6px;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b5b8a;
}
.reto-nombre {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.2;
    color: #1a1a1a;
}
.reto-objetivo {
    margin: 0;
    font-size: 19px;
    line-height: 1.4;
    color: #2a2a2a;
}

/* ---- 2 y 3. Tres tarjetas principales (dificultad, suerte, resultado) ---- */
.reto-tarjetas {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 12px;
}
.reto-tarjeta {
    flex: 1;
    max-width: 200px;
    background: #ffffff;
    border: 2px solid #cbb8e8;
    border-radius: 0;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
/* Tarjeta de dificultad: fondo rojo pastel suave con filete rojo pleno */
.reto-tarjeta.dificultad {
    background: #f7d6d6;
    border-color: #c62828;
}
.reto-tarjeta-titulo {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b5b8a;
}
.reto-tarjeta-valor {
    font-size: 52px;
    line-height: 1;
    color: #1a1a1a;
}
/* Fila que combina el valor de suerte con el modificador de objetos (ej: ? +2) */
.reto-tarjeta-valor-fila {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.reto-tarjeta-bonus {
    font-size: 52px;
    line-height: 1;
    color: #c62828;
}
/* La tarjeta de suerte usa un número más grande; el bonus lo acompaña al mismo tamaño */
.reto-tarjeta.suerte .reto-tarjeta-bonus {
    font-size: 60px;
}
.reto-tarjeta-bonus:empty {
    display: none;
}
/* La tarjeta de suerte es la protagonista (como una tirada de dado) */
.reto-tarjeta.suerte {
    border-color: #000000;
    background: #f4eeff;
}
.reto-tarjeta.suerte .reto-tarjeta-valor {
    font-size: 60px;
}
/* La tarjeta de resultado se colorea según el veredicto */
.reto-tarjeta.resultado.resultado-ganador {
    border-color: #6fae6f;
    background: #eaf6ea;
}
.reto-tarjeta.resultado.resultado-ganador .reto-tarjeta-valor { color: #1a5c1a; }
.reto-tarjeta.resultado.resultado-perdedor {
    border-color: #d68b8b;
    background: #fbecec;
}
.reto-tarjeta.resultado.resultado-perdedor .reto-tarjeta-valor { color: #8b2525; }

/* ---- 4. Objetos de ayuda ---- */
.reto-objetos {
    margin-bottom: 22px;
}
.reto-objetos-titulo {
    margin: 0 0 12px;
    font-size: 20px;
    color: #1a1a1a;
    text-align: center;
}
.reto-objetos-instruccion {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
    text-align: center;
}
.reto-objetos-fila {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.reto-objeto {
    width: 120px;
    background: #f4eeff;
    border: 2px solid #cbb8e8;
    border-radius: 0;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.reto-objeto:hover {
    border-color: #8a76b8;
}
.reto-objeto img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.reto-objeto-nombre {
    font-size: 15px;
    text-align: center;
    line-height: 1.15;
    color: #2a2a2a;
}
.reto-objeto-bonus {
    font-size: 18px;
    color: #000000;
}
/* Objeto seleccionado: borde más fuerte y fondo suave */
.reto-objeto.seleccionado {
    border-color: #000000;
    border-width: 3px;
    background: #e6d8ff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}
/* Objeto perdido por falla extrema (suerte 1 con objetos) */
.reto-objeto.perdido {
    position: relative;
    cursor: default;
    pointer-events: none;
    opacity: 0.85;
}
.reto-objeto.perdido::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(180, 0, 0, 0.45);
    border-radius: 0;
}
.reto-objetos-vacio {
    text-align: center;
    font-size: 20px;
    color: #c62828;
    margin: 0;
}
.reto-objetos-aviso {
    text-align: center;
    margin: 12px 0 0;
    font-size: 16px;
    font-weight: bold;
    color: #c62828;
}

/* ---- 6. Veredicto final (ÉXITO / FALLASTE) ---- */
.reto-veredicto {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 18px;
    border-radius: 0;
    margin-bottom: 22px;
}
.reto-veredicto.exito {
    background: #eaf6ea;
    border: 2px solid #a6d3a6;
}
.reto-veredicto.fallo {
    background: #fbecec;
    border: 2px solid #e0b0b0;
}
.reto-veredicto-titulo {
    font-size: 34px;
    letter-spacing: 2px;
}
.reto-veredicto.exito .reto-veredicto-titulo { color: #1a5c1a; }
.reto-veredicto.fallo .reto-veredicto-titulo { color: #8b2525; }
.reto-veredicto-sub {
    font-size: 18px;
    color: #2a2a2a;
}
.reto-veredicto-comparacion {
    font-size: 16px;
    color: #5a5a5a;
}
.reto-veredicto-nota {
    font-size: 18px;
    color: #c62828;
    margin-top: 4px;
}

/* ---- 7. Pie: botones de acción y enlace de ayuda ---- */
.reto-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.reto-links-ayuda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}
.reto-link-ayuda {
    background: none;
    border: none;
    padding: 6px 4px;
    font-family: inherit;
    font-size: 16px;
    color: #6b5b8a;
    text-decoration: underline;
    cursor: pointer;
}
.reto-link-ayuda:hover { color: #000000; }
.reto-acciones {
    display: flex;
    gap: 10px;
    margin-left: auto;
}
.reto-boton {
    padding: 12px 28px;
    border-radius: 0;
    font-family: inherit;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid #000000;
}
.reto-boton.primario {
    background: #000000; /* botón negro para continuar */
    color: #ffffff;
}
.reto-boton.primario:hover {
    background: #333333;
    transform: translateY(-1px);
}
.reto-boton.secundario {
    background: #ffffff;
    color: #000000;
}
.reto-boton.secundario:hover {
    background: #efe9f7;
}
.reto-boton:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* ---- Panel de ayuda "¿Cómo funciona?" ---- */
.reto-ayuda-panel {
    position: fixed;
    inset: 0;
    z-index: 1600;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 20px;
}
.reto-ayuda-caja {
    background: #fffaf0;
    border: 2px solid #000000;
    border-radius: 0;
    padding: 26px;
    max-width: 460px;
    text-align: center;
}
.reto-ayuda-titulo {
    margin: 0 0 14px;
    font-size: 24px;
    color: #1a1a1a;
}
.reto-ayuda-texto {
    margin: 0 0 22px;
    font-size: 17px;
    line-height: 1.5;
    color: #3a3a3a;
}

/* ---- Responsive: en móvil se apilan las tarjetas ---- */
@media (max-width: 560px) {
    .reto-tarjetas {
        flex-direction: column;
        align-items: stretch;
    }
    .reto-tarjeta {
        max-width: none;
        flex-direction: row;
        justify-content: space-between;
        padding: 14px 18px;
    }
    .reto-tarjeta-valor,
    .reto-tarjeta.suerte .reto-tarjeta-valor {
        font-size: 44px;
    }
    .reto-nombre { font-size: 25px; }
    .reto-pie { justify-content: center; }
    .reto-acciones { margin-left: 0; }
    .reto-objeto { width: 45%; }
}

/* Modal de desafío FUERZA (naranja, misma estructura que destreza) */
.modal-desafio-fortaleza {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.modal-desafio-fortaleza-contenido {
    position: relative;
    background: #ffe0cc;
    color: #000000;
    padding: 30px;
    border-radius: 0;
    max-width: 740px;
    width: 90%;
    border: 2px solid #000000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Variante FUERZA: mismos componentes .reto-* con tonos cálidos anaranjados */
.reto-fortaleza .reto-tipo,
.reto-fortaleza .reto-tarjeta-titulo,
.reto-fortaleza .reto-link-ayuda {
    color: #a05a2a;
}
.reto-fortaleza .reto-tarjeta {
    border-color: #f0c2a0;
}
.reto-fortaleza .reto-tarjeta.dificultad {
    background: #f7d6d6;
    border-color: #c62828;
}
.reto-fortaleza .reto-tarjeta.suerte {
    border-color: #000000;
    background: #fff2e8;
}
.reto-fortaleza .reto-objeto {
    background: #fff2e8;
    border-color: #f0c2a0;
}
.reto-fortaleza .reto-objeto:hover {
    border-color: #c77a3a;
}
.reto-fortaleza .reto-objeto.seleccionado {
    border-color: #000000;
    background: #ffdcc2;
}

