/* ⭐️ NUEVO: Declaración de la fuente de Pokémon personalizada ⭐️ */
@font-face {
  font-family: 'Pokemon Solid'; /* Le damos un nombre para usarla en el CSS */
    src: url('fonts/Pokemon-Solid.ttf') format('truetype'); /* SOLUCIÓN FINAL: Ruta relativa desde style.css */
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Mejora el rendimiento de carga */
}
@font-face {
  font-family: 'Lasirenita'; /* Le damos un nombre para usarla en el CSS */
    src: url('fonts/Lasirenita.ttf') format('truetype'); /* SOLUCIÓN FINAL: Ruta relativa desde style.css */
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Mejora el rendimiento de carga */
}
/* --- FIN DE LA DECLARACIÓN --- */

/* --- VARIABLES DE COLOR NEUTRAS (FALLBACK) --- */
:root {
    /* Colores base si no se definen en el admin */
    --color-primary: #212529;
    --color-secondary: #6c757d;
    --color-text: #212529;
    --color-text-light: #ffffff;
    --color-success: #198754;
    --color-danger: #dc3545;
    --font-family: 'Poppins', sans-serif;
}

/* --- ESTILOS GLOBALES Y CONTENEDOR --- */

body {
    font-family: var(--font-family, 'Poppins', sans-serif);
    background-color: #f8f9fa; /* Un gris muy claro de fondo */
    min-height: 100vh;
    margin: 0;
    transition: background 0.5s ease;

    /* ❗️ CORRECCIÓN: Añadimos padding para crear el "marco" */
    padding: 10px;
    box-sizing: border-box; /* Previene scrollbars */
}

.portal-container, .quiz-container {
    background-image: var(--background-image-url); /* Controlado desde JS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--portal-bg, #ffffff); /* Blanco por defecto */
    border-radius: var(--portal-border-radius, 1rem); /* 16px */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
    border: none; 
    
    /* ❗️ CORRECCIÓN: Ajustamos la altura al 100% del body (que tiene padding) */
    min-height: 100%;
    box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
}

/* 🚨 REGLA ESPECÍFICA PARA H1 (más grande y negrita) */
h1 {
    color: var(--portal-title-color, var(--color-text));
    font-size: 3rem; 
    font-weight: 700;
    margin-bottom: 20px;
    /* ⭐️ NUEVO: Hereda la fuente y espaciado para consistencia */
    font-family: inherit;
    letter-spacing: inherit;
    text-shadow: none; /* Sin sombra por defecto */
}


/* 💡 MEJORA: Estilo para títulos dentro de la sección de recuerdos */
.memory-section-bg {
    /* ⭐️ CORRECCIÓN: Usar una variable para la opacidad controlada desde el super-admin */
    background-color: rgba(255, 255, 255, var(--memories-section-bg-opacity, 0.75));
    backdrop-filter: blur(3px);
    border-radius: 25px; /* Le damos los bordes redondeados a este contenedor */
}

/* --- ESTILOS COMPARTIDOS DE RELIEVE Y BOTONES --- */
.btn-portal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.25rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: var(--btn-portal-border-radius, 1.5rem);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    text-decoration: none;
    box-shadow: var(--btn-shadow, 0 4px) var(--btn-portal-shadow-color, var(--color-secondary)); /* ⭐️ CORRECCIÓN: Usar la variable completa para la sombra */
    border: 2px solid var(--btn-portal-shadow-color, var(--color-secondary));
    background-color: var(--btn-portal-bg, var(--color-primary));
    color: var(--btn-portal-text-color, var(--color-text-light));
}
.btn-portal:hover {
    transform: translateY(-2px);
}
.btn-portal:active {
    transform: translateY(3px);
}

