/* Added minecraft font face */
@font-face {
  font-family: "Minecraft";
  src: url("./fonts/minecraft.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Minecraft", "Segoe UI", sans-serif; /* Updated to use Minecraft font as primary */
  overflow-x: hidden;
  color: #e0e0ff;
  background-color: black;
}
a {
  color: #1a69e0;
  text-decoration: underline;
}

a:hover {
  color: #1e90ff;
}

.galaxy-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.galaxy-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 20% 50%, rgba(22, 25, 219, 0.356) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(132, 12, 175, 0.363) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(0, 117, 175, 0.329) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 0%, rgba(51, 0, 80, 0.397) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(79, 25, 130, 0.267) 0%, transparent 50%),
    linear-gradient(135deg, #050510 0%, #080818 25%, #060612 50%, #0a0a20 75%, #050510 100%);
  animation: galaxyShift 20s ease-in-out infinite;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

@keyframes galaxyShift {
  0%,
  100% {
    filter: hue-rotate(0deg) brightness(1);
  }
  25% {
    filter: hue-rotate(15deg) brightness(1.1);
  }
  50% {
    filter: hue-rotate(-10deg) brightness(0.9);
  }
  75% {
    filter: hue-rotate(20deg) brightness(1.05);
  }
}

.nebula-1,
.nebula-2,
.nebula-3 {
  position: fixed;
  z-index: 1;
}

.nebula-1 {
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(75, 25, 130, 0.12) 0%, transparent 70%);
  animation: nebulaFloat 25s ease-in-out infinite, nebulaColor 40s ease-in-out infinite;
}

.nebula-2 {
  top: -30%;
  right: -30%;
  width: 150%;
  height: 150%;
  background: radial-gradient(ellipse at center, rgba(0, 100, 150, 0.1) 0%, transparent 60%);
  animation: nebulaFloat 30s ease-in-out infinite reverse, nebulaColor 35s ease-in-out infinite reverse;
}

.nebula-3 {
  bottom: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(ellipse at center, rgba(150, 10, 80, 0.08) 0%, transparent 65%);
  animation: nebulaFloat 35s ease-in-out infinite, nebulaColor 45s ease-in-out infinite;
}

@keyframes nebulaFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  33% {
    transform: translate(20px, -20px) scale(1.05);
    opacity: 0.9;
  }
  66% {
    transform: translate(-15px, 15px) scale(0.95);
    opacity: 0.8;
  }
}

@keyframes nebulaColor {
  0% {
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    filter: hue-rotate(30deg) brightness(1.2);
  }
  100% {
    filter: hue-rotate(0deg) brightness(1);
  }
}

#portalCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  display: block;
  background: transparent;
}

.content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: transparent;
}

h1 {
  font-size: 7rem;
  letter-spacing: 5px;
  margin: 0;
  text-shadow: 0 0 25px rgba(154, 168, 255, 0.5);
  animation: textGlow 8s ease-in-out infinite;
  color: inherit;
  font-family: "Minecraft", monospace; /* Explicitly set Minecraft font for main title */
}

@keyframes textGlow {
  0%,
  100% {
    text-shadow: 0 0 25px rgba(154, 168, 255, 0.5);
    color: #9aa8ff;
  }
  50% {
    text-shadow: 0 0 35px rgba(184, 198, 255, 0.8);
    color: #b8c6ff;
  }
}

.cursor {
  animation: blink 3s infinite, cursorColor 6s ease-in-out infinite;
}

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

@keyframes cursorColor {
  0% {
    color: #9aa8ff;
  }
  100% {
    color: #9aa8ff;
  }
}

.subtitle {
  margin-top: 0.5rem;
  font-size: 1.7rem;
  color: #7777ff;
  text-shadow: 0 0 12px rgba(119, 119, 255, 0.3);
  animation: subtitleGlow 10s ease-in-out infinite;
  font-family: "Minecraft", monospace; /* Added Minecraft font to subtitle */
}

@keyframes subtitleGlow {
  0%,
  100% {
    color: #7777ff;
    text-shadow: 0 0 12px rgba(119, 119, 255, 0.3);
  }
  50% {
    color: #9999ff;
    text-shadow: 0 0 18px rgba(153, 153, 255, 0.5);
  }
}

.buttons {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  background: linear-gradient(45deg, #06113f, #180e3a);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  color: rgb(172, 170, 215);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(13, 3, 29, 0.39);
  position: relative;
  overflow: hidden;
  animation: buttonGlow 12s ease-in-out infinite;
  font-family: "Minecraft", monospace; /* Added Minecraft font to buttons */
}

@keyframes buttonGlow {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(76, 29, 149, 0.25);
  }
  50% {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  }
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(154, 168, 255, 0.4);
}

.btn:active {
  transform: scale(0.95);
}

@keyframes colorCycle {
  0% {
    color: #a5b8f5;
  }
  25% {
    color: #bbb2f8;
  }
  50% {
    color: #b0b4f8;
  }
  75% {
    color: #b4ddfb;
  }
  100% {
    color: #c2bef6;
  }
}

#typewriter {
  animation: colorCycle 30s linear infinite;
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9d4edd;
  font-size: 1.5rem;
  z-index: 100;
}

.error {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(139, 0, 0, 0.9);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 100;
  display: none;
}

@media (max-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .buttons {
    flex-direction: column;
    align-items: center;
  }
  .btn {
    width: 80%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
}
