/* --- VARIABLES DEL TEMA MODERNO --- */
:root {
    --color-fondo-oscuro: rgba(20, 20, 30, 0.95);
    --color-panel: rgba(40, 40, 55, 1);
    --color-acento-oro: #ffc800;
    --color-acento-azul: #00a8ff;
    --color-acento-morado: #9b59b6;
    --color-texto: #ffffff;
    --color-texto-gris: #b0b0c0;
    --borde-redondeado: 12px;
    --sombra-suave: 0 4px 15px rgba(0,0,0,0.5);
    --fuente-moderna: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    overflow: hidden;
    font-family: var(--fuente-moderna);
    font-size: 16px;
    color: var(--color-texto);
}

#game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a1a2a 0%, #000000 100%);
}

/* --- UI LAYER (BARRA SUPERIOR) --- */
#ui-layer {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    gap: 15px;
}

#ui-layer > * { pointer-events: auto; }

/* Badges (Monedas/Packs) */
.coin-badge {
    background: var(--color-fondo-oscuro);
    border: 2px solid var(--color-acento-oro);
    border-radius: 30px;
    padding: 8px 20px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--sombra-suave);
    height: 40px; box-sizing: border-box;
}
.coin-icon { font-size: 1.4rem; filter: drop-shadow(0 0 5px var(--color-acento-oro)); }
#html-coins { font-weight: bold; font-size: 1.1rem; color: var(--color-acento-oro); }

.coin-badge.pack-badge { border-color: var(--color-acento-morado); }
.pack-badge .coin-icon { filter: drop-shadow(0 0 5px var(--color-acento-morado)); }
#html-packs { font-weight: bold; font-size: 1.1rem; color: var(--color-acento-morado); }

/* Botón Menú */
#menu-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #2980b9, #00a8ff);
    color: var(--color-texto);
    border: none; border-radius: var(--borde-redondeado);
    padding: 0 24px; height: 40px;
    cursor: pointer; font-family: var(--fuente-moderna); font-weight: bold; font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 168, 255, 0.3);
    transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center;
}
#menu-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 168, 255, 0.5); filter: brightness(1.1); }

/* --- MENÚ PAUSA (OVERLAY) --- */
#menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#menu-overlay.active { opacity: 1; pointer-events: auto; }

.menu-content {
    background: var(--color-fondo-oscuro);
    border-radius: var(--borde-redondeado);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%; max-width: 900px; height: 80%; max-height: 650px;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden; transform: scale(0.95); transition: transform 0.3s ease;
}
#menu-overlay.active .menu-content { transform: scale(1); }

.menu-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.menu-header h2 { margin: 0; color: var(--color-texto); font-weight: 300; letter-spacing: 4px; text-transform: uppercase; font-size: 1.2rem; }

.close-btn {
    background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
    width: 32px; height: 32px; color: var(--color-texto-gris); font-size: 1rem;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: rgba(255, 50, 50, 0.8); color: white; transform: rotate(90deg); }

.menu-body { flex: 1; display: flex; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 180px; background-color: rgba(0,0,0,0.3);
    display: flex; flex-direction: column; padding: 10px 0; gap: 2px;
}
.sidebar button {
    padding: 12px 20px; background: transparent; border: none;
    color: var(--color-texto-gris); cursor: pointer;
    font-family: var(--fuente-moderna); font-size: 13px; font-weight: 500;
    text-align: left; transition: all 0.2s; position: relative;
    text-transform: uppercase; letter-spacing: 1px;
}
.sidebar button.active { color: var(--color-acento-azul); background: rgba(0, 168, 255, 0.1); font-weight: bold; }
.sidebar button.active::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 4px; background: var(--color-acento-azul); }
.sidebar button:hover:not(.active) { color: var(--color-texto); background: rgba(255,255,255,0.05); padding-left: 25px; }

