/* ========================================
   WIKI MISTAKEN - AZUL NOCHE v4.0 CUSTOM
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&family=JetBrains+Mono&display=swap');

/* Fuentes Locales */
@font-face {
    font-family: 'MinecraftTenLocal';
    src: url('./MinecraftTen.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
}

@font-face {
    font-family: 'MojanglesLocal';
    src: url('./mojangles.otf') format('opentype');
    font-weight: normal; font-style: normal; font-display: swap;
}

:root {
    --primary-blue: #4d94ff;
    --dark-bg: #05060a;
    --card-bg: rgba(20, 25, 40, 0.6);
    --border-color: rgba(77, 148, 255, 0.2);
    --text-main: #e0e0e0;
    --text-dim: #b0c4de;
    --dev-yellow: #ffcc00;
    --glow: 0 0 15px rgba(77, 148, 255, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fondo animado */
#particles-js {
    position: fixed;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, #05060a, #0a0b10, #0d1a33, #05060a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === NAVBAR & BOTÓN VOLVER (ADIÓS MORADO) === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(5, 6, 10, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000;
}

.logo {
    color: var(--primary-blue);
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'JetBrains Mono', monospace;
    display: flex; align-items: center; gap: 10px;
    text-shadow: var(--glow);
}

.nav-links { list-style: none; }

.nav-links a {
    color: #ffffff !important; 
    text-decoration: none;
    font-family: 'MojanglesLocal', sans-serif;
    font-size: 13px;
    padding: 8px 20px;
    border: 1px solid var(--primary-blue);
    border-radius: 5px;
    background: rgba(77, 148, 255, 0.05);
    display: flex; align-items: center; gap: 10px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: var(--primary-blue);
    color: #05060a !important; /* Texto oscuro para que resalte */
    border-color: #fff;
    /* Efecto de iluminación neón */
    box-shadow: 0 0 20px var(--primary-blue), 
                0 0 40px rgba(77, 148, 255, 0.4);
    transform: translateY(-2px); /* Se levanta tantito */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a i { transition: transform 0.3s ease; }
.nav-links a:hover i { transform: translateX(-5px); }

/* === HERO SECTION === */

.wiki-hero {
    height: 45vh; /* Un poco más alto para que luzca el banner */
    width: 100%;
    /* Reemplaza 'TU_IMAGEN.png' por el link de tu banner */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), var(--dark-bg)), 
                      url('https://files.catbox.moe/dgv7cg.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-family: 'MinecraftTenLocal', sans-serif !important;
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--primary-blue);
    /* Sombra de texto para el efecto de resplandor */
    text-shadow: 0 0 20px rgba(77, 148, 255, 0.8),
                 0 0 40px rgba(77, 148, 255, 0.4),
                 4px 4px 0px #000; /* Borde negro para que resalte */
}

/* === MODULAR CONTENT GRID === */
.wiki-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
}

.sidebar-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
    position: sticky; top: 100px;
}

.side-link {
    display: block;
    font-family: 'MojanglesLocal', sans-serif;
    color: var(--text-dim);
    text-decoration: none;
    padding: 12px;
    border-radius: 6px;
    transition: 0.3s;
    margin-bottom: 5px;
}

.side-link:hover, .side-link.active {
    background: rgba(77, 148, 255, 0.15);
    color: var(--primary-blue);
    padding-left: 18px;
    border-left: 3px solid var(--primary-blue);
}

/* === CARDS & ENTITIES (GIF SUPPORT) === */
.wiki-content { transition: opacity 0.3s ease; }

.content-card {
    background-color: #070810 !important; 
    background: rgba(7, 8, 16, 0.95) !important; 
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px); 
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9); 
    position: relative;
    z-index: 10; 
    overflow: hidden;
}

.content-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(77, 148, 255, 0.05), transparent);
    pointer-events: none;
}

a, a:visited, a:active, a:focus {
    text-decoration: none !important;
    color: inherit; 
    outline: none;
}

