/* css/style.css - TEMA "FERIA NARANJA" PRO (MASTER FINAL V10 - PULIDO) */

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Esto evita que la pantalla se mueva a los lados */
}

:root {
  /* Paleta CÁLIDA Y VIVA */
  --primary-bg: #ff6f00;      /* Naranja vibrante base */
  --secondary-bg: #e65100;    /* Naranja rojizo oscuro */
  --text-color: #ffffff;
  
  /* Colores de Acento */
  --rosa-mexicano: #f50057;   
  --amarillo-maiz: #ffea00;   
  --verde-limon: #76ff03;     
  --azul-cielo: #00b0ff;      
  --rojo-fuego: #d50000;      
  
  --glass-bg: rgba(0, 0, 0, 0.75); /* Fondo negro translúcido */
  --border-color: rgba(255, 234, 0, 0.5); 
  --box-shadow-warm: 0 8px 32px 0 rgba(100, 30, 0, 0.5);
}

body {
  margin: 0;
  background: linear-gradient(135deg, #ff9100 0%, #ff3d00 100%);
  background-attachment: fixed; 
  color: var(--text-color);
  font-family: 'Montserrat', 'Segoe UI', sans-serif; 
  min-height: 100vh;
  width: 100%;          
  overflow-x: hidden;   
}

/* --- ANIMACIONES CASCADA --- */
@keyframes slideUpEntry {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dealCard {
    0% { opacity: 0; transform: translateX(50px) scale(0.8) rotate(10deg); }
    80% { transform: translateX(-5px) scale(1.05) rotate(-2deg); }
    100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
}

/* Configuración General de Pantallas */
.pantalla {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  min-height: 100vh;         
  padding: 1rem;
  background: transparent; 
  box-sizing: border-box;
  width: 100%;
}

.pantalla.activa { display: flex; }

/* --- APLICACIÓN DE ANIMACIONES --- */
h1, h2, h3, .historial-container, .menu-acciones {
    animation: slideUpEntry 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0; 
    animation-delay: 0.1s;
}

.cartas-container, #juegoCartas, .sala-box {
    animation: slideUpEntry 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.2s; 
}

#controlesJuego, .sala-botones-row {
    animation: slideUpEntry 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

#panelInferior, #jugadoresLista, #apuestasUI {
    animation: slideUpEntry 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

/* Alineación Superior */
#pantallaMenu, #pantallaSeleccion, #pantallaJuego, #pantallaSala {
    justify-content: flex-start;
    padding-top: 40px; 
    padding-bottom: 30px;
}

/* Títulos */
h1, h2, h3 {
    text-transform: uppercase;
    color: #ffffff !important; 
    text-shadow: 0 4px 6px rgba(0,0,0,0.4); 
    margin-bottom: 15px;
    font-weight: 900; 
    letter-spacing: 1px;
    text-align: center;
}

#pantallaSplash h1 {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-size: 1.5rem; font-weight: 400;
  opacity: 1 !important; 
  animation: none;
}

/* --- CONTENEDORES GENÉRICOS (GLASS) --- */
.auth-container, 
#jugadoresLista, 
#jugadoresListaIngame,
.historial-container {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 20px; border: 2px solid rgba(255, 255, 255, 0.15); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
    padding: 1.5rem;
    color: white; width: 100%; max-width: 400px; margin: 10px auto;
    box-sizing: border-box; text-align: center;
}

/* --- HISTORIAL (HUD) --- */
.historial-container {
    padding: 10px 15px !important; 
    min-height: 110px; 
    max-width: 600px; 
    width: 95%; 
    display: flex;
    align-items: center; 
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 15px;
}

#historial { 
    display: flex; 
    gap: 12px; 
    width: 100%;
    height: 100%;
    align-items: center;
}

#historial img { 
    width: 60px; 
    height: 90px; 
    border-radius: 6px; 
    border: 1px solid rgba(255,255,255,0.4); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.5); 
    flex-shrink: 0;
    animation: dealCard 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

