:root {
  --sky-top: #02102b;
  --sky-mid: #0a204d;
  --sky-horizon: #16366d;
  --gold-light: #fef08a;
  --gold-mid: #fbbf24;
  --gold-deep: #f59e0b;
  --amber-btn-start: #ffd000;
  --amber-btn-end: #ff8c00;
  --river-top: #091d42;
  --river-bottom: #051129;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Prompt', 'Kanit', system-ui, -apple-system, sans-serif;
  background: var(--sky-top);
  color: #ffffff;
  -webkit-tap-highlight-color: transparent;
}

.scene-root {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

/* ==================== Z-0: SKY & STARS ==================== */
.sky-layer {
  position: absolute;
  inset: 0 0 42% 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-horizon) 100%);
}

.sky-glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: radial-gradient(ellipse at 50% 100%, rgba(251, 191, 36, 0.22) 0%, transparent 72%);
  pointer-events: none;
}

.stars-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  animation: twinkle var(--dur, 3s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0% { opacity: 0.25; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.25); }
}

/* ==================== Z-1: FULL MOON ==================== */
.moon-layer {
  position: absolute;
  top: 7%;
  right: 8%;
  width: clamp(82px, 11vw, 136px);
  height: clamp(82px, 11vw, 136px);
  z-index: 1;
  pointer-events: none;
}

.moon-corona {
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.36) 0%, rgba(251, 191, 36, 0.14) 45%, transparent 72%);
  animation: moonPulse 5s ease-in-out infinite alternate;
}

@keyframes moonPulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.06); opacity: 1; }
}

/* ==================== MOONLIGHT & CELESTIAL FX ==================== */
.moon-fx {
  position: absolute;
  top: 4%;
  left: 4.5%;
  width: clamp(160px, 18vw, 270px);
  height: clamp(160px, 18vw, 270px);
  pointer-events: none;
  z-index: 1;
}

.moon-halo-outer {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.34) 0%, rgba(251, 146, 60, 0.14) 44%, transparent 72%);
  mix-blend-mode: screen;
  animation: moonPulse 4.6s ease-in-out infinite alternate;
}

.moon-rays {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg, rgba(254, 240, 138, 0.18) 16deg, transparent 36deg,
    transparent 72deg, rgba(253, 186, 116, 0.15) 92deg, transparent 114deg,
    transparent 150deg, rgba(254, 240, 138, 0.18) 170deg, transparent 192deg,
    transparent 230deg, rgba(253, 186, 116, 0.14) 250deg, transparent 274deg,
    transparent 310deg, rgba(254, 240, 138, 0.16) 330deg, transparent 360deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.85) 18%, transparent 70%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.85) 18%, transparent 70%);
  mix-blend-mode: screen;
  animation: moonRaysSpin 38s linear infinite;
}

.moon-orbit {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  animation: moonRaysSpin 28s linear infinite;
  pointer-events: none;
}

.moon-watermark {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  transform: translate(-7%, 2%);
  padding-left: 0.14em;
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(120, 53, 15, 0.45);
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.65);
  pointer-events: none;
  user-select: none;
  animation: moonWatermarkBreath 5s ease-in-out infinite alternate;
}

@keyframes moonWatermarkBreath {
  0% { opacity: 0.72; }
  100% { opacity: 1; }
}

.orbit-star {
  position: absolute;
  color: #fef08a;
  line-height: 1;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.95);
  animation: moonSparkle 2.4s ease-in-out infinite alternate;
}
.orbit-star.os-1 { top: -2%; left: 50%; font-size: 11px; animation-delay: 0s; }
.orbit-star.os-2 { top: 22%; right: 4%; font-size: 10px; animation-delay: -0.6s; }
.orbit-star.os-3 { bottom: 18%; right: 6%; font-size: 12px; animation-delay: -1.2s; }
.orbit-star.os-4 { bottom: -2%; left: 46%; font-size: 10px; animation-delay: -1.8s; }
.orbit-star.os-5 { bottom: 20%; left: 4%; font-size: 10px; animation-delay: -0.9s; }
.orbit-star.os-6 { top: 18%; left: 6%; font-size: 11px; animation-delay: -1.5s; }

.moon-sparkle {
  position: absolute;
  color: #fef08a;
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.95);
  animation: moonSparkle 2.8s ease-in-out infinite alternate;
}
.moon-sparkle.ms-1 { top: 8%; right: 14%; animation-delay: 0s; }
.moon-sparkle.ms-2 { bottom: 14%; left: 10%; font-size: 11px; animation-delay: -1.1s; }
.moon-sparkle.ms-3 { top: 24%; left: 4%; font-size: 10px; animation-delay: -2.0s; }
.moon-sparkle.ms-4 { bottom: 18%; right: 6%; font-size: 14px; animation-delay: -0.6s; }