/* Content Area */
.content-area { flex: 1; padding: 20px; background: var(--color-panel); overflow-y: auto; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.content-area h3 {
    color: var(--color-acento-azul); font-weight: 300; text-transform: uppercase;
    margin-top: 0; margin-bottom: 20px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Stats */
.stats-summary { display: flex; gap: 15px; margin-bottom: 25px; }
.stat-box {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 15px; flex: 1;
    display: flex; flex-direction: column; align-items: center;
}
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--color-texto-gris); margin-bottom: 5px; }
.stat-value { font-weight: bold; font-size: 1.5rem; }
.stat-value.xl { font-size: 2.5rem; }

/* XP Bar */
.xp-container { margin-top: 20px; }
.xp-header { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--color-texto-gris); margin-bottom: 8px; }
#xp-text { color: var(--color-texto); font-weight: bold; }
.xp-bar-bg {
    height: 20px; background-color: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden;
    border: 2px solid rgba(255,255,255,0.05); box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.xp-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--color-acento-azul), #9b59b6);
    border-radius: 8px; box-shadow: 0 0 10px rgba(0, 168, 255, 0.5); transition: width 0.5s ease-in-out;
}

/* Grid & Items */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.skin-item {
    background: rgba(255,255,255,0.05); border-radius: 12px; padding: 15px;
    text-align: center; border: 2px solid transparent; transition: all 0.3s;
}
.skin-item:hover:not(.locked) { border-color: var(--color-acento-azul); transform: translateY(-3px); background: rgba(255,255,255,0.1); }
.skin-item.active-skin { border-color: var(--color-acento-oro); box-shadow: 0 0 15px rgba(255, 200, 0, 0.2); }

