/* ====== Base ====== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050312;
  --fg: #f7f4ff;
  --fg-muted: #b9b5d9;
  --accent: #f9a8ff;
  --accent-soft: #e0b6ff;
  --glass: rgba(12, 10, 35, 0.8);
  --outline: #f973ff;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #1b1234 0, #050312 55%, #02010a 100%);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
}

/* ====== Background orbs ====== */

.background {
  position: fixed;
  inset: -20vh -20vw;
  z-index: -1;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.65;
  mix-blend-mode: screen;
  pointer-events: none;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #ff9cf5, transparent 60%);
  top: -80px;
  left: -40px;
  animation: float-orb-1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #7afcff, transparent 60%);
  right: -120px;
  bottom: -40px;
  animation: float-orb-2 24s ease-in-out infinite alternate;
}

.orb-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #fef3b6, transparent 60%);
  left: 40%;
  top: 60%;
  animation: float-orb-3 22s ease-in-out infinite alternate;
}

@keyframes float-orb-1 {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(60px, 40px, 0);
  }
}

@keyframes float-orb-2 {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-80px, -40px, 0);
  }
}

@keyframes float-orb-3 {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(30px, -40px, 0);
  }
}

/* ====== Shell / Layout ====== */

.shell {
  width: 100%;
  max-width: 900px;
  max-height: 720px;
  background: radial-gradient(circle at top left, #ffffff0d, #060515e6);
  border-radius: 32px;
  padding: 2.2rem clamp(1.6rem, 3vw, 2.4rem);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 120px rgba(0, 0, 0, 0.85);
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(24px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero {
  text-align: center;
  margin-bottom: 1.6rem;
}

.hero-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: radial-gradient(circle at 0 0, #ffffff, #f9a8ff, #7afcff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 0.5rem;
}

.hero-subtitle {
  margin: 0;
  font-size: 0.98rem;
  color: var(--fg-muted);
  max-width: 32rem;
  margin-inline: auto;
}

/* ====== Progress bar ====== */

.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: radial-gradient(circle at top, #ffffff0b, #060515b3);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.progress-step {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.32rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #8c85b5;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.progress-step .step-label {
  font-weight: 700;
  opacity: 0.8;
}

.progress-step .step-text {
  font-weight: 500;
}

.progress-step.active {
  background: radial-gradient(circle at top left, #f9a8ff33, #7afcff22);
  color: #fef9ff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 18px rgba(249, 168, 255, 0.6);
}

.progress-step.completed {
  color: #d1ffee;
}

.progress-separator {
  width: 20px;
  height: 1px;
  background: linear-gradient(to right, #5f5a86, #9a88ff);
  opacity: 0.5;
}

/* ====== Panels ====== */

.panel {
  flex: 1;
  display: none;
  overflow: hidden;
}

.panel.active {
  display: block;
  animation: panel-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-inner {
  height: 100%;
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem 1.1rem;
  background: radial-gradient(circle at top left, #ffffff0a, #05041bfa);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 12px 38px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-inner--center {
  justify-content: flex-start;
}

.panel-inner h2 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

.panel-text {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0.1rem 0 1.2rem;
}

.panel-text strong {
  color: #fef2ff;
}

.subtle {
  font-size: 0.86rem;
  opacity: 0.85;
}

/* ====== Inputs ====== */

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.label-optional {
  font-size: 0.78rem;
  opacity: 0.6;
}

.text-input {
  width: 100%;
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at top, #ffffff0a, #040218f2);
  color: var(--fg);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.text-input::placeholder {
  color: rgba(207, 204, 235, 0.65);
}

.text-input:focus {
  border-color: var(--outline);
  box-shadow: 0 0 0 1px rgba(249, 115, 255, 0.75), 0 0 20px rgba(249, 115, 255, 0.45);
  background: radial-gradient(circle at top, #ffffff12, #05031cff);
}

/* ====== Buttons (generic) ====== */

.primary-btn,
.ghost-btn {
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.6rem;
  border: none;
  cursor: pointer;
  font: 600 0.88rem "DM Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #f9a8ff, #faccff 40%, #7afcff);
  color: #19041c;
  box-shadow:
    0 14px 35px rgba(0, 0, 0, 0.75),
    0 0 26px rgba(249, 168, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.primary-btn:hover:not(:disabled),
.primary-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.9),
    0 0 34px rgba(249, 168, 255, 0.95);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(249, 168, 255, 0.7);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.ghost-btn {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: radial-gradient(circle at top, #ffffff18, #07061e);
  color: #f3eeff;
  transform: translateY(-1px);
}

.ghost-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.ghost-btn--quiet {
  border-style: dashed;
  opacity: 0.75;
}

/* ====== Oath list ====== */

.oath-list {
  margin: 0 0 1rem;
  padding: 0.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.oath-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  cursor: pointer;
}

.oath-item input[type="checkbox"] {
  margin-top: 0.05rem;
  accent-color: #f9a8ff;
  width: 1rem;
  height: 1rem;
}

.oath-item span {
  flex: 1;
}

/* ====== Actions ====== */

.panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.panel-actions--center {
  justify-content: center;
}

/* ====== The Button Area ====== */

.button-area {
  margin-top: 1.1rem;
  margin-bottom: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 220px;
}

.button-temple {
  position: relative;
  padding: 1.7rem 2rem;
  border-radius: 38px;
  background: radial-gradient(circle at top, #ffffff1f, #080723e6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.button-plate {
  position: relative;
  padding: 1.1rem 1.2rem;
  border-radius: 999px;
  background: radial-gradient(circle at top, #ffffff15, #050214f7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.button-halo {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbf0, #f9a8ff55, transparent 65%);
  filter: blur(26px);
  opacity: 0.8;
  pointer-events: none;
  animation: halo-pulse 2.8s ease-in-out infinite;
}

@keyframes halo-pulse {
  0% {
    transform: scale(0.96);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(0.96);
    opacity: 0.7;
  }
}

/* ====== Legendary Button ====== */

.legendary-button {
  position: relative;
  border: none;
  padding: 0 2.4rem;
  height: 4.2rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #180416;
  background:
    radial-gradient(circle at 0% 0%, #ffffff55, transparent 60%),
    linear-gradient(135deg, #ff9cf5 0%, #ffb347 30%, #fff799 50%, #7afcff 70%, #c4b5fd 100%);
  background-size: 220% 220%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 22px 60px rgba(0, 0, 0, 0.95),
    0 0 60px rgba(255, 187, 255, 0.85);
  outline: none;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease,
    background-position 0.4s ease;
}

.legendary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.8) 45%,
    rgba(255, 255, 255, 0.6) 55%,
    transparent 100%
  );
  transform: translateX(-120%);
  opacity: 0.0;
  pointer-events: none;
}

.legendary-button::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
}

.legendary-button:hover,
.legendary-button:focus-visible {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.98),
    0 0 90px rgba(255, 213, 255, 0.95);
  background-position: 100% 50%;
  filter: saturate(120%);
}

.legendary-button:hover::before,
.legendary-button:focus-visible::before {
  animation: button-shimmer 1.3s ease-in-out forwards;
}

.legendary-button:hover::after,
.legendary-button:focus-visible::after {
  opacity: 0.7;
}

.legendary-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.9),
    0 0 55px rgba(255, 187, 255, 0.85);
}

/* Shimmer */
@keyframes button-shimmer {
  0% {
    transform: translateX(-130%);
    opacity: 0;
  }
  25% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(130%);
    opacity: 0;
  }
}

/* Ripple effect on click */
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 60%);
  transform: scale(0);
  opacity: 0.9;
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* Confetti */
.confetti-piece {
  position: absolute;
  top: 45%;
  width: 6px;
  height: 14px;
  border-radius: 999px;
  opacity: 0;
  animation: confetti-fall 2.2s ease-out forwards;
  animation-delay: var(--confetti-delay, 0s);
  transform: rotate(var(--confetti-rotation, 0deg));
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(var(--confetti-rotation, 0deg));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(260px) rotate(calc(var(--confetti-rotation, 0deg) + 120deg));
    opacity: 0;
  }
}

/* ====== Text near button ====== */

.user-name-slot {
  color: #fef2ff;
}

.moment-text {
  margin: 0.4rem 0 0.7rem;
  font-size: 0.96rem;
  color: #f3ecff;
  text-align: center;
}

/* Psychology note text */
.psychology-note {
  margin-top: 0.4rem;
}

/* ====== Footer ====== */

.page-footer {
  margin-top: 1rem;
  font-size: 0.78rem;
  text-align: center;
  color: #a59cd0;
}

.page-footer .highlight {
  color: #fef2ff;
}

/* ====== Responsiveness ====== */

@media (max-width: 720px) {
  body {
    padding: 0.6rem;
    overflow: auto;
  }

  .shell {
    max-height: none;
    height: auto;
    padding: 1.4rem 1.2rem;
  }

  .panel-inner {
    padding: 1.1rem 1rem 1rem;
  }

  .button-temple {
    padding: 1.2rem 1.1rem;
  }

  .legendary-button {
    width: 100%;
  }

  .panel-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .progress {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }
}
