/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ===== PAGES ===== */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.page.active {
  opacity: 1;
  pointer-events: all;
}

/* Page 1 background */
#page1 {
  background: linear-gradient(135deg, #1a1a2e, #1e2a5e, #0f3460, #6b3fa0, #1a1a2e);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* Page 2 background */
#page2 {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460, #533483);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* Page 3 background */
#page3 {
  background: linear-gradient(135deg, #1a1a2e, #0f3460, #533483);
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== FLOATING BUBBLES ===== */
.bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -100px;
  border-radius: 50%;
  opacity: 0.25;
  animation: rise linear infinite;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.25;
  }
  100% {
    transform: translateY(-110vh) scale(1.2);
    opacity: 0;
  }
}

/* ===== CARD ===== */
.card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  border-radius: 28px;
  padding: 48px 40px 48px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.18);
  animation: cardIn 0.6s ease both;
}

#card1 {
  overflow: hidden;
}

@keyframes cardIn {
  from {
    transform: scale(0.8) translateY(30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ===== TITLE ===== */
.title {
  font-family: "Cinzel Decorative", cursive;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #fff;
  text-shadow:
    0 0 20px #a78bfa,
    0 0 40px #60a5fa;
  margin-bottom: 10px;
  line-height: 1.3;
}

#card1 .title {
  font-family: "Playfair Display", serif;
}

.subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 28px;
}

/* ===== INPUT ===== */
.input-wrap {
  position: relative;
  margin-bottom: 28px;
}

.input-decoration {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.input-decoration::before,
.input-decoration::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 139, 250, 0.45),
    rgba(255, 110, 199, 0.35),
    transparent
  );
}

.input-decoration span {
  font-size: 0.65rem;
  color: rgba(167, 139, 250, 0.6);
  letter-spacing: 6px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #a78bfa;
  font-size: 1.1rem;
}

input[type="text"] {
  width: 70%;
  margin: 0 auto;
  display: block;
  padding: 14px 18px;
  text-align: center;
  border-radius: 50px;
  border: 2px solid rgba(167, 139, 250, 0.5);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 1rem;
  font-family: "DM Sans", sans-serif;
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

input[type="text"]:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

#card1 .btn {
  font-size: 0.95rem;
  font-weight: 400;
  padding: 12px 28px;
  width: 45%;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 24px rgba(167, 139, 250, 0.5);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 32px rgba(167, 139, 250, 0.7);
}

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

@keyframes btnShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== ICONS ===== */
.icons-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 1.6rem;
}

.bottom-icons {
  margin-top: 28px;
  margin-bottom: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.icon-spin {
  animation: spin 4s linear infinite;
  display: inline-block;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}
.icon-pulse {
  animation: pulse 1.2s ease infinite;
  display: inline-block;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.icon-float {
  animation: float 2s ease-in-out infinite;
  display: inline-block;
}

/* ===== RAINBOW BOUNCE ===== */
.rainbow-bounce {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(167, 139, 250, 0.1) 0%,
    rgba(96, 165, 250, 0.08) 10%,
    rgba(110, 255, 145, 0.06) 20%,
    rgba(255, 230, 109, 0.05) 30%,
    rgba(255, 110, 199, 0.04) 40%,
    transparent 55%
  );
  border-radius: 0;
}

@keyframes subtleBounce {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-8px) scaleY(1.05);
  }
}

/* ===== PAGE 2: SWIRL CARD ===== */
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.swirl-card {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.18);
  max-width: 560px;
  padding: 44px 48px 32px;
  min-height: auto;
}

.swirl-label {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: #fff;
  text-shadow:
    0 0 20px #a78bfa,
    0 0 40px #60a5fa;
  margin-bottom: 14px;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.option-prompt {
  color: rgba(255, 255, 255, 0.75);
  font-size: calc(1.05rem + 2px);
  margin-bottom: 8px;
  line-height: 1.5;
}

.compliment-box {
  background: none;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
  color: white !important;
  font-size: clamp(16px, 2.5vw, 22px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

.compliment-box-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: grid-template-rows 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
}

.compliment-box-wrap.visible {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 16px;
  margin-bottom: 16px;
}

.compliment-box-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.compliment-box-inner::before,
.compliment-box-inner::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 139, 250, 0.5),
    transparent
  );
}

.compliment-box::before {
  content: "✦  ";
  color: rgba(168, 85, 181, 0.7);
  font-style: normal;
}

.compliment-box::after {
  content: "  ✦";
  color: rgba(168, 85, 181, 0.7);
  font-style: normal;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.big-icon {
  font-size: 2.5rem;
  margin-bottom: 18px;
  display: block;
}

.heart-symbol {
  font-size: 2.5rem;
  color: #ff4444;
  margin-bottom: 18px;
  display: block;
}

.compliment-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 110, 199, 0.5);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.95rem;
  font-family: "DM Sans", sans-serif;
  text-align: center;
  margin-bottom: 20px;
  outline: none;
  resize: none;
  overflow: hidden;
  min-height: 44px;
  line-height: 1.4;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 2px solid rgba(255, 110, 199, 0.5);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 1rem;
  font-family: "DM Sans", sans-serif;
  resize: none;
  outline: none;
  margin-bottom: 24px;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
textarea:focus {
  border-color: #ff6ec7;
  box-shadow: 0 0 20px rgba(255, 110, 199, 0.4);
}

.btn-row {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 5px;
}

.ego-btn {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 0;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  text-align: center;
  justify-content: center;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(8px);
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ego-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.2);
}

.ego-btn:active {
  transform: scale(0.97);
}

.celebrate-btn {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 14px 0;
  width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto 0;
  border-radius: 50px;
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: rgba(196, 181, 253, 0.8);
  box-shadow: none;
  transition: all 0.25s ease;
}

.celebrate-btn:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.6);
  color: rgba(196, 181, 253, 1);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.25);
  transform: translateY(-2px);
}

.celebrate-btn:active {
  transform: scale(0.97);
}

/* ===== PAGE 3: BOMB CARD ===== */
.bomb-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  border-radius: 28px;
  padding: 50px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 10;
  animation:
    cardIn 0.6s ease both,
    bombPop 0.6s ease both;
  box-shadow: 0 0 80px rgba(255, 107, 53, 0.4);
}

@keyframes bombPop {
  0% {
    transform: scale(0.5) rotate(-10deg);
  }
  60% {
    transform: scale(1.1) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.bomb-emoji {
  font-size: 5rem;
  display: inline-block;
  margin-bottom: 16px;
}

@keyframes bombShake {
  from {
    transform: rotate(-8deg) scale(1);
  }
  to {
    transform: rotate(8deg) scale(1.1);
  }
}

.bomb-text {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  background: linear-gradient(90deg, #ff6b35, #ffe66d, #ff6ec7, #60a5fa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: btnShift 8s ease infinite;
  margin-bottom: 4px;
}

.bomb-name {
  color: #ffe66d;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(255, 230, 109, 0.6);
  text-align: center;
}

.bomb-reason {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 24px;
  max-height: 80px;
  overflow-y: auto;
}

.restart-btn {
  background: linear-gradient(90deg, #ff6b35, #ffe66d);
  margin-top: 16px;
  font-size: 0.95rem;
  padding: 12px 48px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  animation: restartPulse 2.5s ease-in-out infinite;
}

@keyframes restartPulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  }
  50% {
    box-shadow: 0 4px 28px rgba(255, 107, 53, 0.6);
  }
}
