/*
 * Archivo de Estilos Principal
 * ----------------------------
 * Organización:
 * 1.  Variables Globales y Reset
 * 2.  Estructura y Páginas de la App
 * 3.  Componentes de UI (Header, Tarjetas, Botones, Modales, etc.)
 * 4.  Componentes Específicos (Ruleta, Ranking, Formularios)
 * 5.  Animaciones y Efectos
 * 6.  Clases de Utilidad y Media Queries
 */

/* ======================================================= */
/* 1. VARIABLES GLOBALES Y RESET                           */
/* ======================================================= */
:root {
    --icon-color: #ffffff;
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #e74c3c;
    --secondary-hover: #c0392b;
    --tertiary-color: #2ecc71;
    --tertiary-hover: #27ae60;
    --background-color: #f0f4f8;
    --text-color: #1e293b;
    --timer-color: #9ca3af;
    --jokers-container-color: #662ac9;
    --card-background: #ffffff;
    --success-color: #22c55e;
    --error-color: #dc2626;
    --warning-color: #f97316;
    --heart-color: #ef4444;
    --heart-empty-color: #cbd5e1;
    --font-family: 'Fredoka', 'Nunito', Tahoma, Geneva, Verdana, sans-serif;
    --header-height: 60px; /* Ajustado para el nuevo header */
    --bottom-menu-height: 70px;
}

html {
    height: 100%;

}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    overscroll-behavior-x: contain;
     -webkit-user-select: none; 
    user-select: none; 

}

/* ======================================================= */
/* 2. ESTRUCTURA Y PÁGINAS DE LA APP                       */
/* ======================================================= */

/* --- Pantalla de Carga (Splash Screen) --- */
#splash-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('images/quiz/bg_home.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start;
    padding-top: 20vh;
    box-sizing: border-box;
    z-index: 2000; 
    transition: opacity 0.75s ease-out;
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }

.splash-title { 
    font-family: 'Titan One';
    font-size: clamp(1.5rem, 6vw, 2.8rem);
    font-weight: 300;
    color: white;
    text-align: center; 
    padding: 0 1rem; 
    line-height: 1.1;
    -webkit-text-stroke: 1px black;
    text-stroke: 1px black;
}

/* --- Contenedor Principal de la App --- */
#app-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--background-color);
    overflow: hidden;

}

/* --- Estilo Base para las Páginas --- */
.app-page {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
    box-sizing: border-box;
    transition: transform 0.4s ease-in-out;
    transform: translateX(100%);
    overflow: hidden; 
}
.app-page.active { transform: translateX(0); }
.app-page.prev { transform: translateX(-100%); }
.app-page.exit-left { transform: translateX(-100%); }
.no-transition { transition: none !important; }

/* --- Página de Bienvenida (#welcome-page) --- */
#welcome-page {
    background-size: cover;
    background-position: center;
    color: #000;
    text-align: left;
    justify-content: space-between;
}

.welcome-content {
    overscroll-behavior-y: contain;
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 12rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.welcome-content .welcome-heading {
    font-size: clamp(1.5rem, 1rem + 2.5vw, 2.5rem);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}
.welcome-heading .line-1 { color: #662d91; }
.welcome-heading .line-2 { color: #00C49A; }
.welcome-heading .line-3 { color: #FFB300; }

.welcome-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 1rem 0;
}
.welcome-content p .highlight { font-weight: 500; color: #662d91; }
.welcome-content .welcome-outro { font-size: 1.1rem; font-weight: 500; }

/* --- Página del Juego (#game-page) --- */
#game-page #main-header { display: none; }



#start-screen {overflow-x: hidden;}

#game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1rem 5rem 1rem;
    box-sizing: border-box;
}

/* --- Páginas de Información (#info-page-container, #more-page) --- */
#info-page-container #info-page-content {
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 10rem 1.5rem;
    box-sizing: border-box;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-user-select: text;
}

#more-menu-content {
    width: 100%;
    max-width: 30rem;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 5rem;
}

/* ======================================================= */
/* 3. COMPONENTES DE UI                                    */
/* ======================================================= */

/* --- Cabecera Global --- */
.welcome-header {
    width: 100%;
    height: var(--header-height);
    background-color: #4b1e6e;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.header-content-container {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}



.header-left, .header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Evita que los íconos se encojan */
}
.header-center {
  position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Estas reglas se mantienen igual para alinear el contenido dentro de cada columna */
.header-left { justify-content: flex-start; }
.header-right { justify-content: flex-end; }


.header-logo { height: 20px; width: auto; }
.header-icon { font-size: 1.5rem; color: white; text-decoration: none; }
.header-title { color: white; font-size: 1.2rem; font-weight: 400; }

/* --- Menú Inferior --- */
#bottom-menu-container {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1100;
    background-color: #4b1e6e;
    height: var(--bottom-menu-height);
    padding-top: 10px;
    box-sizing: border-box;
    transition: transform 0.4s ease-in-out;
}
#bottom-menu-container.is-hidden-bottom { transform: translateY(100%); }

#bottom-menu {
    width: 100%; max-width: 30rem; margin: 0 auto;
    height: 60px; display: flex; justify-content: space-around; align-items: center;
}
#bottom-menu a {
    position: relative; color: white; text-decoration: none; display: flex;
    flex-direction: column; align-items: center; gap: 4px; font-size: 0.7rem;
    flex: 1; transition: color 0.2s, transform 0.2s; padding-bottom: 8px;
}
#bottom-menu a i { font-size: 1.4rem; }
#bottom-menu a:hover { color: #e0c8f5; transform: translateY(-3px); }
#bottom-menu a.nav-item-disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }
#bottom-menu a.active-nav-item { transform: translateY(-3px); pointer-events: none; cursor: default; }
#bottom-menu a.active-nav-item::after {
    content: ''; position: absolute; bottom: -2px; left: 50%;
    transform: translateX(-50%); height: 6px; width: 6px;
    background-color: #45a8bb; border-radius: 50%;
}

/* --- Área del Botón "Jugar" --- */
#play-button-area {
    position: fixed; bottom: var(--bottom-menu-height); left: 0; right: 0;
    z-index: 1099; background-color: #4b1e6e; padding-top: 1rem;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
#play-button-area.is-hidden { transform: translateX(-100%); opacity: 0; }

.play-button-content {
    width: 100%; max-width: 30rem; margin: 0 auto;
    padding: 0 1rem; box-sizing: border-box;
}

/* --- Botones --- */
.btn { 
    padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; 
    transition: all 0.2s ease; cursor: pointer; border: none; 
    width: 100%; box-sizing: border-box; font-size: clamp(0.9rem, 3.5vw, 1rem); 
}
.btn-primary { background-color: var(--primary-color); color: white; margin-top: 0.5rem; }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary-color); color: white; margin-top: 0.75rem; }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.btn-tertiary { background-color: var(--tertiary-color); color: white; margin-top: 0.75rem; }
.btn-tertiary:hover { background-color: var(--tertiary-hover); }
.btn-answer { background-color: #e5e7eb; color: var(--text-color); text-align: left; }
.btn-answer:hover { background-color: #d1d5db; }
.btn:disabled { background-color: #9ca3af; cursor: not-allowed; }

#play-button {
    width: 100%; padding: 1rem; font-size: 1.25rem; font-weight: 600;
    border-radius: 12px; border: none; background-color: var(--tertiary-color);
    color: white; cursor: pointer; margin-bottom: 1rem; box-shadow: 0 4px 0 #27ae60;
    transition: all 0.4s ease-in-out;
}
#play-button:hover { background-color: var(--tertiary-hover); transform: translateY(-2px); box-shadow: 0 6px 0 #27ae60; }
#play-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #27ae60; }

/* --- Tarjetas (Cards) --- */
.card {
    background-color: var(--card-background); border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    padding: 1.5rem; text-align: center; width: 100%;
    display: flex; flex-direction: column;
}
#card-area.card { padding: 1rem; }
.card-title-container {
    display: flex; justify-content: space-between; align-items: baseline;
    width: 100%; margin-bottom: 1rem;
}
.card-title-container .card-title { margin: 0; }
.card-title { font-size: clamp(1rem, 5vw, 1.25rem); font-weight: 400; margin-bottom: 1rem; }
.card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 0.75rem; }
.card-question { font-size: clamp(1rem, 3vw, 1.2rem); font-weight: 400; line-height: 1.35; margin-bottom: 0.75rem; text-align: left;}
.answer-buttons-container { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; margin-top: 0px}

/* --- Modales --- */
.modal {
    visibility: hidden; opacity: 0; transition: opacity 0.4s ease, visibility 0s linear 0.4s;
    position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.90);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; box-sizing: border-box;
}
.modal.is-visible { visibility: visible; opacity: 1; transition: opacity 0.4s ease; }
.modal.is-visible .modal-content { animation: pop-in 0.4s ease-out forwards; }

