:root {
  --primary: #b9adfd;
  --primary-dark: #6d5fa8;
  --accent: #a78bfa;
  --text: #2d2640;
  --text-muted: #6b5b8c;
  --border: #e8e4f3;
  --shadow: rgba(187, 174, 250, 0.1);
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f7f7f7;
  text-align: center;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f9d3f2, #c4daff, #ffffff);
  background-size: 1200% 1200%;
  animation: gradientMove 20s ease infinite;
}

body::after {
  content: "❓";
  position: fixed;
  font-size: 15rem;
  opacity: 0.1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 6s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
main {
  position: relative;
  z-index: 1;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.hero-emoji {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  margin-top: 10rem;
}

.hero-title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(200deg, #da3598, #6d1ebdba);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-muted);
  margin-bottom: 48px;
  padding: 0 1rem;
}
#start-next-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f4f3f7, #9a86fd);
  border: none;
  border-radius: 50px;
  box-shadow: 0 4px 8px var(--shadow);
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-btn-emoji {
  font-size: 28px;
}

.next-btn-name {
  font-weight: 700;
  font-size: 18px;
}

#back-to-categories {
  max-width: 150px;
  margin: 15px auto;
  display: block;
}

#start-next-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-lg);
  border-color: var(--primary);
}

.quiz-overview {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-items: center;
  padding-top: 5rem;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 260px;
  background: #fff;
  border: 2px solid var(--border, #eee);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(209, 132, 248, 0.05);
  padding: 24px 28px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-btn:hover {
  background-color: #d0c9f7;
  transform: translateY(-6px);
  box-shadow: 0 8px 24px var(--shadow);
}

.emoji-icon {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
}
.category-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  padding-top: 1rem;
}

#progress-container {
  width: 100%;
  max-width: 400px;
  margin: 15px auto;
  background-color: #e0e0e0;
  border-radius: 10px;
  height: 25px;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background-color: #9e299ebe;
  transition: width 0.3s ease;
}

#progress-text {
  font-family: Arial, sans-serif;
  font-size: 14px;
  margin-top: 5px;
  text-align: center;
}

.difficulty-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  padding-top: 10vh; /* Shifts content slightly up */
}

.option.correct {
  background-color: #4caf50;
  color: white;
}

.option.wrong {
  background-color: #f44336;
  color: white;
}

.option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.start-screen,
.quiz-overview,
.difficulty-screen,
.quiz-container,
.result-screen {
  display: none;
}
.hidden {
  display: none !important;
}
.start-screen {
  display: block;
}
.difficulty-screen h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(200deg, #d72590, #6d1ebd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Tablet: 768px and up */
@media (min-width: 768px) {
  body::after {
    font-size: 20rem;
  }



  .hero-emoji {
    gap: 3rem;
    margin-top: 8rem;
  }

  #start-next-btn {
    width: 100px;
    height: 100px;
  }

  .next-btn-emoji {
    font-size: 36px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    padding-top: 4rem;
    gap: 2rem;
  }

  .category-btn {
    padding: 28px 24px;
  }

  .emoji-icon {
    width: 6rem;
    height: 6rem;
  }

  .category-name {
    font-size: 17px;
  }
  button {
    padding: 13px 22px;
    font-size: 1rem;
    width: 85%;
  }

  #difficulty-buttons {
    flex-direction: row;
    justify-content: center;
  }

  #question {
    padding: 1.75rem;
  }

  .option {
    padding: 15px 22px;
  }

  #timer {
    font-size: 2.5rem;
    padding: 1.75rem;
  }

  #progress-container {
    height: 22px;
    max-width: 450px;
  }

  #progress-text {
    font-size: 14px;
  }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
  body::after {
    font-size: 25rem;
  }

  .hero-emoji {
    gap: 4rem;
    margin-top: 10rem;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    padding-top: 5rem;
    gap: 2rem;
  }

  .category-btn {
    padding: 32px 28px;
  }

  .emoji-icon {
    width: 7rem;
    height: 7rem;
  }

  .category-name {
    font-size: 18px;
  }

  button {
    padding: 14px 24px;
    width: 80%;
  }

  #question {
    padding: 2rem;
  }

  .option {
    padding: 16px 24px;
  }

  #timer {
    font-size: 3rem;
    padding: 2rem;
  }

  #progress-container {
    height: 25px;
    max-width: 500px;
  }
}

.start-screen h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(200deg, #d72590, #7e2bd2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.start-screen p {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-muted);
  margin-bottom: 48px;
}
button {
  padding: 12px 22px;
  margin: 10px 0;
  border: none;
  background: #470f5095;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: 0.2s ease-in-out;
  width: 80%;
  max-width: 300px;
}
#difficulty-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}

button:hover {
  background: #dd97fb;
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.97);
}
#question {
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 700;
  margin-bottom: 20px;
  padding: 1rem;
  color: #9e299e;
  background: rgba(247, 233, 244, 0.3);
  backdrop-filter: blur(5px);
  border-radius: 0px;
}
#quiz-next-btn {
  max-width: 150px;
  margin: 15px auto;
  display: block;
  visibility: hidden;
}

#quit-quiz-btn {
  max-width: 150px;
  margin: 15px auto;
  display: block;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.option {
  width: 100%;
  max-width: 400px;
  padding: 14px 20px;
  font-size: 1rem;
  color: #fefdfe;
  border-radius: 10px;
}
#timer {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 1rem;
}
.result-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.result-screen h2 {
  font-size: 3rem;
  color: #f86e6e;
  margin-bottom: 10px;
  font-weight: 800;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
}
.result-screen p {
  font-size: 2rem;
  margin-bottom: 30px;
  color: #333;
}


#ranking-table p {
  font-size: 1rem;
  margin: 0px;
}


#ranking-table {
  max-width: 50em;
  max-height: 30rem;
  overflow-y: scroll;
  margin: auto;

  border: 2px solid;
  border-image: linear-gradient(45deg, #192e80, #8e1699) 1;
  border-radius: 20px;
  padding: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.2); /* thin separator */
}

.ranking-row:last-child {
  border-bottom: none;
}

  
.hint-image {
  height: 1.7rem;
}

.hint-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.hint-container {
  position: relative;
  margin: auto;
}

#hintBtn {
  background: rgb(123, 117, 158);
  color: white;
  padding: 0.4rem;
  margin: 0.5rem;
  box-shadow: 10px 10px 5px rgb(133, 139, 141);
  border-radius: 1rem;
  font-size: 25px;
  border: none;
  cursor: pointer;
  position: relative;
}

.hint-popup {
  position: absolute;
  top: 2px;
  right: -8px;
  background: red;
  color: white;
  padding: 4px 8px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  flex-direction: column;
  justify-content: center;
  align-items: center; /* centers items horizontally */
  gap: 0.5rem; /* adds spacing between children */
  height: 80vh;
  margin: 0 auto; /* remove top 20% margin */
}

.user-info input,
.user-info button,
.user-info label {
  width: 100%;      /* make them all full width inside the container */
  max-width: 300px; /* optional max width */
  box-sizing: border-box;
}

.user-info label {
  background-color: #9a86fd15;
  padding: 0.5rem;
  border-radius: 2rem;
}

.user-info input {
  padding: 0.5rem;
  border: 2px solid #6d1ebd;
  border-radius: 1.5rem;
}

.user-info button {
  margin-top: 1rem;
}