/* --- Variables Globales --- */
:root {
    --ds-bg: #0c0c0c;
    /* Fondo oscuro principal */
    --ds-text: #d3d3d3;
    /* Color de texto gris claro */
    --ds-accent: #ffae00;
    /* Naranja "Hoguera" para acentos y enlaces */
    --ds-border: #3a3a3a;
    /* Color gris para bordes tipo piedra */
    --ds-darker: #050505;
    /* Fondo aún más oscuro para el contenedor central */
    --ds-bg-darkness: 0.0;
    /* Opacidad de la capa negra sobre el fondo (0.0 a 1.0) */
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #000;
    color: var(--ds-text);
    font-family: 'Jersey 10', 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    padding: 0;
    /* Centrado flexible para evitar scroll innecesario */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Evita scroll global: el desplazamiento vive dentro del panel central */
    position: relative;
}

/* Capas de fondo partido (Derecha e Izquierda) + Patrón de puntos */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    width: 50%;
    /* Cada mitad ocupa el 50% para fundirse en el centro */
    height: 100%;
    z-index: -1;
    pointer-events: none;
    image-rendering: pixelated;
}

/* Mitad Izquierda */
body::before {
    left: 0;
    background:
        /* Capa de oscuridad y puntos */
        radial-gradient(rgba(0, 0, 0, 0.7) 1px, transparent 1px) repeat,
        linear-gradient(rgba(0, 0, 0, var(--ds-bg-darkness)), rgba(0, 0, 0, var(--ds-bg-darkness))),
        /* Imagen de fondo procesada con fade hacia la derecha */
        url('resources/firelink_left_fade.png') no-repeat left center;
    background-size: 10px 10px, 100% 100%, auto 100vh;
}

/* Mitad Derecha */
body::after {
    right: 0;
    background:
        /* Capa de oscuridad y puntos */
        radial-gradient(rgba(0, 0, 0, 0.7) 1px, transparent 1px) repeat,
        linear-gradient(rgba(0, 0, 0, var(--ds-bg-darkness)), rgba(0, 0, 0, var(--ds-bg-darkness))),
        /* Imagen de fondo procesada con fade hacia la izquierda */
        url('resources/firelink_right_fade.png') no-repeat right center;
    background-size: 10px 10px, 100% 100%, auto 100vh;
}

/* --- Tipografías para Encabezados --- */
h1,
h2,
.section-title,
.dark-souls-title {
    font-family: 'Silkscreen', cursive;
    /* Fuente pixel art para títulos */
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ds-accent);
    /* Sombra de texto para mejorar legibilidad y dar profundidad */
    text-shadow: 2px 2px 0px #000;
}

/* --- Contenedor Principal (Marco de la Web) --- */
#container {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 40px));
    /* Mantiene el look clásico sin salirse en pantallas pequeñas */
    height: min(850px, calc(100vh - 40px));
    /* Marco siempre visible dentro del viewport */
    margin: 20px;
    /* Margen mínimo de seguridad */
    border: 6px inset var(--ds-border);
    /* Borde que parece tallado en la página */
    background-color: rgba(5, 5, 5, 0.95);
    /* Ligeramente translúcido */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Cabecera (Marquesina) --- */
header {
    background-color: #1a1a1a;
    padding: 10px;
    border-bottom: 4px solid var(--ds-border);
    color: var(--ds-accent);
    font-weight: bold;
}

/* --- Layout: Sidebar + Contenido --- */
#wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Barra Lateral */
#sidebar {
    width: 220px;
    padding: 20px;
    border-right: 4px solid var(--ds-border);
    background-color: #0d0d0d;
    overflow-y: auto;
}

#sidebar ul {
    list-style: none;
    /* Quitar puntos de la lista */
    padding: 0;
}

#sidebar ul li {
    margin-bottom: 10px;
}

#sidebar ul li a {
    color: var(--ds-text);
    text-decoration: none;
    display: block;
    padding: 5px;
    border: 1px solid transparent;
}

/* Efecto hover retro en el menú */
#sidebar ul li a:hover {
    background-color: var(--ds-border);
    color: var(--ds-accent);
    border: 1px dashed var(--ds-accent);
}

/* Área de Contenido */
#content {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Bordes estilo Pixel para las secciones */
.pixel-border {
    border: 4px solid var(--ds-border);
    padding: 15px;
    margin-bottom: 20px;
    background-color: #111;
    position: relative;
}

/* Títulos individuales dentro de los bloques */
.section-title {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--ds-accent);
    margin-bottom: 15px;
}

/* Estilos del Contador de Almas */
.stats {
    margin-top: 30px;
    font-size: 0.8rem;
    text-align: center;
}

#hit-counter {
    background: #000;
    color: #0f0;
    /* Color verde "matrix/retro" */
    font-family: 'Courier New', Courier, monospace;
    padding: 5px;
    border: 2px inset #333;
    display: inline-block;
    margin-top: 5px;
}

/* Estilos para la imagen de la Hoguera */
.status-img {
    text-align: center;
    margin: 20px 0;
}

.bonfire-img {
    width: 64px;
    height: auto;
    image-rendering: pixelated;
    /* Evita que el navegador suavice los píxeles */
    filter: drop-shadow(0 0 5px var(--ds-accent));
    /* Resplandor naranja */
}

/* Piezas sin usar (placeholders) */
.pixel-placeholder {
    width: 100px;
    height: 100px;
    background-color: #222;
    border: 2px dashed #444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    font-size: 0.7rem;
    color: #444;
}

/* Estilos del Pie de Página */
footer {
    padding: 15px;
    border-top: 4px solid var(--ds-border);
    text-align: center;
    font-size: 0.8rem;
    background-color: #1a1a1a;
}

/* Insignias retro */
.badges img {
    height: 31px;
    margin: 5px;
}

/* --- Animaciones --- */

/* Texto que parpadea */
.blink {
    animation: blinker 1s linear infinite;
    color: #ff0000;
    font-weight: bold;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.construction {
    text-align: center;
}

/* Ajustes adicionales para encabezados */
h1 {
    font-size: 2.5rem;
    text-align: center;
    border-bottom: none;
}

h2 {
    font-size: 1.8rem;
    margin-top: 0;
}

/* --- Estilos para las entradas del Libro de Visitas --- */
.guestbook-entry {
    background-color: #1a1a1a;
    margin-top: 20px;
    border-color: #4a4a4a;
    animation: fadeIn 0.5s ease-in;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--ds-border);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: var(--ds-accent);
}

.entry-author {
    font-weight: bold;
    text-transform: uppercase;
}

.entry-date {
    font-size: 0.8rem;
    color: #666;
}

.entry-content {
    font-style: italic;
    line-height: 1.4;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enlaces generales */
a {
    color: var(--ds-accent);
}

a:hover {
    color: #fff;
}
/* Estilos específicos del Libro de Visitas */
.guestbook-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.guestbook-iframe {
    background: #000;
    border: 2px inset var(--ds-border);
    max-width: 800px;
    width: 100%;
}