:root {
  --bg: #05060c;
  --bg-soft: #090d18;
  --ink: #fbf7f5;
  --muted: rgba(251, 247, 245, 0.68);
  --faint: rgba(251, 247, 245, 0.14);
  --rose: #ff6f91;
  --rose-2: #ff9eb2;
  --gold: #ffd37a;
  --mint: #8ef4d6;
  --blue: #8ab7ff;
  --violet: #bca0ff;
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 14px 44px rgba(0, 0, 0, 0.24);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1.18, 0.28, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 18px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 111, 145, 0.15), transparent 30rem),
    radial-gradient(circle at 82% 22%, rgba(138, 183, 255, 0.12), transparent 28rem),
    linear-gradient(180deg, #05060c 0%, #08101e 52%, #07080f 100%);
  -webkit-font-smoothing: antialiased;
}

body.is-world-open {
  overflow-x: hidden;
  overflow-y: auto;
}

body.is-modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid rgba(255, 211, 122, 0.9);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 120;
  padding: 10px 14px;
  border: 1px solid rgba(255, 211, 122, 0.4);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(8, 10, 19, 0.88);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: 220ms var(--ease);
}

.skip-link:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 111, 145, 0.16), transparent 16rem),
    rgba(5, 6, 12, 0.96);
  transition: opacity 720ms var(--ease), visibility 720ms;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-mark {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 111, 145, 0.22), rgba(255, 111, 145, 0.05) 56%, transparent 58%);
}

.loader-mark::before {
  content: "\2665";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--rose-2);
  font-size: 2.4rem;
  text-shadow: 0 0 24px rgba(255, 111, 145, 0.8);
  animation: heartIdle 1.5s ease-in-out infinite;
}

.app-loader p {
  margin: 0;
  letter-spacing: 0.04em;
}

.connection-pill {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 85;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 211, 122, 0.24);
  border-radius: 999px;
  color: rgba(255, 248, 250, 0.86);
  background: rgba(10, 12, 22, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px) scale(0.97);
  transition: 420ms var(--ease);
}

.connection-pill.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

#sky-canvas,
.aurora-layer,
.fog-layer,
.moon-glow,
.hold-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#sky-canvas {
  z-index: 0;
}

.aurora-layer {
  z-index: 1;
  opacity: 0.75;
  background:
    radial-gradient(ellipse at 25% 18%, rgba(142, 244, 214, 0.16), transparent 36%),
    radial-gradient(ellipse at 80% 10%, rgba(188, 160, 255, 0.18), transparent 34%),
    linear-gradient(105deg, transparent 0%, rgba(255, 111, 145, 0.08) 28%, transparent 56%);
  filter: blur(28px);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.fog-layer {
  z-index: 2;
  opacity: 0.38;
  background:
    radial-gradient(ellipse at 18% 82%, rgba(255, 255, 255, 0.09), transparent 34%),
    radial-gradient(ellipse at 90% 70%, rgba(255, 211, 122, 0.08), transparent 26%);
  filter: blur(36px);
  animation: fogFloat 26s ease-in-out infinite alternate;
}

.moon-glow {
  z-index: 3;
  background: radial-gradient(circle at 78% 13%, rgba(255, 244, 214, 0.34), rgba(255, 244, 214, 0.08) 8rem, transparent 18rem);
  opacity: 0.7;
}

.hold-veil {
  z-index: 11;
  opacity: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  transition: opacity 700ms var(--ease);
}

body.is-holding .hold-veil {
  opacity: 1;
}

.app-shell {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

.glass-panel {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(130%);
  transform: translateZ(0);
}

.glass-panel::selection,
::selection {
  color: #1b1118;
  background: rgba(255, 211, 122, 0.86);
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.985);
  filter: blur(16px);
  pointer-events: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), filter 700ms var(--ease), visibility 700ms;
}

.stage.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.unlock-card,
.charge-card {
  width: min(94vw, 460px);
  border-radius: 28px;
  padding: clamp(24px, 6vw, 42px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.02;
}

h1 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(3.4rem, 10vw, 6.8rem);
  color: #fff6f8;
  text-shadow: 0 0 34px rgba(255, 111, 145, 0.32);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: 0;
}

.stage-copy,
.chapter-copy,
.hero-copy p,
.section-heading p + h2 + p {
  color: var(--muted);
  line-height: 1.7;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 14px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 158, 178, 0.72);
  border-radius: 999px;
  box-shadow: inset 0 0 0 0 var(--rose-2), 0 0 0 rgba(255, 111, 145, 0);
  transition: 240ms var(--ease);
}