@keyframes moonRaysSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes moonRingBreath {
  0% { transform: scale(0.95); opacity: 0.35; }
  100% { transform: scale(1.09); opacity: 0.8; }
}

@keyframes moonSparkle {
  0% { transform: scale(0.65) rotate(0deg); opacity: 0.3; }
  100% { transform: scale(1.25) rotate(24deg); opacity: 1; }
}

.shooting-star {
  position: absolute;
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(254, 240, 138, 0.9) 100%);
  filter: drop-shadow(0 0 6px rgba(254, 240, 138, 0.9));
  opacity: 0;
  pointer-events: none;
}

.shooting-star.ss-1 {
  top: 10%;
  left: 26%;
  animation: shootStar 9s ease-out infinite;
}

.shooting-star.ss-2 {
  top: 16%;
  left: 58%;
  animation: shootStar 13s ease-out 4.5s infinite;
}

@keyframes shootStar {
  0%, 82% { transform: translate3d(0, 0, 0) rotate(22deg); opacity: 0; }
  85% { opacity: 1; }
  95% { transform: translate3d(220px, 88px, 0) rotate(22deg); opacity: 0; }
  100% { opacity: 0; }
}

/* ==================== BUDDHA ORBITING STARS FX ==================== */
.buddha-orbit-fx {
  position: absolute;
  top: 22%;
  right: 0.5%;
  width: clamp(180px, 20vw, 290px);
  height: clamp(180px, 20vw, 290px);
  pointer-events: none;
  z-index: 1;
}

.buddha-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: moonRaysSpin 30s linear infinite;
  pointer-events: none;
}

/* ==================== RIVER RUNNING LIGHTS FX ==================== */
.mountain-lights-fx {
  position: absolute;
  bottom: 2%;
  left: 0;
  width: 100%;
  height: 30%;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.mtn-trail {
  fill: none;
  stroke-linecap: round;
}

.mtn-trail-1 {
  stroke: rgba(254, 240, 138, 0.55);
  stroke-width: 2.2;
  stroke-dasharray: 70 260;
  animation: mtnDashRun 5.5s linear infinite;
}

.mtn-trail-2 {
  stroke: rgba(244, 114, 182, 0.45);
  stroke-width: 1.8;
  stroke-dasharray: 55 240;
  animation: mtnDashRunReverse 7s linear infinite;
}

@keyframes mtnDashRun {
  0% { stroke-dashoffset: 330; }
  100% { stroke-dashoffset: 0; }
}

@keyframes mtnDashRunReverse {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 295; }
}

.moon-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fffbeb 0%, #fde68a 42%, #f59e0b 95%);
  box-shadow: 0 0 38px rgba(253, 224, 71, 0.65), inset -10px -12px 24px rgba(180, 83, 9, 0.35);
  overflow: hidden;
}

.crater {
  position: absolute;
  border-radius: 50%;
  background: rgba(180, 110, 20, 0.16);
}
.crater.c1 { width: 22%; height: 22%; top: 20%; left: 26%; }
.crater.c2 { width: 14%; height: 14%; top: 48%; left: 58%; }
.crater.c3 { width: 28%; height: 28%; top: 55%; left: 20%; }
.crater.c4 { width: 10%; height: 10%; top: 28%; left: 65%; }
.crater.c5 { width: 16%; height: 16%; top: 72%; left: 52%; }

/* ==================== Z-2: FIREWORKS ==================== */
.fireworks-layer {
  position: absolute;
  inset: 0 0 42% 0;
  width: 100%;
  height: 58%;
  z-index: 2;
  pointer-events: none;
}

/* ==================== Z-3: SKY LANTERNS ==================== */
.lanterns-layer {
  position: absolute;
  inset: 0 0 40% 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 88%, transparent 100%);
}

.floating-lantern {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: center center;
  filter: brightness(1.12) drop-shadow(0 0 12px rgba(255, 196, 60, 0.75));
  transition: filter 0.25s ease;
  will-change: transform, opacity;
}

.floating-lantern:hover {
  filter: brightness(1.2) drop-shadow(0 0 16px rgba(255, 196, 60, 0.92));
  z-index: 40 !important;
}

.floating-lantern .lantern-sway {
  animation: lanternSway var(--sway-dur, 5.2s) ease-in-out infinite alternate;
  animation-delay: var(--sway-delay, 0s);
  will-change: transform;
}

