/* =========================================
   0. FUENTE PERSONALIZADA (Minecraft)
========================================= */
@font-face {
    font-family: 'MinecraftFont';
    src: url('../fonts/Minecraftia.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* =========================================
   1. VARIABLES GLOBALES (Paleta PaltaCity)
========================================= */
:root {
    --clr-shell: #355E3B;     /* Verde oscuro (Cáscara) */
    --clr-pulp: #6FAF4B;      /* Verde claro (Pulpa) */
    --clr-seed: #8B5A2B;      /* Marrón (Carozo) */
    --clr-support: #A4C639;   /* Verde amarillento */
    --clr-dark: #1a1a1a;
    --clr-light: #f5f5f5;
    --clr-success: #4CAF50;
    --clr-error: #F44336;
}

/* =========================================
   2. RESET Y CURSORES INMERSIVOS
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('../img/cursors/minecraft-normal.png'), auto; 
    image-rendering: pixelated; /* Fuerza el aspecto de píxel nítido en elementos gráficos */
}

a, button, .glass-card, .btn-mc {
    cursor: url('../img/cursors/minecraft-pointer.png'), pointer; 
}

body {
    font-family: 'MinecraftFont', 'Courier New', monospace;
    background-color: var(--clr-dark);
    color: var(--clr-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilidades de Texto */
.text-pulp { color: var(--clr-pulp); }
.text-seed { color: var(--clr-seed); }
.text-support { color: var(--clr-support); }

/* =========================================
   3. NAVEGACIÓN Y HAMBURGUESA
========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 3px solid var(--clr-shell);
    backdrop-filter: blur(5px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 12px 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
}

.nav-brand { font-size: 22px; font-weight: bold; letter-spacing: 1px; }
.nav-links { display: flex; list-style: none; gap: 25px; }
.nav-links a { color: var(--clr-light); text-decoration: none; font-weight: bold; }
.nav-links a:hover { color: var(--clr-pulp); text-shadow: 2px 2px 0 #000; }
.hamburger { display: none; font-size: 24px; }

/* =========================================
   4. ESTRUCTURA PRINCIPAL Y HERO
========================================= */
#particles-container {
    position: relative;
    min-height: 100vh;
    padding-top: 100px;
    overflow: hidden;
}

.hero-section {
    text-align: center;
    padding: 100px 20px;
    position: relative;
    z-index: 2;
}

.title { font-size: 3rem; margin-bottom: 20px; text-shadow: 3px 3px 0 #000; }
.subtitle { font-size: 1.2rem; margin-bottom: 40px; color: #ccc; text-shadow: 1px 1px 0 #000; }

.hero-actions { display: flex; gap: 20px; justify-content: center; }

/* Botones Estilo Minecraft Clásico */
.btn-mc {
    padding: 14px 28px;
    font-size: 1rem;
    font-family: 'MinecraftFont', sans-serif;
    font-weight: bold;
    border: 3px solid #000;
    box-shadow: inset -4px -4px 0 rgba(0,0,0,0.5), inset 4px 4px 0 rgba(255,255,255,0.3);
    text-decoration: none;
    display: inline-block;
    transition: transform 0.1s;
}

.btn-mc:active { 
    box-shadow: inset 4px 4px 0 rgba(0,0,0,0.5); 
    transform: translateY(2px); 
}
.btn-primary { background-color: var(--clr-pulp); color: #fff; text-shadow: 1px 1px 0 #000; }
.btn-secondary { background-color: var(--clr-seed); color: #fff; text-shadow: 1px 1px 0 #000; }

/* =========================================
   5. GLASSMORPHISM Y TARJETAS
========================================= */
.modes-section { padding: 50px 20px; max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }
.section-title { text-align: center; margin-bottom: 40px; color: var(--clr-pulp); font-size: 2rem; text-shadow: 2px 2px 0 #000; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.glass-card {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 30px;
    border-radius: 4px;
    transition: transform 0.3s, border-color 0.3s;
}

.glass-card:hover { transform: translateY(-8px); border-color: var(--clr-pulp); }
.glass-card h3 { margin-bottom: 10px; color: var(--clr-support); }

/* =========================================
   6. ANIMACIONES DE PARTÍCULAS
========================================= */
@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.9; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* =========================================
   7. INTERFAZ: TOOLTIPS Y TRANSICIONES
========================================= */
.mc-tooltip-box {
    position: absolute;
    background-color: rgba(16, 0, 16, 0.95);
    border: 2px solid #36009C; 
    color: #AAAAAA;
    padding: 10px;
    border-radius: 2px;
    font-size: 13px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
}

.mc-tooltip-box.show { opacity: 1; }
.mc-tooltip-title { color: #FFAA00; font-weight: bold; margin-bottom: 5px; }

#page-transition-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 99999;
}
.transition-block {
    position: absolute; width: 40px; height: 40px;
    background-color: var(--clr-shell);
    top: -40px;
    animation: dropBlock 0.8s forwards;
}
@keyframes dropBlock { to { top: 100vh; } }

/* =========================================
   8. FOOTER Y ESTADO DEL SERVIDOR
========================================= */
.site-footer {
    background-color: #111;
    padding: 50px 20px 20px;
    border-top: 4px solid var(--clr-shell);
    position: relative;
    z-index: 2;
}

.footer-content {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px; max-width: 1200px; margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 15px;
    color: var(--clr-support);
}

.server-widget {
    background: #181818; padding: 20px; border-radius: 4px; border: 2px solid #333;
}

.status-wrapper { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--clr-error); }
.status-indicator.online { background: var(--clr-success); box-shadow: 0 0 8px var(--clr-success); }

/* Barras de Ping */
.ping-bars { display: flex; gap: 2px; align-items: flex-end; height: 16px; margin-left: auto; }
.ping-bar { width: 4px; background: #555; }
.ping-bar:nth-child(1) { height: 4px; }
.ping-bar:nth-child(2) { height: 7px; }
.ping-bar:nth-child(3) { height: 10px; }
.ping-bar:nth-child(4) { height: 13px; }
.ping-bar:nth-child(5) { height: 16px; }
.ping-bars.good .ping-bar { background: var(--clr-success); }
.ping-bars.bad .ping-bar { background: var(--clr-error); }

.btn-copy-ip {
    margin-top: 15px; padding: 10px; width: 100%;
    background: var(--clr-dark); color: #fff;
    border: 2px solid var(--clr-pulp);
    font-family: 'MinecraftFont', monospace;
    transition: 0.3s;
}
.btn-copy-ip:hover { background: var(--clr-pulp); color: #000; }

.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #333; font-size: 0.9rem; color: #888; }

/* =========================================
   9. GALERÍA MASONRY
========================================= */
.masonry-gallery {
    column-count: 3;
    column-gap: 20px;
    padding: 20px;
}
.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #222;
    padding: 10px;
    border: 2px solid #333;
    border-radius: 4px;
    transition: opacity 0.3s;
}
.masonry-item img { width: 100%; border-radius: 2px; display: block; }

/* =========================================
   10. RESPONSIVE
========================================= */
@media (max-width: 768px) {
    .nav-links {
        display: none; flex-direction: column; position: absolute;
        top: 100%; left: 0; width: 100%; background: #1a1a1a; padding: 20px;
        border-bottom: 3px solid var(--clr-shell);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    .masonry-gallery { column-count: 1; }
}

/* =========================================
   11. COMPONENTES INTERACTIVOS (Index)
========================================= */
/* Línea de Tiempo */
.timeline-container { display: flex; flex-direction: column; gap: 20px; max-width: 800px; margin: 0 auto; }
.timeline-item { opacity: 0; transform: translateX(-50px); transition: all 0.6s ease-out; }
.timeline-item.visible { opacity: 1; transform: translateX(0); }

/* Modal de Jugadores */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-content {
    position: relative; max-width: 500px; width: 90%; text-align: center;
    transform: translateY(-50px); transition: 0.3s;
}
.modal-overlay.show .modal-content { transform: translateY(0); }
.modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 2rem;
    color: var(--clr-error); cursor: url('../img/cursors/minecraft-pointer.png'), pointer;
}

/* =========================================
   12. LÍNEA DE TIEMPO (Estilo Idéntico a Imagen)
========================================= */
.historia-timeline-section {
    padding: 20px 20px 80px;
    position: relative;
    z-index: 2;
}

.ht-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Línea verde central */
.ht-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: #6a9c3d;
    transform: translateX(-50%);
}

.ht-item {
    position: relative;
    width: 100%;
    display: flex;
    margin-bottom: 60px;
}
.ht-item.left { justify-content: flex-start; }
.ht-item.right { justify-content: flex-end; }

/* Caja de contenido */
.ht-card {
    width: 45%; /* Deja el centro libre para la línea */
    background-color: #1a1a1a;
    border: 1px solid #6a9c3d;
    padding: 25px;
    text-align: center;
    position: relative;
}

/* Icono de Palta */
.ht-marker {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    font-size: 16px;
    background: #111;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Textos idénticos */
.ht-date { color: #d19a30; font-size: 0.85rem; display: block; margin-bottom: 5px; }
.ht-title { color: #a4c639; font-size: 1.4rem; margin-bottom: 15px; }
.ht-desc { color: #fff; font-size: 0.9rem; line-height: 1.5; }

/* Línea punteada y Skin */
.ht-divider { border-top: 1px dashed #666; margin: 20px 0; }
.ht-skin-wrapper { display: flex; justify-content: center; height: 160px; margin-bottom: 15px; }

/* Botón Ver Perfil */
.ht-btn {
    background-color: #3b5a3b;
    color: #fff;
    border: 2px solid #000;
    padding: 8px 20px;
    font-size: 0.9rem;
    box-shadow: none;
}
.ht-btn:hover { background-color: #4a704a; }

/* Responsive (Celulares) */
@media (max-width: 768px) {
    .ht-line { left: 20px; }
    .ht-item.left, .ht-item.right { justify-content: flex-end; }
    .ht-card { width: calc(100% - 50px); }
    .ht-marker { left: 20px; }
}

/* =========================================
   13. LIBRO DE REGLAS (Minecraft Book GUI)
========================================= */
.book-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 20px 80px;
    z-index: 2;
    position: relative;
}

.mc-book-gui {
    width: 700px;
    height: 450px;
    background-color: #f4e5c3; /* Color pergamino Minecraft */
    border: 4px solid #303030;
    box-shadow: inset 0 0 40px rgba(139, 116, 75, 0.5), 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    position: relative;
    border-radius: 2px;
}

/* Lomo del libro (doblez central) */
.mc-book-gui::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 50px;
    transform: translateX(-50%);
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1) 50%, transparent);
    border-left: 2px dashed rgba(160, 140, 100, 0.4);
    border-right: 2px dashed rgba(160, 140, 100, 0.4);
    pointer-events: none;
}

/* Páginas */
.mc-book-page {
    width: 50%;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    color: #000; /* Texto negro característico */
}

/* Textos dentro del libro (quitando sombras externas) */
.mc-book-content {
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
    text-shadow: none; 
}
.mc-book-content h2, .mc-book-content h3 {
    color: #000;
    margin-bottom: 15px;
    text-shadow: none;
    border-bottom: 2px solid #d4c5a3;
    padding-bottom: 5px;
}
.mc-book-content ul {
    padding-left: 15px;
}
.mc-book-content li {
    margin-bottom: 12px;
}

/* Paginación abajo */
.mc-page-num {
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    margin-top: 15px;
}

/* Flechas estilo Minecraft */
.mc-book-arrow {
    position: absolute;
    bottom: 25px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #555;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s, transform 0.2s;
}
.mc-book-arrow:hover {
    color: #000;
    transform: scale(1.2);
}
.mc-book-arrow.prev { left: 25px; }
.mc-book-arrow.next { right: 25px; }

/* Responsive (Celulares: se apila y parece una libreta vertical) */
@media (max-width: 768px) {
    .mc-book-gui {
        width: 100%;
        height: auto;
        min-height: 600px;
        flex-direction: column;
    }
    .mc-book-page {
        width: 100%;
        height: 50%;
    }
    .mc-book-gui::before {
        left: 0; right: 0; top: 50%; width: 100%; height: 40px;
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1) 50%, transparent);
        border-left: none; border-right: none;
        border-top: 2px dashed rgba(160, 140, 100, 0.4);
        border-bottom: 2px dashed rgba(160, 140, 100, 0.4);
    }
    .mc-book-arrow.prev { top: 15px; bottom: auto; left: 50%; transform: translateX(-50%) rotate(90deg); }
    .mc-book-arrow.next { bottom: 15px; right: 50%; transform: translateX(50%) rotate(90deg); }
    .mc-book-arrow:hover { transform: scale(1.2) rotate(90deg); }
}

/* =========================================
   14. GALERÍA DE FOTOS Y LIGHTBOX
========================================= */
.gallery-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 80px;
    position: relative;
    z-index: 2;
}

/* Filtros */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 8px 18px;
    font-size: 0.9rem;
    background: #222;
    border: 2px solid #444;
    color: #fff;
    cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
    background-color: var(--clr-support);
    color: #000;
    border-color: #000;
}

/* Grilla */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    border: 2px solid var(--clr-support);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.gallery-item.hide {
    display: none;
}

.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Overlay desplegable al pasar el mouse */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}
.gallery-overlay h4 { color: var(--clr-support); margin-bottom: 5px; font-size: 1.1rem; }
.gallery-overlay p { font-size: 0.85rem; color: #ccc; }

/* Modal Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.lightbox-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
    background: #111;
    border: 2px solid var(--clr-support);
    padding: 20px;
    position: relative;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #333;
    margin-bottom: 15px;
}
.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}
.lightbox-close:hover { color: var(--clr-pulp); }

/* =========================================
   15. CORRECCIONES Y AJUSTES FINALES
========================================= */

/* 2. Estilos para los botones sociales del Footer */
.social-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

/* Variante pequeña del botón Minecraft */
.btn-mc.btn-social {
    padding: 6px 14px; /* Menos relleno que el botón normal */
    font-size: 0.85rem; /* Texto más chico */
    min-width: auto;
    text-decoration: none; /* Quita el subrayado azul feo */
    display: inline-block;
}

/* Corrección de altura para Emojis con tipografías Pixel */
.nav-menu a, 
.nav-links a, 
.glass-card h3,
.hero-content h3 {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

/* Fuerza el desplazamiento vertical de cualquier emoji pegado al texto */
.nav-menu a::first-letter,
.nav-links a::first-letter,
.glass-card h3::first-letter {
    vertical-align: middle;
    position: relative;
    top: -3px; /* Sube el emoji 3 píxeles para alinear con la letra */
}

.emoji, .icon {
    display: inline-block;
    vertical-align: middle;
    transform: translateY(-3px);
}

/* =========================================
   16. CHAT GLOBAL (Estilo PaltaCity)
========================================= */
.chat-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 80px;
    position: relative;
    z-index: 2;
}

.chat-container {
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid var(--clr-support);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-header-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px dashed #444;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 10px;
    margin-bottom: 15px;
}

.chat-msg {
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--clr-support);
    padding: 10px 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    border-radius: 0 4px 4px 0;
}

.chat-msg.system {
    border-left-color: #d19a30;
    background: rgba(209, 154, 48, 0.1);
}

.msg-author {
    font-weight: bold;
    margin-right: 8px;
}

.chat-input-box {
    display: flex;
    gap: 10px;
}

.mc-input {
    flex: 1;
    background: #111;
    border: 2px solid #444;
    color: #fff;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.mc-input:focus {
    border-color: var(--clr-support);
}