/* === Base === */
html, body {
  height: 100%;
  margin: 0;
}

body {
  background: url("spell2.jpg") center center fixed;
  background-size: cover;
  background-repeat: no-repeat;
  color: #e6e6e6;
  font-family: "Cinzel", "Times New Roman", serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 40px; /* prevents buttons being cut on mobile */
}

/* === Containers === */
.container {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 22px rgba(212, 175, 55, 1);
  border-radius: 40px;
  padding: 20px;
  width: 90%;
  max-width: 900px;
  backdrop-filter: blur(20px);
  transition: all 0.8s ease;
}

.card {
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  padding: 20px;
  width: 100%;
  max-width: 750px;
  margin-top: 20px;
  color: #f22409;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hidden {
  opacity: 0;
  transform: translateY(20px);
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Text & Titles === */
h2 {
  font-size: 1.4rem;
  color: #000;
  margin-bottom: 20px;
  text-shadow:
    0 0 5px rgb(255, 196, 0),
    0 0 9px rgb(255, 217, 0),
    0 0 15px rgb(234, 255, 0);
}

#result {
  margin-top: 25px;
  font-size: 1.1rem;
  color: #ffab3d;
  text-shadow: 0 0 12px rgba(244, 65, 24, 0.4);
}

p {
  white-space: normal;
  word-break: break-word;
}

.glow-text {
  display: inline-block;
  opacity: 0;
  animation: glowMaterialize 1.2s ease forwards;
  vertical-align: middle; /* prevents animation from shifting lines */
}

/* === Inputs & Buttons === */
input[type="text"] {
  padding: 10px;
  font-size: 16px; /* stops iOS zoom bug */
  border-radius: 6px;
  border: none;
  text-align: center;
  width: 80%;
  outline: none;
  background: #111;
  color: #fafc7c;
  margin: 20px 0 15px;
  box-shadow: inset 0 0 5px #333;
}

button {
  background: linear-gradient(9deg, #ff480076, #f9fd0c76);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px #ff7b00;
}

/* === Glow Animation === */
@keyframes glowMaterialize {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: scale(1.03);
    text-shadow:
      0 0 30px rgba(255, 220, 120, 0.9),
      0 0 60px rgba(255, 190, 80, 0.6);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    text-shadow:
      0 0 15px rgba(255, 230, 120, 0.9),
      0 0 25px rgba(255, 200, 90, 0.6);
  }
}

/* === Bottom Fade Overlay === */
body::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
}

/* === Fade Animations === */
.fade-out {
  opacity: 0;
  transform: translateY(-15px);
  transition: all 0.8s ease;
}

.fade-in-under {
  opacity: 0;
  animation: fadeInUnder 1s ease forwards;
  margin-top: 25px;
}

@keyframes fadeInUnder {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Wake-up message */
.wake-message {
  font-size: 1.4rem;
  max-width: 90%;
  color: #f8e98a;
  text-shadow:
    0 0 10px rgba(255, 255, 150, 0.8),
    0 0 25px rgba(255, 200, 50, 0.6);
  opacity: 0;
  animation: fadeInOut 2s ease forwards;
  margin-top: 50px;
  text-align: center;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20%, 80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.centered {
  justify-content: center !important;
  align-items: center !important;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Feedback Button === */
#feedbackButton {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 999;
  background: linear-gradient(9deg, #4a00ff, #00e1ff);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 225, 255, 0.7);
  transition: all 0.2s ease-in-out;
}

#feedbackButton:hover {
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(0, 255, 255, 1);
}

/* === MOBILE & SMALL SCREENS === */
@media (max-width: 600px) {
  .container {
    width: 95%;
    padding: 15px;
    border-radius: 25px;
  }

  #result {
    font-size: 1rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  input[type="text"] {
    width: 90%;
    font-size: 16px;
  }

  button {
    padding: 10px;
    font-size: 0.9rem;
  }

  #feedbackButton {
    right: 10px;
    bottom: 10px;
    padding: 10px 15px;
    font-size: 0.85rem;
  }

  .wake-message {
    font-size: 1.2rem;
    line-height: 1.4rem;
  }
}