.pin-dots span.is-filled {
  box-shadow: inset 0 0 0 9px var(--rose-2), 0 0 18px rgba(255, 111, 145, 0.76);
  transform: scale(1.14);
}

.pin-error,
.pin-hint {
  min-height: 1.3em;
  margin: 8px 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: 260ms var(--ease);
}

.pin-error {
  color: #ff9aa6;
  font-weight: 600;
}

.pin-hint {
  color: var(--gold);
  font-size: 0.86rem;
}

.pin-error.is-visible,
.pin-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: min(100%, 288px);
  margin: 24px auto 0;
}

.key {
  width: 72px;
  height: 72px;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 1.35rem;
  transition: transform 170ms var(--ease), background 170ms var(--ease), box-shadow 170ms var(--ease);
}

.key:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 28px rgba(255, 111, 145, 0.18);
}

.key:active {
  transform: scale(0.9);
}

.record-btn:active,
.ending-button:active,
.bucket-item:active,
.envelope-card:active,
.story-dot:active {
  transform: scale(0.96);
}

.key.is-utility {
  font-size: 0.82rem;
  color: var(--muted);
  background: transparent;
}

.is-shaking {
  animation: shake 420ms both;
}

.charge-heart {
  position: relative;
  width: clamp(132px, 34vw, 190px);
  height: clamp(132px, 34vw, 190px);
  margin: 28px auto 24px;
  border: 0;
  border-radius: 50%;
  color: var(--rose);
  background: radial-gradient(circle, rgba(255, 111, 145, 0.24), rgba(255, 111, 145, 0.04) 62%, transparent 68%);
  cursor: pointer;
  font-size: clamp(5.5rem, 18vw, 8rem);
  line-height: 1;
  text-shadow: 0 0 44px rgba(255, 111, 145, 0.9);
  animation: heartIdle 2.6s infinite;
  transition: transform 220ms var(--ease), filter 220ms var(--ease);
}

.charge-heart::before,
.hold-button::before,
.hold-button::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 111, 145, 0.38);
  border-radius: inherit;
  animation: pulseRing 2.2s infinite;
}

.charge-heart.is-tapped {
  transform: scale(1.1);
  filter: saturate(1.25) brightness(1.1);
}

.charge-meter {
  width: min(100%, 320px);
  height: 10px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.charge-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--violet));
  box-shadow: 0 0 22px rgba(255, 111, 145, 0.72);
  transition: width 360ms var(--ease);
}

.charge-count {
  margin: 12px 0 0;
  color: var(--gold);
  font-weight: 700;
}

.stage-cinema {
  background: #000;
  z-index: 30;
}

.stage-cinema p {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  letter-spacing: 0.04em;
  animation: cinemaText 4.5s var(--ease) both;
}

.cinema-stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 12px white;
  animation: starBirth 3.8s var(--ease) both;
}

.cinema-pulse {
  position: absolute;
  width: min(72vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 111, 145, 0.16), transparent 64%);
  animation: cinemaPulse 1.4s ease-in-out infinite;
}

.world {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px clamp(76px, 7vw, 104px) 80px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(26px);
  filter: blur(16px);
  pointer-events: none;
  transition: opacity 1000ms var(--ease), transform 1000ms var(--ease), filter 1000ms var(--ease), visibility 1000ms;
}

.world.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  filter: blur(0);
  pointer-events: auto;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 44;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transition: opacity 500ms var(--ease);
}

.world.is-active .scroll-progress {
  opacity: 1;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold), var(--rose-2), var(--mint));
  box-shadow: 0 0 16px rgba(255, 111, 145, 0.65);
  will-change: transform;
}

.story-rail {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  z-index: 42;
  display: grid;
  gap: 9px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 48px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(18px, -50%, 0);
  transition: 650ms var(--ease);
}

.world.is-active .story-rail {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, -50%, 0);
}

.story-dot {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 220ms var(--ease-spring), background 220ms var(--ease), box-shadow 220ms var(--ease);
}

.story-dot::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(255, 248, 250, 0.62);
  box-shadow: 0 0 12px rgba(255, 248, 250, 0.25);
}

.story-dot::after {
  content: attr(aria-label);
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 248, 250, 0.86);
  background: rgba(8, 10, 19, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  font-size: 0.74rem;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(8px, -50%, 0);
  transition: 220ms var(--ease);
}