@keyframes lanternSway {
  0% { transform: rotate(-2.2deg) translate3d(-3px, 0, 0); }
  100% { transform: rotate(2.2deg) translate3d(3px, 0, 0); }
}

/* ==================== Z-4: HERITAGE FACADE ==================== */
.heritage-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40%;
  height: 34%;
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.city-skyline {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(9, 24, 56, 0.85) 100%);
}

.building-wrapper {
  position: relative;
  width: 100%;
  max-width: 1500px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.heritage-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  filter: drop-shadow(0 -4px 20px rgba(251, 191, 36, 0.2));
}

/* ==================== Z-5: RIVER & KRATHONGS ==================== */
.river-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5%;
  height: 29%;
  z-index: 5;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

.river-reflection {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 35% 75% at 50% 8%, rgba(251, 191, 36, 0.34) 0%, rgba(245, 158, 11, 0.14) 45%, transparent 75%),
    radial-gradient(ellipse 14% 70% at 88% 12%, rgba(254, 240, 138, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 22% 55% at 24% 12%, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.river-shimmer {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 232, 160, 0.06) 0px,
    rgba(255, 232, 160, 0.06) 2px,
    transparent 2px,
    transparent 9px
  );
  animation: waterShimmer 3.6s ease-in-out infinite alternate;
  pointer-events: none;
}

.river-waves {
  position: absolute;
  inset: -10% 0 -18% 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 88%, transparent 100%);
}

.river-wave {
  position: absolute;
  inset: 0 -300px;
  background-repeat: repeat;
  pointer-events: none;
  will-change: transform, opacity;
}

.river-wave-1 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='28' viewBox='0 0 220 28'%3E%3Cpath d='M0 14 Q 55 5, 110 14 T 220 14' fill='none' stroke='rgba(255,244,200,0.36)' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M25 23 Q 80 17, 135 23 T 245 23' fill='none' stroke='rgba(255,255,255,0.22)' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 220px 28px;
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: waveDriftLeft 12s linear infinite, waveBreath 4.2s ease-in-out infinite alternate;
}

.river-wave-2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='34' viewBox='0 0 280 34'%3E%3Cpath d='M0 17 Q 70 25, 140 17 T 280 17' fill='none' stroke='rgba(254,240,138,0.28)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M0 7 Q 70 12, 140 7 T 280 7' fill='none' stroke='rgba(255,255,255,0.16)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 280px 34px;
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: waveDriftRight 16s linear infinite, waveBreath 5.5s ease-in-out infinite alternate-reverse;
}

@keyframes waveDriftLeft {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-220px, 0, 0); }
}

@keyframes waveDriftRight {
  0% { transform: translate3d(-280px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes waveBreath {
  0% { opacity: 0.55; }
  100% { opacity: 0.92; }
}

@keyframes waterShimmer {
  0% { transform: translateX(-6px) scaleY(1); opacity: 0.7; }
  100% { transform: translateX(6px) scaleY(1.03); opacity: 1; }
}

.krathongs-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-krathong {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform, opacity;
  filter: brightness(1.15) drop-shadow(0 0 12px rgba(254, 240, 138, 0.75));
  transition: filter 0.25s ease;
}

.floating-krathong:hover {
  filter: brightness(1.22) drop-shadow(0 0 18px rgba(254, 240, 138, 0.92));
  z-index: 45 !important;
}

.krathong-bob {
  position: relative;
  animation: krathongBob var(--bob-dur, 3.2s) ease-in-out infinite alternate;
  animation-delay: var(--bob-delay, 0s);
  will-change: transform;
}

@keyframes krathongBob {
  0% { transform: translate3d(0, -2px, 0) rotate(-1.4deg); }
  100% { transform: translate3d(0, 2.5px, 0) rotate(1.4deg); }
}

.water-ring {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -4px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(254, 240, 138, 0.32);
  animation: ringPulse 2.4s ease-out infinite;
  pointer-events: none;
}

.krathong-photo-blend {
  filter: brightness(0.88) contrast(1.06) saturate(1.12);
  opacity: 0.96;
}

.sparkle-aura {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--aura-color, rgba(253, 224, 71, 0.45)) 0%, transparent 68%);
  pointer-events: none;
  animation: auraPulse 2.2s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  0% { transform: scale(0.92); opacity: 0.72; }
  100% { transform: scale(1.08); opacity: 1; }
}

.sparkle-dot {
  position: absolute;
  pointer-events: none;
  font-size: 12px;
  line-height: 1;
  color: var(--sparkle-color, #fef08a);
  text-shadow: 0 0 8px var(--sparkle-color, #fde047);
  animation: sparkleFloat var(--sp-dur, 1.8s) ease-in-out infinite alternate;
  animation-delay: var(--sp-delay, 0s);
}

@keyframes sparkleFloat {
  0% { transform: translateY(2px) scale(0.75) rotate(0deg); opacity: 0.45; }
  100% { transform: translateY(-5px) scale(1.2) rotate(25deg); opacity: 1; }
}

@keyframes ringPulse {
  0% { transform: scale(0.92); opacity: 0.75; }
  100% { transform: scale(1.22); opacity: 0; }
}

.user-highlight-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #fde047;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.85);
  animation: userPulse 1.6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes userPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.08); opacity: 1; }
}

