/* ================================================
   INDEX.CSS - RPG GameBoy Style
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ── RESET Y VARIABLES ─────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

:root {
    --gb-black: #000000;
    --gb-dark:  #382843;
    --gb-light: #7c6d80;
    --gb-white: #c7c6c6;

    --primary-color: var(--gb-white);
    --secondary-color: var(--gb-light);
    --bg-color: var(--gb-black);
    --panel-color: var(--gb-dark);
    --border-color: var(--gb-light);
    --text-color: var(--gb-white);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Press Start 2P', monospace;
    line-height: 2;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 4px,
            rgba(199, 198, 198, 0.02) 4px,
            rgba(199, 198, 198, 0.02) 8px
        );
}

/* ── NAVBAR ────────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--gb-dark);
    border-bottom: 4px solid var(--gb-black);
    box-shadow:
        inset 0 -4px 0 var(--gb-black),
        inset 0 4px 0 var(--gb-light);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* ── LOGOS RESPONSIVOS ─────────────────────────── */

.nav-container a {
    display: inline-flex;
    align-items: center;
    line-height: 0; /* evita espacio extra debajo de la imagen */
    text-decoration: none;
}

.nav-container img[alt="logo de gonoz"] {
    height: clamp(28px, 5vw, 56px); /* escala suave entre 28 y 56px */
    width: auto;
    object-fit: contain;            /* nunca se deforma */
    transition: height 0.2s;
    flex-shrink: 0;
}

.nav-container img[alt="Gonoz Letras"] {
    height: clamp(20px, 3.5vw, 42px);
    width: auto;
    object-fit: contain;
    margin: 0 clamp(4px, 1vw, 16px);
    transition: height 0.2s;
    flex-shrink: 0;
}

/* ── LOGO TEXTO (si se usa .logo) ──────────────── */

.logo {
    text-decoration: none;
    font-size: clamp(0.5rem, 1.5vw, 1rem);
    font-weight: normal;
    color: var(--gb-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 18px 10px 28px;
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    box-shadow:
        3px 3px 0 var(--gb-black),
        inset 0 0 0 2px var(--gb-dark);
    transition: all 0.1s ease;
    position: relative;
    white-space: nowrap;
}

.logo::before {
    content: '▶';
    position: absolute;
    left: 8px;
    animation: blink 1s step-end infinite;
}

.logo:hover {
    transform: translate(2px, 2px);
    box-shadow:
        1px 1px 0 var(--gb-black),
        inset 0 0 0 2px var(--gb-dark);
}

.logo-text {
    display: inline-block;
    margin-left: 16px;
}

/* ── NAV MENU ──────────────────────────────────── */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--gb-white);
    font-size: clamp(0.42rem, 0.9vw, 0.65rem); /* uniforme en toda la pantalla */
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: clamp(6px, 1vw, 10px) clamp(8px, 1.2vw, 14px); /* padding también escala */
    background-color: var(--gb-dark);
    border: 2px solid var(--gb-light);
    box-shadow:
        2px 2px 0 var(--gb-black),
        inset 0 0 0 1px var(--gb-black);
    transition: all 0.1s ease;
    display: block;
    position: relative;
    white-space: nowrap;
    line-height: 1.6;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--gb-light);
    color: var(--gb-black);
    transform: translate(1px, 1px);
    box-shadow:
        1px 1px 0 var(--gb-black),
        inset 0 0 0 1px var(--gb-dark);
}

.nav-link:hover::before,
.nav-link.active::before {
    content: '►';
    position: absolute;
    left: 4px;
}

/* ── HAMBURGER ─────────────────────────────────── */

.hamburger {
    display: none;
    flex-direction: column;
    background: var(--gb-dark);
    border: 3px solid var(--gb-light);
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    box-shadow: 2px 2px 0 var(--gb-black);
    flex-shrink: 0;
}

.hamburger:hover {
    background: var(--gb-light);
}

.bar {
    width: 24px;
    height: 3px;
    background-color: var(--gb-white);
    margin: 3px 0;
    transition: all 0.1s ease;
}

.hamburger.active .bar:nth-child(1) { transform: rotate(-45deg) translate(-6px, 6px); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: rotate(45deg) translate(-6px, -6px); }
.hamburger.active { background: var(--gb-light); }
.hamburger.active .bar { background-color: var(--gb-black); }

/* ── HERO ──────────────────────────────────────── */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gb-black);
    background-image:
        repeating-linear-gradient(45deg,  transparent, transparent 10px, rgba(56,40,67,0.3) 10px, rgba(56,40,67,0.3) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(56,40,67,0.3) 10px, rgba(56,40,67,0.3) 20px);
    color: var(--text-color);
    text-align: center;
    padding: 0 20px;
    margin-top: 80px;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 1;
    background-color: var(--gb-dark);
    padding: 40px;
    border: 4px solid var(--gb-white);
    box-shadow:
        8px 8px 0 var(--gb-black),
        inset 0 0 0 4px var(--gb-black),
        inset 0 0 0 8px var(--gb-light);
    max-width: 800px;
    width: 100%;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: -12px; left: -12px;
    right: -12px; bottom: -12px;
    border: 2px solid var(--gb-light);
    pointer-events: none;
}

.hero-content h1 {
    font-size: clamp(0.9rem, 3vw, 2rem);
    margin-bottom: 2rem;
    color: var(--gb-white);
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1.6;
    word-break: break-word;
    animation: textAppear 2s steps(20);
}

.hero-content p {
    font-size: clamp(0.6rem, 1.5vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gb-light);
    line-height: 2.2;
}

