/* =========================================
   RESET GLOBAL Y ESTILOS BÁSICOS
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

body {
    background: #ffb6d9;
    /* Patrón de lunares crudo */
    background-image: radial-gradient(circle, rgba(255, 192, 217, 0.6) 2px, transparent 2px);
    background-size: 20px 20px;
    font-family: 'Courier Prime', 'Courier New', Courier, monospace;
    color: #000;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 200vh;
    padding-bottom: 30px;
}

/* =========================================
   EFECTOS GLITCH Y FLASHY (CSS)
   ========================================= */
@keyframes glitch-text {
    0% {
        text-shadow: 2px 0 red, -2px 0 cyan;
    }

    20% {
        text-shadow: -2px 0 red, 2px 0 cyan;
    }

    40% {
        text-shadow: 2px 0 red, -2px 0 cyan;
    }

    60% {
        text-shadow: -2px 0 red, 2px 0 cyan;
    }

    80% {
        text-shadow: 2px 0 red, -2px 0 cyan;
    }

    100% {
        text-shadow: -2px 0 red, 2px 0 cyan;
    }
}

.glitch-header {
    animation: glitch-text 0.3s infinite linear alternate-reverse;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
}

/* =========================================
   ESTILOS DEL CURSOR PERSONALIZADO
   ========================================= */
#cursor {
    position: fixed;
    font-size: 28px;
    pointer-events: none;
    z-index: 10000;
    will-change: transform;
}

.trail {
    position: fixed;
    font-size: 18px;
    pointer-events: none;
    animation: fadeTrail 0.5s ease-out forwards;
    z-index: 9999;
    color: #0ff;
    text-shadow: 1px 1px 0 #000;
    font-weight: bold;
}

@keyframes fadeTrail {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.2) translateY(50px) rotate(45deg);
    }
}

/* =========================================
   GRID DE DISEÑO (LAYOUT)
   ========================================= */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 25px;
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   ESTILOS DE COMPONENTES BÁSICOS
   ========================================= */
header {
    grid-column: 1 / -1;
    background: #fff;
    border: 3px solid #000;
    padding: 20px;
    text-align: center;
    /* Sombras apiladas flashy */
    box-shadow: 5px 5px 0 #000, 10px 10px 0 #0ff, 15px 15px 0 #ff00ff;
    position: relative;
    overflow: hidden;
}

/* Imagen estilo banner en el header */
.header-banner {
    display: block;
    margin: 0 auto 15px auto;
    max-width: 100%;
    height: auto;
    border: 3px dashed #ff00ff;
    image-rendering: pixelated;
}

h1 {
    font-size: 2.5em;
    color: #ff1493;
    text-shadow: 3px 3px 0 #000;
    margin: 15px 0;
}

.kaomoji-line {
    font-size: 1.1em;
    margin: 8px 0;
    letter-spacing: 5px;
    color: #000;
    font-weight: bold;
    background: yellow;
    display: inline-block;
    padding: 2px 10px;
    border: 2px solid #000;
}

.box {
    background: #fff;
    border: 3px solid #000;
    padding: 20px;
    /* Sombras apiladas estilo web 1.0 */
    box-shadow: 5px 5px 0 #000, 8px 8px 0 #ff1493;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.box h2 {
    font-size: 1.3em;
    color: #fff;
    background: #000;
    margin: -20px -20px 15px -20px;
    padding: 10px;
    border-bottom: 3px solid #ff1493;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
}

/* Clases para alinear imágenes/stickers caóticos */
.sticker-left {
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
    max-width: 80px;
}

.sticker-right {
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
    max-width: 100px;
}

.sticker-center {
    display: block;
    margin: -10px auto 10px auto;
    width: 100px;
    height: auto;
}

.sticker-center-freiren {
    display: block;
    margin: -10px auto 10px auto;
    width: 200px;
    height: auto;
}

.sticker-hanging {
    display: block;
    margin: -20px auto 10px auto;
    width: 85px;
    height: auto;
    position: relative;
    z-index: 10;
}

.icon-w30 {
    width: 30px;
}

.icon-w80-center {
    margin: 0 auto 5px auto;
    display: block;
    width: 80px;
}

.icon-w150-center {
    margin: 0 auto 5px auto;
    display: block;
    width: 150px;
    border: 2px solid #000;
}

.icon-h60-right {
    float: right;
    width: 60px;
    image-rendering: pixelated;
}

.sticker-max110 {
    max-width: 110px;
}

/* =========================================
   ELEMENTOS FIJOS (UNICORNIO PINEADO)
   ========================================= */
.unicorn-corner {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(4px 4px 0px #ff00ff);
}

/* =========================================
   SECCIONES ESPECÍFICAS
   ========================================= */
#about {
    grid-column: 1;
    grid-row: 2;
}

#about p {
    font-size: 0.9em;
    line-height: 1.6;
    margin: 5px 0;
    font-weight: bold;
}

.kaomoji-big {
    font-size: 1.4em;
    text-align: center;
    margin: 10px 0;
    color: #ff00ff;
    text-shadow: 1px 1px 0 #000;
}

/* --- ESTILOS DEL REPRODUCTOR DE MÚSICA --- */
#music {
    grid-column: 2;
    grid-row: 2;
    /* Fondo de flores para máximo caos */
    background-image: url('assets/blooming_flowers.gif');
    color: #fff;
}

.vibe-header {
    background: #000;
    color: #0f0;
    font-family: 'Comic Neue', 'Comic Sans MS', 'Comic Sans', cursive;
    padding: 8px;
    font-size: 0.85em;
    text-align: center;
    border: 2px solid #0f0;
    margin-bottom: 10px;
}