/* Estilos de Botones Específicos */
.btn-trivia {
    background-color: var(--btn-juegos-menu-bg, var(--color-success));
    color: var(--btn-juegos-menu-text-color, var(--color-text-light));
    box-shadow: var(--btn-shadow, 0 4px) var(--btn-juegos-menu-shadow-color, #157347);
    border-color: var(--btn-juegos-menu-border-color, #157347);
}
.btn-messages {
    background-color: var(--btn-portal-bg, var(--color-primary));
    color: var(--btn-portal-text-color, var(--color-text-light));
    box-shadow: var(--btn-shadow, 0 4px) var(--btn-portal-shadow-color, var(--color-secondary));
}
.btn-messages:hover {
    box-shadow: 0 6px var(--btn-portal-shadow-color-hover, var(--btn-portal-shadow-color, #FF9800));
}


/* --- ESTILOS DEL MODO JUEGO (#player.html) --- */

#quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 12px 20px;
    /* 🚨 Fondo casi blanco para contraste */
    background: rgba(255, 255, 255, 0.9); 
    border-radius: 15px;
    border: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05); 
    text-shadow: none !important; /* Quitar sombra de texto aquí */
}

/* AJUSTE RESPONSIVE */
@media (max-width: 500px) {
    #quiz-header {
        flex-direction: column; 
        gap: 8px; 
        padding: 10px;
    }
    .timer, .score, #player-name-display {
        width: 100%; 
        text-align: center;
        font-size: 1.1em;
    }
}
/* Botones de Opción de Trivia */
.option-btn {
    width: 100%;
    /* ⭐️ CORRECCIÓN: Usar las variables del super-admin */
    padding: var(--btn-trivia-padding, 12px 15px);
    margin: 5px 0;
    border-radius: var(--btn-trivia-border-radius, 8px);
    font-size: var(--btn-trivia-font-size, 1.1em);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    background-color: var(--btn-trivia-bg, white);
    border: 3px solid var(--btn-trivia-border-color, var(--honey-gold));
    color: var(--btn-trivia-text-color, var(--bee-black));
    box-shadow: var(--btn-shadow, 0 4px) var(--btn-trivia-shadow-color, var(--honey-gold));
    text-shadow: none !important;
}

.option-btn:hover:not(:disabled) {
    background-color: var(--btn-trivia-bg-hover, #ffc107);
    transform: translateY(-3px);
    box-shadow: 0 6px var(--btn-trivia-shadow-color, var(--honey-gold));
}

.option-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px var(--honey-gold);
}

/* Feedback de Respuesta Correcta/Incorrecta */
.option-btn.correct {
    background-color: var(--spring-green) !important; 
    box-shadow: 0 5px var(--spring-shadow) !important;
    transform: none !important;
}

.option-btn.incorrect {
    background-color: #F44336 !important; 
    box-shadow: 0 5px #c62828 !important;
    transform: none !important;
}

/* Botón Siguiente - Estilo Fijo para Móviles */
#next-button-fixed-container {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%;
    padding: 10px 20px;
    /* 🚨 Fondo blanco sólido para que el texto sea legible */
    background-color: #ffffff; 
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); 
    box-sizing: border-box;
    z-index: 1000; 
    display: flex;
    justify-content: center; 
}
#next-button-fixed-container #next-btn {
    width: 100%;
    max-width: 400px; 
    background-color: var(--spring-green);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 6px var(--spring-shadow);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    text-shadow: none !important;
}

#next-button-fixed-container #next-btn:hover {
    background-color: #43A047;
    transform: translateY(-3px);
    box-shadow: 0 9px #388E3C; 
}