.story-dot:hover,
.story-dot.is-active {
  transform: scale(1.08);
  background: rgba(255, 211, 122, 0.14);
  box-shadow: 0 0 26px rgba(255, 111, 145, 0.16);
}

.story-dot:hover::after,
.story-dot:focus-visible::after {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}

.story-dot.is-active::before {
  inset: 9px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 211, 122, 0.72);
}

.world-hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 28px;
}

.hero-copy {
  max-width: 740px;
}

.hero-copy p:last-child {
  max-width: 620px;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.music-player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  padding: 18px;
  border-radius: 24px;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), border-color 260ms var(--ease);
}

.music-player:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 211, 122, 0.24);
}

.record-btn {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #111 0 20%, #2b1a25 22% 42%, #111 44% 66%, #3a2630 68%);
  cursor: pointer;
  box-shadow: 0 0 28px rgba(255, 111, 145, 0.24);
  transition: transform 220ms var(--ease-spring), box-shadow 220ms var(--ease), filter 220ms var(--ease);
}

.record-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.12);
  box-shadow: 0 0 36px rgba(255, 111, 145, 0.38);
}

.record {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(255, 211, 122, 0.18);
}

.music-player.is-playing .record-btn {
  animation: spin 4s linear infinite;
}

.song-meta span,
.song-meta strong {
  display: block;
}

.song-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.song-meta strong {
  margin-top: 3px;
  font-size: 1.04rem;
}

.equalizer {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 34px;
}

.equalizer i {
  display: block;
  width: 5px;
  height: 10px;
  border-radius: 999px;
  background: var(--rose-2);
  opacity: 0.45;
}

.music-player.is-playing .equalizer i {
  animation: eq 900ms ease-in-out infinite alternate;
}

.music-player.is-playing .equalizer i:nth-child(2) { animation-delay: 120ms; }
.music-player.is-playing .equalizer i:nth-child(3) { animation-delay: 240ms; }
.music-player.is-playing .equalizer i:nth-child(4) { animation-delay: 360ms; }

.chapter {
  padding: clamp(52px, 9vw, 96px) 0;
  scroll-margin-top: 34px;
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 26px;
}

.section-heading h2 {
  max-width: 760px;
}

.counters-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 18px;
}

.counter-card {
  min-height: 300px;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 28px;
}

.counter-card.centerpiece {
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 111, 145, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
}

.time-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.dream-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.time-cell,
.stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  transition: transform 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease);
}

.time-cell:hover,
.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 211, 122, 0.24);
  background: rgba(255, 255, 255, 0.095);
}

.time-cell {
  padding: 18px 10px;
  text-align: center;
}

.time-cell strong {
  display: block;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1;
}

.time-cell span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sakinah-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sakinah-card {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: clamp(22px, 3vw, 30px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 24% 10%, rgba(142, 244, 214, 0.13), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(255, 211, 122, 0.12), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.045));
  transition: transform 280ms var(--ease), border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}

.sakinah-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 211, 122, 0.12);
  border-radius: 22px;
  pointer-events: none;
}

.sakinah-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 211, 122, 0.26);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.4), 0 0 42px rgba(142, 244, 214, 0.08);
}

.sakinah-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sakinah-meta strong {
  color: rgba(255, 248, 250, 0.74);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: right;
}

.arabic-line {
  margin: 0 0 18px;
  color: #fff9ea;
  font-family: "Times New Roman", serif;
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  line-height: 1.85;
  text-shadow: 0 0 24px rgba(255, 211, 122, 0.16);
}

.sakinah-card blockquote {
  margin: 0;
  color: rgba(255, 248, 250, 0.9);
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.22;
}

.sakinah-card p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.stat-card {
  padding: 24px 18px;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 18px -20px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 111, 145, 0.28);
  filter: blur(20px);
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.stat-card span:last-child {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 25px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 211, 122, 0.7), transparent);
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  align-items: start;
  max-width: 820px;
  opacity: 0;
  transform: translateY(26px);
  transition: 720ms var(--ease);
}

.timeline-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 22px rgba(255, 211, 122, 0.22);
}

.timeline-body {
  padding: 20px;
  border-radius: 22px;
  transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}

.timeline-card:hover .timeline-body {
  transform: translateX(4px);
  border-color: rgba(255, 211, 122, 0.24);
}

.timeline-body h3 {
  margin: 0 0 8px;
}

