/* ============================================
   ESTILOS GLOBALES Y RESET
   ============================================ */

body {
  margin: 0;
  padding: 0;
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  background-color: black;
}

/* ============================================
   CURSOR PERSONALIZADO
   ============================================ */

.custom-cursor {
  cursor: url('../graficos/pointer.png'), auto !important;
}

#start-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
  opacity: 1;
}

#start-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

#start-text {
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.3);
  animation: glowPulse 2s ease-in-out infinite, fadeInUp 1s ease-out, float 3s ease-in-out 1s infinite;
  position: relative;
  z-index: 10000;
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.3); }
  50% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 0 60px rgba(255, 255, 255, 0.5); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   TERMINAL SIMULADORA
   ============================================ */

#terminal {
  position: fixed;
  top: 50px;
  left: 50px;
  width: 600px;
  height: 400px;
  background-color: #1e1e1e;
  color: #ffffff;
  border-radius: 10px;
  z-index: 1000;
  border: 2px solid #4d4d4d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Estilos para la terminal en dispositivos móviles */
@media screen and (max-width: 480px) {
  #terminal {
    height: 320px;
  }
  
  #terminal-content {
    padding: 10px;
    font-size: 11px;
    line-height: 1.3;
  }
}

/* Estilos para la terminal en tablets */
@media screen and (max-width: 768px) {
  #terminal {
    top: 20px;
    left: 5%;
    width: 90%;
    height: 300px;
  }
}

#terminal-header {
  background-color: #2d2d2d;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: flex-start;
  transition: background-color 0.3s;
}

#terminal-buttons {
  display: flex;
  gap: 10px;
}

.terminal-button {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s ease, filter 0.2s ease;
}

.terminal-button:hover {
  filter: brightness(1.35);
  transform: scale(1.15);
}

#close-button {
  background-color: #FF5F57;
}

#minimize-button {
  background-color: #FFBD2E;
}

#maximize-button {
  background-color: #28CA42;
}

#terminal-content {
  padding: 20px;
  height: calc(100% - 40px);
  overflow-y: auto;
  user-select: none;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  font-size: 13px;
  scrollbar-width: none; /* Firefox */
  text-align: center; /* centra el bloque de texto */
}

#terminal-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ---- Estilo terminal: CRT ---- */
#terminal {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Salida suave al entrar a la card */
#terminal.closing {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

/* Scanlines + flicker */
#terminal::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.14) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  border-radius: 10px;
  z-index: 2;
  animation: crtFlicker 4s infinite;
}

@keyframes crtFlicker {
  0%, 100% { opacity: 0.55; }
  48%      { opacity: 0.70; }
  50%      { opacity: 0.40; }
  52%      { opacity: 0.70; }
}

#terminal-text {
  margin: 0;
  line-height: 1.4;
  display: inline-block;   /* el bloque se centra... */
  text-align: left;        /* ...pero las líneas empiezan desde la izquierda */
}

.t-line.ascii {
  white-space: pre;
}

.t-line.out-line {
  color: rgba(255, 255, 255, 0.75);
}

.term-cursor {
  display: inline-block;
  animation: termBlink 1s step-start infinite;
}

.term-hint {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.85);
  animation: termBlink 1.1s step-start infinite;
}

@keyframes termBlink {
  50% { opacity: 0; }
}

/* ============================================
   FONDO DE VIDEO
   ============================================ */

#video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

#video-background::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 2px);
  z-index: 1;
  pointer-events: none;
}

#myVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* ============================================
   TARJETA DE PERFIL
   ============================================ */

#blurred-box {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 92%;
  max-width: 410px;
  height: fit-content;
  /* Glassmorphism real estilo guns.lol */
  background: rgba(18, 18, 24, 0.38);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  z-index: 999;
  display: none; /* el JS lo cambia a flex al mostrarla */
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 28px;
  text-align: center;
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    transform 0.18s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* Brillo (glare) que sigue al ratón */
#blurred-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.14),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#blurred-box:hover {
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#blurred-box:hover::before {
  opacity: 1;
}

/* Estilos para la tarjeta en móviles */
@media screen and (max-width: 480px) {
  #blurred-box {
    width: 88%;
    padding: 26px 22px;
  }
}

#blurred-box img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

#username {
  color: #fff;
  margin: 0;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.user-description {
  margin: 0;
}

.user-description p {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.user-description:hover p {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}

.links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  z-index: 1001;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.links a i {
  margin: 0;
  font-size: 20px;
}

.links a:hover {
  transform: translateY(-5px);
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 18px rgba(252, 252, 252, 0.315);
  text-decoration: none;
}

/* ============================================
   EXTRAS PREMIUM (estilo guns.lol)
   ============================================ */

/* Variable de ángulo para los bordes/anillos giratorios */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes borderSpin {
  to { --angle: 360deg; }
}

/* ---- Entrada animada de la card ---- */
#blurred-box {
  animation: cardIn 0.7s ease both;
}