.hero-content p::after {
    content: '▼';
    display: block;
    text-align: right;
    margin-top: 1rem;
    animation: blink 1s step-end infinite;
}

/* ── SECCIONES ─────────────────────────────────── */

.section {
    padding: 80px 20px;
    min-height: 60vh;
    position: relative;
    border-top: 1px solid var(--gb-light);
}

.section:nth-child(even) { background-color: var(--gb-black); }

.section:nth-child(odd) {
    background-color: var(--gb-dark);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent, transparent 2px,
            rgba(0,0,0,0.2) 2px, rgba(0,0,0,0.2) 4px
        );
}

/* ── CONTAINER ─────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    border: 4px solid var(--gb-white);
    box-shadow:
        6px 6px 0 var(--gb-black),
        inset 0 0 0 4px var(--gb-black),
        inset 0 0 0 8px var(--gb-light);
    position: relative;
    box-sizing: border-box;
}

.container::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px;
    right: -10px; bottom: -10px;
    border: 2px solid var(--gb-light);
    pointer-events: none;
}

.section h2 {
    font-size: clamp(0.8rem, 2.5vw, 2rem);
    margin-bottom: 2rem;
    color: var(--gb-white);
    text-transform: uppercase;
    letter-spacing: 3px;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--gb-light);
    position: relative;
    word-break: break-word;
    line-height: 1.5;
}

.section h2::before {
    content: '◆';
    margin-right: 10px;
    color: var(--gb-light);
}

.section p {
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
    line-height: 2.2;
    color: var(--gb-white);
    text-align: justify;
    word-break: break-word;
}

/* ── FOOTER ────────────────────────────────────── */

.footer {
    background-color: var(--gb-dark);
    color: var(--text-color);
    text-align: center;
    padding: 2rem 20px;
    border-top: 4px solid var(--gb-white);
    box-shadow: inset 0 4px 0 var(--gb-black);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: clamp(0.5rem, 1.2vw, 1rem);
}

/* ── BOTÓN PIXEL ───────────────────────────────── */

.pixel-button {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.5rem, 1.2vw, 0.85rem);
    font-weight: normal;
    text-transform: uppercase;
    padding: 12px 24px;
    border: 3px solid var(--gb-white);
    background: var(--gb-dark);
    color: var(--gb-white);
    cursor: pointer;
    box-shadow:
        4px 4px 0 var(--gb-black),
        inset 0 0 0 2px var(--gb-black);
    transition: all 0.1s ease;
    letter-spacing: 2px;
    position: relative;
}

.pixel-button::before {
    content: '►';
    position: absolute;
    left: 8px;
    opacity: 0;
    transition: opacity 0.1s;
}

.pixel-button:hover {
    background: var(--gb-light);
    color: var(--gb-black);
    transform: translate(2px, 2px);
    box-shadow:
        2px 2px 0 var(--gb-black),
        inset 0 0 0 2px var(--gb-dark);
}

.pixel-button:hover::before { opacity: 1; }
.pixel-button:active { transform: translate(4px, 4px); box-shadow: none; }

/* ── ANIMACIONES ───────────────────────────────── */

@keyframes blink {
    0%, 50%  { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes textAppear {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pixelPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}

/* ── SCROLL OFFSET ─────────────────────────────── */

section {
    scroll-margin-top: 80px;
}

/* ── ADS SECTION ──────────────────────────────── */

.ads-section {
    padding: 20px;
    display: flex;
    justify-content: center;
    background-color: var(--gb-black);
    border-top: 2px solid var(--gb-dark);
    border-bottom: 2px solid var(--gb-dark);
}

.ads-section ins {
    min-height: 90px;
    background-color: var(--gb-dark);
}

/* ── GAMES PREVIEW ───────────────────────────── */

.games-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.preview-card {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    padding: 30px 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.preview-card:hover {
    border-color: var(--gb-white);
    transform: translateY(-5px);
}

.preview-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.preview-card h3 {
    font-size: 0.7rem;
    color: var(--gb-white);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.preview-card p {
    font-size: 0.5rem;
    color: var(--gb-light);
}

/* ── RESPONSIVE ────────────────────────────────── */

@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--gb-dark);
        width: 100%;
        text-align: center;
        transition: left 0.2s ease;
        border-bottom: 4px solid var(--gb-black);
        box-shadow: inset 0 -4px 0 var(--gb-black);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    /* En menú hamburguesa todos los links tienen el mismo ancho */
    .nav-link {
        font-size: 0.65rem;
        padding: 10px 0;
        width: 220px;
        margin: 0 auto;
        text-align: center;
        box-sizing: border-box;
    }

    .section {
        padding: 60px 15px;
    }

    .container {
        padding: 25px 15px;
    }

    .hero-content {
        padding: 30px 20px;
    }
}

@media screen and (max-width: 480px) {
    .nav-container {
        height: 70px;
    }

    /* Logos aún más compactos en móvil pequeño */
    .nav-container img[alt="logo de gonoz"] {
        height: clamp(24px, 8vw, 36px);
    }

    .nav-container img[alt="Gonoz Letras"] {
        height: clamp(16px, 5.5vw, 28px);
        margin: 0 clamp(2px, 1vw, 8px);
    }

    .hero {
        margin-top: 70px;
    }

    .hero-content {
        padding: 25px 15px;
    }

    .section {
        padding: 40px 10px;
    }

    .container {
        padding: 20px 10px;
    }

    section {
        scroll-margin-top: 70px;
    }
}