/* --- MENÚ PRINCIPAL --- */
.menu-acciones {
    display: grid; 
    grid-template-columns: 1fr 1fr;
    gap: 20px; 
    width: 100%; max-width: 600px; 
    margin: 20px auto; box-sizing: border-box;
}

.sala-box {
    background: var(--glass-bg); backdrop-filter: blur(12px);
    border-radius: 20px; border: 2px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.3); padding: 1rem;
    color: white; box-sizing: border-box; text-align: center; width: 100%;
}

.menu-card {
    display: flex; flex-direction: column; justify-content: space-between;
    height: 100%; min-height: 250px; transition: transform 0.2s;
}
.menu-card:hover { transform: translateY(-5px); border-color: var(--amarillo-maiz); }

.btn-full { width: 100%; margin: 10px 0 0 0; }

.sala-botones-row {
    display: flex; flex-direction: row; justify-content: center; gap: 15px; 
    width: 100%; max-width: 500px; margin: 20px 0;
}
.sala-botones-row button {
    flex: 1; margin: 0; padding: 1rem 0.5rem; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; white-space: nowrap;
}

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%; padding: 14px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); 
    color: white; font-size: 1rem; box-sizing: border-box; margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}
input:focus { border-color: var(--amarillo-maiz); outline: none; background: rgba(255,255,255,0.2); }
input::placeholder { color: rgba(255,255,255,0.6); }

/* --- GESTIÓN DE CARTAS --- */

.cartas-container, .juego-cartas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding-bottom: 10px;
}

.carta-img {
  border-radius: 10px; cursor: pointer; transition: transform 0.2s ease;
  height: auto; border: 3px solid transparent;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  width: 100%; 
}
.carta-img.seleccionada {
  transform: scale(1.02); border-color: var(--amarillo-maiz);
  box-shadow: 0 0 25px var(--amarillo-maiz); 
}

/* --- FICHA (AJUSTADA TAMAÑO MÓVIL) --- */
.ficha {
  position: absolute;
  /* REDUCIDO A 28% PARA QUE NO DESBORDE */
  width: 28%; 
  max-width: 80px;
  height: auto;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
  z-index: 10;
  cursor: pointer; 
  pointer-events: auto; 
}

/* FICHA EN MODAL VICTORIA (MÁS CHICA) */
#modalVerificationArea .ficha {
    width: 20% !important; 
}

/* TAMAÑOS MÓVIL BASE */
#contenedorCartas .carta-juego, 
#contenedorCartas .carta-img {
    width: 150px; 
    max-width: 45%; 
}

#juegoCartas .carta-juego {
    flex-basis: 45%; 
    max-width: 48%;
    position: relative;
    display: flex; justify-content: center;
}

/* MODAL VICTORIA (MÓVIL) */
#modalVerificationArea {
    width: 100%;
    justify-content: center;
}
#modalVerificationArea .carta-juego {
    flex: 1; 
    position: relative;
    display: flex; 
    justify-content: center;
    min-width: 100px; 
    max-width: 180px; 
}

/* --- BOTONES --- */
button {
  padding: 1rem 1.5rem; font-size: 1rem; margin: 0.5rem;
  border-radius: 50px; border: none; background: var(--rosa-mexicano);
  color: white; cursor: pointer; font-weight: 800; letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.1s, box-shadow 0.1s;
  text-transform: uppercase; font-family: 'Montserrat', sans-serif;
}
button:active { transform: scale(0.95); box-shadow: none; }

button[onclick*="crearSala"], #btnIniciarJuego, #btnApostar, #btnGuardarSet, button[class*="confirmar"], button[onclick*="cargarSet"] {
    background: linear-gradient(to bottom, var(--verde-limon), #64dd17); color: #003300; 
}
button[onclick*="unirseSala"], #btnBarajear, #btnLimpiarCartas {
    background: linear-gradient(to bottom, var(--azul-cielo), #0091ea); color: #002f6c;
}
#btnDetenerJuego, #btnSalirSala, #btnSalirLobby, button[onclick*="cerrarSesion"] {
    background: linear-gradient(to bottom, #ff5252, #d50000); color: white;
}
#btnCambiarCartas {
    background: linear-gradient(to bottom, var(--amarillo-maiz), #fbc02d); color: #3e2723;
}
#btnLoteria { 
    background: linear-gradient(45deg, #ffea00, #ff9100, #ffea00);
    background-size: 200% 200%; color: #bf360c; font-size: 1.2rem;
    animation: palpito 1.5s infinite, gradientMove 2s ease infinite; border: 2px solid white; width: 100%;
}
@keyframes gradientMove {
    0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}