.timeline-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.love-note-card {
  position: relative;
  display: block;
  width: min(100%, 660px);
  min-height: clamp(300px, 42vw, 380px);
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1200px;
  transform: translateZ(0);
}

.note-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 211, 122, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 780ms var(--ease), box-shadow 780ms var(--ease);
}

.love-note-card:hover .note-face {
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), 0 0 44px rgba(255, 111, 145, 0.12);
}

.note-front strong {
  font-family: "Dancing Script", cursive;
  font-size: clamp(2.5rem, 7vw, 4.2rem);
}

.note-front small {
  margin-top: -28px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.note-back {
  transform: rotateY(180deg);
}

.note-back em {
  display: block;
  max-width: 540px;
  max-height: 100%;
  overflow: auto;
  padding: 4px 8px;
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.28rem, 3.5vw, 2.15rem);
  line-height: 1.28;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 122, 0.45) transparent;
}

.note-back em::-webkit-scrollbar {
  width: 6px;
}

.note-back em::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 211, 122, 0.38);
}

.love-note-card.is-flipped .note-front {
  transform: rotateY(-180deg);
}

.love-note-card.is-flipped .note-back {
  transform: rotateY(0);
}

.love-note-card.is-refreshing .note-back em {
  animation: noteRefresh 360ms var(--ease) both;
}

.letters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(156px, 1fr));
  gap: 16px;
}

.letters-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 22px;
}

.letter-search {
  display: grid;
  gap: 8px;
}

.letter-search span,
.letters-count,
.letter-message-count {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.letter-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  outline: 0;
  padding: 0 16px;
  color: #fff8fa;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.035);
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease);
}

.letter-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.letter-search input:focus {
  border-color: rgba(255, 211, 122, 0.58);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 4px rgba(255, 211, 122, 0.09), inset 0 0 24px rgba(255, 211, 122, 0.045);
}

.letters-count {
  margin: 0;
  text-align: right;
  max-width: 230px;
  line-height: 1.5;
}

.letters-clear,
.letters-more {
  min-height: 48px;
  border: 1px solid rgba(255, 211, 122, 0.24);
  border-radius: 16px;
  padding: 0 16px;
  color: #fff8fa;
  background: rgba(255, 211, 122, 0.1);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 220ms var(--ease), visibility 220ms, transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}

.letters-clear {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
}

.letters-clear.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.letters-clear:hover,
.letters-clear:focus-visible,
.letters-more:hover,
.letters-more:focus-visible {
  border-color: rgba(255, 211, 122, 0.52);
  background: rgba(255, 211, 122, 0.16);
}

.letters-more {
  display: block;
  width: min(100%, 360px);
  margin: 18px auto 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.letters-more.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.letters-empty {
  margin: 18px auto 0;
  max-width: 520px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 211, 122, 0.22);
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  background: rgba(255, 255, 255, 0.055);
  transition: opacity 260ms var(--ease), visibility 260ms, transform 260ms var(--ease);
}

.letters-empty.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.envelope-card {
  position: relative;
  min-height: 156px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.envelope-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 211, 122, 0.28);
}

.envelope-flap {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 158, 178, 0.18), rgba(255, 211, 122, 0.08));
  clip-path: polygon(0 0, 50% 48%, 100% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  transition: transform 520ms var(--ease);
}

.envelope-card:hover .envelope-flap,
.envelope-card.is-opened .envelope-flap {
  transform: rotateX(52deg);
}

.envelope-content {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  height: 100%;
  padding: 18px 16px;
}

.envelope-content strong {
  max-width: 14ch;
  font-size: 0.94rem;
  line-height: 1.28;
  text-wrap: balance;
}

.envelope-content span {
  font-size: 2rem;
}

.envelope-content small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.hold-card {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 30px;
}

.hold-button {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(112px, 24vw, 160px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 111, 145, 0.55);
  border-radius: 50%;
  background: rgba(255, 111, 145, 0.12);
  cursor: pointer;
  color: var(--rose);
  font-size: 4rem;
  box-shadow: 0 0 46px rgba(255, 111, 145, 0.26);
}

.hold-button::after {
  animation-delay: 600ms;
}

.hold-button span {
  position: relative;
  z-index: 1;
}

body.is-holding .hold-button span {
  animation: heartIdle 780ms infinite;
}

.hold-message {
  grid-column: 1 / -1;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--gold);
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  opacity: 0;
  transition: 700ms var(--ease);
}

.hold-card.is-complete .hold-message {
  max-height: 120px;
  opacity: 1;
}

