:root {
  --bg-top: #d9f4ff;
  --bg-bottom: #fff7e8;
  --card: rgba(255, 255, 255, 0.78);
  --text: #2d3142;
  --soft: #5a7d7c;
  --accent: #f08ca4;
  --accent-2: #ffbe8a;
  --good: #3f8f6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom), #ffeff5);
  background-size: 180% 180%;
  overflow-x: hidden;
  position: relative;
  animation: skyShift 14s ease-in-out infinite;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.45;
  z-index: -1;
  animation: float 11s ease-in-out infinite;
}

.ambient-1 {
  width: 280px;
  height: 280px;
  background: #a3d5ff;
  top: -70px;
  left: -40px;
}

.ambient-2 {
  width: 260px;
  height: 260px;
  background: #ffd1dc;
  right: -60px;
  bottom: -40px;
  animation-delay: 2s;
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1.1rem 1rem;
  text-align: center;
  animation: liftIn 0.7s ease both;
}

.tag {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--soft);
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  margin: 0.2rem 0;
}

h1 {
  font-size: clamp(2rem, 4.8vw, 3.4rem);
}

.subtitle {
  max-width: 720px;
  margin: 0.75rem auto 1.2rem;
  line-height: 1.55;
}

.breath-text {
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--soft);
}

.music-wrap {
  margin-top: 0.7rem;
  display: inline-grid;
  gap: 0.55rem;
  justify-items: center;
}