.btn-wiki {
    color: #ffffff !important; 
    background: rgba(20, 25, 40, 0.6) !important;
}

.btn-wiki:hover {
    background: var(--primary-blue) !important;
    color: #05060a !important; 
}

a span {
    color: inherit !important;
}

.content-card h2 {
    font-family: 'MojanglesLocal', sans-serif;
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 28px;
    display: flex; align-items: center; gap: 15px;
    text-shadow: 0 0 10px rgba(77, 148, 255, 0.3);
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; margin-top: 20px;
}

.grid-mapas {
    grid-template-columns: repeat(2, 1fr) !important;
}

.entity-card {
    background: rgba(10, 15, 30, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}

.entity-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: 0 5px 20px rgba(77, 148, 255, 0.2);
}

.img-container {
    position: relative;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.wiki-img {
    width: 100%;
    height: 300px; 
    object-fit: cover !important; 
    object-position: center !important;
    display: block;
    filter: brightness(0.7) contrast(1.1);
    transition: 0.3s;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.wiki-img:hover {
    filter: brightness(0.9) contrast(1.2);
    border-color: var(--primary-blue);
}

.img-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.03) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: 0.4;
}

.entity-card:hover .wiki-img { filter: brightness(1); }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'MojanglesLocal', sans-serif;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.badge-dev {
    background: var(--dev-yellow);
    color: #000;
    border: 1px solid #000;
    font-weight: bold;
    box-shadow: 0 0 10px var(--dev-yellow);
}

