@import url(https://fonts.googleapis.com/css?family=Lato:300italic);

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: #252432;
  font-family: "Lato", sans-serif;
  overflow-x: hidden;
}

/* Keep the scene hidden until the PIN is unlocked */
body.locked #cake,
body.locked .candle,
body.locked .photo,
body.locked .text,
body.locked .hint {
  display: none;
}

/* ==============================================
   PIN lock screen
============================================== */

.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #2e2c42 0%, #1c1b29 70%);
  transition: opacity 0.6s ease;
}

.lock.unlocking {
  opacity: 0;
  pointer-events: none;
}

.lock-card {
  width: min(320px, 84vw);
  text-align: center;
  padding: 24px 8px;
}

.lock-emoji {
  margin: 0 0 6px;
  font-size: 3.4em;
}

.lock-card h2 {
  margin: 0;
  color: #ffe3ee;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.7em;
}

.lock-card p {
  margin: 10px 0 0;
  color: #9d95c4;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: italic;
}

.lock-card input {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  text-align: center;
  font-family: "Lato", sans-serif;
  font-size: 1.7em;
  letter-spacing: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  outline: none;
}

.lock-card input:focus {
  border-color: #ff9a9e;
  box-shadow: 0 0 0 3px rgba(255, 154, 158, 0.2);
}

.lock-card input.input-error {
  border-color: #ff6b6b;
  animation: shake 0.3s ease;
}

.lock-card .btn {
  margin-top: 18px;
}

.lock-error {
  margin: 14px 0 0;
  color: #ff6b6b;
  font-size: 0.85em;
  font-style: italic;
}


/* ==============================================
   Twinkling stars
============================================== */

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  animation: twinkle 3s linear infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
  50% {
    opacity: 0.9;
    transform: scale(1);
  }
}

/* ==============================================
   Falling confetti
============================================== */

#confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -8vh;
  animation: confettiFall 8s linear infinite;
  will-change: transform;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(118vh) rotate(660deg);
  }
}

/* Burst particles on blow */
.burst {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  animation: burstOut 0.9s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes burstOut {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.5) rotate(var(--rot, 120deg));
    opacity: 0;
  }
}

/* ==============================================
   Cake
============================================== */

#cake {
  display: block;
  position: relative;
  margin: -10em auto 0 auto;
  z-index: 2;
}

/* ==============================================
   Candle
============================================== */

.candle {
  background: #ffffff;
  border-radius: 10px;
  position: absolute;
  top: 228px;
  left: 50%;
  margin-left: -2.4px;
  margin-top: -8.33333333px;
  width: 5px;
  height: 35px;
  transform: translateY(-300px);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  -webkit-animation: in 500ms 6s ease-out forwards;
          animation: in 500ms 6s ease-out forwards;
  z-index: 10;
}

.candle:after,
.candle:before {
  background: rgba(255, 0, 0, 0.4);
  content: "";
  position: absolute;
  width: 100%;
  height: 2.22222222px;
}

.candle:after {
  top: 25%;
  left: 0;
}

.candle:before {
  top: 45%;
  left: 0;
}

/* Big invisible tap target over the candle */
.candle-hit {
  position: absolute;
  top: 200px;
  left: 50%;
  margin-left: -20px;
  width: 40px;
  height: 70px;
  cursor: pointer;
  z-index: 15;
}

.candle-hit:active + .candle,
.candle-hit:active {
  transform: none;
}

/* ==============================================
   Fire
============================================== */

.fire {
  border-radius: 100%;
  position: absolute;
  top: -20px;
  left: 50%;
  margin-left: -2.6px;
  width: 6.66666667px;
  height: 18px;
}

.fire:nth-child(1) {
  -webkit-animation: fire 2s 6.5s infinite;
          animation: fire 2s 6.5s infinite;
}

.fire:nth-child(2) {
  -webkit-animation: fire 1.5s 6.5s infinite;
          animation: fire 1.5s 6.5s infinite;
}

.fire:nth-child(3) {
  -webkit-animation: fire 1s 6.5s infinite;
          animation: fire 1s 6.5s infinite;
}

.fire:nth-child(4) {
  -webkit-animation: fire 0.5s 6.5s infinite;
          animation: fire 0.5s 6.5s infinite;
}

.fire:nth-child(5) {
  -webkit-animation: fire 0.2s 6.5s infinite;
          animation: fire 0.2s 6.5s infinite;
}

@-webkit-keyframes fire {
  0%, 100% {
    background: rgba(254, 248, 97, 0.5);
    box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
    transform: translateY(0) scale(1);
  }
  50% {
    background: rgba(255, 50, 0, 0.1);
    box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
    transform: translateY(-20px) scale(0);
  }
}
@keyframes fire {
  0%, 100% {
    background: rgba(254, 248, 97, 0.5);
    box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
    transform: translateY(0) scale(1);
  }
  50% {
    background: rgba(255, 50, 0, 0.1);
    box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
    transform: translateY(-20px) scale(0);
  }
}