@keyframes cardIn {
  from { opacity: 0; filter: blur(12px); }
  to   { opacity: 1; filter: blur(0); }
}

/* ---- Borde de cristal sutil (sin color) ---- */
.card-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.05));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* ---- Reflejo (sheen) que cruza la card ---- */
#blurred-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 48%, transparent 62%);
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: sheen 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes sheen {
  0%        { background-position: 150% 0; }
  35%, 100% { background-position: -60% 0; }
}

/* ---- Profundidad por capas (parallax 3D) ---- */
.avatar          { transform: translateZ(50px); }
.name-row        { transform: translateZ(35px); }
.user-description { transform: translateZ(25px); }
.links           { transform: translateZ(30px); }
.views           { transform: translateZ(15px); }

/* ---- Avatar con anillo giratorio ---- */
.avatar {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
}

/* foto limpia, sin anillo de color */

.avatar img {
  position: relative;
  z-index: 1;
}

/* ---- Ubicación (esquina superior de la card) ---- */
.location {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 3px 9px;
  border-radius: 999px;
  transform: translateZ(20px);
  z-index: 3;
}

/* ---- Reloj de la ubicación (esquina derecha) ---- */
.localtime {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 3px 9px;
  border-radius: 999px;
  transform: translateZ(20px);
  z-index: 3;
}

/* ---- Entrada en cascada de los elementos de la card ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.location,
.localtime,
.avatar,
.name-row,
.user-description,
.links,
.views {
  animation: fadeIn 0.5s ease both;
}

.location         { animation-delay: 0.10s; }
.localtime        { animation-delay: 0.15s; }
.avatar           { animation-delay: 0.20s; }
.name-row         { animation-delay: 0.30s; }
.user-description { animation-delay: 0.40s; }
.links            { animation-delay: 0.50s; }
.views            { animation-delay: 0.60s; }

/* ---- Accesibilidad: respetar movimiento reducido ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Nombre + badge ---- */
.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #fff; /* sello blanco */
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  transform: translateY(-2px); /* sube la insignia para alinearla con el texto */
}

.badge svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ---- Username blanco (tipografía original) ---- */
#username {
  color: #fff;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* ---- Contador de visitas ---- */
.views {
  font-size: 0.72rem;
  color: rgba(255,255,255,.6);
  letter-spacing: 0.5px;
}

/* ---- Tooltips de los iconos ---- */
.links a::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.links a:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Capa de partículas ---- */
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ---- Estela del cursor ---- */
.trail-dot {
  position: fixed;
  width: 22px;
  height: 22px;
  background: url('../graficos/pointer.png') center / contain no-repeat;
  pointer-events: none;
  z-index: 3000;
  animation: trailFade 0.6s ease-out forwards;
}

@keyframes trailFade {
  to { opacity: 0; transform: scale(0.6); }
}

/* ---- Parallax del fondo de vídeo ---- */
#myVideo {
  transform: scale(1.08);
  transition: transform 0.2s ease-out;
}

/* ---- Reproductor de música ---- */
#music-player {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* el JS lo muestra al entrar */
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(18,18,24,.5);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  z-index: 1500;
  color: #fff;
  font-size: 12px;
}

#mp-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.mp-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}

.mp-title {
  font-weight: bold;
  letter-spacing: 0.5px;
}

.mp-bar {
  width: 150px;
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  overflow: hidden;
}

.mp-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #888, #fff);
}

.mp-viz {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.mp-viz span {
  width: 3px;
  height: 4px;
  background: linear-gradient(#fff, #777);
  border-radius: 2px;
  transition: height 0.06s linear;
}

.mp-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mp-btn:hover {
  background: rgba(255,255,255,.18);
  transform: translateY(-2px);
}

/* ---- Barra de controles (esquina) ---- */
#controls {
  position: fixed;
  top: 18px;
  right: 18px;
  display: none; /* el JS la muestra al entrar */
  gap: 8px;
  z-index: 1600;
}

#controls button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#controls button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

#controls button svg {
  width: 17px;
  height: 17px;
  display: block;
}

#snow-toggle.off {
  color: rgba(255, 255, 255, 0.35);
}

#snow-toggle.off::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Reproductor responsive */
@media screen and (max-width: 480px) {
  .mp-viz { display: none; }
  .mp-bar { width: 110px; }
  #music-player { gap: 8px; padding: 8px 10px; }
}
