/* ===== DomeGallery — Valentine Theme CSS ===== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;0,900;1,500;1,700&family=Outfit:wght@300;400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #1a0613;
  overflow: hidden;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

body.dg-scroll-lock {
  overflow: hidden !important;
  touch-action: none;
}

/* ===== Root ===== */

.sphere-root {
  position: relative;
  width: 100%;
  height: 100%;
  --radius: 520px;
  --viewer-pad: 72px;
  --circ: calc(var(--radius) * 3.14);
  --rot-y: calc((360deg / var(--segments-x)) / 2);
  --rot-x: calc((360deg / var(--segments-y)) / 2);
  --item-width: calc(var(--circ) / var(--segments-x));
  --item-height: calc(var(--circ) / var(--segments-y));
  --overlay-blur-color: #1a0613;
  --tile-radius: 30px;
  --enlarge-radius: 30px;
  --image-filter: grayscale(0);
}

.sphere-root * {
  box-sizing: border-box;
}

.sphere,
.item,
.item__image {
  transform-style: preserve-3d;
}

/* ===== Main ===== */

main.sphere-main {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
}

/* ===== Stage / Perspective ===== */

.stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  perspective: calc(var(--radius) * 2);
  perspective-origin: 50% 50%;
  contain: layout paint size;
}

.sphere {
  transform: translateZ(calc(var(--radius) * -1));
  will-change: transform;
}

/* ===== Overlays (pink-tinted vignette) ===== */

.overlay,
.overlay--blur {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 3;
  pointer-events: none;
}

.overlay {
  background-image: radial-gradient(rgba(255, 182, 193, 0) 55%,
      rgba(255, 105, 135, 0.08) 70%,
      var(--overlay-blur-color, #1a0613) 100%);
}

.overlay--blur {
  -webkit-mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #1a0613) 90%);
  mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #1a0613) 90%);
  backdrop-filter: blur(3px);
}

/* ===== Tiles ===== */

.item {
  width: calc(var(--item-width) * var(--item-size-x));
  height: calc(var(--item-height) * var(--item-size-y));
  position: absolute;
  top: -999px;
  bottom: -999px;
  left: -999px;
  right: -999px;
  margin: auto;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transition: transform 300ms;
  transform:
    rotateY(calc(var(--rot-y) * (var(--offset-x) + ((var(--item-size-x) - 1) / 2)) + var(--rot-y-delta, 0deg))) rotateX(calc(var(--rot-x) * (var(--offset-y) - ((var(--item-size-y) - 1) / 2)) + var(--rot-x-delta, 0deg))) translateZ(var(--radius));
}

.item__image {
  position: absolute;
  display: block;
  inset: 10px;
  border-radius: var(--tile-radius, 12px);
  background: transparent;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 300ms;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.item__image:focus {
  outline: none;
}

.item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  backface-visibility: hidden;
  filter: var(--image-filter, none);
}

/* ===== Viewer / Enlarge ===== */

.viewer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--viewer-pad);
}

.viewer .frame {
  height: 100%;
  aspect-ratio: 1;
  border-radius: var(--enlarge-radius, 32px);
  display: flex;
}

@media (max-aspect-ratio: 1/1) {
  .viewer .frame {
    height: auto;
    width: 100%;
  }
}

.viewer .scrim {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(26, 6, 19, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms ease;
  backdrop-filter: blur(3px);
}

.sphere-root[data-enlarging='true'] .viewer .scrim {
  opacity: 1;
  pointer-events: all;
}

.viewer .enlarge {
  position: absolute;
  z-index: 30;
  border-radius: var(--enlarge-radius, 32px);
  overflow: hidden;
  transition:
    transform 500ms ease,
    opacity 500ms ease;
  transform-origin: top left;
  box-shadow: 0 10px 40px rgba(255, 105, 135, 0.2), 0 5px 20px rgba(0, 0, 0, 0.3);
}

.viewer .enlarge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--image-filter, none);
}

.sphere-root .enlarge-closing img {
  filter: var(--image-filter, none);
}

/* ===== Edge fades (pink tinted) ===== */

.edge-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--overlay-blur-color, #1a0613));
}

.edge-fade--top {
  top: 0;
  transform: rotate(180deg);
}

.edge-fade--bottom {
  bottom: 0;
}

/* ═══════════════════════════════════════════
   VALENTINE PROPOSAL OVERLAY
   ═══════════════════════════════════════════ */

.valentine-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.valentine-overlay.hidden {
  opacity: 0;
  pointer-events: none !important;
}

.valentine-card {
  position: relative;
  background: rgba(255, 240, 245, 0.10);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid rgba(255, 182, 193, 0.2);
  border-radius: 32px;
  padding: 52px 48px 44px;
  max-width: 480px;
  width: 90vw;
  text-align: center;
  pointer-events: auto;
  box-shadow:
    0 0 80px rgba(255, 105, 180, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardFloat 3s ease-in-out infinite;
}

@keyframes cardFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.valentine-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  animation: heartBeat 1.2s ease-in-out infinite;
  display: block;
}

@keyframes heartBeat {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.15);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.1);
  }

  60% {
    transform: scale(1);
  }
}

.valentine-question {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(22px, 5vw, 34px);
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(255, 105, 180, 0.25);
}

.valentine-sub {
  font-size: 14px;
  color: rgba(255, 182, 193, 0.7);
  margin-bottom: 36px;
  font-weight: 300;
}

.valentine-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  min-height: 70px;
  position: relative;
}

/* YES button */
.btn-yes {
  background: linear-gradient(135deg, #ff6b9d, #ff2d78, #e91e63);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  padding: 16px 36px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(255, 45, 120, 0.4),
    0 0 40px rgba(255, 105, 180, 0.15);
  transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.3s ease, font-size 0.3s ease, padding 0.3s ease;
  position: relative;
  z-index: 2;
  letter-spacing: 0.02em;
}

.btn-yes:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 30px rgba(255, 45, 120, 0.55),
    0 0 60px rgba(255, 105, 180, 0.25);
}

/* NO button */
.btn-no {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 200, 210, 0.7);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 22px;
  border: 1px solid rgba(255, 182, 193, 0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, left 0.15s ease, top 0.15s ease;
  position: relative;
  z-index: 1;
  user-select: none;
}

.btn-no:hover {
  opacity: 0.5;
}

/* ── Hearts explosion ── */

.heart-particle {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 200;
  animation: heartRise 2.5s ease-out forwards;
  opacity: 1;
}

@keyframes heartRise {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.5) rotate(0deg);
  }

  30% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy-mid)) scale(1.2) rotate(var(--spin));
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx-end), var(--dy)) scale(0.3) rotate(var(--spin-end));
  }
}

/* ── Floating ambient hearts (background) ── */
.ambient-heart {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: ambientFloat linear forwards;
  font-size: 18px;
}

@keyframes ambientFloat {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.6);
  }

  10% {
    opacity: 0.25;
  }

  90% {
    opacity: 0.15;
  }

  100% {
    opacity: 0;
    transform: translateY(-100vh) rotate(45deg) scale(1);
  }
}

/* ═══════════ Post-accept celebration ═══════════ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.celebration-overlay.show {
  opacity: 1;
}

.celebration-text {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(28px, 7vw, 52px);
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 30px rgba(255, 105, 180, 0.5);
  animation: celebPulse 2s ease-in-out infinite;
  line-height: 1.4;
}

.celebration-text span {
  display: block;
  font-size: 64px;
  animation: heartBeat 1s ease-in-out infinite;
}

@keyframes celebPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}