.modal-content {
    background-color: var(--card-background); padding: 1.5rem; border-radius: 12px;
    width: 100%; max-width: 500px; max-height: 70vh;
    overflow-y: auto; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h2 { 
    text-align: center; margin-top: 0; margin-bottom: 1.5rem; font-weight: 400;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; 
}
.modal-close-button { 
    position: absolute; top: 10px; right: 15px; color: #aaa; 
    font-size: 44px; font-weight: 300; cursor: pointer; padding-right: 15px;
}
.modal-close-button:hover, .modal-close-button:focus { color: black; }
.modal-buttons-container { display: flex; gap: 1rem; width: 100%; }
.modal-buttons-container .btn { margin-top: 0; flex: 1; }

/* --- Banner de Cookies --- */
#cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 41, 59, 0.8); /* Fondo oscuro más suave */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

#cookie-banner.is-visible {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Añadimos la animación de entrada al contenido del pop-up */
#cookie-banner.is-visible .cookie-banner-content {
    animation: pop-in 0.4s ease-out forwards;
}

.cookie-banner-content {
    background-color: white;
    padding: 2rem;
    border-radius: 16px; /* Bordes más redondeados */
    max-width: 380px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

/* Estilo para el nuevo ícono de galleta */
.cookie-banner-content .fa-cookie-bite {
    font-size: 3.5rem;
    color: #8D6E63; /* Un color café amigable para la galleta */
    margin-bottom: 1.5rem;
}

.cookie-banner-content p {
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    font-size: 1rem;
    color: #334155; /* Un gris oscuro más suave para el texto */
}

.cookie-banner-content a {
    color: var(--primary-color);
    font-weight: 500; /* Hacemos el enlace un poco más visible */
}

/* Estilo mejorado para el botón "Ok" */
#cookie-accept-button {
    width: 100%;
    background-color: var(--tertiary-color); /* Verde amigable de tu paleta */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 0 #27ae60; /* Sombra para darle profundidad */
    transition: all 0.2s ease;
}

#cookie-accept-button:hover {
    background-color: var(--tertiary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #27ae60;
}

#cookie-banner hr {
  border: none;
  height: 1px;
  background-color: #e0e0e0; /* Un color gris claro y sutil */
  margin: 1rem 0; /* Espacio vertical arriba y abajo de la línea */
}


.support-links-container {
  display: flex;
  flex-direction: row; 
  justify-content: center;
  gap: 1.5rem; 
  padding: 1.5rem 0 1rem 0; 
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb; 
}

.btn-support {
  display: flex;
  align-items: center;
  justify-content: center;     
  text-decoration: none;
  color: white;
  transition: transform 0.2s ease, opacity 0.2s ease;

  width: 50px;                 
  height: 50px;                
  padding: 0;                  
  border-radius: 50%;          
  background-color: transparent; 
  border: 2px solid #ced4da;  
  box-sizing: border-box;      
}

.btn-support span { display: none;}

.btn-support:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

.btn-support i {
  font-size: 1.5rem;   
  color: #ced4da; 
}


.menu-separator {
  border: none;
  border-top: 1px solid #e5e7eb; /* Color de línea sutil */
  margin: 1rem 0; /* Espacio vertical */
}

.coffe-links-container {
  display: flex;
  justify-content: center;
}

.btn-coffee {
  background-color: #FFDD00;
  color: #000000;
  border: 1px solid #FFDD00;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-weight: 400;
  gap: 0.75rem;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease; 
  display: flex;
  width: 90%;
  box-sizing: border-box;
}

.btn-coffee i {
  color: #000000;
  -webkit-text-stroke-width: 0;
  font-size: 1.2rem; 
}

.btn-coffee:hover {
  background-color: #f0c808;
  border-color: #f0c808;
  transform: scale(1.02);
  color: #000000;
}

.btn-coffee span {  display: inline; }

.welcome-footer {
    text-align: center;
    margin-top: 4rem; /* Espacio para separarlo del contenido principal */
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb; /* Una línea divisoria sutil */

     max-width: 500px;      /* Le damos el mismo ancho máximo que los párrafos */
    margin-left: auto;     /* Centramos el contenedor en la página */
    margin-right: auto;    /* Centramos el contenedor en la página */
}

.welcome-footer .footer-logo {
    height: 70px; /* Tamaño del logo */
    width: auto;
    margin-bottom: 0rem;
}

.welcome-footer .copyright-text {
    font-size: 0.8rem;
    color: #9ca3af; /* Un color gris claro */
    margin: 0.25rem 0;
}

.footer-links {
    margin-top: 1.5rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.social-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem; /* Espacio extra arriba */
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb; /* Línea divisoria sutil */
    width: 100%;
}

.social-link {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-family);
    color: #66558a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: #662d91;

}

#deck-instructions-button {
text-decoration: none;
transition: transform 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
border-color: #4b5563;
color: #4b5563;
}


#deck-instructions-button:hover {
border-color: #4b5563;
color: #4b5563;
}

#deck-instructions-button:hover {
transform: scale(1.1);
}

.social-share-buttons-container {
  display: flex;
  flex-direction: column; /* Apila los botones verticalmente */
  gap: 0.75rem;           /* Espacio entre cada botón */
  margin-top: 1.5rem;     /* Espacio para separarlo del texto del modal */
}

/* Estilo base común para todos los botones de redes */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  transition: background-color 0.2s ease-in-out;
}

/* Estilo para los íconos dentro de los botones */
.btn-social i {
  font-size: 1.2rem;
  margin-right: 0.75rem; /* Espacio entre el ícono y el texto */
}

/* --- Colores específicos para cada red social --- */

/* Facebook */
.btn-social-facebook {
  background-color: #1877F2;
}
.btn-social-facebook:hover {
  background-color: #166fe5;
}

/* X (Twitter) */
.btn-social-x {
  background-color: #000000;
}
.btn-social-x:hover {
  background-color: #262626;
}

/* WhatsApp */
.btn-social-whatsapp {
  background-color: #25D366;
}
.btn-social-whatsapp:hover {
  background-color: #1ebe59;
}

#share-confirm-modal .modal-content p{
  text-align: center;
}
/* ======================================================= */
/* 4. COMPONENTES ESPECÍFICOS                              */
/* ======================================================= */

/* --- Componentes del Juego (Puntaje, Timer, Corazones, etc.) --- */
#header-score-board {
  width: 100%;
}

#header-score-board .score-group {
   display: flex;
  justify-content: center; /* Centra los dos elementos en el medio */
  gap: 0.75rem;            /* Define un espacio pequeño entre "Record" y "Aciertos" */
  width: 100%;
  align-items: center;
}

/* Ajusta el color y tamaño para que sea legible en la cabecera */
#header-score-board .score-item-max,
#header-score-board .score-item-current {
  color: #ffffff; /* Color de texto blanco */
  font-size: 1rem;
  font-weight: 400;
}
.score-board { display: flex; gap: 1rem; align-items: center; width: 100%; justify-content: space-between; }
.score-group { display: flex; gap: 1rem; align-items: center; }
.score-item-max { font-size: 1rem; color: #6b7280; }
.score-item-current { position: relative; font-size: 1rem; font-weight: 500; }

.timer-container { margin-bottom: 0.75rem; }
.timer-bar-background { width: 100%; border-radius: 9999px; height: 0.5rem; overflow: hidden; } /*solo es la barra del tiempo*/
.timer-bar { height: 100%; background-color: var(--timer-color); border-radius: 9999px; transition: width 0.1s linear, background-color 0.3s ease; }
.time-text { display: flex; align-items: center; justify-content: flex-start; font-size: 1.25rem; margin-top: 0.5rem; color: var(--timer-color); gap: 0.25rem; transition: color 0.3s ease; }
.time-text span { font-family: 'Fredoka'; font-weight: 500; font-size: 1.6rem; color: inherit; min-width: 1.2em; text-align: center; }


.timer-container.time-warning .time-text {color: var(--warning-color); }
.timer-container.time-warning .timer-bar { background-color: var(--warning-color); }
.timer-container.time-danger .time-text {color: var(--error-color); }
.timer-container.time-danger .timer-bar {background-color: var(--error-color); }


.feedback-container { min-height: 2.5rem; display: flex; align-items: center; justify-content: center; margin-top: 0.75rem; }
.feedback-incorrect { color: var(--error-color); font-weight: 500; font-size: clamp(1.5rem, 5vw, 1.875rem); animation: pop-in 0.4s ease-out forwards; }
.feedback-correct { color: var(--success-color); font-weight: 500; font-size: clamp(1.5rem, 5vw, 1.875rem); animation: pop-in 0.4s ease-out forwards; }

.game-helpers-container { display: flex; justify-content: space-between; margin-top: 0.5rem; width: 100%; }
.hearts-container { display: flex; justify-content: flex-start; gap: 1rem; font-size: 1.75rem; align-items: center; height: 40px; }
.heart-full { color: var(--heart-color); cursor: pointer; transition: transform 0.2s ease; }
.heart-full:hover { transform: scale(1.2); }
.heart-empty { color: var(--heart-empty-color); }
.heart-container-stacked { display: grid; place-items: center; }
.heart-container-stacked > i { grid-area: 1 / 1; }
.heart-background-layer { color: var(--heart-empty-color); }
.heart-fill-layer { color: var(--heart-color); clip-path: inset(0 0 0 0); transition: clip-path 0.2s ease-in-out; }



.jokers-container {
    position: relative; /* Necesario para el posicionamiento de los botones */
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 40px;
}
#joker-fifty-fifty, #joker-reveal-answer {
    position: relative; /* Cambiamos a relative */
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    z-index: 2; /* Por defecto, el 50/50 está encima */
}

/* Clase que activa la animación de deslizamiento */
#joker-fifty-fifty.slide-behind {
    transform: translateX(45px); /* Lo mueve a la derecha */
    opacity: 0;
    z-index: 1; /* Lo pone detrás del otro comodín */
}