.hold-card.is-deep .hold-message {
  color: #fff4d2;
  text-shadow: 0 0 26px rgba(255, 211, 122, 0.22);
}

.bucket-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
}

.bucket-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: left;
  padding: 14px 16px;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}

.bucket-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 211, 122, 0.24);
  background: rgba(255, 255, 255, 0.085);
}

.checkmark {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 211, 122, 0.6);
  border-radius: 8px;
  color: transparent;
  transition: 260ms var(--ease);
}

.bucket-item.is-checked .checkmark {
  color: #16120b;
  background: var(--gold);
  transform: rotate(-4deg) scale(1.06);
}

.constellation {
  position: relative;
  min-height: clamp(380px, 58vw, 560px);
  overflow: hidden;
  border-radius: 30px;
}

.constellation svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.28;
}

.star-button {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 220ms var(--ease-spring);
}

.star-button:hover {
  transform: translate(-50%, -50%) scale(1.18);
}

.star-button::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 12px white, 0 0 34px rgba(255, 211, 122, 0.75);
  animation: twinkle 2.6s ease-in-out infinite;
}

.star-button::after {
  content: attr(data-label);
  position: absolute;
  top: 28px;
  left: 50%;
  width: max-content;
  max-width: 130px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.72rem;
}

.star-button.is-opened::before {
  background: var(--gold);
}

.star-button.is-secret::before {
  background: var(--rose-2);
  box-shadow: 0 0 16px rgba(255, 158, 178, 0.95), 0 0 48px rgba(255, 111, 145, 0.72);
  animation: secretTwinkle 1.8s ease-in-out infinite;
}

.star-button.is-secret::after {
  color: rgba(255, 219, 228, 0.92);
}

.ending-section {
  min-height: 72vh;
  display: grid;
  place-items: center;
}

.ending-card {
  max-width: 720px;
  padding: clamp(28px, 6vw, 54px);
  border-radius: 32px;
  text-align: center;
}

.ending-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.ending-lines {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.ending-line {
  display: block;
  color: rgba(255, 248, 250, 0.82);
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease), filter 900ms var(--ease);
  transition-delay: calc(var(--line-index) * 520ms);
}

.ending-card.is-reading .ending-line {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.ending-card.is-reading .ending-button {
  opacity: 0.72;
}

.ending-button {
  margin-top: 18px;
  border: 1px solid rgba(255, 211, 122, 0.42);
  border-radius: 999px;
  padding: 13px 22px;
  background: rgba(255, 211, 122, 0.13);
  cursor: pointer;
}

body.is-ending .world > *:not(.ending-section) {
  opacity: 0.08;
  filter: blur(10px);
  transition: 1600ms var(--ease);
}

.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--ease), visibility 420ms;
}

.letter-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.letter-paper {
  position: relative;
  width: min(94vw, 560px);
  max-height: min(86vh, 720px);
  min-height: 390px;
  border-radius: 28px;
  padding: 38px 30px 30px;
  overflow: auto;
  transform: translateY(28px) scale(0.96);
  transition: transform 520ms var(--ease);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 122, 0.42) transparent;
}

.letter-paper::-webkit-scrollbar {
  width: 6px;
}

.letter-paper::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 211, 122, 0.36);
}

.letter-modal.is-open .letter-paper {
  transform: translateY(0) scale(1);
}

.paper-envelope {
  position: relative;
  height: 98px;
  margin: 0 auto 16px;
  width: 150px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px var(--border);
}

.paper-envelope span {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 158, 178, 0.32), rgba(255, 211, 122, 0.16));
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
  transform-origin: top;
  animation: unfold 900ms var(--ease) both;
}

.letter-paper h2 {
  font-family: "Dancing Script", cursive;
  color: #fff8fa;
  margin-bottom: 4px;
}

.letter-message-count {
  display: block;
  margin: 0 0 14px;
}

.letter-message-count:empty {
  max-height: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
}

.letter-paper p:last-child {
  min-height: 150px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
  font-size: 1.4rem;
}

.achievement-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 36px));
}

.achievement-toast {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 211, 122, 0.34);
  border-radius: 18px;
  background: rgba(12, 13, 22, 0.84);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34), 0 0 34px rgba(255, 211, 122, 0.14);
  backdrop-filter: blur(18px);
  animation: toastIn 480ms var(--ease) both;
}

.achievement-toast span {
  font-size: 1.6rem;
}

.achievement-toast strong,
.achievement-toast small {
  display: block;
}

