/* --- ESTILOS GLOBALES Y TEMA DEL JUEGO --- */
:root {
    --bg-color: #1a1a2e;
    --primary-color: #00ff9d;
    --secondary-color: #f700ff;
    --text-color: #e0e0e0;
    --container-bg: #162447;
    --border-color: #00ff9d;
    --button-primary: #209cee;
    --button-error: #e74c3c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    background-image: url('backgrounds/frame_001.jpg'); /* 👈 tu frame inicial */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: var(--text-color);
    line-height: 1.8;
    font-size: 14px;
    padding-top: 60px;
}


.social-links {
  display: flex;
  justify-content: center;  /* 🔹 centra horizontalmente */
  align-items: center;      /* centra verticalmente si cambia la altura */
  flex-wrap: wrap;          /* permite varias líneas si hay muchos iconos */
  gap: 12px;                /* espacio entre iconos */
  line-height: 0;           /* evita líneas azules entre ellos */
  margin-top: 16px;         /* separa del contenido superior */
}

.social-links a {
  text-decoration: none;    /* sin subrayado */
  outline: none;
  display: inline-flex;     /* centra cada imagen dentro del enlace */
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.social-links img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border: 0;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
  transition: transform 150ms ease, opacity 150ms ease;
}

.social-links a:hover img,
.social-links a:focus img {
  transform: translateY(-4px) scale(1.06);
  opacity: 0.95;
}

.social-links a:focus-visible {
  box-shadow: 0 0 0 3px rgba(0,240,255,0.12);
  outline: none;
}

/* --- INTERFAZ DEL JUEGO (XP BAR) --- */
.game-ui { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    background-color: #10101a; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 20px; 
    border-bottom: 3px solid var(--border-color); 
    z-index: 1000; 
    font-size: 12px; 
}
.ui-right-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio entre barra XP y botón */
}
.nes-button.is-small {
    padding: 4px 8px;
    font-size: 10px;
    margin: 0;
    min-width: 40px; /* Ancho mínimo para que no baile al cambiar texto */
    text-align: center;
}
.xp-bar-container { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.xp-bar-background { width: 200px; height: 20px; background-color: #333; border: 2px solid var(--text-color); }
.xp-bar-progress { width: 0%; height: 100%; background-color: var(--secondary-color); transition: width 0.3s ease-out; }

/* --- CONTENEDOR PRINCIPAL Y ESTILO NES --- */
.container { max-width: 900px; margin: 0 auto; padding: 2rem; }
.nes-container { background-color: var(--container-bg); border: 4px solid var(--text-color); padding: 1.5rem; margin-bottom: 2rem; box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3); }

/* --- HEADER Y TÍTULO ANIMADO --- */
header { text-align: center; margin-bottom: 3rem; }
#main-title { color: var(--primary-color); font-size: 2rem; margin-bottom: 0.5rem; display: inline-block; }
#main-title::after { content: '_'; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
header .subtitle { color: #aaa; font-size: 0.8rem; margin-bottom: 1.5rem; }
.social-links img { width: 32px; filter: grayscale(1) brightness(2); transition: transform 0.2s; }
.social-links a:hover img { transform: scale(1.2) rotate(10deg); }

/* --- NAVEGACIÓN (QUEST LOG) Y SECCIONES --- */
.quest-log ul { list-style: none; }
.quest-log a { color: var(--text-color); text-decoration: none; transition: all 0.2s; }
.quest-log a:hover { color: var(--primary-color); padding-left: 10px; }
h2 { color: var(--secondary-color); font-size: 1.2rem; margin-bottom: 1rem; }
p, .card-subtitle { font-size: 0.9rem; }
.skills-container { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag { background-color: var(--bg-color); padding: 8px 12px; border: 2px solid var(--text-color); }

/* --- PORTFOLIO: FILTROS Y TARJETAS --- */
.filter-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; }
.nes-button { font-family: 'Press Start 2P', cursive; background-color: #555; color: white; padding: 10px 15px; border: 2px solid white; text-decoration: none; display: inline-block; cursor: pointer; }
.nes-button:hover { background-color: #777; }
.nes-button.active { background-color: var(--primary-color); color: var(--bg-color); }
.nes-button.is-primary { background-color: var(--button-primary); }
.nes-button.is-error { background-color: var(--button-error); }
#portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.card { background-color: #10101a; border: 3px solid var(--text-color); overflow: hidden; }
.card img { width: 100%; height: 200px; object-fit: cover; border-bottom: 3px solid var(--text-color); }
.card-content { padding: 1.5rem; }
.card h3 { color: var(--primary-color); font-size: 1rem; }
.card-date { font-size: 0.8rem; color: #aaa; margin-bottom: 0.5rem; }
.card-link { margin-top: 1rem; font-size: 0.8rem; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-bottom: 3px solid var(--text-color); }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }


/* --- FOOTER Y LOGROS --- */
footer { text-align: center; }
#achievements-unlocked span { display: inline-block; padding: 5px 10px; margin: 5px; border: 2px solid #555; background: #333; color: #777; }
#achievements-unlocked span.unlocked { border-color: var(--primary-color); background-color: var(--bg-color); color: var(--primary-color); }
.achievement-toast { position: fixed; bottom: -300px; left: 50%; transform: translateX(-50%); background-color: var(--primary-color); color: var(--bg-color); padding: 15px 25px; border: 3px solid var(--bg-color); font-size: 1rem; z-index: 2000; transition: bottom 0.5s ease-in-out; }
.achievement-toast.show { bottom: 20px; }

/* Fondo animado (mantener así) */
#animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* quita transition larga para evitar parpadeo; opcional */
    transition: opacity 0.15s linear;
    opacity: 1;
}

/* Asegura que los contenedores muestren el fondo detrás: usa rgba con alpha */
.nes-container {
    background-color: rgba(22,36,71,0.72); /* antes era sólido; ahora semitransparente */
    border: 4px solid var(--text-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3);
}

/* Si quieres que el .container sea totalmente transparente (opcional) */
.container {
    background: transparent;
    position: relative;
    z-index: 0;
}

/* Asegúrate de que game-ui esté por encima */
.game-ui { z-index: 1000; position: fixed; top: 0; left: 0; width: 100%; }
