/* Soft, still ambient wash to calm the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 214, 228, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 85% 88%, rgba(214, 232, 240, 0.35) 0%, transparent 45%);
}

main {
  max-width: 38rem;
  animation: fade-in 0.7s ease;
}

.header h1 { font-weight: 500; }

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 2.5rem;
  max-width: 28rem;
  line-height: 1.7;
}

.relax-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid #f6e7df;
  border-radius: 28px;
  box-shadow: 0 10px 36px rgba(255, 160, 195, 0.14);
  padding: 3rem 2rem;
  text-align: center;
  min-height: 26rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.step.is-active {
  display: flex;
  animation: fade-in 0.6s ease;
}

.step-lead {
  color: var(--ink);
  line-height: 1.75;
  max-width: 26rem;
  margin: 0;
}

/* Mode picker */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  width: 13rem;
  background: #fffafc;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.mode-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.mode-btn.is-active { background: var(--pick-bg); border-color: var(--pick-border); }

.mode-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
}

.mode-detail { font-size: 0.82rem; color: var(--muted); }

.pace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pace label { font-weight: 600; }
.pace #paceValue { color: var(--primary-dark); }

.pace input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #f6f1f3;
  cursor: pointer;
}

.pace input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  box-shadow: 0 1px 3px rgba(255, 107, 157, 0.4);
}

.pace input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
}

.pace input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #f6f1f3;
}

.pace-mini {
  margin-top: 0.5rem;
  max-width: 14rem;
  font-size: 0.82rem;
  opacity: 0.85;
}

.sound-mini {
  font-size: 0.82rem;
  opacity: 0.85;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Player */
.area-counter {
  font-family: "Fredoka", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.pulse {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 38% 30%, #fff6fa 0%, #ffdce8 70%, #ffccdd 100%);
  box-shadow: 0 0 40px rgba(255, 200, 220, 0.45);
  animation: pulse 7s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.94); box-shadow: 0 0 30px rgba(255, 200, 220, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 50px rgba(255, 200, 220, 0.55); }
}

.phase-label {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--primary-dark);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

.area-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 1.45rem;
  color: var(--ink);
  margin: 0;
}

.instruction {
  color: var(--ink);
  line-height: 1.75;
  max-width: 26rem;
  margin: 0;
  min-height: 3.5rem;
}

/* Progress bar */
.progress {
  width: 100%;
  max-width: 24rem;
  height: 6px;
  background: #f3e6ec;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffc0d8, var(--primary));
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* Buttons */
.step-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.65rem 2rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: var(--primary); color: var(--ink); }

/* Done */
.done-mark {
  font-size: 3rem;
  color: var(--primary);
  animation: float-once 0.6s ease;
}

.done-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--ink);
  margin: 0;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float-once {
  0% { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  main, .step.is-active, .done-mark, .pulse { animation: none; }
}

/* dark mode: light card / buttons / slider tracks need dark surfaces */
html.dark .relax-card { background: var(--card); border-color: var(--border); }
html.dark .mode-btn { background: var(--bg); }
html.dark .pace input[type="range"],
html.dark .pace input[type="range"]::-webkit-slider-runnable-track,
html.dark .pace input[type="range"]::-moz-range-track { background: var(--border); }