/* --- CONTROLES DE JUEGO --- */
#controlesJuego { width: 100%; max-width: 500px; margin: 10px auto; display: flex; flex-direction: column; }
#divVelocidad { width: 100%; box-sizing: border-box; }
.botones-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 10px; }
.botones-grid button { width: 100%; height: 55px; margin: 0; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
#btnSalirLobby, #btnSalirSala { grid-column: 1 / -1; margin-top: 5px !important; }

/* --- PANEL INFERIOR --- */
#panelInferior { display: flex; flex-direction: column; width: 100%; margin-top: 15px; }
.panel-seccion { width: 100%; margin-bottom: 15px; }

/* APUESTAS UI (CON BORDE DORADO) */
#apuestasUI {
  display: flex; justify-content: space-between; align-items: center; padding: 1rem;
  background: var(--glass-bg) !important; backdrop-filter: blur(12px);          
  border-radius: 20px; 
  /* AQUÍ ESTÁ EL BORDE DORADO */
  border: 2px solid var(--amarillo-maiz); 
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); flex-direction: row; gap: 1rem;
  width: 90%; max-width: 500px; margin-left: auto; margin-right: auto;
}
.saldo-jugador, .apuesta-control { flex: 1; display: flex; flex-direction: column; align-items: center; }
.monedas-apiladas { display: flex; flex-direction: column; margin-right: -10px; }
.moneda-stack { width: 44px; height: 44px; margin-top: -30px; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5)); }
.moneda-stack:first-of-type { margin-top: 0; }
#monedas-valor { color: var(--amarillo-maiz); font-size: 2rem; font-weight: 800; margin-top: 0.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.bote-monedas { position: relative; width: 55px; height: 55px; display: flex; justify-content: center; align-items: center; margin-bottom: 0.5rem; }
.bote-monedas img { position: absolute; width: 40px; height: 40px; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5)); }
.bote-monedas img:nth-child(2) { transform: translate(18px, 10px); z-index: 2; }
.bote-monedas img:nth-child(3) { transform: translate(10px, 18px); z-index: 3; }
.bote-monedas img:nth-child(4) { transform: translate(0px, 20px); z-index: 4; }
#bote-valor { color: var(--amarillo-maiz); font-weight: 800; font-size: 1.4rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 13; text-shadow: 0 0 8px rgba(0,0,0,0.9); }

/* LISTA JUGADORES (CON BORDE DORADO) */
#jugadoresLista, #jugadoresListaIngame { max-width: 500px; margin-top: 15px; border-color: var(--amarillo-maiz); }
#jugadoresLista div, #jugadoresListaIngame div { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-weight: 600; color: white; }
#jugadoresLista div:last-child, #jugadoresListaIngame div:last-child { border-bottom: none; }

/* MODAL Y EXTRAS */
#loteriaMensaje { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 4rem; color: var(--amarillo-maiz); font-weight: bold; background-color: rgba(0,0,0,0.9); backdrop-filter: blur(5px); padding: 30px 60px; border-radius: 20px; z-index: 9999; display: none; border: 3px solid var(--rosa-mexicano); animation: pulsate 1s infinite alternate; box-shadow: 0 0 30px var(--rosa-mexicano); }
@keyframes pulsate { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.1); } }
.confeti { position: fixed; width: 10px; height: 10px; background-color: var(--amarillo-maiz); z-index: 9998; animation: caer 4s linear forwards; border-radius: 50%; }
@keyframes caer { to { transform: translateY(100vh) rotate(360deg); opacity: 0; } }

.modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.modal.active { display: flex; opacity: 1; }

/* MODAL CONTENT (FULL WIDTH) */
.modal-content { 
    background: #d84315; 
    padding: 2rem; 
    border-radius: 20px; 
    text-align: center; 
    border: 2px solid var(--amarillo-maiz); 
    color: white; 
    width: 95%; 
    max-width: 95%; 
    box-sizing: border-box; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
}

.modal-buttons { margin-top: 1.5rem; display: flex; justify-content: center; gap: 1rem; }
.historial-container-modal { width: 100%; padding: 8px; background: rgba(0, 0, 0, 0.4); border-radius: 12px; margin-bottom: 15px; overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.1); }
#modalHistorialFlex { display: flex; gap: 8px; white-space: nowrap; }
#modalHistorialFlex img { width: 45px; height: auto; border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.btn-recargar-verde {
    font-size: 0.8rem; padding: 8px 16px; margin-top: 10px; background-color: var(--verde-limon); color: #003d00; border-radius: 20px; box-shadow: 0 0 10px var(--verde-limon); text-transform: uppercase; font-weight: 800; width: auto; border: 2px solid white; animation: palpito 2s infinite; cursor: pointer; transition: all 0.2s ease;
}
.btn-recargar-verde:hover { transform: scale(1.05); background-color: #b2ff59; box-shadow: 0 0 20px var(--verde-limon); }
@keyframes palpito { 0% { box-shadow: 0 0 0 0 rgba(118, 255, 3, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(118, 255, 3, 0); } 100% { box-shadow: 0 0 0 0 rgba(118, 255, 3, 0); } }

.paquete-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); padding: 15px; border-radius: 12px; cursor: pointer; transition: transform 0.2s; position: relative; margin-bottom: 10px; }
.paquete-item:hover { background: rgba(255,255,255,0.2); transform: translateX(5px); }
.paquete-item.destacado { border: 2px solid var(--amarillo-maiz); background: rgba(255, 235, 59, 0.2); }
.badge-pop { position: absolute; top: -10px; left: 10px; background: var(--amarillo-maiz); color: black; font-size: 0.7rem; font-weight: bold; padding: 2px 8px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.btn-precio { background: var(--verde-limon); color: #003d00; margin: 0; width: auto; font-size: 0.9rem; box-shadow: none; }
.modal-content { max-height: 90vh; overflow-y: auto; overflow-x: hidden; }

/* =========================================================
   MEDIA QUERY: ESCRITORIO (SOLUCIÓN DEFINITIVA) 🖥️
   ========================================================= */

@media (min-width: 1024px) {

    /* --- 1. MESA DE JUEGO (Full Ancho) --- */
    #juegoCartas {
        width: 100% !important; 
        max-width: 1600px; 
        gap: 20px; 
        margin-bottom: 20px;
        justify-content: center;
    }

    #juegoCartas .carta-juego {
        flex: 1; 
        min-width: 250px; 
        max-width: none; 
        display: flex;
        justify-content: center;
    }
    
    #juegoCartas .carta-img {
        width: 100%; 
    }

    /* --- 2. PANTALLA DE SELECCIÓN (MAX 5 por FILA) --- */
    #contenedorCartas {
        max-width: 1400px; 
        gap: 20px;
    }
    
    #contenedorCartas .carta-juego, 
    #contenedorCartas .carta-img {
        width: 240px; 
        max-width: none;
        flex: 0 0 auto;
    }

    /* --- 3. MODAL DE VICTORIA (HORIZONTAL Y GRANDE) --- */
    #modalVerificationArea {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 20px !important;
        width: 100% !important;
        overflow-x: auto; 
    }

    #modalVerificationArea .carta-juego {
        flex: 1 !important; 
        min-width: 200px !important; 
        max-width: none !important;  
        margin: 5px !important;
        position: relative !important;
    }

    #modalVerificationArea .carta-img {
        width: 100% !important;
        height: auto !important;
    }

    /* --- 4. HISTORIAL AUMENTADO EN PC --- */
    #historial img {
        width: 80px; 
        height: 120px;
    }

    /* --- OTROS AJUSTES DE PC --- */
    .menu-acciones { gap: 40px; max-width: 1000px; }
    #controlesJuego { max-width: 1200px; margin: 20px auto; display: flex; flex-direction: column; align-items: center; }
    .botones-grid { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 15px; width: auto; }
    .botones-grid button { width: auto; min-width: 140px; height: 55px; }
    #btnSalirSala { margin-top: 0 !important; background: linear-gradient(to bottom, #ff5252, #d50000); }
    #panelInferior { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; max-width: 1400px; margin: 30px auto; gap: 40px; }
    #seccionJugadores { flex: 1; display: flex; justify-content: flex-start; }
    #jugadoresListaIngame { width: 100%; margin-top: 0; height: 100%; min-height: 160px; }
    #seccionApuestas { flex: 1; display: flex; justify-content: flex-end; }
    #apuestasUI { width: 100%; max-width: 100%; margin-top: 0; }
    #monedas-valor { font-size: 3.5rem; }
    #bote-valor { font-size: 2.5rem; }
}

