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

:root {
    --bg: #07030f;
    --panel: rgba(21, 10, 43, 0.82);
    --panel-2: rgba(34, 16, 66, 0.9);
    --purple: #7a33bd;
    --violet: #a855f7;
    --accent: #ff3b6b;   /* ojos de Gengar */
    --cyan: #22d3ee;
    --gold: #fcd34d;
    --text: #e9e3f7;
    --muted: #a99bc9;
    --pixel: 'Press Start 2P', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(rgba(7, 3, 15, 0.72), rgba(7, 3, 15, 0.9)),
        url('imagenes/fondo.jpeg') center / cover no-repeat fixed;
    background-color: var(--bg);
}

/* Líneas de escaneo tipo CRT */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.025) 0,
        rgba(255, 255, 255, 0.025) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ---------- BARRA SUPERIOR ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 5%;
    background: rgba(10, 4, 24, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--violet);
    box-shadow: 0 4px 24px rgba(168, 85, 247, 0.35);
}

.brand {
    font-family: var(--pixel);
    font-size: 14px;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
    text-decoration: none;
}
.brand span { color: var(--accent); text-shadow: 0 0 10px var(--accent); }

.nav { display: flex; flex-wrap: wrap; gap: 10px; }

.nav a {
    font-family: var(--pixel);
    font-size: 10px;
    text-decoration: none;
    color: var(--text);
    padding: 10px 14px;
    background: var(--panel-2);
    border: 2px solid var(--purple);
    border-radius: 4px;
    box-shadow: 3px 3px 0 var(--purple);
    transition: transform .12s ease, box-shadow .12s ease, color .12s ease, border-color .12s ease;
}
.nav a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.nav a.active {
    background: var(--violet);
    border-color: #fff;
    color: #fff;
    box-shadow: 3px 3px 0 var(--accent);
}

/* ---------- HERO ---------- */
.hero {
    text-align: center;
    padding: 70px 20px 40px;
}
.hero .tag {
    display: inline-block;
    font-family: var(--pixel);
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 18px;
    animation: blink 1.4s steps(2, start) infinite;
}
.hero h1 {
    margin: 0;
    font-family: var(--pixel);
    font-size: clamp(20px, 4.5vw, 40px);
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 0 8px var(--violet), 0 0 24px var(--violet), 3px 3px 0 var(--accent);
}
.hero p {
    margin: 18px auto 0;
    max-width: 640px;
    font-size: 18px;
    font-weight: 300;
    color: var(--muted);
}

@keyframes blink { to { visibility: hidden; } }

/* ---------- CONTENEDOR Y PANELES ---------- */
.wrap {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 10px;
    flex: 1;
}

.panel {
    position: relative;
    background: var(--panel);
    backdrop-filter: blur(6px);
    border: 2px solid var(--violet);
    border-radius: 6px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 0 0 4px rgba(122, 51, 189, 0.25), 0 10px 40px rgba(0, 0, 0, 0.5);
}
/* esquinas tipo HUD */
.panel::before, .panel::after {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    border: 3px solid var(--cyan);
    pointer-events: none;
}
.panel::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }

.panel h2 {
    margin: 0 0 16px;
    font-family: var(--pixel);
    font-size: clamp(13px, 2.4vw, 18px);
    line-height: 1.6;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}
.panel h2::before { content: "▶ "; color: var(--accent); }

.panel p { margin: 0 0 12px; font-size: 17px; }
.panel strong { color: var(--gold); }

.center { text-align: center; }

/* ---------- BOTONES ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }

.btn {
    font-family: var(--pixel);
    font-size: 11px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(180deg, var(--accent), #c21f4c);
    padding: 14px 20px;
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 5px 0 #7d1230;
    transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 #7d1230; }
.btn.alt {
    background: linear-gradient(180deg, var(--violet), var(--purple));
    box-shadow: 0 5px 0 #3b1466;
}
.btn.alt:hover { box-shadow: 0 3px 0 #3b1466; }

/* ---------- TARJETA DE JUGADOR (index) ---------- */
.player {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
}
.player .banner {
    background: #fff;
    border: 3px solid var(--violet);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.5);
}
.player .banner img { width: 100%; height: auto; display: block; }