.joker-button { width: 40px; height: 40px; object-fit: cover; padding: 0; background-color: transparent; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease-out; }
.joker-button:not(.joker-used):hover { transform: scale(1.15); }
.joker-button.joker-used { cursor: not-allowed; pointer-events: none; }
.joker-button.joker-disabled {
    filter: grayscale(100%);
    opacity: 0.5;
    cursor: not-allowed;
}
#joker-fifty-fifty.joker-used { opacity: 0; }
#joker-reveal-answer.joker-used { opacity: 1; }
.jokers-container.jokers-blocked .joker-button { pointer-events: none; }

/* --- Selección de Mazos --- */
#deck-selection-container { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.deck-item { position: relative; border-radius: 12px; overflow: hidden; color: white; box-shadow: 0 4px 8px rgba(0,0,0,0.2); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; border: 4px solid transparent; }
.deck-item:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.25); }
.deck-item-background { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.deck-type-a { grid-column: 1 / -1; height: 200px; padding: 0; }
.deck-type-b { grid-column: 1 / -1; height: 100px; }
.deck-type-c { grid-column: span 1; height: 100px; }
.deck-item-locked { cursor: not-allowed; }
.deck-item-locked .deck-item-background { filter: grayscale(80%) blur(2px); transition: filter 0.3s ease; }
.deck-item-overlay-locked {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); color: white;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 5; text-align: center;
}
.deck-item-overlay-locked .fa-lock { font-size: 2.5rem; margin-bottom: 0.5rem; }
.deck-item-overlay-locked span { font-size: 1rem; font-weight: 600; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.deck-item .deck-item-title {
    position: absolute; left: 0; right: 0; z-index: 3; color: white;
    font-size: 1.1rem; font-weight: 500; text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none; text-transform: uppercase;
}
.deck-item.deck-type-b .deck-item-title { top: 50%; transform: translateY(-50%); left: 35px; padding: 0.75rem 0; text-align: left; width: 70%;}
.deck-item:not(.deck-type-b) .deck-item-title { top: 0; padding: 0.75rem; }


/* --- ESTILOS PARA EL BUSCADOR DE MAZOS CON ICONO --- */
.search-input-container {
    position: relative; /* Clave para posicionar el ícono */
    width: 100%;
    
    /* Movemos los márgenes del input a su contenedor */
    margin-top: 1.5rem; 
    margin-bottom: 1.5rem;
}

.search-input-container .fa-magnifying-glass {
    position: absolute; /* Posicionamiento "flotante" */
    top: 50%;
    transform: translateY(-50%); /* Centrado vertical perfecto */
    left: 1rem; /* 16px de espacio desde la izquierda */
    font-size: 1rem;
    color: #9ca3af; /* Un color gris sutil, como el del placeholder */
    pointer-events: none; /* Evita que el ícono bloquee el clic al input */
    z-index: 2; /* Nos aseguramos que esté por encima del input (si fuera necesario) */
}
/* --- Estilos para la Nueva Selección de Mazos --- */

.deck-search-input {
    width: 100%;
    /* Cambiamos el padding:
      - 0.75rem (arriba/abajo)
      - 1rem (derecha)
      - 2.8rem (izquierda, para hacer espacio a la lupa)
    */
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    
    /* Quitamos los márgenes, ya que ahora están en .search-input-container */
    margin-top: 0; 
    margin-bottom: 0;
    
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.deck-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.deck-cards-container {
    width: 100%;
    display: grid;
    /* Columnas auto-ajustables, mínimo 120px de ancho */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 1rem; /* Espacio entre tarjetas */
    margin-bottom: 1.5rem; /* Espacio antes del pie */
}

/* Estilo BÁSICO para las futuras tarjetas (luego lo detallaremos) */
.deck-card-item {
    aspect-ratio: 2 / 3; /* Proporción vertical */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb; /* Color de fondo provisional */
    display: flex; /* Para centrar contenido si lo hubiera */
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative; /* Necesario para el indicador de nuevas preguntas */
    overflow: hidden; /* Para que el indicador no se salga */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.deck-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);

}


.no-results-message {
    text-align: center;
    color: #6b7280;
    padding: 1rem;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.no-results-message p {
    margin: 0 0 1rem 0; /* Espacio entre el texto y el botón */
}

/* Oculta el mensaje por defecto */
.no-results-message.hidden {
    display: none;
}



/* --- Pantallas de Fin de Juego y Continuar --- */
.game-over-card, .continue-image-area {
    width: 100%; border-radius: 16px; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); background-color: white;
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; justify-content: center;
    box-sizing: border-box; align-items: center;
}
.game-over-card { min-height: 480px; padding: 1rem 1.5rem 3rem 1.5rem; background: rgba(255, 255, 255, 0.2) !important; backdrop-filter: blur(2px); z-index: 1; }
.game-over-content-wrapper { width: 100%; text-align: center; position: relative; z-index: 2; }
.card-title-gameover, .final-score-number { font-family: 'Titan One'; font-size: 2rem; color: #20bca4; margin-bottom: 0; }
.final-score-number-pts { font-family: 'Titan One'; font-size: 1.5rem; color: #20bca4; }
.final-score-text, .final-score-text-vidas { font-size: 1rem; color:#292929; padding: 0 1rem; }
.final-score-text { padding-bottom: 2rem; }
.final-score-text-vidas { padding-bottom: 1rem; }
.final-score-image { width: 200px; height: auto; }
.game-over-buttons-container { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1.5rem; z-index: 2; }

#continue-game-modal .modal-content { background-color: transparent; padding: 0; box-shadow: none; max-width: 380px; width: 100%;  z-index: 10000;}
#continue-game-modal {
    z-index: 10000; /* Un valor más alto que el overlay de bloqueo (9999) */
}
.continue-image-area { min-height: 250px; justify-content: flex-start; gap: 1rem; padding: 3rem 1.5rem 1.5rem 1.5rem; }
.continue-score-wrapper { text-align: center; color: white; }
.continue-score-text { font-family: 'Fredoka'; font-size: 1rem; font-weight: 100; color : var(--text-color); }
.continue-final-score { font-family: 'Fredoka'; font-size: 4rem; font-weight: 500; line-height: 1; margin: 0; color: #000; }
.continue-final-score::after { content: ' pts.'; font-family: 'Fredoka'; font-size: 2rem; font-weight: 400; color: var(--text-color); margin-left: 0.25em; vertical-align: middle; text-shadow: none; }
.continue-buttons-container { width: 100%; display: flex; gap: 1rem; z-index: 2; }
.modal-overlay-icon { position: absolute; top: -50px; left: 50%; transform: translate(-50%, -50%); z-index: 5; width: 100%; height: auto; }

/* --- Ranking (Leaderboard) --- */
#leaderboard-modal .modal-content h2 { margin-bottom: 1rem; }
#leaderboard-title-image { height: 200px; width: auto; display: block; margin: 0 auto; }
#leaderboard-list { list-style-type: none; padding-left: 0; margin-top: 1.5rem; }
#leaderboard-list li { display: flex; justify-content: space-between; padding: 0.75rem 0.5rem; border-radius: 6px; font-size: 1.1rem; margin-bottom: 0.5rem; }
#leaderboard-list li:nth-child(odd) { background-color: #f0f4f8; }
#leaderboard-list li:nth-child(1)::before { content: '🥇'; margin-right: 1rem; }
#leaderboard-list li:nth-child(2)::before { content: '🥈'; margin-right: 1rem; }
#leaderboard-list li:nth-child(3)::before { content: '🥉'; margin-right: 1rem; }
.leaderboard-name { font-weight: 400; }
.leaderboard-score { font-weight: 400; color: var(--primary-color); }

/* --- Instrucciones --- */
.instructions-card { text-align: left; }
.instructions-card h3 { text-align: center; margin-top: 0; margin-bottom: 1.5rem; font-weight: 400; display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: #6f1c9e; }
.instructions-list { margin-top: 1rem; }
.instruction-item { display: flex; align-items: center; margin-bottom: 1.25rem; }
.instruction-item:last-child { margin-bottom: 0; }
.instruction-item img { width: 50px; height: 50px; margin-right: 1rem; flex-shrink: 0; border-radius: 8px; }
.instruction-item p { margin: 0; line-height: 1.5; color: var(--text-color); }
.instruction-item p strong { color: #000; font-weight: 500; }

/* --- Menú "Más" --- */
.more-menu-list { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.85rem 1.25rem; }
.more-menu-item {
    display: flex; align-items: center; padding: 1rem; background-color: var(--card-background);
    border-radius: 8px; text-decoration: none; color: var(--text-color);
    font-size: 1rem; font-weight: 300; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.more-menu-item:hover { transform: scale(1.02); background-color: #f8fafc; }
.more-menu-item i:first-child { font-size: 1.2rem; color: #662d91; margin-right: 1rem; width: 20px; text-align: center; }
.more-menu-item span { flex-grow: 1; }
.more-menu-item .fa-chevron-right { color: #cbd5e1; }

/* --- Formularios --- */
#contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; color: var(--text-color); }
.form-input, .form-textarea {
    width: 100%; padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 1rem; font-family: var(--font-family); box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3); }
.form-textarea { resize: vertical; }
.form-submit { margin-top: 1rem; }

#player-name-input {
  width: 100%;
  box-sizing: border-box; /* Importante para que el padding no desborde el ancho */
  padding: 0.85rem;
  margin: 1.5rem 0; /* Espacio vertical para separarlo del texto y botones */
  border: 2px solid #e5e7eb; /* Borde un poco más grueso y sutil */
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1.2rem; /* Texto más grande para que sea fácil de leer */
  text-align: center; /* Centra el texto del placeholder y el que se escribe */
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Estilo para el texto del placeholder */
#player-name-input::placeholder {
  color: #9ca3af;
}

/* Estilo cuando el campo está seleccionado (en foco) */
#player-name-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}


/* --- Títulos y Párrafos de Páginas de Información --- */
#info-page-content h1 { font-family: 'Fredoka', sans-serif; font-size: 1.6rem; font-weight: 400; color: #4b1e6e; text-align: left; margin-bottom: 1.5rem; line-height: 1.2; }
#info-page-content h2 { font-family: 'Fredoka', sans-serif; font-size: 1.2rem; font-weight: 400; color: var(--text-color); margin-top: 2rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; }
#info-page-content h3 { font-family: 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 300; margin-top: 1.5rem; margin-bottom: 0.5rem; }
#info-page-content p { font-size: 1rem; line-height: 1.6; color: #334155; }

/* --- Ruleta (anteriormente roulette.css) --- */
.roulette-wrapper {
    background-image: url('images/roulette/bg_ruleta.jpeg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    padding: 20px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex; justify-content: space-around; align-items: center;
    width: 100%; height: 100%; box-sizing: border-box; gap: 20px;
}
.title-section { flex: 1; text-align: center; padding: 10px; }
.title-section h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); color: #2c3e50; margin: 0 0 15px 0; }
.roulette-section { flex: 1.2; display: flex; justify-content: center; align-items: center; }
.roulette-container { position: relative; width: 300px; height: 300px; }
.roulette-wheel { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 15px rgba(0,0,0,0.1); }
.wedge {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    clip-path: polygon(50% 50%, 100% 29.3%, 100% 70.7%);
    transform-origin: center; transform: rotate(var(--r)) scale(var(--s, 1));
    transition: transform 0.4s cubic-bezier(0.5, 1.5, 0.5, 1);
}
.section-name { position: absolute; top: 50%; left: 50%; transform: translate(35px, -50%); width: 100px; text-align: center; font-weight: bold; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.6); font-size: 1.1em; }
.wedge:nth-of-type(1) { --r: 22.5deg; background-color: #701f9e; }
.wedge:nth-of-type(2) { --r: 67.5deg; background-color: #f04fac; }
.wedge:nth-of-type(3) { --r: 112.5deg; background-color: #c9232b; }
.wedge:nth-of-type(4) { --r: 157.5deg; background-color: #f58f01; }
.wedge:nth-of-type(5) { --r: 202.5deg; background-color: #f1d334; }
.wedge:nth-of-type(6) { --r: 247.5deg; background-color: #18bf5f; }
.wedge:nth-of-type(7) { --r: 292.5deg; background-color: #0e6cc4; }
.wedge:nth-of-type(8) { --r: 337.5deg; background-color: #00b7b2; }
.wedge.highlighted { --s: 1.1; filter: brightness(1.2); z-index: 10; }
.center-circle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; background-color: white; border-radius: 50%; border: 4px solid #515151; z-index: 5; }
.indicator { position: absolute; width: 0; height: 0; top: 50%; left: -20px; transform: translateY(-50%); border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-right: 20px solid #515151; z-index: 6; }
.rotatable-img { display: inline-block; width: 50px; height: 50px; transform: rotate(var(--icon-rotation)) translateY(-15px) translateX(0px); object-fit: contain; }
.play-button-minimal {
    display: inline-flex; align-items: center; gap: 8px; font-size: clamp(0.9rem, 3vw, 1.1rem);
    font-weight: bold; color: #2c3e50; cursor: pointer; transition: transform 0.3s ease;
    user-select: none; border: 2px solid #2c3e50; padding: 8px 16px;
    border-radius: 25px; background-color: rgba(255, 255, 255, 0.7);
}
.play-button-minimal:hover { transform: scale(1.1); }

/* ======================================================= */
/* 5. ANIMACIONES Y EFECTOS                                */
/* ======================================================= */

/* --- Animaciones de Carga --- */
.loading-crown-container { position: relative; font-size: 60px; margin-top: 1.5rem; }
.crown-outline, .crown-fill { position: absolute; top: 0; left: 0; transform: translate(-50%, -50%); }
.crown-outline { color: transparent; -webkit-text-stroke: 2px white; text-stroke: 2px white; z-index: 10; }
.crown-fill { color: #fff; animation: fill-up 2.5s ease-in-out forwards; }
@keyframes fill-up {
    from { clip-path: inset(100% 0 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

/* --- Transiciones de Tarjetas y Paneles --- */
@keyframes slide-out-left { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-120%); opacity: 0; } }
@keyframes slide-in-right { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.card-transition-out { animation: slide-out-left 0.5s forwards ease-in-out; }
.card-transition-in { animation: slide-in-right 0.5s forwards ease-in-out; }

@keyframes panel-fade-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.98); } }
@keyframes panel-fade-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.panel-fade-out { animation: panel-fade-out 0.3s ease-in-out forwards; }
.panel-fade-in { animation: panel-fade-in 0.3s ease-in-out forwards; }

/* --- Animaciones de Feedback en Pantalla --- */
#animation-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; display: flex;
    justify-content: center; align-items: center; overflow: hidden;
}
@keyframes score-plus-one-center { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(1.5) translateY(-80px); } }
.score-plus-one-effect { position: absolute; font-size: 7rem; font-weight: 500; color: var(--success-color); animation: score-plus-one-center 1s ease-out forwards; text-shadow: 2px 2px 5px rgba(0,0,0,0.25); }
@keyframes full-heart-effect { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1) translateY(-100px); opacity: 0; } }
.full-heart-animation-effect { position: absolute; font-size: 8rem; color: var(--heart-color); text-shadow: 0 0 15px rgba(239, 68, 68, 0.5); animation: full-heart-effect 1.5s forwards; }
@keyframes plus-ten-seconds-effect { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(1.5) translateY(-80px); } }
.plus-ten-seconds-effect { position: absolute; font-size: 7rem; font-weight: 500; color: var(--primary-color); animation: plus-ten-seconds-effect 1.2s ease-out forwards; text-shadow: 2px 2px 5px rgba(0,0,0,0.2); }
@keyframes break-heart-left-animation { 0% { transform: translateX(0) rotate(0deg) scale(0.7); opacity: 0; } 50% { transform: translateX(-20px) rotate(-15deg) scale(0.9); opacity: 0.5; } 100% { transform: translateX(-40px) rotate(-30deg) scale(0.8); opacity: 0; } }
@keyframes break-heart-right-animation { 0% { transform: translateX(0) rotate(0deg) scale(0.7); opacity: 0; } 50% { transform: translateX(20px) rotate(15deg) scale(0.9); opacity: 0.5; } 100% { transform: translateX(40px) rotate(30deg) scale(0.8); opacity: 0; } }
.broken-heart-part { position: absolute; font-size: 6rem; color: var(--heart-color); text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); opacity: 0; }
.broken-heart-part.left { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); animation: break-heart-left-animation 1s ease-out forwards; }
.broken-heart-part.right { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); animation: break-heart-right-animation 1s ease-out forwards; }
@keyframes heart-lose-life-flash { 0% { transform: scale(1); } 25% { transform: scale(1.2); color: #ff0000; text-shadow: 0 0 10px #ff0000; } 50% { transform: scale(1); } 75% { transform: scale(1.2); color: #ff0000; text-shadow: 0 0 10px #ff0000; } 100% { transform: scale(1); color: var(--heart-empty-color); text-shadow: none; } }
.heart-lose-animation { animation: heart-lose-life-flash 0.7s ease-out forwards; }
@keyframes heartbeat { 0% { transform: scale(1); } 30% { transform: scale(1.5); } 50% { transform: scale(1); } 100% { transform: scale(1); } }
#time-left span.heartbeat-animation { animation: heartbeat 0.7s ease-out; }
@keyframes pop-in { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.pop-in-animation { animation: pop-in-animation 0.3s ease-out forwards; }
@keyframes pop-in-animation { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* --- Animación del Contador 3-2-1 --- */
#countdown-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(29, 41, 59, 0.8); display: flex;
    justify-content: center; align-items: center; z-index: 10000;
}
#countdown-text {
    font-family: 'Titan One'; font-size: clamp(8rem, 30vw, 15rem); color: white;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.3), 0 0 10px rgba(0, 0, 0, 0.5);
    transform: scale(0.5); opacity: 0;
}
#countdown-text.pop { animation: countdown-pop 0.9s ease-in-out; }
@keyframes countdown-pop {
    0% { transform: scale(0.5); opacity: 0; }
    40% { transform: scale(1.1); opacity: 1; }
    60% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* --- Animación de Ruleta --- */
@keyframes rotateLeft { 0% { transform: translate(-50%, -50%) rotate(0deg); } 30%  { transform: translate(-50%, -50%) rotate(-10deg); } 100% { transform: translate(-50%, -50%) rotate(0deg); } }
@keyframes rotateRight { 0% { transform: translate(-50%, -50%) rotate(0deg); } 30%  { transform: translate(-50%, -50%) rotate(10deg); } 100% { transform: translate(-50%, -50%) rotate(0deg); } }
.center-circle.rotate-left { animation: rotateLeft 0.5s ease; }
.center-circle.rotate-right { animation: rotateRight 0.5s ease; }

/* --- Animación Icono Top 10 --- */
.top-10-icon {
    color: #f59e0b; font-size: 1.4rem; cursor: pointer;
    text-shadow: 0 0 7px rgba(245, 158, 11, 0.5);
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease; animation: pulse-gold 2s infinite ease-in-out;
}
@keyframes pulse-gold { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* --- Efectos de Partículas (tsParticles) --- */
#rainCanvas {
  position: fixed; top: 0 !important; left: 0 !important; width: 100vw !important;
  height: 100vh !important; z-index: 2147483647 !important; pointer-events: none !important;
  background: transparent !important;
}
/* La regla !important es a menudo necesaria para sobreescribir estilos inyectados por librerías como tsParticles */
#rainCanvas canvas {
  width: 100% !important; height: 100% !important; pointer-events: none !important;
  background: transparent !important;
}


/* --- Animación para Diente Dorado (AÑADIR ESTO) --- */
@keyframes golden-crown-fly-effect {
  /* El diente aparece en el centro y late */
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  /* El diente vuela hacia la esquina superior derecha y desaparece */
  100% {
    transform: translate(calc(50vw - 50%), calc(-50vh + 50%)) scale(0.5);
    opacity: 0;
  }
}

.golden-crown-effect {
  /* Posición inicial en el centro del overlay */
  position: absolute;

  /* Estilo visual del diente */
  font-size: 8rem;
  color: #f59e0b;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.7); /* Efecto de brillo */

  /* Aplicamos la animación */
  animation: golden-crown-fly-effect 1.8s forwards ease-in-out;
}

/* 1. Preparamos el contenedor del modal */
#top-10-info-modal .modal-content {
    position: relative;
    padding-top: 4rem;
    text-align: center;
    overflow: visible;
}

/* 2. Estilos para el icono del diente */
#top-10-info-modal .fa-crown{
    /* --- Posicionamiento --- */
    position: absolute;
    top: 0; /* Lo alinea con el borde superior del modal-content */
    left: 50%; /* Lo centra horizontalmente */
    transform: translate(-50%, -50%); /* Lo mueve hacia arriba y a la izquierda para un centrado perfecto */

    /* --- Estilos del círculo --- */
    background-color: #662d91; /* El color de fondo que pediste */
    border-radius: 50%; /* Esto lo convierte en un círculo */
    width: 80px;  /* Ancho del círculo */
    height: 80px; /* Alto del círculo */
    border: 4px solid white; /* Un borde blanco para que destaque */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Sombra para darle profundidad */

    /* --- Estilos para centrar el icono DENTRO del círculo --- */
    display: flex;
    align-items: center;
    justify-content: center;

    /* --- Estilos del icono en sí --- */
    font-size: 2.5rem; /* Tamaño del diente */
    color: #f59e0b;    /* Color dorado del diente */
    
    animation: pulse-gold-info 1.5s infinite;
}


/* ======================================================= */
/* 6. CLASES DE UTILIDAD Y MEDIA QUERIES                   */
/* ======================================================= */
.hidden { display: none !important; }
.font-bold { font-weight: 400; font-size: 1.2rem; }

/* Media Query para mejorar la legibilidad del ranking en móviles */
@media (max-width: 480px) {
    #leaderboard-list li {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
    }
    .leaderboard-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
    }
    #leaderboard-list li:nth-child(1)::before,
    #leaderboard-list li:nth-child(2)::before,
    #leaderboard-list li:nth-child(3)::before {
        margin-right: 0.5rem;
    }
}



/* ======================================================= */
/* PREGUNTAS TIPO TRUE OR FALSE                            */
/* ======================================================= */

.true-false-container {
    margin-top: 0rem;
    width: 100%;
}

/* Contenedor principal del toggle que actúa como pista */
.tf-slider {
    position: relative;
    width: 100%;
    height: 50px;
    background-color: #e9e9eb; /* Gris claro por defecto */
    border-radius: 25px; /* Totalmente redondeado */
    display: flex; /* Para alinear el texto de dentro */
    align-items: center;
    cursor: pointer;
    transition: background-color 0.4s ease;
    overflow: hidden; /* Oculta lo que se salga de los bordes redondeados */
}
/* --- NUEVOS ESTADOS DE COLOR PARA EL TOGGLE --- */
.tf-slider.true-state {
  background-color: #34c759; /* Verde para Verdadero */
}

.tf-slider.false-state {
  background-color: #ef4444; /* Rojo para Falso */
}

/* Manija o círculo deslizante */
.tf-thumb {
    position: absolute;
    top: 4px;
    left: calc(50% - 21px); /* Posición inicial al centro */
    width: 42px;  /* Ancho fijo para que sea un círculo */
    height: 42px; /* Alto igual al ancho */
    background-color: white;
    border-radius: 50%; /* Círculo perfecto */
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1); /* Transición suave */
    z-index: 2;
    cursor: grab;
}
.tf-thumb:active {
    cursor: grabbing;
}

/* Etiquetas de texto DENTRO del toggle */
.tf-label-false, .tf-label-true {
    flex: 1;
    text-align: center;
    font-weight: 400;
    font-size: 1.3rem;
    color: #6b7280; /* Color gris por defecto */
    z-index: 3;
    pointer-events: none;
    transition: color 0.3s ease, opacity 0.3s ease; /* Transición suave */
    user-select: none;
}

/* --- ESTADOS ACTIVOS --- */

/* Cuando se elige "Verdadero" */
.tf-slider.active {
    background-color: #34c759; /* La pista se pone verde */
}
.tf-slider.active .tf-thumb {
    left: calc(100% - 42px - 4px); /* Ancho total - ancho del círculo - margen derecho */
}
.tf-slider.active .tf-label-true {
    color: white; /* El texto "Verdadero" se pone blanco */
}

.tf-slider.true-state .tf-label-true {
  color: white; /* El texto "Verdadero" se pone blanco */
}
.tf-slider.true-state .tf-label-false {
  opacity: 0;   /* El texto "Falso" se oculta */
}



.tf-slider.false-state .tf-label-false {
  color: white;
}
.tf-slider.false-state .tf-label-true {
  opacity: 0;   /* El texto "Verdadero" se oculta */
}

/* Ocultamos el ícono de emoción que ya no usaremos */
.tf-feedback-icon {
    font-size: 3.5rem;
    transition: transform 0.3s ease; 
}

.tf-feedback-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem; /* Espacio entre los textos y el emoticón */
  margin-bottom: 1rem; /* Espacio antes del toggle */
  margin-top: 0px;
}

.tf-feedback-text-left,
.tf-feedback-text-right {
  font-size: 1.1rem;
  font-weight: 500;
  color: #9ca3af;
  
  /* --- AÑADE ESTAS LÍNEAS --- */
  opacity: 0; /* Ocultos por defecto */
  transition: opacity 0.3s ease; /* Transición suave */
}

/* Nueva clase para hacerlos visibles */
.tf-feedback-text-left.visible,
.tf-feedback-text-right.visible {
    opacity: 1;
}


/* ======================================================= */
/* PREGUNTAS ESTILO ABIERTAS                               */
/* ======================================================= */

.open-answer-container {
    width: 100%;
    margin-top: 0rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.open-answer-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--font-family);
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.open-answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}


/* ======================================================= */
/* PREGUNTAS ESTILO AUDIO                                  */
/* ======================================================= */
/* --- Estilos para Preguntas de Audio --- */

#card-media-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.character-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.text-bubble {
    position: relative;
    flex-grow: 1;
    background-color: #eef2f9;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Crea el "pico" del globo de texto */
.text-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #eef2f9;
}