#next-button-fixed-container #next-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px #388E3C; 
}
/* Padding para que el contenido no quede oculto detrás del botón fijo */
.game-padding { padding-bottom: 100px; }
.admin-mode { background: #fcfcfc; border-color: var(--honey-gold); text-align: left; }
.save-btn, .clear-btn { padding: 12px 20px; border-radius: 8px; font-weight: 600; }

/* 🚨 ESTILOS DEL CONTENEDOR MODAL/FLOTANTE (Juego de Memoria) */
.modal-full-screen {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 🚨 Fondo blanco casi sólido para el modal */
    background-color: rgba(255, 255, 255, 0.98); 
    z-index: 9999; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto; 
}

/* Contenedor interno para que se vea como una sección */
.quiz-section-floating {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 550px; 
    margin-top: 20px;
}

/* Ajuste específico para el grid dentro del modal */
.modal-full-screen .grid-container {
    max-width: none; 
    margin: 10px auto;
}
/* Aseguramos que los botones de cierre funcionen */
.close-btn:hover {
    color: #F44336 !important;
}

/* RE-AJUSTE DE TAMAÑOS DE CARTA PARA MÓVILES */
@media (max-width: 768px) {
    .modal-full-screen .card {
        height: 140px; 
    }
    .modal-full-screen .grid-container {
        max-width: 95%;
        padding: 5px;
    }
}
@media (max-width: 400px) {
    .modal-full-screen .card {
        height: 100px; 
    }
}

/* 🚨 SOLUCIÓN PARA LA VISIBILIDAD DE LA IMAGEN EN EL VOLTEO */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; 
    border-radius: 7px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-front {
    transform: rotateY(180deg);
}

.card-back {
    transform: rotateY(0deg); 
}

/* ======================================================================= */
/* --- ESTILOS VISUALES DEL JUEGO DEL AHORCADO (CSS DRAWING) --- */
/* ======================================================================= */

/* Contenedor principal para el dibujo */
.hangman-graphic {
    position: relative;
    width: 200px; 
    height: 250px; 
    margin: 20px auto;
    background-color: transparent !important; 
    border: none !important; 
    padding: 0 !important;
}

/* Estructura de la Horca (Gallows) */
.gallows-base {
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 10px;
    background-color: var(--bee-black);
    border-radius: 5px;
}
.gallows-pole {
    position: absolute;
    bottom: 10px;
    left: 20%;
    width: 10px;
    height: 230px;
    background-color: var(--bee-black);
}
.gallows-beam {
    position: absolute;
    top: 0;
    left: 20%;
    width: 100px; 
    height: 10px;
    background-color: var(--bee-black);
}
.gallows-rope {
    position: absolute;
    top: 10px;
    left: 60%;
    width: 3px;
    height: 20px;
    background-color: #A0522D; 
}

/* ======================================================================= */
/* --- ESTILOS VISUALES DEL JUEGO DEL AHORCADO (CSS DRAWING) --- */
/* ======================================================================= */

/* ... (código anterior de la horca) ... */

/* Cuerpo del Ahorcado (The Bee-Man) */
.hangman-part {
    position: absolute;
    /* ⭐️ CORRECCIÓN: Oculto por defecto. JS lo mostrará cuando sea necesario. */
    display: none;
    z-index: 10;
    transition: opacity 0.3s;
}

/* ⭐️ CORRECCIÓN: Usar 'display: none' en lugar de 'opacity: 0'.
 * 'opacity: 0' lo hace invisible pero sigue ocupando espacio y puede
 * causar problemas de layout. 'display: none' lo elimina completamente
 * hasta que se necesite.
*/
.hangman-part.hidden {
    display: none;
}

/* Cabeza - Se pinta de amarillo Abeja (YA ESTÁ CORRECTO) */
#hg-head {
    top: 30px;
    left: 54%;
    width: 25px;
    height: 25px;
    border: 3px solid var(--bee-black);
    background-color: var(--bee-yellow); 
    border-radius: 50%;
}

/* Cuerpo (tronco) - 🚨 MODIFICADO */
#hg-body {
    top: 55px;
    left: 60.5%;
    width: 3px;
    height: 50px;
    transform: translateX(-50%);
    border-radius: 0; /* o un ligero border-radius para suavizar */
    
    /* 🚨 NUEVOS ESTILOS: Color y contorno de la cabeza */
    background-color: var(--bee-yellow);
    border: 3px solid var(--bee-black);
    /* Ajustar el tamaño para compensar el borde */
    height: 44px; /* 50px - (2*3px) de borde */
    left: calc(60.5% - 3px); /* Ajuste de posición */
    width: 3px; /* El borde hará que parezca más ancho */
}

/* Brazos, Piernas (Líneas diagonales) */
/* 🚨 MODIFICADO: Eliminar background-color base para brazos/piernas */
#hg-arm-l, #hg-arm-r, #hg-leg-l, #hg-leg-r {
    /* width: 3px; // Esto ya no aplica directamente como el "grosor" */
    height: 25px;
    border-radius: 0;
    /* background-color: var(--bee-black); // ELIMINADO */
    transform-origin: top; 
    
    /* 🚨 NUEVOS ESTILOS: Color y contorno de la cabeza */
    background-color: var(--bee-yellow);
    border: 3px solid var(--bee-black);
    /* Ajustar el tamaño y la posición para compensar el borde */
    height: 19px; /* 25px - (2*3px) de borde, pero como es rotado, es más complejo */
    width: 3px; /* El borde lo hará parecer más grueso */
}

/* Brazo Izquierdo - 🚨 AJUSTADA POSICIÓN */
#hg-arm-l {
    top: 65px; 
    left: calc(60.5% - 3px); /* Ajuste de posición */
    transform: translateX(-50%) rotate(45deg); 
}
/* Brazo Derecho - 🚨 AJUSTADA POSICIÓN */
#hg-arm-r {
    top: 65px; 
    left: calc(60.5% - 3px); /* Ajuste de posición */
    transform: translateX(-50%) rotate(-45deg); 
}

/* Pierna Izquierda - 🚨 AJUSTADA POSICIÓN y ALTURA */
#hg-leg-l {
    height: 24px; /* 30px - (2*3px) */
    top: 105px; 
    left: calc(60.5% - 3px); /* Ajuste de posición */
    transform: translateX(-50%) rotate(-30deg); 
}
/* Pierna Derecha - 🚨 AJUSTADA POSICIÓN y ALTURA */
#hg-leg-r {
    height: 24px; /* 30px - (2*3px) */
    top: 105px;
    left: calc(60.5% - 3px); /* Ajuste de posición */
    transform: translateX(-50%) rotate(30deg); 
}