/* --- CARRUSEL Y TIENDA (UI MODERNA) --- */

.menu-acciones-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.menu-acciones {
    display: flex; /* Fila horizontal */
    overflow-x: auto; /* Scroll lateral */
    gap: 20px;
    padding: 10px 20px 20px 20px;
    box-sizing: border-box;
    /* Efecto imán para que se centre la tarjeta */
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Ocultar barra scroll */
}
.menu-acciones::-webkit-scrollbar { display: none; }

.menu-card {
    /* MÓVIL */
    min-width: 85%; 
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    
    /* --- AGREGADO PARA ESTANDARIZAR --- */
    height: 520px; /* Altura fija para que todos sean iguales */
    justify-content: space-between; /* Distribuye el contenido (botón siempre abajo) */
}

/* Indicadores (Puntos) */
.carrusel-indicadores {
    display: flex; justify-content: center; gap: 8px; margin-bottom: 20px;
}
.dot {
    width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 50%;
}

/* ESTILOS INTERNOS DE LA TIENDA */
.tienda-categoria {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Para contener el scroll interno */
}

.lista-items-scroll {
    overflow-y: auto; /* Scroll vertical para los sonidos */
    max-height: 250px; /* Altura máxima de la lista */
    padding-right: 5px;
}

.item-sonido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.2s;
}

.item-sonido.comprado {
    border-color: var(--verde-limon);
    background: rgba(118, 255, 3, 0.15);
}

.info-sonido {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    text-align: left;
}

.emoji-icon { font-size: 1.5rem; }
.nombre-sonido { font-size: 0.9rem; font-weight: 600; }

.btn-play-preview {
    background: none; border: none; font-size: 1.2rem; cursor: pointer; color: white; padding: 0; margin-right: 10px;
}

.btn-accion-tienda {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    min-width: 70px;
}

.btn-comprar { background: gold; color: black; box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3); }
.btn-gratis { background: var(--azul-cielo); color: white; }
.btn-listo { background: transparent; color: var(--verde-limon); border: 1px solid var(--verde-limon); cursor: default; }

/* ESCRITORIO (GRID) */
@media (min-width: 1024px) {
    .menu-acciones {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr; /* 3 Columnas */
        overflow-x: visible;
        max-width: 1200px;
        margin: 0 auto;
    }
    .menu-card { min-width: auto; width: 100%; }
    .carrusel-indicadores { display: none; }
    .lista-items-scroll { max-height: 350px; }
}


/* --- FAB SONIDOS (SOUNDBOARD) --- */

.fab-container {
    position: fixed;
    bottom: 20px;
    left: 20px; /* A la izquierda para no estorbar al botón Loteria */
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse; /* Para que el menú salga hacia arriba */
    align-items: center;
    gap: 10px;
}

.fab-btn-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3, #0D47A1); /* Azul eléctrico */
    color: white;
    font-size: 1.8rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn-main:active { transform: scale(0.9); }