.skin-image-placeholder {
    width: 70px; height: 70px; background: transparent; border-radius: 10px;
    margin: 0 auto 10px auto; overflow: hidden; border: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: center; align-items: center;
}
.skin-image-placeholder img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons */
.skin-action-btn {
    width: 100%; padding: 8px 0; margin-top: 8px; border: none; border-radius: 8px;
    font-family: var(--fuente-moderna); font-weight: bold; text-transform: uppercase; font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s ease; letter-spacing: 1px;
}
.skin-action-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.btn-buy { background: linear-gradient(135deg, var(--color-acento-oro), #e67e22); color: #1a1a1a; box-shadow: 0 4px 10px rgba(255, 200, 0, 0.2); }
.btn-select { background: linear-gradient(135deg, var(--color-acento-azul), #2980b9); color: #ffffff; box-shadow: 0 4px 10px rgba(0, 168, 255, 0.3); }
.skin-action-btn:disabled { background: rgba(255, 255, 255, 0.1); color: #aaa; border: 1px solid rgba(255, 255, 255, 0.1); cursor: not-allowed; opacity: 0.7; }
.btn-equipped {
    background: transparent; color: var(--color-acento-oro); border: 2px solid var(--color-acento-oro);
    padding: 6px 0; width: 100%; margin-top: 8px; border-radius: 8px; font-weight: bold;
    text-transform: uppercase; font-size: 0.8rem; cursor: default; box-shadow: 0 0 10px rgba(255, 200, 0, 0.1) inset;
}
.btn-owned {
    background: rgba(40, 40, 55, 1); color: #4cd137; border: 1px solid #4cd137;
    width: 100%; padding: 6px 0; margin-top: 8px; border-radius: 8px; font-weight: bold;
    text-transform: uppercase; font-size: 0.8rem; cursor: default; opacity: 0.8;
}

/* --- MODAL DE QUIZ (NPCs) --- */
#quiz-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#quiz-overlay.active { opacity: 1; pointer-events: auto; }

.quiz-card {
    background: linear-gradient(145deg, #2c3e50, #1a252f);
    border: 2px solid var(--color-acento-oro); border-radius: 20px;
    width: 90%; max-width: 600px; box-shadow: 0 0 30px rgba(255, 200, 0, 0.2);
    overflow: hidden; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.quiz-header {
    background: rgba(0,0,0,0.3); padding: 15px 25px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
#quiz-npc-name { color: var(--color-acento-oro); font-weight: bold; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; }

.quiz-body { padding: 30px; text-align: center; }
#quiz-question-text { font-size: 1.3rem; margin-bottom: 30px; line-height: 1.6; color: white; }

.quiz-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.quiz-option-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2);
    padding: 15px; border-radius: 10px; color: #ddd; font-size: 1rem; cursor: pointer; transition: all 0.2s;
}
.quiz-option-btn:hover { background: var(--color-acento-azul); color: white; border-color: transparent; transform: translateY(-3px); }

.quiz-correct { background-color: #2ecc71 !important; border-color: #2ecc71 !important; color: white !important; }
.quiz-wrong { background-color: #e74c3c !important; border-color: #e74c3c !important; color: white !important; }

.quiz-timer-bar { margin-top: 25px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
#quiz-time-fill { height: 100%; width: 100%; background: var(--color-acento-oro); transition: width 1s linear; }

/* --- ADAPTACIÓN MÓVIL (MEDIA QUERY) --- */
@media (max-width: 768px) {
    #ui-layer { top: 10px; left: 10px; right: 10px; gap: 8px; }
    .coin-badge { padding: 4px 12px; height: 32px; border-width: 1px; }
    .coin-icon { font-size: 1rem; }
    #html-coins, #html-packs { font-size: 0.9rem; }
    #menu-btn { padding: 0 16px; height: 32px; font-size: 12px; }
    body { font-size: 14px; }
    .sidebar { width: 140px; }
    .content-area { padding: 15px; }
    .stat-value.xl { font-size: 2rem; }
    
    /* Quiz Móvil */
    .quiz-options-grid { grid-template-columns: 1fr; }
    #quiz-question-text { font-size: 1.1rem; }
}


/* 1. ESTILO DEL CONTENEDOR (El Marco) */
.health-bar-container {
    /* Tamaño de la barra */
    width: 250px;
    height: 30px;
    
    /* EL MARCO: Un borde sólido hecho con código */
    border: 4px solid #333333; /* Color gris oscuro para el borde */
    
    /* EL FONDO VACÍO: Qué color se ve cuando baja la vida */
    background-color: #550000; /* Un rojo oscuro sangre queda bien */
    
    /* Redondear las esquinas (opcional, si lo quieres cuadrado quita esto) */
    border-radius: 15px;
    
    /* IMPORTANTE: Recorta el relleno para que no se salga de las esquinas redondas */
    overflow: hidden;
    
    /* Separación con las monedas */
    margin-right: 20px;
    
    /* Para que el borde no aumente el tamaño total */
    box-sizing: border-box;
}

/* 2. ESTILO DEL RELLENO (La barra que cambia) */
.health-bar-fill {
    /* Ocupa toda la altura del contenedor */
    height: 100%;
    /* Empieza al 100% de ancho */
    width: 100%;
    
    /* Color inicial (verde puro, luego el JS lo cambiará) */
    background-color: rgb(0, 255, 0);
    
    /* Animación suave al cambiar de tamaño y color */
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* --- NUEVOS ESTILOS DE SALUD --- */

/* 1. Envoltorio para alinear Corazón y Barra */
.health-wrapper {
    display: flex;
    align-items: center; /* Los centra verticalmente */
    margin-right: 20px; /* Separación con las monedas */
}

/* 2. El Icono del Corazón (SVG) */
.heart-icon {
    width: 32px;  /* Tamaño del corazón */
    height: 32px;
    color: #ff3333; /* Color rojo brillante */
    /* Un pequeño filtro para darle un brillo sutil ("glow") */
    filter: drop-shadow(0 0 2px rgba(255, 50, 50, 0.5));
    margin-right: 8px; /* Espacio entre corazón y barra */
}

/* 3. El Marco de la Barra */
.health-bar-container {
    width: 220px; /* Un poco más corta ahora que hay corazón */
    height: 26px; /* Un poco más fina para ser elegante */
    
    /* Borde gris oscuro */
    border: 3px solid #2a2a2a;
    /* Fondo rojo muy oscuro (sangre seca) para cuando está vacía */
    background-color: #3a0000;
    
    border-radius: 13px; /* Bordes redondeados */
    overflow: hidden; /* Recorta el relleno */
    box-sizing: border-box;

    /* SOMBRA INTERNA: Da sensación de profundidad (hundido) */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

/* 4. El Relleno (La parte que cambia de color con JS) */
.health-bar-fill {
    height: 100%;
    width: 100%;
    /* El color de fondo lo pone el JS (verde->rojo), aquí ponemos el inicial */
    background-color: rgb(0, 255, 0);
    
    /* Transición suave */
    transition: width 0.3s ease, background-color 0.3s ease;
    position: relative; /* Necesario para posicionar el brillo */
}

/* 5. EL BRILLO (Efecto cristal) */
/* Usamos un pseudo-elemento '::after' para crear una capa de brillo encima */
.health-bar-fill::after {
    content: ''; /* Necesario para que se muestre */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%; /* Solo ocupa la mitad superior */
    
    /* DEGRADADO: Blanco semitransparente arriba a transparente abajo */
    background: linear-gradient(
        to bottom, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    
    /* Bordes redondeados para seguir la forma */
    border-radius: 10px 10px 0 0;
}

/* ===========================================================
   AJUSTES DE EMERGENCIA PARA MÓVILES (Pega esto al final de style.css)
   Esto forzará a que la barra superior sea compacta y no se corte.
=========================================================== */

@media screen and (max-width: 768px) {

    /* 1. CONTENEDOR PRINCIPAL (#ui-layer) */
    /* Reducimos los márgenes externos y el espacio entre elementos */
    #ui-layer {
        top: 5px !important;   /* Pegado arriba */
        left: 5px !important;  /* Pegado a la izquierda */
        right: 5px !important; /* Pegado a la derecha */
        gap: 5px !important;   /* Espacio mínimo entre monedas, vida y menú */
        width: auto !important; /* Asegura que no fuerce un ancho mayor */
        flex-wrap: nowrap !important; /* Obliga a que todo esté en una línea */
    }

    /* 2. MONEDAS Y SOBRES (.coin-badge) */
    /* Los hacemos más pequeños y finos */
    .coin-badge {
        padding: 2px 8px !important; /* Relleno mínimo */
        height: 28px !important;     /* Altura reducida */
        font-size: 11px !important;  /* Texto más pequeño */
        border-width: 1px !important; /* Borde más fino */
    }
    .coin-icon { font-size: 12px !important; }
    #html-coins, #html-packs { font-size: 11px !important; }

    /* 3. BOTÓN DE MENÚ (#menu-btn) */
    /* Más compacto */
    #menu-btn {
        padding: 0 10px !important;
        height: 28px !important;
        font-size: 11px !important;
        margin-left: auto !important; /* Empujar a la derecha */
    }

    /* --- 4. LA BARRA DE VIDA (Lo más importante) --- */

    /* Si usas el wrapper con corazón: */
    .health-wrapper {
        margin-right: 5px !important; /* Menos separación con las monedas */
    }
    /* Reducir el icono del corazón */
    .heart-icon {
        width: 20px !important;
        height: 20px !important;
        margin-right: 4px !important;
    }

    /* REDUCCIÓN DRÁSTICA DEL ANCHO DE LA BARRA */
    /* Busca la clase que estés usando para el contenedor de la barra y fuérzale este tamaño */
    .health-bar-container {
        /* Ancho fijo pequeño para móvil. AJUSTA ESTE VALOR SI ES NECESARIO */
        width: 100px !important;
        height: 20px !important;     /* Más fina */
        border-width: 2px !important; /* Borde más fino */
        border-radius: 8px !important;
    }
    /* Asegurar que el relleno se adapte */
    .health-bar-fill { border-radius: 6px !important; }
}

/* --- AÑADIR AL FINAL DE TU CSS --- */

/* Tema especial para el Guardián de la Mazmorra */
#quiz-overlay.dungeon-theme .quiz-container {
    background: linear-gradient(135deg, #2a0e0e 0%, #000000 100%); /* Fondo rojizo oscuro */
    border: 4px solid #ff4400; /* Borde naranja/rojo intenso */
    box-shadow: 0 0 30px rgba(255, 68, 0, 0.5);
}

#quiz-overlay.dungeon-theme .quiz-header h2 {
    color: #ff4400; /* Título rojo */
    text-shadow: 2px 2px 4px #000;
    border-bottom: 2px solid #ff4400;
}

#quiz-overlay.dungeon-theme #quiz-question-text em {
    color: #ff8800 !important; /* Texto de énfasis naranja */
}

/* Botones en modo mazmorra */
#quiz-overlay.dungeon-theme .quiz-option-btn {
    background: linear-gradient(to right, #4a1a1a, #662222); /* Botones rojizos */
    border: 2px solid #ff4400;
    color: #ffccaa;
}

#quiz-overlay.dungeon-theme .quiz-option-btn:hover {
    background: linear-gradient(to right, #ff4400, #ff6600);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 68, 0, 0.4);
}

#quiz-overlay.dungeon-theme .quiz-time-fill {
    background: linear-gradient(to right, #ff4400, #ff0000); /* Barra de tiempo roja */
}

/* --- ESTILOS DE LA PESTAÑA DE STATS --- */

/* Cabecera donde dice "Puntos Disponibles" */
.stats-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-texto);
}

/* Cada fila de estadística (Ataque, Defensa...) */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.stat-row:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-row span {
    font-weight: 500;
    color: var(--color-texto-gris);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-row strong {
    color: var(--color-texto);
    font-size: 1.1rem;
    margin-right: 15px;
}

/* Botón de subir (+) */
.btn-upgrade {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s, filter 0.2s;
}

.btn-upgrade:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.btn-upgrade:active {
    transform: scale(0.95);
}

/* Botón desactivado (cuando no hay puntos) */
.btn-disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilo de la Notificación */
.notification {
    position: absolute;
    top: 20%; /* Un poco más abajo del borde superior */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85); /* Negro semitransparente */
    color: #ffc800; /* Oro */
    padding: 15px 30px;
    border-radius: 50px; /* Bordes redondos */
    border: 2px solid #ffc800;
    font-family: 'Arial', sans-serif; /* O tu fuente pixel */
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    pointer-events: none; /* Para poder clicar a través de ella */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, top 0.3s ease;
}

/* Clases para mostrar/ocultar */
.notification.show {
    opacity: 1;
    top: 15%; /* Pequeña animación de subida */
}
.notification.hidden {
    opacity: 0;
}

/* =========================================
   LEADERBOARD (ESTILO RPG LEYENDA)
   ========================================= */

/* Item individual (Fila) - Diseño base robusto */
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5); /* Fondo más oscuro */
    border: 1px solid rgba(255, 215, 0, 0.1); /* Borde dorado muy sutil */
    margin-bottom: 12px; /* Más espacio entre filas */
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Efecto hover con brillo */
.leaderboard-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.1);
}

/* 🥇 TOP 1: Borde completo dorado con Relieve y Brillo 🥇 */
.leaderboard-item.rank-1 {
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.7));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); /* Brillo externo dorado */
}
/* Efecto de borde doble "tallado" para el Top 1 */
.leaderboard-item.rank-1::before {
    content: ''; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px;
    border: 1px solid #ffd700; border-radius: 16px; opacity: 0.2; pointer-events: none;
}

