* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

:root {
  --theme-main: #6aa2ff;
  --theme-accent: #a8d1ff;
  --theme-glow: rgba(140, 180, 255, 0.7);
}

body {
  font-family: "Segoe UI", sans-serif;
  color: white;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at center, var(--theme-main), #0a0f2c 70%);
  animation: bgPulse 6s infinite alternate ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes bgPulse {
  0% {
    background-size: 100% 100%;
  }
  100% {
    background-size: 115% 115%;
  }
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.container {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 2rem;
  border-radius: 1rem;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 25px var(--theme-glow);
  animation: containerFade 0.8s ease-out;
}

@keyframes containerFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

h1,
h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress {
  height: 10px;
  background: var(--theme-main);
  width: 0%;
  transition: width 0.4s ease-out;
}

.question {
  margin: 1.5rem 0;
  font-size: 1.2rem;
  animation: fadeIn 0.5s ease-out;
}

/* Options layout: top row = agree options, bottom row = disagree options */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.75rem;
}

/* base button style */
.options button {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* top row (Agree options) */
.options button[data-type="agree"] {
  flex: 0 0 calc((100% - 1rem) / 3);
  max-width: calc((100% - 1rem) / 3);
}

/* bottom row (Disagree options) */
.options button[data-type="disagree"] {
  flex: 0 0 calc((100% - 1rem) / 3);
  max-width: calc((100% - 1rem) / 3);
}

/* hover / active visuals */
.options button:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 10px var(--theme-glow);
  background: rgba(255, 255, 255, 0.14);
}

.options button:active::after {
  width: 150px;
  height: 150px;
  opacity: 0;
}

/* small screens: stack naturally */
@media (max-width: 520px) {
  .options button {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* small screens: stack more naturally */
@media (max-width: 520px) {
  .options button:nth-child(-n + 3),
  .options button:nth-child(n + 4) {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* dissolve animation */
.dissolve-out {
  animation: dissolve 0.7s forwards;
}
@keyframes dissolve {
  0% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    filter: blur(10px);
    transform: scale(1.05);
  }
}

.result {
  display: none;
  text-align: center;
}

/* stronger, solid result title so it never looks washed out */
#type {
  font-size: 2rem;
  font-weight: 800;
  color: var(--theme-accent);
  opacity: 0;
  animation: wishReveal 1.4s ease-out forwards;
  -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.25);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 255, 255, 0.02);
  /* ensure svg/text rendering remains crisp */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* reveal animation ensures final opacity = 1 */
@keyframes wishReveal {
  0% {
    opacity: 0;
    transform: scale(2) rotate(10deg);
    filter: blur(10px);
  }
  40% {
    opacity: 1;
    transform: scale(0.9);
    filter: blur(0);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: none;
  }
}

#description {
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bar-container {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 0.7rem 0;
}

.bar {
  height: 20px;
  background: var(--theme-main);
  width: 0%;
  animation: growBar 1.3s ease-out forwards;
}

@keyframes growBar {
  from {
    width: 0%;
  }
  to {
    width: var(--final-width);
  }
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
}

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