.fab-menu {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    padding: 10px;
    border-radius: 20px;
    display: flex; /* Flex para mostrar, 'none' para ocultar */
    flex-direction: column;
    gap: 10px;
    transform: scale(0); /* Oculto por defecto con animación */
    transform-origin: bottom center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    max-height: 300px;
    overflow-y: auto;
}

.fab-menu.mostrar {
    transform: scale(1); /* Mostrar */
}

.btn-emoji-sonido {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.btn-emoji-sonido:active {
    background: gold;
    transform: scale(1.2);
}

@keyframes flotarDesvanecer {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-50px); }
}

/* =========================================
   NUEVOS ESTILOS UI (MONEDERO Y SPLASH)
   ========================================= */

/* --- PANTALLA SPLASH MEJORADA --- */
#pantallaSplash {
    position: fixed; /* OBLIGATORIO: Lo fija a la pantalla */
    top: 0;
    left: 0;
    width: 100vw; /* Ancho total */
    height: 100vh; /* Alto total */
    z-index: 9999; /* Se asegura de estar encima de todo */
    background: linear-gradient(135deg, #ff9100 0%, #ff3d00 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease; /* Suaviza la desaparición */
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease-out; /* Pequeña animación de entrada */
}

.splash-icon {
    width: 180px; /* Tamaño del icono */
    height: 180px;
    border-radius: 35px; /* Bordes redondeados estilo app */
    /* Sombra para efecto de "brillo" y elevación */
    box-shadow: 0 10px 25px rgba(0,0,0,0.3), 0 0 50px rgba(255, 255, 255, 0.2) inset;
    border: 3px solid rgba(255,255,255,0.2); /* Borde sutil */
}

/* Animación simple de entrada */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- MONEDERO ELECTRÓNICO (MENÚ) --- */
.monedero-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 20px auto 10px auto; /* Reduje el margen inferior para pegar los botones */
}

.monedero-card-img {
    width: 100%;
    height: auto;
    display: block;
    /* Sombra para que la tarjeta "flote" */
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

#menuMonedas {
    position: absolute;
    /* --- AJUSTE DE POSICIÓN (ARRIBA Y A LA IZQUIERDA) --- */
    top: 42%;  /* Antes 50%, lo subí al 42% */
    left: 42%; /* Antes 50%, lo moví a la izquierda al 42% */
    
    /* El transform termina de acomodarlo */
    transform: translate(-50%, -50%); 
    
    margin: 0;
    color: white;
    
    /* FUENTE Y ESTILO */
    font-family: 'Montserrat', sans-serif;
    font-weight: 900; 
    font-size: 3.5rem; 
    white-space: nowrap; 
    
    text-shadow: 2px 2px 5px rgba(0,0,0,0.6);
    z-index: 10;
    width: auto; 
    pointer-events: none; 
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 380px) {
    #menuMonedas { font-size: 2.8rem; }
}

/* --- NUEVO CONTENEDOR DE BOTONES (Recargar + Transferir) --- */
.wallet-actions-container {
    display: flex; /* Para ponerlos lado a lado */
    align-items: center; /* Centrados verticalmente */
    justify-content: space-between; /* Espacio entre ellos */
    gap: 12px; /* Separación entre el botón dorado y la imagen */
    width: 100%;
    max-width: 380px;
    margin: 0 auto; /* Centrado horizontal */
}

/* --- BOTÓN RECARGAR DORADO (AJUSTADO) --- */
.btn-recargar-gold {
    /* Flex grow para que ocupe el espacio disponible menos el de la imagen */
    flex-grow: 1; 
    
    background: linear-gradient(to bottom, #ffd700, #ffb300);
    color: #4a3f00; 
    font-weight: 900;
    font-size: 1.1rem;
    padding: 12px 20px; /* Ajusté un poco el padding lateral */
    border-radius: 50px;
    border: none;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    margin-top: 0; /* Quitamos margen top porque lo maneja el contenedor */
    
    /* Asegura que el texto no se rompa feo */
    white-space: nowrap; 
}

.btn-recargar-gold:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.7);
}