.speaker-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.speaker-icon:hover {
    transform: scale(1.1);
}

.speaker-icon.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    transform: scale(1);
}

/* ======================================================= */
/* PREGUNTAS ESTILO RELACION                               */
/* ======================================================= */
/* --- Estilos para Preguntas de Relacionar Elementos --- */
.matching-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.matching-column {
    background-color: #f9fafb; 
    width: 48%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.matching-item {
    width: 100%;
    height: 120px;
    border: 3px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.matching-item .item-text {
    background-color: transparent;
    color: #1f2937;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
    position: relative; 
    z-index: 2;  
}

.matching-item .matching-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* <-- ESTA ES LA CLAVE: adapta la imagen */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* Se asegura de que la imagen esté detrás del texto */
}

/* --- Estados Visuales --- */
.matching-item.selected {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.matching-item.correct {
    border-color: var(--success-color);
    background-color: rgba(34, 197, 94, 0.2);
    cursor: not-allowed;
    opacity: 0.7;
}

.matching-item.incorrect {
    animation: flash-red 0.5s ease;
}

@keyframes flash-red {
    0%, 100% { border-color: var(--primary-color); transform: scale(1.05);  background-color: transparent;}
    50% { border-color: var(--error-color); transform: scale(1.1); background-color: rgba(239, 68, 68, 0.2);}
}

/* ======================================================= */
/* PREGUNTAS ESTILO RESPUESTA CON IMAGEN                   */
/* ======================================================= */
/* --- Estilos para Preguntas con Respuestas de Imagen --- */
.image-answer-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Crea una cuadrícula de 2x2 */
    gap: 0.75rem;

}

.image-answer-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* Hace que los elementos sean cuadrados */
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden; /* Asegura que los efectos no se salgan */
}