.stat { margin: 14px 0; }
.stat-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--pixel);
    font-size: 9px;
    color: var(--muted);
    margin-bottom: 6px;
}
.bar {
    height: 16px;
    background: #0d0620;
    border: 2px solid var(--purple);
    border-radius: 3px;
    overflow: hidden;
}
.bar > i {
    display: block;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--cyan) 0 10px, #0e9fb8 10px 12px);
    box-shadow: 0 0 12px var(--cyan);
    animation: fill 1.4s ease-out both;
}
.bar.red > i   { background: repeating-linear-gradient(90deg, var(--accent) 0 10px, #b3254c 10px 12px); box-shadow: 0 0 12px var(--accent); }
.bar.gold > i  { background: repeating-linear-gradient(90deg, var(--gold) 0 10px, #c9a227 10px 12px); box-shadow: 0 0 12px var(--gold); }

@keyframes fill { from { width: 0; } }

/* ---------- CHIPS ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip {
    font-family: var(--pixel);
    font-size: 9px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 2px solid var(--cyan);
    border-radius: 3px;
    color: var(--cyan);
}

/* ---------- GALERÍA / IMÁGENES ---------- */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
}
.gallery img, .frame {
    width: 250px;
    max-width: 100%;
    border-radius: 6px;
    border: 3px solid var(--violet);
    box-shadow: 0 0 0 4px rgba(122, 51, 189, 0.3), 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: transform .2s ease, border-color .2s ease;
}
.gallery img:hover, .frame:hover { transform: scale(1.04) rotate(-1deg); border-color: var(--accent); }

.frame { width: 100%; max-width: 440px; display: block; margin: 0 auto; }

/* ---------- MISIÓN (académica) ---------- */
.quest {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--panel-2);
    border-left: 5px solid var(--gold);
    border-radius: 4px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.quest .icon { font-family: var(--pixel); font-size: 20px; color: var(--gold); line-height: 1.2; }
.quest p { margin: 0; }
.quest small { display: block; font-family: var(--pixel); font-size: 9px; color: var(--muted); margin-bottom: 6px; }

/* ---------- NIVELES / PRÁCTICAS ---------- */
.levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.level {
    display: block;
    position: relative;
    text-decoration: none;
    color: var(--text);
    background: var(--panel-2);
    border: 2px solid var(--purple);
    border-radius: 6px;
    padding: 22px 20px 20px;
    box-shadow: 4px 4px 0 var(--purple);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    overflow: hidden;
}
.level::after {
    content: "JUGAR ▶";
    position: absolute;
    right: 14px; bottom: 12px;
    font-family: var(--pixel);
    font-size: 8px;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-8px);
    transition: all .15s ease;
}
.level:hover {
    transform: translate(-3px, -3px);
    border-color: var(--accent);
    box-shadow: 7px 7px 0 var(--accent), 0 0 28px rgba(255, 59, 107, 0.35);
}
.level:hover::after { opacity: 1; transform: translateX(0); }

.level .lvl {
    display: inline-block;
    font-family: var(--pixel);
    font-size: 8px;
    color: #07030f;
    background: var(--gold);
    padding: 5px 8px;
    border-radius: 3px;
    margin-bottom: 12px;
}
.level h3 {
    margin: 0 0 6px;
    font-family: var(--pixel);
    font-size: 13px;
    line-height: 1.5;
    color: #fff;
}
.level p { margin: 0 0 18px; font-size: 15px; color: var(--muted); }

.progress-note {
    text-align: center;
    font-family: var(--pixel);
    font-size: 10px;
    color: var(--gold);
    margin-bottom: 26px;
    line-height: 1.8;
}

/* ---------- FOOTER ---------- */
.footer {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    font-family: var(--pixel);
    font-size: 9px;
    line-height: 1.9;
    color: var(--muted);
    background: rgba(10, 4, 24, 0.92);
    border-top: 2px solid var(--violet);
}
.footer b { color: var(--accent); font-weight: normal; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
    .topbar { justify-content: center; }
    .player { grid-template-columns: 1fr; }
    .hero { padding: 44px 16px 24px; }
    .panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