.btn-recargar-gold:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.5);
}

/* --- BOTÓN IMAGEN TRANSFERIR --- */
.btn-transferir-img {
    /* Tamaño fijo o flexible según prefieras */
    flex-shrink: 0; /* Evita que se aplaste */
    width: 65px; /* Tamaño base de la imagen */
    height: auto;
    
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-transferir-img img {
    width: 100%;
    height: auto;
    display: block;
    /* Sombrita a la imagen para que resalte */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.btn-transferir-img:hover {
    transform: scale(1.1) rotate(5deg); /* Efecto divertido al pasar el mouse */
}

.btn-transferir-img:active {
    transform: scale(0.95);
}

/* --- AJUSTES MODAL TRANSFERENCIA --- */

/* 1. Texto de descripción en blanco */
#modalTransferencia p {
    color: rgba(255, 255, 255, 0.9) !important; /* Blanco casi puro */
    font-weight: 500;
}

/* 2. Botón de Cerrar "Pro" (Redondo y flotante) */
.btn-close-pro {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2); /* Fondo semi-transparente */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-close-pro:hover {
    background: #d50000; /* Rojo al pasar el mouse */
    transform: rotate(90deg); /* Pequeña animación de giro */
    border-color: #d50000;
}

.btn-close-pro svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
}

/* Aseguramos que el modal de sistema siempre gane en altura */
#modalSistema {
    z-index: 10000 !important; /* Número altísimo para ganar */
}

/* El modal de transferencia debe estar abajo del sistema pero arriba del juego */
#modalTransferencia {
    z-index: 9000; 
}

/* --- CORRECCIÓN DE Z-INDEX (CONFIRMACIONES AL FRENTE) --- */
#modalSistema {
    z-index: 20000 !important; /* Superpone a la tienda y transferencias (que tienen 10000) */
}

/* Opcional: Asegurar que el fondo negro del sistema también tape lo de atrás */
#modalSistema.active {
    background-color: rgba(0, 0, 0, 0.85); 
}

/* --- ESTILOS HISTORIAL --- */
.monedero-container:active {
    transform: scale(0.98); /* Efecto de click en la tarjeta */
    transition: transform 0.1s;
}

.historial-lista-container {
    flex-grow: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #333;
}

.item-historial {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.item-historial:last-child { border-bottom: none; }

.hist-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.hist-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hist-desc { font-weight: 600; font-size: 0.9rem; color: white; }
.hist-fecha { font-size: 0.7rem; color: #aaa; }

.hist-monto { font-weight: 900; font-size: 1rem; }
.hist-positivo { color: #76ff03; } /* Verde */
.hist-negativo { color: #ff1744; } /* Rojo */

/* --- TIENDA HUB (Categorías) --- */
.tienda-hub {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.btn-categoria-tienda {
    background: linear-gradient(145deg, #2b2b2b, #1a1a1a);
    border: 1px solid gold;
    padding: 20px;
    border-radius: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.btn-categoria-tienda:active {
    transform: scale(0.98);
}

.btn-categoria-tienda span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

/* --- GRID DE PRODUCTOS (Dentro del Modal) --- */
.tienda-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Adaptable */
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
    flex-grow: 1;
}

.item-tienda-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.preview-img-tienda {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.item-nombre { font-size: 0.8rem; font-weight: bold; color: #eee; }

/* Botones de acción en la tienda */
.btn-buy { background: gold; color: black; font-weight: bold; padding: 5px 10px; font-size: 0.8rem; width: 100%; }
.btn-use { background: #4dd0e1; color: black; font-weight: bold; padding: 5px 10px; font-size: 0.8rem; width: 100%; }
.btn-owned { background: #aed581; color: black; font-weight: bold; padding: 5px 10px; font-size: 0.8rem; width: 100%; cursor: default; }
.btn-active { background: #76ff03; color: black; border: 2px solid white; box-shadow: 0 0 10px #76ff03; }