/* ==================== SPEECH BUBBLE ==================== */
.wish-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 145px;
  max-width: 215px;
  padding: 8px 11px;
  border-radius: 14px;
  background: rgba(15, 28, 60, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(253, 224, 71, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  color: #ffffff;
  text-align: left;
  z-index: 60;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  animation: bubblePop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-lantern.near-header .wish-bubble {
  opacity: 0.16;
}

body.hide-wishes .wish-bubble {
  opacity: 0 !important;
  transform: translateX(-50%) scale(0.92);
}

/* ==================== MASCOT FLOATING & BLEND ==================== */
.mascot-float {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
  animation: mascotBreathe 3.8s ease-in-out infinite alternate;
  will-change: transform;
}

.mascot-float-right {
  animation-delay: -1.9s;
}

@keyframes mascotBreathe {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -4px, 0); }
}

.wish-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: rgba(15, 28, 60, 0.85) transparent transparent transparent;
}

.wish-bubble-text {
  font-size: 0.82rem;
  line-height: 1.42;
  color: #fef9c3;
  word-break: break-word;
}

.wish-bubble-author {
  margin-top: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #93c5fd;
  text-align: right;
}

@keyframes bubblePop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ==================== Z-6: FOREGROUND PIER & LOTUS ==================== */
.foreground-layer {
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  z-index: 6;
  pointer-events: none;
}

.wooden-pier {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(230px, 26vw, 340px);
  height: 135px;
}

.pier-deck {
  position: absolute;
  inset: 16px 0 0 0;
  background: repeating-linear-gradient(
    180deg,
    #6b4226 0px,
    #6b4226 11px,
    #4e2e18 11px,
    #4e2e18 14px
  );
  clip-path: polygon(16% 0%, 84% 0%, 100% 100%, 0% 100%);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.45);
}

