#bgFade {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -2;
  background-image: var(--bg-dark-url);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transition: opacity 1.2s ease;
}

#bgFade.fade-out {
  opacity: 0;
}

#themeToggle {
  position: fixed;
  top: 1rem;
  right: 1.6rem;
  z-index: 10;
  background: transparent;
  border: none;
  cursor: pointer;
}

#themeIcon {
  width: 24px;
  height: 24px;
  transition: filter 0.3s ease;
  filter: invert(1);
}

body.light #themeIcon {
  filter: none;
}

#contadorContainer {
  position: absolute;
  top: 90px;
  right: 16px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  opacity: 0.75;
  padding: 6px 12px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

#particlesOverlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background: url('https://i.gifer.com/origin/74/74043b11818c7a40ae726b01c8eb4a43_w200.gif') center/contain no-repeat;
  z-index: 1;
  opacity: 0.3;
  mix-blend-mode: lighten;
  animation: fadeIn 2s ease forwards;
}

#entryScreen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  cursor: pointer;
  animation: fadeIn 0.8s ease-out forwards;
}

#entryScreen .text {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  font-family: 'Courier New', monospace;
  animation: blink 1s steps(1) infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.3; }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.profile-section {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  animation: fadeInUp 0.8s ease forwards;
}

.profile-img {
  position: relative;
  width: 206px;
  height: 206px;
  border-radius: 50%;
  animation: pulse 2s infinite ease-in-out;
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-img::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  width: 230px;
  height: 230px;
  background: url('https://img.avatardecoration.com/decorations/dice_azure.png') center/contain no-repeat;
  z-index: 2;
  pointer-events: none;
}

.profile-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-links img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  filter: invert(100%);
  transition: filter 0.3s ease;
}

body.light .profile-links img {
  filter: invert(0%);
}

.navi:hover img {
  filter: invert(0%);
}

body.light .navi:hover img {
  filter: invert(100%);
}

.navi {
  background-color: #1a1a1a;
  color: #fff;
  padding: 12px;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
  animation: fadeInUp 1s ease forwards;
}

.navi:hover {
  background-color: #fff;
  color: #000;
}

body.light .navi {
  background-color: #e0e0e0;
  color: #000;
}

body.light .navi:hover {
  background-color: #000;
  color: #fff;
}

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

@media (max-width: 600px) {
  .profile-section {
    flex-direction: column;
    align-items: center;
  }

  .navi {
    font-size: 16px;
    padding: 16px;
  }

  #themeToggle {
    padding: 14px 18px;
    font-size: 16px;
  }

  #particlesOverlay {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    mix-blend-mode: normal;
  }

  .profile-img {
    width: 160px;
    height: 160px;
  }

  .profile-img::before {
    width: 180px;
    height: 180px;
    top: -10px;
    left: -10px;
  }
}