.image-answer-item:hover {
    transform: scale(1.03);
}

/* --- Estados Visuales --- */
.image-answer-item.correct,
.image-answer-item.incorrect {
    pointer-events: none; /* Deshabilita clics después de responder */
}

.image-answer-item.correct::after,
.image-answer-item.incorrect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.image-answer-item.correct::after {
    background-color: rgba(34, 197, 94, 0.8); /* Capa verde para la correcta */
    /*border: 4px solid var(--success-color);*/
}

.image-answer-item.incorrect::after {
    background-color: rgba(220, 38, 38, 0.8); /* Capa roja para la incorrecta */
    /*border: 4px solid var(--error-color);*/
}

/*cambio de pantalla modo harcore para gameover*/
.fade-to-black-effect {
    animation: fadeToBlack 0.8s ease-in forwards;
}

@keyframes fadeToBlack {
    from { background-color: rgba(0, 0, 0, 0); }
    to { background-color: rgba(0, 0, 0, 1);  }
}


/* ======================================================= */
/* PREGUNTAS ESTILO RESPUESTA CON IMAGEN pokemon           */
/* ======================================================= */
/* --- Animación para el cambio de imagen en la pregunta --- */
@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-fade-out {
    animation: fade-out 0.25s ease-out forwards;
}

.image-fade-in {
    animation: fade-in 0.4s ease-in forwards;
}