.pier-post {
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 118px;
  background: linear-gradient(90deg, #4b2d18, #7c4d2b, #4b2d18);
  border-radius: 5px 5px 0 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.pier-post.left { left: 10%; }
.pier-post.right { right: 10%; }

.post-lantern {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 16px;
  border-radius: 50% 50% 35% 35%;
  background: radial-gradient(circle, #fffbeb 10%, #fbbf24 55%, #f59e0b 100%);
  box-shadow: 0 0 18px 6px rgba(251, 191, 36, 0.65);
}

.thai-fabric-drape {
  position: absolute;
  top: 28px;
  right: -12px;
  width: 34px;
  height: 76px;
  background: repeating-linear-gradient(
    45deg,
    #7e22ce 0px,
    #7e22ce 6px,
    #d8b4fe 6px,
    #d8b4fe 8px,
    #eab308 8px,
    #eab308 11px
  );
  border-radius: 4px 10px 6px 12px;
  transform: rotate(-8deg);
  opacity: 0.92;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.pier-rope {
  position: absolute;
  top: 34px;
  width: 24px;
  height: 46px;
  border-bottom: 3px solid #a16207;
  border-radius: 0 0 50% 50%;
}
.pier-rope.left { left: 2%; transform: rotate(-18deg); }
.pier-rope.right { right: 2%; transform: rotate(18deg); }

.lotus-corner {
  position: absolute;
  bottom: -6px;
  width: clamp(160px, 24vw, 310px);
  height: clamp(120px, 18vw, 220px);
}
.lotus-corner.left { left: -10px; }
.lotus-corner.right { right: -10px; transform: scaleX(-1); }

/* ==================== Z-10: UI OVERLAY ==================== */
.top-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 16px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

.counter-badge {
  position: absolute;
  top: 18px;
  left: 24px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(5, 17, 45, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(254, 240, 138, 0.25);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.counter-label {
  font-size: 0.92rem;
  font-weight: 400;
  color: #e2e8f0;
}

.counter-number {
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.title-block {
  text-align: center;
  margin-top: 6px;
}

.thai-ornament-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #fde68a;
  font-size: 0.9rem;
  opacity: 0.85;
}

.main-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), 0 0 24px rgba(251, 191, 36, 0.45);
}

.sub-title {
  margin-top: 2px;
  font-size: clamp(0.68rem, 1.2vw, 0.88rem);
  letter-spacing: 2.2px;
  color: #fef3c7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.center-cta-wrap {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
}

.cta-gold-btn {
  position: relative;
  overflow: hidden;
  border: 2px solid #fef08a;
  border-radius: 999px;
  padding: 13px 44px;
  background: linear-gradient(180deg, var(--amber-btn-start) 0%, var(--amber-btn-end) 100%);
  color: #451a03;
  font-family: inherit;
  font-size: 1.22rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.55), 0 0 0 4px rgba(251, 191, 36, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-gold-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 34px rgba(245, 158, 11, 0.72), 0 0 0 6px rgba(251, 191, 36, 0.3);
}

.cta-gold-btn:active {
  transform: translateY(0) scale(0.98);
}

.cta-shine {
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-24deg);
  animation: shineSweep 3.5s infinite;
}

@keyframes shineSweep {
  0%, 60% { left: -80%; }
  100% { left: 150%; }
}

.bottom-ui {
  position: absolute;
  bottom: 12px;
  left: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.bottom-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
}

.terms-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.terms-btn:hover {
  background: rgba(30, 41, 59, 0.88);
  border-color: #fde047;
}

.copyright-text {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.bottom-right {
  pointer-events: auto;
}

.sound-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sound-btn:hover {
  transform: scale(1.07);
  border-color: #fde047;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 10, 28, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 20px;
  padding: 24px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: modalUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.modal-close-btn:hover {
  background: #e5e7eb;
}

.modal-header {
  text-align: center;
  padding-right: 18px;
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #111827;
}

.modal-subtitle {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #4b5563;
}

/* Preview Stage */
.preview-stage {
  position: relative;
  margin: 14px auto;
  padding: 14px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 45%, #16366d 0%, #06142e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 136px;
}

.preview-halo {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.32) 0%, transparent 70%);
  pointer-events: none;
}

.preview-graphic {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
  animation: krathongBob 2.4s ease-in-out infinite alternate;
}

.preview-item-name {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fef08a;
}

/* Form */
.create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2937;
}

.form-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1.5px solid #d1d5db;
  font-family: inherit;
  font-size: 0.94rem;
  color: #111827;
  background: #f9fafb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #f59e0b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.form-textarea {
  resize: none;
}

.form-helper {
  font-size: 0.74rem;
  color: #6b7280;
}

.wish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.wish-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-family: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wish-chip:hover {
  background: #fef3c7;
}

/* Catalog Grid */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-count {
  font-size: 0.76rem;
  color: #6b7280;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.catalog-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #0c1f44;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.catalog-item:hover {
  transform: translateY(-2px);
  border-color: #fbbf24;
}

.catalog-item.selected {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
  background: #142f63;
}

.catalog-item.locked {
  opacity: 0.75;
}

.lock-badge {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.52);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.couple-unlock-bar {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fefce8;
  border: 1px dashed #f59e0b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.couple-note {
  font-size: 0.75rem;
  color: #854d0e;
  flex: 1 1 240px;
}

.unlock-couple-btn {
  padding: 5px 11px;
  border-radius: 8px;
  border: none;
  background: #f59e0b;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.unlock-couple-btn:hover {
  background: #d97706;
}

.submit-gold-btn {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #ffd000 0%, #f59e0b 100%);
  color: #451a03;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.38);
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.submit-gold-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.submit-gold-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Terms Modal */
.terms-body {
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #374151;
}

.heritage-pillars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pillar-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.pillar-icon {
  font-size: 1.4rem;
  line-height: 1.2;
}

.pillar-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #92400e;
}

.pillar-card p {
  font-size: 0.8rem;
  color: #78350f;
}

.terms-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #4b5563;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #fde047;
  color: #fef9c3;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .top-ui {
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
  }

  .counter-badge {
    position: static;
    margin-bottom: 4px;
    padding: 4px 12px;
  }

  .counter-number {
    font-size: 1.3rem;
  }

  .center-cta-wrap {
    bottom: 72px;
  }

  .cta-gold-btn {
    padding: 11px 32px;
    font-size: 1.08rem;
  }

  .copyright-text {
    font-size: 0.64rem;
    max-width: 240px;
  }

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