.soft-btn.on {
  background: linear-gradient(120deg, #5fa37f, #8fd4ab);
  color: #fff;
  border: none;
}

.breath-visual {
  width: 148px;
  height: 148px;
  margin: 0.8rem auto 1rem;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.breath-ring,
.breath-core,
.breath-glow {
  position: absolute;
  border-radius: 50%;
  transition: transform 0.8s ease, opacity 0.8s ease, box-shadow 0.8s ease;
}

.breath-ring {
  width: 130px;
  height: 130px;
  border: 2px solid rgba(90, 125, 124, 0.35);
}

.breath-core {
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #ffd0dd 60%, #f6aec2 100%);
  box-shadow: 0 8px 30px rgba(240, 140, 164, 0.35);
}

.breath-glow {
  width: 112px;
  height: 112px;
  background: radial-gradient(circle, rgba(255, 212, 226, 0.55), rgba(255, 212, 226, 0));
  opacity: 0.8;
}

.breath-particles {
  position: absolute;
  inset: 0;
  animation: orbit 10s linear infinite;
}

.breath-particles span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(90, 125, 124, 0.42);
}

.breath-particles span:nth-child(1) { top: 10%; left: 48%; }
.breath-particles span:nth-child(2) { top: 25%; right: 6%; }
.breath-particles span:nth-child(3) { top: 64%; right: 8%; }
.breath-particles span:nth-child(4) { bottom: 8%; left: 48%; }
.breath-particles span:nth-child(5) { top: 65%; left: 7%; }
.breath-particles span:nth-child(6) { top: 24%; left: 8%; }

.breath-visual.inhale .breath-core {
  transform: scale(1.17);
}

.breath-visual.inhale .breath-ring {
  transform: scale(1.08);
  opacity: 0.85;
}

.breath-visual.hold .breath-core {
  transform: scale(1.11);
}

.breath-visual.hold .breath-glow {
  opacity: 1;
}

.breath-visual.exhale .breath-core {
  transform: scale(0.88);
}

.breath-visual.exhale .breath-ring {
  transform: scale(0.92);
  opacity: 0.55;
}

.soft-btn.is-breathing {
  box-shadow: 0 0 0 0 rgba(240, 140, 164, 0.45);
  animation: btnPulse 1.5s ease infinite;
}

.grid {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.5rem 1.1rem 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  backdrop-filter: blur(5px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(45, 49, 66, 0.08);
  animation: liftIn 0.8s ease both;
}

.card:nth-child(2) {
  animation-delay: 0.12s;
}

.card:nth-child(3) {
  animation-delay: 0.22s;
}

.card:nth-child(4) {
  animation-delay: 0.3s;
}

.quote {
  font-size: 1.12rem;
  line-height: 1.6;
  min-height: 84px;
}

.quote.swap {
  animation: quoteSwap 0.35s ease;
}

.soft-btn {
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.soft-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.soft-btn:active {
  transform: scale(0.98);
}

.soft-btn.ghost {
  background: transparent;
  color: var(--soft);
  border: 1px solid rgba(90, 125, 124, 0.4);
}

.soft-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0.5rem 0 0.7rem;
  font-weight: 700;
}

.game-area {
  height: 250px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #eef9ff);
  border: 1px dashed rgba(90, 125, 124, 0.4);
  position: relative;
  overflow: hidden;
}

.star {
  position: absolute;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  cursor: pointer;
  animation: pop 0.25s ease, twinkle 1.1s ease-in-out infinite;
}

.game-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
}

.status {
  margin-top: 0.7rem;
  font-weight: 700;
  color: var(--soft);
}

.status.ok {
  color: var(--good);
}

.status.err {
  color: #c35d6f;
}

.reward-list {
  display: grid;
  gap: 0.65rem;
}

.reward {
  border-radius: 12px;
  padding: 0.7rem;
  border: 1px solid rgba(63, 143, 107, 0.35);
  background: rgba(95, 187, 120, 0.08);
}

.reward.locked {
  filter: grayscale(0.75);
  opacity: 0.62;
}

.reward.unlocked {
  animation: reveal 0.35s ease;
  border-color: rgba(63, 143, 107, 0.7);
  background: rgba(95, 187, 120, 0.18);
}

.reward-note {
  margin-bottom: 0;
  font-style: italic;
}

.reward-media {
  margin: 0.45rem 0 0.6rem;
  height: 135px;
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(90, 125, 124, 0.35);
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 -35px 45px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.reward-media::after {
  content: "Tambah gambar untuk personalize reward";
  position: absolute;
  left: 0.6rem;
  bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(45, 49, 66, 0.72);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.reward-media-2 {
  background-image:
    linear-gradient(140deg, rgba(255, 245, 250, 0.72), rgba(218, 243, 255, 0.75)),
    url("IMG_1039.PNG");
}

.reward-media-3 {
  background-image:
    linear-gradient(140deg, rgba(255, 231, 214, 0.75), rgba(255, 255, 255, 0.8)),
    url("IMG_1040.PNG");
}

.reward-media-3::before {
  content: "mood: serabut -> santai";
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-size: 0.76rem;
  font-weight: 800;
  transform: rotate(-4deg);
  padding: 0.24rem 0.5rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  color: #c35d6f;
}

.reward.unlocked .reward-media {
  animation: mediaPop 0.45s ease;
}

.reward.locked .reward-media {
  pointer-events: none;
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 31, 0.55);
  display: grid;
  place-items: center;
  z-index: 99;
  padding: 1rem;
}

.popup.hidden {
  display: none;
}

.popup-card {
  width: min(92vw, 560px);
  background: #fff;
  border-radius: 16px;
  padding: 0.8rem;
  position: relative;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  animation: liftIn 0.24s ease both;
}

.popup-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  background: rgba(45, 49, 66, 0.08);
}

.popup-image {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(217, 244, 255, 0.45);
}

.contact-card {
  grid-column: 1 / -1;
}

.mail-form {
  display: grid;
  gap: 0.5rem;
}

.mail-form label {
  margin-top: 0.4rem;
  font-weight: 700;
}

.mail-form input,
.mail-form textarea {
  border: 1px solid rgba(90, 125, 124, 0.32);
  border-radius: 10px;
  padding: 0.68rem 0.72rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mail-form input:focus,
.mail-form textarea:focus {
  outline: none;
  border-color: rgba(240, 140, 164, 0.8);
  box-shadow: 0 0 0 3px rgba(240, 140, 164, 0.16);
  transform: translateY(-1px);
}

.mail-form textarea {
  resize: vertical;
  min-height: 110px;
}

footer {
  text-align: center;
  padding: 0.5rem 1rem 2rem;
  font-weight: 700;
  color: var(--soft);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes skyShift {
  0% { background-position: 0% 20%; }
  50% { background-position: 100% 80%; }
  100% { background-position: 0% 20%; }
}

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes quoteSwap {
  from {
    opacity: 0.2;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes twinkle {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.12);
    filter: brightness(1.2);
  }
}

@keyframes btnPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 140, 164, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(240, 140, 164, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 140, 164, 0);
  }
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mediaPop {
  0% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  55% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes reveal {
  from {
    transform: translateY(6px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 700px) {
  .game-area {
    height: 210px;
  }
}