/* --- Estilos para la cabecera del Ranking (leaderboard) --- */

/* Convierte el h2 en un contenedor flexible */
#leaderboard-modal .modal-content h2 {
    display: flex;
    justify-content: space-between; /* Separa los elementos */
    align-items: center;          /* Los alinea verticalmente */
    gap: 1rem;                    /* Espacio entre los elementos */
    margin-bottom: 1rem;          /* Mantiene el margen inferior */
}

/* Estilo para la imagen central */
#leaderboard-modal .modal-content h2 img {
    height: 150px;       /* Un tamaño adecuado para la imagen */
    width: auto;
    flex-shrink: 0;   /* Evita que la imagen se encoja */
}

/* Estilo para los nuevos textos */
.leaderboard-header-text {
    flex: 1; /* Permite que el texto ocupe el espacio sobrante */
    font-size: clamp(0.8rem, 2.5vw, 1rem); /* Tamaño de fuente adaptable */
    font-weight: 500;
    color: #4b5563; /* Un color de texto sobrio */
    line-height: 1.2;
}

/* Alineación específica para cada texto */
#leaderboard-prize-text {
    text-align: left;
}

#leaderboard-date-text {
    text-align: right;
}

/*Icono taza de cafe*/

.app-header .header-content .coffee-icon {
position: absolute; /* Para poder posicionarlo independientemente del flujo */
left: 10px; /* Ajusta la distancia desde la izquierda según necesites */
top: 50%; /* Centra verticalmente */
transform: translateY(-50%);
font-size: 1.5em; /* Ajusta el tamaño del icono si usas Font Awesome */
color: #333; /* Ajusta el color del icono si usas Font Awesome */
}


/* AÑADE ESTOS ESTILOS AL FINAL DE TU ARCHIVO CSS */

/* --- Estilos para el Modal de Donadores (Buy Me a Coffee) --- */

#supporters-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#supporters-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

#supporters-list {
  list-style-type: none;
  padding-left: 0;
  margin-top: 1rem;
  max-height: 45vh; /* Altura máxima para que no sea muy largo */
  overflow-y: auto;   /* Habilita el scroll si la lista es larga */
}

.supporter-item {
  border-bottom: 1px solid #f0f4f8;
}
.supporter-item:last-child {
  border-bottom: none;
}

.supporter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.5rem;
  cursor: pointer;
  user-select: none;
}

.supporter-name {
  font-weight: 500;
  color: var(--text-color);
}

.supporter-arrow {
  font-size: 1rem;
  color: #9ca3af;
  transition: transform 0.3s ease;
}

.supporter-message {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
  background-color: #f8fafc;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0 1rem;
}

/* --- Estilos para el estado activo del acordeón --- */

.supporter-item.active .supporter-arrow {
  transform: rotate(180deg);
}

.supporter-item.active .supporter-message {
  padding: 1rem;
  max-height: 500px; /* Un valor alto para permitir cualquier contenido */
}


.supporters-link {
  display: block;
  margin-top: -0.5rem; /* Reduce el espacio con el título */
  margin-bottom: 1.5rem; /* Aumenta el espacio con el buscador */
  padding: 0.5rem;
  background-color: #f0f4f8; /* Un color de fondo sutil */
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.supporters-link:hover {
  background-color: #e5e7eb;
}


/* Styles for Deck Chooser */
#deck-chooser-container {
    grid-column: 1 / -1; /* Hace que el contenedor ocupe todo el ancho de la grilla */
    width: 100%;
    margin-top: 1.5rem; /* Space below the roulette */
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#deck-select-dropdown {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-family: var(--font-family);
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background-color: white;
    -webkit-appearance: none; /* Removes default browser styling */
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    cursor: pointer;
}

#deck-select-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

#start-selected-deck-button {
    margin-top: 0;
    background-color: var(--tertiary-color); /* <-- Cambio a color verde */
    box-shadow: 0 4px 0 #27ae60; /* <-- Cambio a la sombra verde */
}

#start-selected-deck-button:hover:not(:disabled) {
    background-color: var(--tertiary-hover); /* <-- Cambio al verde oscuro para el hover */
}


/* --- Banner de Contenido Nuevo --- */
#new-content-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #3498db; /* Fondo azul de tu variable --primary-color */
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    
    /* Para la animación */
    opacity: 0;
    transform: translateY(-150%);
    transition: opacity 0.4s ease-out, transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#new-content-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-text {
    flex-grow: 1; /* Ocupa el espacio disponible */
    margin: 0;
    font-weight: 500;
}

.close-button {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-button:hover {
    opacity: 1;
}

/* Ajustes para el contenedor de botones del menú "Más" */
.coffe-links-container {
    display: flex;
    flex-direction: column; /* Apila los botones verticalmente */
    gap: 0.75rem; /* Añade un espacio entre los botones */
    width: 100%;
}

/* Estilo base para los botones en esta sección */
.coffe-links-container .btn-support {
    width: 100%;
    border-radius: 4px; /* <-- VALOR MODIFICADO PARA UN LOOK MÁS RECTANGULAR */
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 500;
    box-sizing: border-box;
}

.coffe-links-container .btn-support span {
    display: inline; /* Asegura que el texto sea visible */
}

.coffe-links-container .btn-support:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Estilo específico para el nuevo botón de sugerencias */
.btn-suggest {
    background-color: #00feff; /* <-- El color cian que pediste */
    color: #333333;            /* <-- Texto oscuro para buena legibilidad */
    border: none;              /* <-- Nos aseguramos de que no tenga borde */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra sutil opcional */
}

/* Efecto al pasar el mouse por encima */
.btn-suggest:hover {
    background-color: #00e0e1; /* Un tono de cian un poco más oscuro */
    color: #333333;
    opacity: 1; /* Quitamos la opacidad del hover anterior */
}

.btn-suggest i {
    color: #333333; /* <-- Color oscuro para el icono también */
}

/* Estilo para el crédito de la pregunta */
#question-credit {
    text-align: center;
    font-size: 1rem;
    color: #9ca3af; /* Un gris sutil de tus variables --timer-color */
    margin-top: 1rem;
    height: 1.2rem; /* Altura fija para evitar saltos en el diseño */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Keyframes para la animación de reducción de tiempo */
@keyframes timeDecreaseEffect {
    0% {
        transform: scale(1);
        color: var(--timer-color);
    }
    50% {
        transform: scale(1.5); /* Lo hacemos un poco más grande para que sea más notorio */
        color: var(--error-color); /* <-- CORRECCIÓN: Usamos --error-color en lugar de --danger-color */
    }
    100% {
        transform: scale(1);
        color: var(--timer-color);
    }
}


/* Clase para aplicar la animación */
.time-decrease-animation {
    animation: timeDecreaseEffect 1s ease-out; /* Duración de 0.5 segundos, easing rápido */
}

#supporters-modal .modal-content h2 {
    margin-top: 2rem;
}


/* ======================================================= */
/* CORRECCIÓN PARA EL ESTADO DESHABILITADO DEL BOTÓN JUGAR */
/* ======================================================= */

#play-button:disabled {
    background-color: #9ca3af; /* Color gris de botón deshabilitado */
    box-shadow: 0 4px 0 #6b7280;   /* Sombra más oscura para el estado inactivo */
    cursor: not-allowed;          /* Cursor de "no permitido" */
    opacity: 0.7;                 /* Un poco de transparencia */
}


/* ======================================================= */
/* ESTILOS PARA MENSAJES DE ERROR DE AUTENTICACIÓN         */
/* ======================================================= */
.auth-error {
    background-color: rgba(220, 38, 38, 0.1); /* Fondo rojo muy suave */
    color: #b91c1c; /* Texto rojo oscuro */
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: none; /* Oculto por defecto */
}