/* 🥈 Top 2 y 🥉 Top 3: Borde izquierdo ancho Plateado/Bronce */
.leaderboard-item.rank-2 {
    border-left: 5px solid #c0c0c0; /* Borde ancho plateado */
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.05), rgba(0, 0, 0, 0.6));
}

.leaderboard-item.rank-3 {
    border-left: 5px solid #cd7f32; /* Borde ancho bronce */
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.05), rgba(0, 0, 0, 0.6));
}

/* "Eres Tú" resaltado en Cian */
.leaderboard-item.is-me {
    border: 1px solid #00ffcc;
    background: rgba(0, 255, 204, 0.05) !important;
    box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.1);
}

/* Columna Rango (Número o Emojis de medallas) */
.rank-number {
    font-weight: bold;
    font-size: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #888;
}
/* Emojis más grandes para las medallas */
.rank-1 .rank-number { font-size: 32px; background: none; } 
.rank-2 .rank-number { font-size: 28px; background: none; }
.rank-3 .rank-number { font-size: 26px; background: none; }

/* Columna Nombre (Izquierda) */
.player-name {
    flex-grow: 1;
    padding-left: 15px;
    display: flex;
    align-items: center;
}
.player-name .name-text {
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

/* Columna Nivel (Derecha) */
.player-level-right {
    color: #00ffcc; /* Color cian brillante */
    font-weight: bold;
    font-size: 16px;
    text-align: right;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap; /* Evita que la palabra "Nivel" se separe del número */
}

/* =========================================
   CHAT GLOBAL (TABERNA)
   ========================================= */
#chat-messages-container {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 168, 255, 0.3);
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Estilo de los mensajes */
.chat-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-msg .msg-author {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 3px;
    display: block;
    text-transform: uppercase;
    color: #00a8ff;
}
.chat-msg .msg-time {
    font-size: 9px;
    color: #888;
    float: right;
    margin-top: 5px;
    margin-left: 10px;
}

/* Mensajes de otros */
.chat-other {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #00a8ff;
}

/* Mis propios mensajes */
.chat-me {
    align-self: flex-end;
    background: rgba(0, 255, 204, 0.1);
    border-right: 3px solid #00ffcc;
    text-align: right;
}
.chat-me .msg-author { color: #00ffcc; }

/* Área de escribir */
#chat-input-area {
    display: flex;
    gap: 10px;
}
#chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}
#chat-input:focus {
    border-color: #00a8ff;
}
#chat-send-btn {
    background: linear-gradient(135deg, #00a8ff, #005f99);
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}
#chat-send-btn:hover {
    transform: scale(1.05);
}