/* Blown out */
.candle.blown .fire {
  animation: none;
  opacity: 0;
  transform: scale(0);
}

/* Smoke puff */
.puff {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 11;
}

.candle.blown .puff {
  animation: puffUp 0.8s ease-out forwards;
}

@keyframes puffUp {
  0% {
    opacity: 0.7;
    transform: translateY(0) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(2.6);
  }
}

@-webkit-keyframes in {
  to {
    transform: translateY(0);
  }
}
@keyframes in {
  to {
    transform: translateY(0);
  }
}

/* ==============================================
   Photo
============================================== */

.photo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 8px auto 0;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 5px rgba(255, 154, 158, 0.25), 0 8px 28px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
}

/* ==============================================
   Text
============================================== */

.text {
  color: #d1d1d1;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
  position: relative;
  z-index: 2;
  margin-top: 18px;
}

.text h1 {
  font-size: 1.6em;
  margin: 0;
  line-height: 1.2;
  color: #ffe3ee;
  text-shadow: 0 0 24px rgba(255, 150, 190, 0.35);
}

.text .name {
  font-size: 2em;
  margin: 4px 0 0;
  font-weight: 300;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(255, 210, 120, 0.5);
  letter-spacing: 1px;
}

.text .date {
  font-size: 0.85em;
  margin: 6px 0 0;
  color: #a9a9a9;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.text .address {
  font-size: 0.9em;
  margin: 8px 0 0;
  color: #cdc6ea;
  letter-spacing: 0.5px;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.hint {
  color: #9d95c4;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
  font-size: 1em;
  margin: 16px 0 0;
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: hintIn 1s 7.2s ease-out forwards;
}

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

/* ==============================================
   Celebration modal
============================================== */

.modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  width: min(92vw, 360px);
  padding: 26px 20px;
  text-align: center;
  font-family: "Lato", sans-serif;
  background: rgba(45, 41, 62, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}

.modal.show {
  display: block;
  animation: popIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}

@keyframes popIn {
  from {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.modal h2 {
  margin: 0;
  font-size: 1.7em;
  font-weight: 300;
  font-style: italic;
  color: #ffd166;
  text-shadow: 0 0 24px rgba(255, 209, 102, 0.5);
}

.modal p {
  margin: 8px 0 0;
  font-size: 1em;
  font-weight: 300;
  font-style: italic;
  color: #e6dfff;
}

.modal .view[hidden] {
  display: none;
}

.modal .rsvp-name {
  font-size: 1.15em;
  color: #ffffff;
  margin-top: 10px;
}

.modal .rsvp-date {
  font-size: 0.9em;
  color: #a9a9a9;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal .rsvp-address {
  font-size: 0.95em;
  color: #ffd6e8;
  line-height: 1.4;
}

.modal .rsvp-sub {
  font-size: 1.05em;
  line-height: 1.4;
}

.modal .rsvp-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal .btn {
  font-family: "Lato", sans-serif;
  font-size: 0.95em;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  color: #ffffff;
  width: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.modal .btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.modal .btn-primary {
  background: linear-gradient(120deg, #ff9a9e, #a18cd1);
  box-shadow: 0 6px 18px rgba(255, 154, 158, 0.35);
}

.modal .btn-primary:hover {
  box-shadow: 0 10px 24px rgba(255, 154, 158, 0.45);
}

.modal .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.modal .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.modal form {
  margin-top: 12px;
  text-align: left;
}

.modal form label {
  display: block;
  font-size: 0.8em;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a9a9a9;
  margin: 12px 0 5px;
}

.modal form input {
  width: 100%;
  box-sizing: border-box;
  font-family: "Lato", sans-serif;
  font-size: 1em;
  font-weight: 300;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
}

.modal form input:focus {
  border-color: #ff9a9e;
  box-shadow: 0 0 0 3px rgba(255, 154, 158, 0.2);
}

.modal form input.input-error {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25);
  animation: shake 0.3s ease;
}

#recaptcha-error {
  color: #ff6b6b;
  font-size: 0.82em;
  font-style: italic;
  margin: 8px 0 0;
  text-align: center;
}

#rsvp-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.modal form input::placeholder {
  color: #8f8aa5;
}

.modal form .btn {
  margin-top: 18px;
}

.modal .btn-link {
  background: none;
  border: none;
  width: auto;
  color: #ffd6e8;
  font-size: 0.85em;
  font-style: italic;
  text-decoration: underline;
  padding: 8px 4px 2px;
}

.modal .btn-link:hover {
  transform: none;
  color: #ffffff;
}

.modal .btn + .btn-link {
  margin-top: 6px;
  display: inline-block;
}