/* ======================================================= */
/* ESTILOS PARA LA NUEVA AUTENTICACIÓN (VERSIÓN CONTENIDO)   */
/* ======================================================= */

#header-auth-actions {
    display: flex;
    width: 100%;
    margin-bottom: 2rem; /* Espacio antes del título "Hola." */
    align-items: center;
    border-bottom: 1px solid #e5e7eb; 
    padding-bottom: 1rem;    
    justify-content: space-between; 
}

#header-auth-actions #header-login-btn {
    margin-left: 0;
    padding-left: 0;
}

.btn-header-auth {
    background: none;
    border: none;
    color: var(--primary-color); /* Color primario para que sea visible */
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    font-family: var(--font-family);
    transition: background-color 0.2s, color 0.2s;
    display: flex; /* Para alinear el ícono y el texto en el botón de logout */
    align-items: center;
    gap: 0.5rem;
}

.btn-header-auth:hover {
    background-color: #eef2f9; /* Un fondo muy sutil al pasar el mouse */
}

#header-logout-btn {
    font-size: 1.2rem;
    color: var(--secondary-color); /* Color rojo para la acción de salir */
}

#header-user-email {
    background-color: #eef2f9;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

#auth-modal .modal-content h2 {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* ======================================================= */
/* ESTILO ESPECIAL PARA EL BOTÓN DE REGISTRO               */
/* ======================================================= */

#header-register-btn {
    background-color: var(--tertiary-color); /* Color verde */
    color: white;
    font-weight: 300;
    padding: 0.5rem 1rem; /* Un poco más de espacio interno */
    border: none;
    box-shadow: 0 2px 0 #27ae60; /* Sombra sutil */
}

#header-register-btn:hover {
    background-color: var(--tertiary-hover); /* Verde más oscuro al pasar el mouse */
    color: white;
}

/* ======================================================= */
/* ESTILO PARA EL INDICADOR DE INVITADO                    */
/* ======================================================= */
.guest-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 01rem;
    font-weight: 400;
    color: #ffffff;
    padding: 0.4rem 0rem;
    border-radius: 6px;
}

.guest-indicator i {
    color: #64748b;
}

/* ======================================================= */
/* CORRECCIÓN PARA VISIBILIDAD DEL TEXTO CERRAR SESIÓN   */
/* ======================================================= */
#header-logout-btn span {
    display: inline;
}

.user-avatar-icon {
    background-color: #662d91;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ======================================================= */
/* ESTILOS PARA EL BOTÓN DE JUGAR COMO INVITADO          */
/* ======================================================= */

#guest-prompt-modal .btn-secondary {
    background-color: #e5e7eb; /* Gris claro */
    color: #4b5563;            /* Gris más oscuro */
    border: 1px solid #d1d5db;  /* Borde sutil */
}

#guest-prompt-modal .btn-secondary:hover {
    background-color: #d1d5db; /* Un gris un poco más oscuro al pasar el mouse */
    color: #374151;
}

/* ======================================================= */
/* ESTILO PARA BOTÓN DE REGISTRO EN MODAL DE INVITADO      */
/* ======================================================= */

#register-from-guest-btn {
    background-color: var(--tertiary-color); /* Color verde, igual al del header */
    box-shadow: 0 2px 0 #27ae60; /* Sombra sutil para consistencia */
    border: none;
}

#register-from-guest-btn:hover {
    background-color: var(--tertiary-hover); /* Verde más oscuro al pasar el mouse */
}


/* ======================================================= */
/* ESTILOS PARA MODAL DE AUTENTICACIÓN (LOGIN/REGISTER)    */
/* ======================================================= */

/* Contenedor principal de los formularios */
#login-form,
#register-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Espacio entre elementos del formulario */
}

/* Títulos de los formularios */
#auth-modal h2 {
    text-align: center;
}

/* Estilo general para los campos de texto del modal */
#auth-modal input[type="email"],
#auth-modal input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 1rem;
}

/* Márgenes inferiores específicos para los inputs */
#login-email, #register-password {
    margin-bottom: 0.5rem;
}
#login-password {
    margin-bottom: 1rem;
}

/* Enlace para cambiar entre login y registro */
#auth-toggle-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}
#auth-toggle-link a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Separador con la letra "o" */
.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}
.auth-separator hr {
    flex: 1;
    border: none;
    border-top: 1px solid #e5e7eb;
}
.auth-separator span {
    padding: 0 1rem;
    color: #9ca3af;
}

/* Botón de Google */
.btn-google {
    background-color: #4285F4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.btn-google:hover {
    background-color: #357ae8;
}
.btn-google i {
    font-size: 1.2rem;
}


/* ======================================================= */
/* ESTILOS PARA BOTONES DE LOGIN/REGISTER EN EL HEADER     */
/* ======================================================= */

.btn-header-welcome {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: var(--font-family);
    transition: background-color 0.2s;
}

.btn-header-welcome:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

#header-register-btn-welcome {
    background-color: var(--tertiary-color);
    border-color: var(--tertiary-color);
}
#header-register-btn-welcome:hover {
    background-color: var(--tertiary-hover);
}

#user-status-indicator {
    margin-left: 0.75rem; /* Espacio para separarlo de la taza */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem; /* Tamaño del icono */
    cursor: default; /* Para que no parezca un botón */
}

/* Estilos para el nuevo logo SVG en el header */
.user-status-logo {
    width: 26px;  /* Ajusta el ancho según tu logo */
    height: 26px; /* Ajusta el alto según tu logo */
    vertical-align: middle; /* Ayuda a alinear con el texto si lo hay */
    padding-top: 4px;
}

/* Ajuste opcional para el contenedor del logo del usuario registrado */
.user-avatar-icon {
    background-color: transparent; /* Quita el fondo de color si no lo quieres */
    border: none; /* Quita el borde si no lo quieres */
    width: auto;
    height: auto;
    padding: 0;
}


/* ======================================================= */
/* ESTILOS PARA LA PÁGINA DE PERFIL (NUEVO)                */
/* ======================================================= */

/* --- Contenedor Principal y Animación --- */
.profile-page-container {
    background-color: #f8fafc; /* Un fondo ligeramente distinto */
    transform: translateY(-100%); /* Estado inicial: oculto abajo */
    transition: transform 0.4s ease-in-out; /* Animación suave */

    z-index: 1200; /* 1. La coloca por encima del menú inferior (que tiene z-index 1100) */
    top: var(--header-height); /* 2. Posiciona su borde superior justo donde termina el header */
    height: calc(100% - var(--header-height)); /* 3. Ajusta su altura al espacio restante */
    padding-top: 0; /* 4. Anula el padding que hereda de .app-page */

    pointer-events: none;
    visibility: hidden; 
    opacity: 0; 
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0s linear 0.4s; 


}
.profile-page-container.active {
    transform: translateY(0); /* Estado visible: en su posición */
    pointer-events: auto;
    visibility: visible; 
    opacity: 1; 
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out; 
}

/* --- Cabecera del Perfil --- */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
}

.profile-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}
.profile-header-btn .fa-xmark {
    font-size: 1.5rem;
}

/* --- Contenido Principal del Perfil --- */
.profile-content {
    padding: 1.5rem;
    overflow-y: auto;
    margin-top: 60px; /* Dejamos espacio para el header fijo */
}

/* --- Sección de Información del Usuario --- */
.profile-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;

}

.profile-picture-container {
    position: relative;
    cursor: pointer;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
#profile-picture-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.profile-picture-overlay {
    position: absolute; /* <-- MUY IMPORTANTE */
    top: 3px;
    left: 3px;
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Para que el overlay sea circular */
    background-color: rgba(0, 0, 0, 0.5); /* Color oscuro semi-transparente */
    display: flex;
    justify-content: center; /* Centra el contenido (texto/icono) horizontalmente */
    align-items: center; /* Centra el contenido (texto/icono) verticalmente */
    opacity: 0; /* Empieza invisible */
    transition: opacity 0.3s ease; /* Transición suave al aparecer */
    cursor: pointer; /* Indica que es clickeable */
    text-align: center; /* Por si hay texto, para que esté centrado */
    color: white; /* Color del texto/icono dentro del overlay */
    font-size: 1.5rem; /* Tamaño del texto/icono dentro del overlay */
    pointer-events: none; /* <-- IMPORTANTE: Permite hacer clic "a través" por defecto */
}
.profile-picture-container:hover .profile-picture-overlay {
    opacity: 1;
}