.achievement-toast small {
  color: var(--muted);
}

.tap-particle {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  animation: particleUp 850ms var(--ease) forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(10px);
  transition: opacity 850ms var(--ease), transform 850ms var(--ease), filter 850ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@keyframes auroraDrift {
  to { transform: translate3d(2%, -2%, 0) scale(1.08); }
}

@keyframes fogFloat {
  to { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}

@keyframes shake {
  15%, 85% { transform: translateX(-4px); }
  35%, 65% { transform: translateX(8px); }
  50% { transform: translateX(-8px); }
}

@keyframes heartIdle {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(1.12); }
  36% { transform: scale(1); }
  54% { transform: scale(1.08); }
}

@keyframes pulseRing {
  0% { opacity: 0.72; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes cinemaText {
  0%, 16% { opacity: 0; transform: translateY(12px); filter: blur(10px); }
  42%, 82% { opacity: 1; transform: translateY(0); filter: blur(0); }
  100% { opacity: 0.35; }
}

@keyframes starBirth {
  0% { opacity: 0; transform: scale(0.2); }
  45%, 100% { opacity: var(--o); transform: scale(1); }
}

@keyframes cinemaPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.3; }
  45% { transform: scale(1); opacity: 0.58; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes eq {
  to { height: 31px; opacity: 1; }
}

@keyframes twinkle {
  0%, 100% { transform: scale(0.86); opacity: 0.72; }
  50% { transform: scale(1.26); opacity: 1; }
}

@keyframes secretTwinkle {
  0%, 100% { transform: scale(0.76); opacity: 0.66; }
  45% { transform: scale(1.46); opacity: 1; }
}

@keyframes unfold {
  0% { transform: rotateX(0); }
  100% { transform: rotateX(68deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes particleUp {
  to { opacity: 0; transform: translateY(-74px) scale(1.5) rotate(18deg); }
}

@keyframes noteRefresh {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  .world {
    padding-right: 0;
    padding-bottom: 112px;
  }

  .story-rail {
    top: auto;
    right: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    grid-auto-flow: column;
    transform: translate3d(50%, 18px, 0);
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .story-rail::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .world.is-active .story-rail {
    transform: translate3d(50%, 0, 0);
  }

  .story-dot::after {
    top: auto;
    right: auto;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate3d(-50%, 8px, 0);
  }

  .story-dot:hover::after,
  .story-dot:focus-visible::after {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 860px) {
  .aurora-layer {
    filter: blur(18px);
    opacity: 0.58;
  }

  .fog-layer {
    filter: blur(22px);
    opacity: 0.34;
  }

  .glass-panel,
  .story-rail,
  .modal-scrim,
  .achievement-toast {
    backdrop-filter: blur(10px);
  }

  .world {
    width: min(100% - 24px, 680px);
    padding: 28px 0 112px;
  }

  .world-hero,
  .counters-grid,
  .hold-card {
    grid-template-columns: 1fr;
  }

  .world-hero {
    align-content: center;
    padding: 70px 0 42px;
  }

  .music-player {
    max-width: 420px;
  }

  .stats-grid,
  .time-grid,
  .dream-grid,
  .sakinah-grid,
  .bucket-list,
  .letters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .letters-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .letters-count {
    max-width: none;
    text-align: left;
  }

  .hold-button {
    margin: 0 auto;
  }

}

@media (max-width: 520px) {
  .aurora-layer,
  .fog-layer {
    animation-duration: 44s;
  }

  .stage {
    padding: 18px;
  }

  .chapter {
    padding: 44px 0;
  }

  .key {
    width: 62px;
    height: 62px;
  }

  .unlock-card,
  .charge-card {
    border-radius: 24px;
  }

  .stats-grid,
  .time-grid,
  .dream-grid,
  .sakinah-grid,
  .bucket-list,
  .letters-grid {
    grid-template-columns: 1fr;
  }

  .letters-grid {
    gap: 12px;
  }

  .envelope-card {
    min-height: 136px;
  }

  .counter-card,
  .stat-card,
  .bucket-list,
  .letter-paper {
    border-radius: 22px;
  }

  .music-player {
    grid-template-columns: auto 1fr;
    min-height: 96px;
  }

  .love-note-card {
    min-height: 360px;
  }

  .note-back em {
    font-size: clamp(1.18rem, 7vw, 1.72rem);
    line-height: 1.34;
  }

  .equalizer {
    width: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .aurora-layer,
  .fog-layer {
    animation: none;
  }
}