.retro-player-wrapper {
    position: relative;
    width: 100%;
    height: 352px;
    border: 4px solid #fff;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 15px #0ff;
}

.retro-player-wrapper iframe {
    width: 100% !important;
    height: 352px !important;
    border: none;
    border-radius: 0px !important;
    filter: grayscale(100%) contrast(150%) brightness(0.8);
    opacity: 0.8;
}

#anime {
    grid-column: 3;
    grid-row: 2;
}

.anime-list {
    line-height: 1.8;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border: 2px dashed #000;
}

.anime-list li {
    margin: 5px 0;
    list-style: none;
    font-size: 0.9em;
    font-weight: bold;
}

.anime-list li:before {
    content: "☆ ";
    color: #0ff;
    text-shadow: 1px 1px 0 #000;
}

/* SECCIÓN DEL BLOG */
#blog {
    grid-column: 1 / 3;
    grid-row: 3;
    min-height: 300px;
}

.blog-entry {
    background: #ffb6d9;
    border: 3px solid #000;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 4px 4px 0 #0ff;
}

.blog-entry h3 {
    color: #fff;
    background: #ff1493;
    border: 2px solid #000;
    display: inline-block;
    padding: 5px;
    font-size: 1.1em;
    margin-bottom: 8px;
    transform: rotate(-2deg);
}

.blog-date {
    font-size: 0.75em;
    color: #000;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.blog-entry p {
    font-size: 0.9em;
    line-height: 1.6;
    margin: 5px 0;
    background: #fff;
    padding: 5px;
    border: 1px dashed #000;
}

/* --- SECCIÓN DEL MURO / CBOX --- */
#wall {
    grid-column: 3;
    grid-row: 3;
}

.cbox-wrapper {
    width: 100%;
    height: 400px;
    border: 4px solid #000;
    background: #fff;
}

/* REDES SOCIALES */
#socials {
    grid-column: 1;
    grid-row: 4;
    text-align: center;
}

.social-link {
    display: block;
    background: #000;
    color: #0ff;
    padding: 10px;
    margin: 10px 0;
    text-decoration: none;
    text-align: center;
    border: 3px solid #ff00ff;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    font-size: 1.1em;
    font-weight: bold;
}

.social-link:hover {
    background: #ff00ff;
    color: #fff;
    border-color: #0ff;
}

#links {
    grid-column: 2;
    grid-row: 4;
}

#links a {
    display: block;
    color: #000;
    background: #0ff;
    border: 2px solid #000;
    padding: 5px;
    text-decoration: none;
    margin: 8px 0;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    animation: pulseLink 6s infinite ease-in-out;
}

#links .animated-links a:nth-child(1) {
    animation-delay: 0s;
}

#links .animated-links a:nth-child(2) {
    animation-delay: 1.5s;
}

#links .animated-links a:nth-child(3) {
    animation-delay: 3.0s;
}

#links .animated-links a:nth-child(4) {
    animation-delay: 4.5s;
}

@keyframes pulseLink {

    0%,
    100% {
        transform: scale(1);
        background: #0ff;
        color: #000;
    }

    50% {
        transform: scale(1.05);
        background: #ff00ff;
        color: #fff;
    }
}

#links a:hover {
    background: yellow;
    animation: none;
    /* Stop pulsing on hover so the user can click comfortably */
}

#extra {
    grid-column: 3;
    grid-row: 4;
    text-align: center;
    background-image: url('assets/violin_anime.gif');
    background-size: cover;
    background-position: center;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

.visitor-count {
    background: #000;
    color: #0f0;
    padding: 12px;
    margin: 15px 0;
    border: 4px solid #222;
    font-size: 1.5em;
    font-family: monospace;
    text-shadow: 0 0 5px #0f0;
}

.pixel-art {
    font-size: 0.8em;
    line-height: 1.2;
    margin: 15px 0;
    font-family: monospace;
    white-space: pre;
    color: #ff1493;
    font-weight: bold;
}

/* 88x31 Button Banner Container */
.button-banners {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-top: 15px;
}

.button-banners img {
    image-rendering: pixelated;
    border: 1px solid #000;
}

/* Pie de página - Estilo Terminal/CRT */
footer {
    grid-column: 1 / -1;
    grid-row: 5;
    background: #000;
    color: #fff;
    border: 4px ridge #ff00ff;
    /* Ridge border for a slightly 3D retro feel */
    padding: 20px;
    text-align: center;
    box-shadow: 5px 5px 0 #ff00ff, 10px 10px 0 #0ff;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

/* Efecto de líneas de escaneo (CRT Scanlines) para el footer */
footer::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

footer p {
    margin: 5px 0;
    font-size: 0.9em;
    font-family: 'Courier Prime', 'Courier New', monospace;
    /* Back to courier for terminal vibe */
    text-shadow: 1px 1px 0 #0ff;
    position: relative;
    z-index: 3;
}

.footer-gif {
    max-width: 150px;
    margin-top: 10px;
    border: 2px dashed #0ff;
    /* Changed from white to cyan */
    position: relative;
    z-index: 3;
    padding: 5px;
    background: rgba(255, 0, 255, 0.2);
}

::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: repeating-linear-gradient(45deg, #000, #000 10px, #ff1493 10px, #ff1493 20px);
}

::-webkit-scrollbar-thumb {
    background: #0ff;
    border: 3px solid #000;
}

/* =========================================
   RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    #about,
    #music,
    #anime,
    #blog,
    #wall,
    #socials,
    #links,
    #extra,
    footer {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .unicorn-corner {
        width: 80px;
    }
}