/* =========================================
   SISTEMA DE CLANES (UI)
   ========================================= */
.clan-header {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8));
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.clan-submenu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.clan-submenu button {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.clan-submenu button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.clan-submenu button.active {
    background: linear-gradient(135deg, #00a8ff, #005f99);
    color: #fff;
    border-color: #00a8ff;
    box-shadow: 0 4px 10px rgba(0, 168, 255, 0.3);
}

/* Interruptor de Canales de Chat */
.chat-channel-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}
.chat-channel-switcher button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s;
}
.chat-channel-switcher button.active {
    background: rgba(0, 168, 255, 0.1);
    border-color: #00a8ff;
    color: #00a8ff;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}


/* =========================================
   ADMIN PANEL STYLES
   ========================================= */
#admin-users-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}
#admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
#admin-users-table th {
    background: #111;
    color: #ff4444;
    padding: 10px;
    text-align: left;
    position: sticky; top: 0;
}
#admin-users-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #eee;
}
.admin-select-clan {
    background: #000;
    color: #ffd700;
    border: 1px solid #ffd700;
    padding: 4px;
    border-radius: 4px;
    font-size: 11px;
    width: 100%;
}

/* =========================================
   ANUNCIOS DEL ORÁCULO
   ========================================= */
#oracle-overlay {
    animation: oracleDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.oracle-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(50, 40, 0, 0.95));
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.1);
    color: #ffd700;
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    min-width: 300px;
    animation: oraclePulse 2s infinite;
}

@keyframes oraclePulse {
    0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
}

@keyframes oracleDrop {
    0% { top: -100px; opacity: 0; transform: translateX(-50%) scale(0.8); }
    100% { top: 15%; opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Mensajes del Oráculo en el Chat */
.chat-oracle {
    align-self: center;
    width: 90%;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid #ffd700;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    margin-top: 10px;
    margin-bottom: 10px;
}
.chat-oracle .msg-author {
    color: #ffd700;
    font-size: 15px;
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 5px;
}
.chat-oracle .msg-text {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* Animación de rebote para el marcador del mapa */
@keyframes bounce-marker {
    0%, 100% { transform: translate(-50%, -100%); }
    50% { transform: translate(-50%, -125%); }
}

#player-map-pin {
    animation: bounce-marker 1s infinite ease-in-out;
}