* {
  box-sizing: border-box;
}

:root {
  --primary: #0f3d3e;
  --secondary: #d4af37;
  --text: #3f3527;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Georgia", "Times New Roman", serif;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.35), transparent 30%),
    linear-gradient(180deg, #103739 0%, #1b4c4d 45%, #0d2f31 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  position: relative;
  color: var(--text);
}

/* SCHERMATE */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* COVER */
#cover {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.22), transparent 20%),
    radial-gradient(circle at 80% 15%, rgba(255,215,120,0.12), transparent 18%),
    linear-gradient(180deg, #123d3f 0%, #0d2f31 100%);
}

.cover-content {
  width: 100%;
  max-width: 430px;
  text-align: center;
  position: relative;
}

.top-decoration {
  position: relative;
  height: 0;
}

.dino-top {
  position: absolute;
  left: 50%;
  top: -30px;
  transform: translateX(-50%);
  width: 180px;
  max-width: 50vw;
  z-index: 6;
  filter:
    drop-shadow(0 4px 2px rgba(0,0,0,0.25))
    drop-shadow(0 10px 12px rgba(0,0,0,0.15));
  animation: floatDino 3s ease-in-out infinite;
}

.envelope {
  z-index: 2;
}

.envelope::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 30px;
  background: radial-gradient(
    ellipse,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.12) 40%,
    transparent 70%
  );
  filter: blur(6px);
  z-index: 1;
}

.open-btn {
  border: 2px solid rgba(214, 170, 120, 0.55);
  border-radius: 999px;
  padding: 15px 34px;

  font-size: 20px;
  font-weight: 600;
  font-family: 'Playfair Display', serif;

  cursor: pointer;

  color: #7b4f57;

  background:
    linear-gradient(
      180deg,
      rgba(255,245,240,0.95) 0%,
      rgba(244,214,201,0.92) 55%,
      rgba(228,190,178,0.95) 100%
    );

  box-shadow:
    0 10px 25px rgba(0,0,0,0.18),
    0 0 18px rgba(255,220,210,0.35),
    inset 0 2px 8px rgba(255,255,255,0.7);

  backdrop-filter: blur(4px);

  transition: all 0.3s ease;
}

/* INVITO */
#invite {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.14), transparent 30%),
    linear-gradient(180deg, #123d3f 0%, #0d2f31 100%);
  z-index: 10;
}

.invite-card {
  width: 100%;
  max-width: 430px;
  min-height: calc(100vh - 36px);
  height: auto;
  border-radius: 30px;
  padding: 14px;
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.30),
    rgba(255, 255, 255, 0.08)
  );
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(212, 175, 55, 0.40);
}

.invite-inner {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  padding: 34px 24px 26px;
  text-align: center;
  position: relative;
  overflow: auto;

  background:
  linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.72) 45%,
    rgba(255, 255, 255, 0.68) 100%
  ),
  url("bg-dino.jpg") center/cover no-repeat;

  border: 2px solid rgba(212, 175, 55, 0.55);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.25),
    inset 0 0 30px rgba(212, 175, 55, 0.10);
}

#titolo {
  font-family: 'Great Vibes', cursive !important;
  font-size: 5rem;
  font-weight: 400;
  color: #c99663;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  color: #c99d1a;
  font-size: 2.4rem;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 18px;

  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: none;
}

.subtitle {
  font-size: 18px;
  line-height: 1.5;
  margin: 0 auto 22px;
  max-width: 310px;
  color: #6b5a40;
}

.main-text {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 22px;
  color: #5c4f3d;
}

.name-highlight {
  font-size: 34px;
  line-height: 1.2;
  margin-top: 8px;
  color: #c99d1a;
  font-weight: 700;
}

.event-date {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 14px;
}

.line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.date-center {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.month,
.year {
  font-size: 18px;
  color: #7a674c;
}

.day {
  font-size: 72px;
  line-height: 1;
  color: #c99d1a;
  margin: 4px 0;
  font-weight: 700;
}

.event-info {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 10px 0 22px;
  flex-wrap: wrap;
}

.info-box {
  min-width: 120px;
  padding: 10px 14px;
  border-top: 2px solid #d4af37;
  border-bottom: 2px solid #d4af37;
  color: #6d5a42;
  font-size: 17px;
  font-weight: 500;
}

.footer-text {
  max-width: 300px;
  margin: 0 auto 28px;
  font-size: 17px;
  line-height: 1.6;
  color: #5d4f3c;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.circle-action {
  text-decoration: none;
  color: #6b5434;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  min-width: 88px;
}

.icon i {
  color: white;
  font-size: 34px;
}

.icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background:
    radial-gradient(circle at 30% 30%, #fff9e8 0%, #ead38a 45%, #caa23a 100%);
  border: 3px solid #d4af37;
  box-shadow:
    0 0 0 4px rgba(212, 175, 55, 0.18),
    0 0 18px rgba(212, 175, 55, 0.35),
    inset 0 2px 10px rgba(255,255,255,0.45);
}

.action-text {
  font-size: 17px;
  color: #6b5434;
  font-weight: 600;
}

/* CONFETTI */
.confetti-layer {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
}

.confetti-layer.active {
  display: block;
}

.confetti-layer::before,
.confetti-layer::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(circle, rgba(255,219,120,0.9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255,245,220,0.85) 0 1.8px, transparent 2.8px),
    radial-gradient(circle, rgba(214,168,67,0.8) 0 2.2px, transparent 3.2px);
  background-size: 120px 120px, 160px 160px, 200px 200px;
  animation: confettiFall 11s linear infinite;
  opacity: 0.9;
}