.badge-hard { background: rgba(255, 77, 77, 0.1); color: #ff4d4d; border-color: #ff4d4d; }
.badge-mid { background: rgba(255, 170, 0, 0.1); color: #ffaa00; border-color: #ffaa00; }
.badge-easy { background: rgba(85, 255, 85, 0.1); color: #55ff55; border-color: #55ff55; }

.alert-box {
    background: rgba(77, 148, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 15px; border-radius: 8px;
    display: flex; align-items: center; gap: 15px;
    margin: 20px 0; font-size: 0.9rem;
}

.ability-list {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    list-style: none;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: #1a2a4a; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-blue); }

/* === PLUGIN LIST === */
.section-title {
    font-family: 'MojanglesLocal', sans-serif;
    color: #4d94ff;
    margin: 30px 0 15px 0;
    font-size: 1.2rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.plugin-list { display: flex; flex-direction: column; gap: 12px; }
.plugin-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #4d94ff;
    padding: 15px;
    border-radius: 4px 12px 12px 4px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}
.plugin-card:hover { transform: translateX(10px); background: rgba(77, 148, 255, 0.08); }
.plugin-name { font-family: 'MojanglesLocal', sans-serif; display: block; color: #fff; font-size: 0.9rem; margin-bottom: 4px; }
.plugin-desc { font-size: 0.85rem; color: #b0c4de; margin: 0; }
.plugin-link { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #4d94ff; opacity: 0.7; margin-top: 5px; display: inline-block; }
.special-plugin { border-left: 4px solid #ff4d4d; background: rgba(255, 77, 77, 0.05); }

/* === VHS & GLITCH LAYERS === */
.vhs-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    background-size: 100% 4px; z-index: 14000;
    pointer-events: none; opacity: 0.3;
    animation: vhs-flicker 0.15s infinite;
}

body::after {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExemo2MGI3aHZyazBjNm1mMDQxNjJ2eHBlcWwya3ZycGppajk1MThkOCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/FgiU10cTkyiGY/giphy.gif');
    opacity: 0.05; pointer-events: none; z-index: 14001;
}

body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 100%);
    pointer-events: none; z-index: 14002;
}

@keyframes vhs-flicker { 0% { opacity: 0.2; } 5% { opacity: 0.3; } 10% { opacity: 0.2; } 100% { opacity: 0.2; } }

.content-card h2 { animation: glitch-text 4s infinite; }
@keyframes glitch-text {
    0% { transform: translate(0); }
    1% { transform: translate(-2px, 1px); text-shadow: 1px 0 red, -1px 0 blue; }
    2% { transform: translate(2px, -1px); text-shadow: -1px 0 red, 1px 0 blue; }
    3% { transform: translate(0); text-shadow: none; }
}

/* === REPRODUCTOR DE MÚSICA (WIDGET DESPLEGABLE) === */
.music-widget {
    position: fixed; bottom: 25px; right: 25px;
    display: flex; align-items: center;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 10px;
    z-index: 16000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 50px; height: 50px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.music-widget:hover { width: 320px; border-radius: 15px; }

.widget-icon {
    min-width: 30px; display: flex; justify-content: center; align-items: center;
    color: var(--primary-blue); font-size: 1.2rem; cursor: pointer;
}

.playing-icon { animation: pulse-blue 2s infinite; }
@keyframes pulse-blue { 0%, 100% { filter: drop-shadow(0 0 2px var(--primary-blue)); } 50% { filter: drop-shadow(0 0 8px var(--primary-blue)); } }

.widget-panel {
    display: flex; flex-direction: column; gap: 8px; margin-left: 15px;
    opacity: 0; transition: opacity 0.3s ease; width: 240px;
}
.music-widget:hover .widget-panel { opacity: 1; }
.player-info { display: flex; flex-direction: column; line-height: 1.2; }
#track-name { font-family: 'MojanglesLocal', sans-serif; font-size: 0.7rem; color: #fff; white-space: nowrap; }
#track-time { font-size: 0.6rem; color: #888; }
.player-controls { display: flex; gap: 15px; align-items: center; }
.player-controls button { background: none; border: none; color: #fff; cursor: pointer; font-size: 0.8rem; }
#seek-bar, #volume-slider { height: 3px; accent-color: var(--primary-blue); cursor: pointer; }
.volume-container { display: flex; align-items: center; gap: 8px; opacity: 0.6; font-size: 0.7rem; }

/* === [NUEVO] RESPONSIVE ENGINE (MOBILE OPTIMIZATION) === */
@media (max-width: 768px) {
    .wiki-grid {
        grid-template-columns: 1fr;
        margin: 10px auto;
    }

    .wiki-sidebar {
        position: sticky;
        top: 70px;
        z-index: 100;
        width: 100%;
    }

/* Reduce el espacio interno superior de la sidebar */
.sidebar-box {
    padding-top: 10px !important; /* Ajusta este valor si lo quieres más arriba aún */
    display: flex;
    flex-direction: column;
}

/* Elimina el margen por defecto del título para que suba */
.sidebar-box h3 {
    margin-top: 0 !important;
    margin-bottom: 15px; /* Espacio con los links de abajo */
    font-size: 0.9rem;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    text-transform: uppercase;
}

    #sidebar-nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        gap: 10px;
        padding: 5px 0;
        scrollbar-width: none; /* Oculta scrollbar en Firefox */
    }

    #sidebar-nav::-webkit-scrollbar { display: none; } /* Oculta scrollbar en Chrome */

    .side-link {
        display: inline-block;
        padding: 8px 15px;
        background: rgba(77, 148, 255, 0.1);
        border: 1px solid var(--border-color);
        font-size: 0.75rem;
    }

    .wiki-img {
        height: 200px !important; /* Ajuste altura móvil */
    }

    .content-card {
        padding: 15px;
    }

    .entity-grid {
        grid-template-columns: 1fr !important; /* Forzar una columna en móvil */
    }

    .music-widget:hover {
        width: 260px; /* Más pequeño en cel */
    }
}

/* Clase de utilidad para grillas de 2 en PC */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Efecto para las tarjetas descartadas */
.discarded {
    position: relative;
    overflow: hidden;
}

.discarded::before {
    content: "RESTRICTED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 2rem;
    color: rgba(255, 0, 0, 0.2);
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    border: 3px solid rgba(255, 0, 0, 0.2);
    padding: 10px;
}

.discarded:hover {
    filter: grayscale(0) !important; /* Se ve el color al pasar el mouse como si lo hackearas */
    transition: 0.5s ease;
}