/* Cara de Perdedor (La boca final) - SE MANTIENE IGUAL */
#hg-face {
    top: 45px; 
    left: 50.5%;
    width: 20px;
    height: 3px;
    background-color: #F44336; 
    border-radius: 0;
    transform: translateX(-50%) rotate(-20deg); 
}

/* --- NUEVO: Estilo para el botón de Ranking Flotante --- */

#ranking-trophy-btn {
    position: fixed; /* Flota sobre todo */
    top: 15px;
    right: 15px;
    font-size: 2.5rem; /* Tamaño del emoji */
    /* ⭐️ CORRECCIÓN: Se hace el fondo transparente y se quita la sombra para que solo se vea el emoji. */
    background-color: transparent;
    border-radius: 50%; /* Lo hace redondo */
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    z-index: 1001; /* Asegura que esté por encima del menú */
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-shadow: none; /* Quita el text-shadow de la regla global */
}

#ranking-trophy-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* --- NUEVO: Anula el text-shadow para el contenido del recuadro blanco --- */
.memory-section-bg h2,
.memory-section-bg h3,
.memory-section-bg p,
.memory-section-bg .like-count,
.memory-section-bg .memory-item p {
    text-shadow: none !important;
}
/* --- NUEVO: Estilo para el Mensaje Flotante (Toast) --- */
.custom-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);    
    background-color: #198754; /* ⭐️ CORREGIDO: Usamos un color verde sólido y opaco */
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 10001; /* Más alto que el botón de la copa */
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: none;
    
    /* Oculto por defecto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, top 0.3s ease;
}

.custom-toast.show {
    opacity: 1;
    visibility: visible;
    top: 45%; /* Sube un poco al aparecer */
}

/* --- ⭐️ NUEVO: Estilos para Interacción en Recuerdos ⭐️ --- */

.memory-item {
    background-color: #fff;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.like-btn {
    cursor: pointer;
}

.like-btn:active svg {
    transform: scale(1.2);
    transition: transform 0.1s;
}

.comment-input {
    width: 100%;
    padding: 0.5rem 0.75rem; /* 8px 12px */
    border: 1px solid #e2e8f0; /* gray-200 */
    border-radius: 0.5rem; /* 8px */
    font-size: 0.875rem; /* 14px */
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--bee-yellow, #FACC15);
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.5);
}

.comment-submit-btn {
    background-color: var(--bee-yellow, #FACC15);
    color: var(--bee-black, #1F2937);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-submit-btn:hover {
    background-color: var(--honey-gold, #F59E0B);
}

/* ⭐️ MODIFICADO: Estilo para el botón de burbuja de comentario (ahora un icono) */
.comment-bubble-btn {
    background-color: transparent; /* Sin fondo */
    color: #65676b; /* Color del icono */
    padding: 0.25rem 0.5rem; /* Padding más pequeño para un icono */
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-bubble-btn:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Un fondo sutil al pasar el ratón */
    border-radius: 0.5rem; /* Ligeramente redondeado */
}

/* ⭐️ NUEVO: Ocultar un elemento */
.hidden {
    display: none !important;
}

/* ⭐️ NUEVO: Estilos para el selector de reacciones ⭐️ */
.reaction-picker {
    /* Posicionamiento */
    position: absolute;
    bottom: 100%; /* Arriba del botón */    
    margin-bottom: 8px; /* Espacio entre el botón y el picker */

    /* Apariencia */
    background-color: white;
    padding: 8px 12px;
    border-radius: 9999px; /* Forma de píldora */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex; /* Asegura que los emojis estén en línea */
    gap: 8px; /* Espacio entre emojis */
    z-index: 10; /* Asegura que esté por encima de otros elementos */

    /* ⭐️ CORRECCIÓN: Centrado robusto y prevención de desbordamiento ⭐️ */
    left: 0; /* Inicia desde el borde izquierdo del padre */
    right: 0; /* Se extiende hasta el borde derecho del padre */
    margin-left: auto; /* Centra el elemento horizontalmente */
    margin-right: auto; /* Centra el elemento horizontalmente */
    width: fit-content; /* Toma solo el ancho necesario para su contenido */
    max-width: calc(100vw - 20px); /* Limita el ancho máximo al viewport - un margen */
    box-sizing: border-box; /* Incluye padding y borde en el cálculo del ancho */
}

.reaction-emoji {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.reaction-emoji:hover {
    transform: scale(1.2);
}