.profile-user-details h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 500;
}
.profile-user-details span {
    background-color: #e0e7ff;
    color: #4338ca;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Fecha de Unión y Premios --- */
.profile-join-date {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.profile-awards h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

/* ======================================================= */
/* 7. ESTILOS PARA LOGROS (PÁGINA DE PERFIL Y MODAL)      */
/* ======================================================= */

/* --- Cuadrícula en la página de perfil --- */

/* REEMPLAZA los estilos que tenías para .award-item con esto */
.award-item {
    width: 100%;
    aspect-ratio: 3 / 4; /* Para que sean cuadrados */
    border-radius: 12px;
    background-color: #f8fafc; /* Fondo sutil */
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    box-sizing: border-box;
    
    /* Layout para centrar imagen y texto verticalmente */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    transition: all 0.2s ease;
}

/* Estilo para la imagen SVG dentro del logro */
.award-item img {
    width: 80%; 
    height: auto;
    margin-bottom: 0.5rem; /* Espacio antes de la fecha */
}

/* Título del logro (en la tarjeta) */
.award-item .award-title {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 0.5rem; /* Espacio antes de la imagen */
    text-align: center;
    color: var(--text-color);
    line-height: 1.2;

    /* --- LÍNEAS NUEVAS PARA TRUNCAMIENTO --- */
    width: 100%;             
    white-space: nowrap;     
    overflow: hidden;        
    text-overflow: ellipsis; /* Poner los '...' */
}

/* --- Estado Bloqueado --- */
.award-item.locked {
    background-color: #f9fafb;
    cursor: not-allowed;
    opacity: 0.7; /* Le da un aspecto atenuado */
}

/* Título atenuado para el logro bloqueado */
.award-item.locked .award-title {
    color: #6b7280; 
}

/* --- Estado Desbloqueado --- */
.award-item.unlocked {
    cursor: pointer;
    background-color: #ffffff; /* Fondo blanco para destacar */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.award-item.unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Subtítulo (fecha) para el logro desbloqueado */
.award-item.unlocked .award-subtitle {
    font-size: 0.75rem;
    color: #6b7280;/* Color azul primario */
    margin-top: 0.25rem;
    text-align: center;
}


/* --- Estilos para el NUEVO Modal del Logro --- */

#award-modal .modal-content {
    padding: 1rem;
    padding-top: 3.5rem; /* Espacio para los botones de arriba */
    position: relative; /* Clave para los botones */
    text-align: center;
}

/* Cabecera para los botones de cerrar y compartir */
.award-modal-header {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Estilo de los botones (compartir y cerrar) */
.award-modal-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #9ca3af; /* Gris sutil */
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.award-modal-btn:hover {
    color: var(--text-color);
}

/* Hover especial para el botón de compartir */
#award-share-button:hover {
    color: var(--primary-color);
}

/* Contenedor de la imagen SVG grande */
.award-image-container {
    margin-bottom: 1rem;
}

.award-image-container img {
    width: 150px;
    height: 150px;
    max-width: 50vw; /* Límite para pantallas pequeñas */
    max-height: 50vw;
}

/* Título dentro del modal */
#award-modal-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

/* Mensaje de felicitación */
#award-modal-message {
    font-size: 1rem;
    color: #4b5563; /* Gris oscuro para el texto */
    line-height: 1.5;
    margin: 0.75rem 0;
}

/* Fecha "Hace X días" */
#award-modal-time {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color); /* Mismo color que el subtítulo */
}




/* ======================================================= */
/* ESTILOS PARA NOTIFICACIÓN "TOAST" (NUEVO)               */
/* ======================================================= */
.toast {
    position: fixed;
    bottom: 90px; /* Justo encima del menú inferior */
    left: 50%;
    transform: translateX(-50%) translateY(150%); /* Empieza oculto abajo */
    background-color: #323232;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.4s ease-in-out;
}
.toast.show {
    transform: translateX(-50%) translateY(0); /* Lo mueve a su posición visible */
}
.toast.hidden {
    display: none;
}

/* --- Estilos Adicionales para las Tarjetas de Mazos --- */

.deck-card-item {
    background-size: cover;     /* Asegura que la imagen cubra la tarjeta */
    background-position: center;/* Centra la imagen */
    color: white;               /* Color de texto por defecto (para títulos) */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); /* Sombra para legibilidad */
    position: relative; 
    overflow: visible;

}

/* --- Estados de la Tarjeta --- */

.deck-card-item.locked {
    filter: grayscale(90%); /* Pone la imagen en escala de grises */
    cursor: not-allowed;
}

.deck-card-item.in-construction {
    background-color: #333; /* Fondo oscuro */
    cursor: not-allowed;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Overlays (Capas superpuestas) --- */

.deck-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* Para alinear verticalmente si hay más elementos */
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    box-sizing: border-box;
}


.deck-card-overlay.construction {
     background-color: rgba(0, 0, 0, 0.7); /* Ligeramente más oscuro */
}
.deck-card-overlay.title-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 10%, rgba(0,0,0,0) 70%); /* Gradiente para el título */
    justify-content: flex-end; /* Alinea el título abajo */
    align-items: flex-start; /* Alinea el título a la izquierda */
    padding: 0.75rem;
}


/* --- Contenido dentro de los Overlays --- */



.deck-card-overlay.construction i {
    font-size: 3rem; /* Tamaño del candado */
    color: rgba(255, 255, 255, 0.8); /* Color blanco semitransparente */
}

.deck-title {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.2;
    text-align: left; /* Título alineado a la izquierda */
}

/* --- Indicador de Nuevas Preguntas (Estilo Básico) --- */
.new-questions-indicator {
    position: absolute;
    top: -8px; /* Ligeramente fuera para que se vea bien */
    right: -8px;
    background-color: #ff0000; /* Rojo */
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 400;
}
.new-questions-indicator.hidden {
    display: none; /* Oculto por defecto */
}

/* Estilo para el contador de preguntas en la tarjeta */
.deck-question-count {
    font-size: 0.75rem; /* Más pequeño que el título */
    font-weight: 300; /* Más ligero */
    margin-top: 0.2rem; /* Pequeño espacio bajo el título */
    opacity: 0.8; /* Ligeramente transparente */
    display: block; /* Para que ocupe su propia línea */
}

/* Ajuste al overlay del título para dar espacio */
.deck-card-overlay.title-overlay {
    padding-bottom: 0.5rem; /* Un poco más de espacio abajo */
}


/* Estilo específico para el texto bloqueado */
.locked-text {
    /* Flexbox para apilar icono y texto */
    display: flex;
    flex-direction: column; /* Apila verticalmente */
    align-items: center; /* Centra horizontalmente */
    gap: 0.25rem; /* Pequeño espacio entre icono y texto */

    /* Estilo visual */
    font-size: 0.8rem;
    font-weight: 300;
    color: white; /* Color blanco para icono y texto */
    background-color: transparent; /* Sin fondo */
    padding: 0; /* Quitamos el padding anterior */
    border-radius: 0; /* Quitamos el borde redondeado anterior */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Sombra para legibilidad */
    /* Ya no necesita position: absolute */
}

/* Estilo opcional para el icono si necesitas ajustar su tamaño */
.locked-text .fa-lock-open {
    font-size: 1.5rem; /* Ajusta el tamaño del icono si es necesario */
    margin-bottom: 0.1rem; /* Pequeño ajuste de espacio inferior */
}

/* Estilo opcional para la etiqueta de texto */
.locked-text .locked-text-label {
    display: block; /* Asegura que ocupe su propia línea */
}

/* Ajuste al contenedor principal para asegurar espacio */
.deck-card-overlay.locked {
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-bottom: 0.75rem; /* Reducimos un poco el padding inferior si es necesario */
    border-radius: 5px;
}

.welcome-content,
#game-container,
#info-page-content,
#more-menu-content,
.profile-content /* Añadido el contenido del perfil */ {

    /* --- AJUSTE CLAVE --- */
    /* Padding base (ej: 1rem) + altura del menú inferior + espacio seguro */
    padding-bottom: calc(9rem + var(--bottom-menu-height) + env(safe-area-inset-bottom));

    /* Padding superior y laterales (ajusta según tu diseño) */
    padding-top: 1rem; /* O el valor que necesites */
    padding-left: 1rem; /* O el valor que necesites */
    padding-right: 1rem; /* O el valor que necesites */
}


/* ======================================================= */
/* 8. ESTILOS PARA EDICIÓN DE NOMBRE DE PERFIL             */
/* ======================================================= */

.profile-user-details {
    /* Asegura que los contenedores de nombre se apilen correctamente */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinea todo a la izquierda */
    flex-grow: 1;
}

.username-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Oculta el contenedor de edición por defecto */
#username-edit-container.hidden {
    display: none;
}

/* Estilo para el campo de texto */
#username-edit-input {
    flex-grow: 1; /* Ocupa el espacio disponible */
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family);
}
#username-edit-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Estilo para los botones de íconos */
.profile-edit-btn,
.profile-save-btn,
.profile-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.profile-edit-btn:hover { color: var(--primary-color); }
.profile-save-btn { color: var(--success-color); }
.profile-cancel-btn { color: var(--error-color); }



/* ======================================================= */
/* 9. ESTILOS PARA NOMBRE DE DECK EN CUENTA REGRESIVA      */
/* ======================================================= */

#countdown-overlay {
    /* Asegura que los elementos se apilen verticalmente */
   display: flex;             /* Asegura que use Flexbox */
    flex-direction: column;    /* Asegura que apile verticalmente */
    align-items: center;       /* Centra horizontalmente */
    
    justify-content: center; /* Centra verticalmente (opcional) */
    padding-bottom: 5vh;
}

.countdown-deck-label {
    font-family: 'Fredoka', sans-serif; /* Usa la fuente principal */
    font-size: clamp(1.5rem, 5vw, 2.5rem); /* Tamaño adaptable */
    font-weight: 500;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    margin-bottom: 1rem; /* Espacio antes del número */
    display: block; /* Asegura que ocupe su propia línea */
    opacity: 0; /* Empieza oculto */
    transition: opacity 0.3s ease-in; /* Animación suave */
}

/* Cuando el overlay es visible, muestra el texto */
#countdown-overlay:not(.hidden) .countdown-deck-label {
    opacity: 1;
}