.confetti-layer::after {
  animation-duration: 16s;
  transform: translateY(-30%);
  opacity: 0.55;
}

/* BALLOONS */
.balloons-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 29;
  overflow: hidden;
}

.balloon {
  position: absolute;
  bottom: -120px;
  width: 42px;
  height: 56px;
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  animation: floatUp linear infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 2px;
  height: 22px;
  background: rgba(80, 80, 80, 0.7);
  transform: translateX(-50%);
}

/* SPARKLES */
.sparkles-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 31;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  animation: sparkleBlink ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
  content: "";
  position: absolute;
  background: rgba(255, 245, 190, 0.95);
  border-radius: 999px;
}

.sparkle::before {
  width: 10px;
  height: 2px;
  left: 0;
  top: 4px;
}

.sparkle::after {
  width: 2px;
  height: 10px;
  left: 4px;
  top: 0;
}

/* DISCO */
.disco-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
  mix-blend-mode: screen;
}

.disco-beam {
  position: absolute;
  top: -10%;
  width: 120px;
  height: 140%;
  transform: rotate(18deg);
  filter: blur(18px);
  opacity: 0.18;
  animation: discoMove 5s ease-in-out infinite alternate;
}

.disco-beam:nth-child(1) {
  background: linear-gradient(180deg, rgba(255, 0, 128, 0.5), transparent);
}

.disco-beam:nth-child(2) {
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.5), transparent);
}

.disco-beam:nth-child(3) {
  background: linear-gradient(180deg, rgba(255, 255, 0, 0.45), transparent);
}

.disco-beam:nth-child(4) {
  background: linear-gradient(180deg, rgba(0, 255, 170, 0.45), transparent);
}

/* CLASSI UTILI */
.hidden {
  display: none !important;
}

.fade-out {
  animation: fadeOut 1.2s ease forwards;
}

.fade-in {
  animation: fadeIn 1.2s ease forwards;
}

/* ANIMAZIONI */
@keyframes floatDino {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes confettiFall {
  from {
    transform: translateY(-8%);
  }
  to {
    transform: translateY(18%);
  }
}

@keyframes floatUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-130vh);
  }
}

@keyframes sparkleBlink {
  0%, 100% {
    opacity: 0.2;
    transform: rotate(45deg) scale(0.7);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1.2);
  }
}

@keyframes discoMove {
  from {
    transform: rotate(18deg) translateX(-20px);
  }
  to {
    transform: rotate(-18deg) translateX(40px);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.04);
    visibility: hidden;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* LETTERA DENTRO */
.letter-preview {
  display: none;
}

.envelope {
  position: relative;
  width: 260px;
}

.envelope-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%) scale(0.7);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 229, 120, 0.95) 0%,
    rgba(255, 213, 79, 0.55) 30%,
    rgba(255, 213, 79, 0.18) 55%,
    rgba(255, 213, 79, 0) 75%
  );
  opacity: 0;
  filter: blur(10px);
  z-index: 0;
  transition: opacity 0.45s ease, transform 0.6s ease;
}

.envelope-img {
  position: relative;
  width: 100%;
  display: block;
  filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.2));
  transition: transform 0.6s ease;
  z-index: 1;
}

.envelope.open .envelope-img {
  transform: scale(1.05);
}

.envelope.open .envelope-glow {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
}

.seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--primary), #568e46);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  z-index: 2;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  transition: all 0.6s ease;
}

.envelope-wrapper {
  position: relative;
  margin: 12px auto 26px;
  width: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#introVideo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 9999;
  transition: opacity 1.2s ease;
}

#introVideo.video-hide {
  opacity: 0;
}

.flash-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
}

.flash-overlay.active {
  animation: flashEffect 0.8s ease-out;
}

@keyframes flashEffect {
  0% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

.tap-audio-hint {
  position: fixed;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%);
  z-index: 999999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  animation: tapHintPulse 1.4s ease-in-out infinite;
  pointer-events: none;
}

.tap-audio-hint.hidden {
  display: none !important;
}

@keyframes tapHintPulse {
  0% {
    opacity: 0.6;
    transform: translateX(-50%) scale(1) rotate(0deg);
  }
  20% {
    transform: translateX(-50%) scale(1.08) rotate(-2deg);
  }
  40% {
    transform: translateX(-50%) scale(1.08) rotate(2deg);
  }
  60% {
    transform: translateX(-50%) scale(1.08) rotate(-1deg);
  }
  80% {
    transform: translateX(-50%) scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1) rotate(0deg);
  }
}

.circle-action {
  transition: transform 0.25s ease, filter 0.25s ease;
}

.circle-action:hover {
  transform: translateY(-6px) scale(1.05);
  filter: brightness(1.1);
}

.icon {
  transition: all 0.3s ease;
}

.circle-action:hover .icon {
  box-shadow:
    0 0 0 6px rgba(212, 175, 55, 0.25),
    0 0 25px rgba(212, 175, 55, 0.6),
    inset 0 2px 12px rgba(255,255,255,0.6);
}

.dresscode-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dresscode-modal.hidden {
  display: none;
}

.dresscode-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}

.dresscode-content {
  position: relative;
  z-index: 2;
  max-width: 90%;
  max-height: 85%;
  animation: fadeZoom 0.3s ease;
}

.dresscode-content img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.dresscode-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #d4af37;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: white;
}

@keyframes fadeZoom {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.circle-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.icon-img {
width: 50px;
  height: 50px;
  margin-bottom: 5px;
}


