/* =========================================================
   TIKKI CARD — POLAROID ROMANCE
   CLEAN CSS
========================================================= */


/* =========================================================
   01. ROOT / RESET
========================================================= */

:root {
  --ivory: #eee8df;
  --paper: #f7f2ea;
  --taupe: #b7aa9d;
  --cocoa: #5d5149;
  --ink: #292522;
  --rose: #b98783;
  --dust: #d7cbc0;

  --ease-smooth: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
}

* {
  box-sizing: border-box;
}

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

  background: var(--ivory);
  color: var(--ink);

  font-family: "Noto Sans Thai", sans-serif;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}


/* =========================================================
   02. GLOBAL SCENE
========================================================= */

.scene {
  position: fixed;
  inset: 0;

  display: grid;
  place-items: center;

  padding: 28px;

  opacity: 0;
  visibility: hidden;

  transform: scale(1.018);
  filter: blur(7px);

  transition:
    opacity 1.35s var(--ease-soft),
    transform 1.7s var(--ease-smooth),
    filter 1.2s ease,
    visibility 1.35s;
}

.scene.active {
  opacity: 1;
  visibility: visible;

  transform: scale(1);
  filter: blur(0);
}


/* =========================================================
   03. FILM GRAIN
========================================================= */

.grain {
  position: fixed;
  inset: -50%;

  z-index: 99;

  pointer-events: none;

  opacity: .035;

  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  animation:
    grain .25s steps(2) infinite;
}

@keyframes grain {

  25% {
    transform: translate(2%, -1%);
  }

  50% {
    transform: translate(-1%, 2%);
  }

  75% {
    transform: translate(1%, 1%);
  }

}


/* =========================================================
   04. CAMERA FLASH
========================================================= */

.flash {
  position: fixed;
  inset: 0;

  z-index: 2000;

  background: #fff;

  opacity: 0;

  pointer-events: none;
}

.flash.go {
  animation:
    cameraFlash .62s ease-out;
}

@keyframes cameraFlash {

  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  30% {
    opacity: .45;
  }

  100% {
    opacity: 0;
  }

}


/* =========================================================
   05. GLOBAL AMBIENT GLOW
========================================================= */

.glow {
  position: absolute;

  border-radius: 50%;

  filter: blur(80px);

  opacity: .28;

  animation:
    ambientFloat 9s
    ease-in-out infinite;
}

@keyframes ambientFloat {

  50% {
    transform:
      translate(3vw, -2vh)
      scale(1.08);
  }

}


/* =========================================================
   06. SOUND BUTTON
========================================================= */

.sound {
  position: fixed;

  top: 20px;
  right: 20px;

  z-index: 1500;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 9px 13px;

  border:
    1px solid rgba(110, 98, 87, .2);

  border-radius: 999px;

  background:
    rgba(245, 239, 232, .86);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  color: #51473f;

  cursor: pointer;

  transition: .4s ease;
}

.sound:hover {
  transform: translateY(-2px);

  background:
    rgba(250, 246, 240, .95);
}

.sound small {
  font-size: 9px;
  letter-spacing: .12em;
}


/* =========================================================
   07. GENERAL BUTTONS
========================================================= */

.start,
.soft-btn,
.story-btn {
  margin-top: 25px;

  padding: 13px 23px;

  border: 0;
  border-radius: 999px;

  background: #5c5048;
  color: #fffaf4;

  box-shadow:
    0 10px 30px rgba(78, 67, 55, .17);

  cursor: pointer;

  transition:
    transform .35s ease,
    box-shadow .35s ease,
    background .35s ease;
}

.start:hover,
.soft-btn:hover,
.story-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 15px 35px rgba(78, 67, 55, .24);
}

.outline {
  margin-top: 25px;

  padding: 12px 20px;

  border:
    1px solid rgba(255, 255, 255, .2);

  border-radius: 999px;

  background: transparent;
  color: #ddd;

  cursor: pointer;

  transition: .3s ease;
}

.outline:hover {
  background:
    rgba(255, 255, 255, .06);
}


/* =========================================================
   08. INTRO
========================================================= */

.intro {
  grid-template-columns:
    1fr 1fr;

  gap: 5vw;

  background:
    radial-gradient(
      circle at 28% 18%,
      #fffaf4 0,
      transparent 35%
    ),
    radial-gradient(
      circle at 75% 80%,
      #d8c6ba 0,
      transparent 38%
    ),
    #eae3da;
}

.g1 {
  left: -12vw;
  bottom: -12vw;

  width: 42vw;
  height: 42vw;

  background: #d6a9a3;
}

.g2 {
  top: -8vw;
  right: -10vw;

  width: 35vw;
  height: 35vw;

  background: #e7c69f;

  animation-delay: -4s;
}

.intro-copy {
  justify-self: end;

  max-width: 510px;
}

.kicker,
.tiny {
  font-size: 10px;
  letter-spacing: .26em;

  color: #8f7f72;
}

.intro h1 {
  margin: 5px 0;

  font-family:
    "DM Serif Display",
    "Noto Sans Thai",
    serif;

  font-size:
    clamp(48px, 6vw, 80px);

  font-weight: 400;
  line-height: 1.03;
}

.intro h1 i {
  color: #9a6e6c;

  font-weight: 400;
}

.muted {
  margin-top: 25px;

  color: #8d8177;

  font-weight: 300;
}


/* intro reveal */

.reveal {
  opacity: 0;

  transform:
    translateY(18px);

  animation:
    revealElement 1.2s forwards;
}

.reveal:nth-child(2) {
  animation-delay: .45s;
}

.reveal:nth-child(3) {
  animation-delay: .9s;
}

.reveal:nth-child(4) {
  animation-delay: 1.45s;
}

.camera-wrap.reveal {
  animation-delay: 1.9s;
}

@keyframes revealElement {

  to {
    opacity: 1;
    transform: none;
  }

}


/* =========================================================
   09. CAMERA
========================================================= */

.camera-wrap {
  text-align: center;
}

.camera {
  position: relative;

  width: min(380px, 80vw);
  height: 290px;

  margin: auto;

  border:
    1px solid rgba(183, 170, 155, .4);

  border-radius: 34px;

  background:
    linear-gradient(
      145deg,
      #e5ddd2,
      #cfc5b9
    );

  box-shadow:
    0 28px 65px rgba(117, 104, 92, .18),
    inset 0 2px rgba(255, 255, 255, .6);
}

.camera-top {
  display: flex;
  justify-content: space-between;

  padding: 24px 30px;

  color: #756b63;

  font:
    12px Georgia,
    serif;
}

.lens {
  position: absolute;

  top: 72px;
  left: 50%;

  width: 140px;
  height: 140px;

  border-radius: 50%;

  background: #302c29;

  transform:
    translateX(-50%);

  box-shadow:
    0 0 0 12px #afa69c,
    0 0 0 15px #837970;
}

.lens div {
  position: absolute;
  inset: 23px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 36% 30%,
      #897f76,
      #211f1d 30%,
      #0c0b0a 70%
    );

  box-shadow:
    inset 0 0 18px #000;
}

.finder {
  position: absolute;

  top: 62px;
  right: 35px;

  width: 48px;
  height: 36px;

  border-radius: 7px;

  background: #4c4742;
}

.shutter {
  position: absolute;

  top: 38px;
  left: 35px;

  width: 38px;
  height: 13px;

  border-radius: 10px;

  background: #8f7e72;
}

.slot {
  position: absolute;

  bottom: 24px;
  left: 14%;

  width: 72%;
  height: 7px;

  border-radius: 8px;

  background: #514a45;

  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .3);
}


/* =========================================================
   10. CAPTURE STACK
========================================================= */

.shot-stack {
  position: absolute;

  right: 6vw;
  bottom: 6vh;

  width: 210px;
  height: 250px;

  pointer-events: none;
}

.captured-card {
  position: absolute;

  top: 25px;
  left: 25px;

  width: 145px;
  height: 185px;

  padding:
    7px 7px 28px;

  background: #f8f3ec;

  box-shadow:
    0 16px 38px
    rgba(85, 72, 62, .17);

  opacity: 0;

  transform:
    translateY(-130px)
    rotate(0deg);
}

.captured-card.arrive {
  animation:
    cardFall 1.5s
    var(--ease-smooth)
    forwards;
}

.captured-card .blank {
  width: 100%;
  height: 100%;

  background:
    linear-gradient(
      145deg,
      #eee8e1,
      #d8cfc7
    );
}

@keyframes cardFall {

  35% {
    opacity: 1;
  }

  100% {
    opacity: 1;

    transform:
      translateY(var(--y))
      translateX(var(--x))
      rotate(var(--r));
  }

}


/* =========================================================
   11. REVIEW
========================================================= */

.review {
  grid-template-rows:
    auto 1fr auto;

  text-align: center;

  background:
    radial-gradient(
      circle at 45% 25%,
      #fffaf4,
      #e4dbd2 64%,
      #d1c4ba
    );
}

.review-head {
  align-self: end;

  margin-top: 4vh;
}

.review-head h2 {
  margin: 8px;

  font:
    400 clamp(32px, 5vw, 52px)
    "DM Serif Display",
    "Noto Sans Thai",
    serif;
}

.paper-stack {
  position: relative;

  align-self: center;

  width: min(420px, 78vw);
  height: min(510px, 58vh);
}

.stack-sheet {
  position: absolute;
  inset: 5% 10%;

  padding:
    12px 12px 58px;

  background: #f8f3ec;

  box-shadow:
    0 22px 60px
    rgba(88, 74, 64, .17);

  opacity: 0;
}

.review.active .stack-sheet {
  animation:
    stackIn 1.35s
    var(--ease-smooth)
    forwards;
}

.stack-sheet .blank {
  width: 100%;
  height: 100%;

  background: #e9e2db;
}

.review .soft-btn {
  align-self: start;

  margin-top: -2vh;
}

@keyframes stackIn {

  from {
    opacity: 0;

    transform:
      translateY(-70px)
      rotate(0);
  }

  to {
    opacity: 1;

    transform:
      translate(
        var(--x),
        var(--y)
      )
      rotate(var(--r));
  }

}


/* =========================================================
   12. MEMORY
========================================================= */

.memory {
  background:
    radial-gradient(
      circle at 50% 20%,
      #fffaf4,
      #e9e1d8 68%,
      #d9cec4
    );
}

.memory-index {
  position: absolute;

  top: 26px;

  color: #8e8278;

  font-size: 9px;
  letter-spacing: .22em;
}


/* Polaroid */

.polaroid {
  position: absolute;

  top: 18%;

  z-index: 4;

  width: min(340px, 76vw);

  padding:
    13px 13px 56px;

  background: var(--paper);

  box-shadow:
    0 24px 60px
    rgba(102, 87, 75, .17);

  opacity: 1;

  transform:
    rotate(-1deg);

  transition:
    transform 1.2s var(--ease-smooth),
    opacity 1s ease;
}

.polaroid.enter {
  animation:
    memoryOpen 1.65s
    var(--ease-smooth)
    both;
}

.polaroid.exit {
  opacity: 0;

  transform:
    translateX(-55vw)
    rotate(-9deg)
    scale(.92);
}

@keyframes memoryOpen {

  from {
    opacity: 0;

    transform:
      translateY(70px)
      rotate(4deg)
      scale(.94);
  }

  to {
    opacity: 1;

    transform:
      rotate(-1deg)
      scale(1);
  }

}


/* actual photo */

.photo {
  position: relative;

  overflow: hidden;

  aspect-ratio: 4 / 5;

  background: #ddd4ca;
}

.photo img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  filter:
    saturate(.86)
    contrast(.94)
    sepia(.06);
}

.develop {
  position: absolute;
  inset: 0;

  background: #f1ece5;

  mix-blend-mode: screen;

  animation:
    developPhoto 2.7s ease forwards;
}

@keyframes developPhoto {

  0% {
    opacity: .94;
  }

  35% {
    opacity: .72;
  }

  100% {
    opacity: 0;
  }

}

.handwrite {
  position: absolute;

  right: 22px;
  bottom: 18px;

  color: #76685e;

  font:
    italic 16px
    "Playfair Display",
    serif;
}


/* memory caption */

.caption {
  position: absolute;

  top: 70%;

  max-width: 560px;

  text-align: center;
}

.caption .line {
  margin: 4px;

  color: #5d534c;

  font-size: 17px;
  font-weight: 300;

  opacity: 0;

  transform:
    translateY(10px);
}

.caption.show .line {
  animation:
    captionLineIn 1.2s forwards;
}

.caption.show .line:nth-child(2) {
  animation-delay: .85s;
}

@keyframes captionLineIn {

  to {
    opacity: 1;
    transform: none;
  }

}


/* next memory */

.keep-btn {
  position: absolute;

  bottom: 24px;

  padding: 8px;

  border: 0;
  border-bottom:
    1px solid #a79b90;

  background: transparent;

  color: #786b61;

  font-size: 11px;
  letter-spacing: .1em;

  opacity: 0;

  cursor: pointer;

  transition: .7s;
}

.keep-btn.show {
  opacity: 1;
}


/* =========================================================
   13. TABLE / DAYS
========================================================= */

.table-scene {
  background: #d9d0c7;
}

.table-light {
  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      120deg,
      rgba(255, 248, 237, .6)
      0 30%,
      transparent 52%
    );
}

.photo-table {
  position: relative;

  width: min(720px, 92vw);
  height: min(620px, 65vh);
}

.table-polaroid {
  position: absolute;

  width:
    min(260px, 35vw);

  padding:
    10px 10px 38px;

  background: #f8f3ec;

  box-shadow:
    0 20px 45px
    rgba(73, 61, 52, .2);

  opacity: 0;

  animation:
    tablePhotoDrop 1.3s forwards;
}

.table-polaroid img {
  display: block;

  width: 100%;

  aspect-ratio: 4 / 5;

  object-fit: cover;

  filter:
    saturate(.84);
}

@keyframes tablePhotoDrop {

  from {
    opacity: 0;

    transform:
      translateY(-35px)
      rotate(0deg);
  }

  to {
    opacity: 1;
  }

}


/* days */

.days-copy {
  position: absolute;

  z-index: 8;

  text-align: center;
}

.days-copy > strong {
  display: block;

  color: #4d433d;

  font:
    72px
    "DM Serif Display",
    serif;
}

.days-copy > span {
  color: #9b756e;

  font-size: 10px;
  letter-spacing: .4em;
}

.days-copy > p {
  color: #7f736a;

  font-size: 12px;
}


/* =========================================================
   14. LIVE CLOCK
========================================================= */

.live-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;

  gap: 10px;

  margin:
    10px 0 8px;

  font-variant-numeric:
    tabular-nums;
}

.live-time > div {
  min-width: 58px;
}

.live-time b {
  display: block;

  color: #5a4c45;

  font:
    400 clamp(18px, 3vw, 28px)
    "DM Serif Display",
    serif;
}

.live-time small {
  display: block;

  margin-top: 2px;

  color: #99867c;

  font-size: 7px;
  letter-spacing: .12em;
}

.live-time i {
  margin-top: 2px;

  color: #aa9187;

  font-style: normal;
}


/* =========================================================
   15. DAYS NEXT BUTTON
========================================================= */

.days-next-btn {
  margin-top: 18px;

  padding:
    10px 22px;

  border:
    1px solid
    rgba(93, 81, 73, .22);

  border-radius: 999px;

  background:
    rgba(255, 250, 244, .5);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: #6d5e56;

  font-size: 12px;
  font-weight: 400;

  cursor: pointer;

  opacity: 0;

  transform:
    translateY(10px);

  animation:
    daysButtonIn 1s 1.4s
    var(--ease-smooth)
    forwards;

  transition:
    opacity .5s ease,
    transform .5s ease,
    background .3s ease;
}

.days-next-btn:hover {
  background:
    rgba(255, 250, 244, .82);

  transform:
    translateY(-2px);
}

.days-next-btn.leaving {
  opacity: 0;

  transform:
    translateY(6px);

  pointer-events: none;
}

@keyframes daysButtonIn {

  to {
    opacity: 1;
    transform: none;
  }

}


/* =========================================================
   16. BLACKOUT
========================================================= */

.blackout {
  background: #020202;

  color: #eee;
}

.black-copy {
  max-width: 600px;

  text-align: center;
}

.black-line {
  opacity: 0;

  transform:
    translateY(12px);
}

.blackout.active .black-line {
  animation:
    blackTextIn 1.4s forwards;
}

.blackout.active .black-line:nth-child(2) {
  animation-delay: 2.2s;
}

.blackout.active .black-line:nth-child(3) {
  animation-delay: 4.8s;
}

.black-copy h2 {
  font-size:
    clamp(35px, 7vw, 62px);

  font-weight: 300;
  line-height: 1.4;
}

.dark-btn {
  padding:
    11px 18px;

  border:
    1px solid rgba(255, 255, 255, .15);

  border-radius: 999px;

  background: transparent;

  color: #aaa;

  opacity: 0;

  cursor: pointer;
}

.blackout.active .dark-btn {
  animation:
    blackTextIn 1s 7.1s forwards;
}

@keyframes blackTextIn {

  to {
    opacity: 1;
    transform: none;
  }

}


/* =========================================================
   17. CONFESSION
========================================================= */

.confession {
  background:
    radial-gradient(
      circle at 50% 50%,
      #e9ddd4,
      #bfaea4
    );
}

.floating-photos {
  position: absolute;
  inset: 0;

  opacity: .55;
}

.float-pol {
  position: absolute;

  width: 160px;

  padding:
    7px 7px 25px;

  background: #f7f2ea;

  box-shadow:
    0 16px 40px
    rgba(73, 58, 48, .15);

  animation:
    floatingPhoto 7s
    ease-in-out infinite;
}

.float-pol img {
  display: block;

  width: 100%;

  aspect-ratio: 4 / 5;

  object-fit: cover;

  filter:
    saturate(.72);
}

@keyframes floatingPhoto {

  50% {
    transform:
      translateY(-12px)
      rotate(var(--r));
  }

}

.confession-copy {
  position: relative;

  z-index: 3;

  max-width: 620px;

  text-align: center;
}

.conf-line {
  display: none;

  opacity: 0;
}

.conf-line.current {
  display: block;

  animation:
    confessionLine 1.6s forwards;
}

@keyframes confessionLine {

  from {
    opacity: 0;

    transform:
      translateY(15px);

    filter: blur(4px);
  }

  to {
    opacity: 1;

    transform: none;

    filter: none;
  }

}

.confession-copy p {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.9;
}

.feelings span {
  color: #786a62;

  font:
    italic 48px
    "Playfair Display",
    serif;

  text-decoration:
    line-through;
}

.feelings b {
  display: block;

  margin-top: 10px;

  color: #8f5f60;

  font:
    500 italic 80px
    "Playfair Display",
    serif;
}

.final-conf {
  font-size:
    22px !important;
}

.soft-btn {
  display: none;
}

.soft-btn.show {
  display: inline-block;

  animation:
    confessionLine 1s forwards;
}


/* =========================================================
   18. PROPOSAL
========================================================= */

.proposal {
  grid-template-columns:
    .8fr 1.2fr;

  gap: 6vw;

  background:
    linear-gradient(
      135deg,
      #eee6dd,
      #d5c8bd
    );
}

.proposal-polaroid {
  width:
    min(340px, 70vw);

  padding:
    12px 12px 55px;

  background: #faf5ee;

  box-shadow:
    0 30px 70px
    rgba(85, 72, 62, .18);

  transform:
    rotate(-3deg);
}

.proposal-polaroid span {
  display: block;

  margin-top: 15px;

  color: #75665d;

  text-align: center;

  font:
    italic 17px
    "Playfair Display",
    serif;
}

.proposal-copy {
  max-width: 590px;
}

.prop-line {
  opacity: 0;

  transform:
    translateY(14px);
}

.proposal.active .prop-line {
  animation:
    proposalLine 1.15s forwards;
}

.proposal.active .prop-line:nth-child(2) {
  animation-delay: 1.1s;
}

.proposal.active .prop-line:nth-child(3) {
  animation-delay: 2.3s;
}

.proposal.active .prop-line:nth-child(4) {
  animation-delay: 3.6s;
}

.proposal.active .prop-line:nth-child(5) {
  animation-delay: 5s;
}

.proposal.active .prop-line:nth-child(6) {
  animation-delay: 6.5s;
}

@keyframes proposalLine {

  to {
    opacity: 1;
    transform: none;
  }

}

.proposal-copy p {
  color: #71665e;

  line-height: 1.8;
}

.proposal-copy h2 {
  font-size: 25px;
  font-weight: 300;
}

.proposal-copy h1 {
  color: #574944;

  font-family:
    "DM Serif Display",
    "Noto Sans Thai",
    serif;

  font-size: 39px;
  font-weight: 400;
  line-height: 1.35;
}


/* choices */

.choices {
  position: relative;

  display: flex;
  align-items: center;

  gap: 12px;

  min-height: 65px;
}

.yes,
.no,
.not-ready {
  padding:
    12px 20px;

  border-radius: 999px;

  cursor: pointer;
}

.yes {
  border: 0;

  background: #765b57;

  color: #fff;
}

.no,
.not-ready {
  border:
    1px solid rgba(136, 122, 112, .33);

  background: #eee6dd;

  color: #786b62;

  transition: .2s;
}

.yes:hover {
  transform: translateY(-2px);

  box-shadow:
    0 10px 25px
    rgba(93, 70, 66, .2);
}

.not-ready {
  margin-top: 8px;
}


/* =========================================================
   19. WAIT / NOT READY
========================================================= */

.wait-copy {
  color: #aaa;

  text-align: center;

  line-height: 2;
}

.wait-copy h2 {
  margin-top: 35px;

  color: #fff;

  font-size: 40px;
  font-weight: 300;
}

.wait-close {
  margin-top: 24px;

  padding:
    11px 22px;

  border:
    1px solid
    rgba(255, 255, 255, .22);

  border-radius: 999px;

  background: transparent;

  color: #bbb;

  cursor: pointer;

  transition: .35s;
}

.wait-close:hover {
  border-color: #777;

  color: #fff;

  transform:
    translateY(-2px);
}


/* =========================================================
   20. SUCCESS
========================================================= */

.success {
  overflow: hidden;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% 25%,
      #fff9f2,
      #e7dbd1 60%,
      #cfc0b5
    );
}

.success-glow {
  position: absolute;

  width: 60vw;
  height: 60vw;

  border-radius: 50%;

  background:
    rgba(217, 167, 162, .4);

  filter:
    blur(120px);

  animation:
    successGlow 8s
    ease-in-out infinite alternate;
}

@keyframes successGlow {

  from {
    opacity: .5;

    transform:
      scale(.9);
  }

  to {
    opacity: .8;

    transform:
      scale(1.1);
  }

}


/* success polaroid */

.new-polaroid {
  position: relative;

  z-index: 30;

  width:
    min(310px, 65vw);

  margin-bottom: 20px;

  padding:
    11px 11px 52px;

  background: #faf6ef;

  box-shadow:
    0 28px 70px
    rgba(94, 78, 66, .18);

  transform:
    rotate(1.5deg);

  animation:
    newRelationshipPhoto 1.7s
    var(--ease-smooth);
}

@keyframes newRelationshipPhoto {

  from {
    opacity: 0;

    transform:
      translateY(-120px)
      rotate(0deg)
      scale(.94);
  }

  to {
    opacity: 1;

    transform:
      rotate(1.5deg)
      scale(1);
  }

}

.new-polaroid span {
  position: absolute;

  right: 0;
  bottom: 17px;
  left: 0;

  color: #796a60;

  font:
    italic 15px
    "Playfair Display",
    serif;
}

.success h1 {
  position: relative;

  z-index: 30;

  margin: 7px;

  font:
    48px
    "DM Serif Display",
    "Noto Sans Thai",
    serif;
}

.success h1 i {
  color: #9a6868;

  font-weight: 400;
}

.success > p,
.success .tiny {
  position: relative;

  z-index: 30;

  color: #7f7168;
}


/* success actions */

.ending-actions {
  position: relative;

  z-index: 30;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;

  gap: 10px;
}

.close-program-btn {
  margin-top: 25px;

  padding:
    12px 20px;

  border:
    1px solid
    rgba(93, 81, 73, .25);

  border-radius: 999px;

  background: transparent;

  color: #6f625a;

  cursor: pointer;

  transition: .35s;
}

.close-program-btn:hover {
  background:
    rgba(255, 255, 255, .35);

  transform:
    translateY(-2px);
}


/* =========================================================
   21. HEART RAIN — GLOBAL
   สำคัญ: ชื่อตรงกับ JS ล่าสุด
========================================================= */

.love-rain-global {
  position: fixed !important;
  inset: 0 !important;

  z-index: 1600 !important;

  width: 100vw;
  height: 100vh;

  overflow: hidden;

  pointer-events: none;

  contain: none;
}


/* หัวใจแต่ละดวง */

.rain-heart-global {
  position: absolute;

  top: -80px;

  display: block;

  color: #b96f76;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-weight: 400;
  line-height: 1;

  opacity: 0;

  will-change:
    transform,
    opacity;

  filter:
    drop-shadow(
      0 3px 8px
      rgba(117, 67, 71, .15)
    );

  animation-name:
    globalHeartRain;

  animation-timing-function:
    linear;

  animation-iteration-count:
    infinite;

  animation-fill-mode:
    both;
}

@keyframes globalHeartRain {

  0% {
    opacity: 0;

    transform:
      translate3d(
        0,
        -10vh,
        0
      )
      rotate(0deg)
      scale(.75);
  }

  7% {
    opacity:
      var(--heart-opacity, .65);
  }

  30% {
    opacity:
      var(--heart-opacity, .65);

    transform:
      translate3d(
        calc(var(--drift) * .45),
        30vh,
        0
      )
      rotate(90deg)
      scale(1);
  }

  60% {
    opacity:
      var(--heart-opacity, .65);

    transform:
      translate3d(
        var(--drift),
        65vh,
        0
      )
      rotate(190deg)
      scale(.9);
  }

  90% {
    opacity:
      var(--heart-opacity, .65);
  }

  100% {
    opacity: 0;

    transform:
      translate3d(
        calc(var(--drift) * -.4),
        115vh,
        0
      )
      rotate(330deg)
      scale(.7);
  }

}


/* =========================================================
   22. HEART + STAR BURST — GLOBAL
========================================================= */

.love-burst-global {
  position: fixed !important;

  top: 50vh !important;
  left: 50vw !important;

  z-index: 1700 !important;

  width: 1px;
  height: 1px;

  pointer-events: none;
}

.burst-item-global {
  position: absolute;

  top: 0;
  left: 0;

  display: block;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  line-height: 1;

  opacity: 0;

  will-change:
    transform,
    opacity;

  filter:
    drop-shadow(
      0 4px 9px
      rgba(120, 65, 65, .2)
    );

  animation:
    globalLoveBurst
    2.2s
    cubic-bezier(.16, .75, .25, 1)
    forwards;
}

@keyframes globalLoveBurst {

  0% {
    opacity: 0;

    transform:
      translate(-50%, -50%)
      scale(.1)
      rotate(0deg);
  }

  6% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      scale(1.4)
      rotate(0deg);
  }

  18% {
    opacity: 1;

    transform:
      translate(
        calc(-50% + var(--x) * .15),
        calc(-50% + var(--y) * .15)
      )
      scale(1.15)
      rotate(
        calc(var(--rotate) * .15)
      );
  }

  55% {
    opacity: 1;
  }

  100% {
    opacity: 0;

    transform:
      translate(
        calc(-50% + var(--x)),
        calc(-50% + var(--y))
      )
      rotate(var(--rotate))
      scale(.55);
  }

}


/* =========================================================
   23. STORY
========================================================= */

.story {
  overflow: auto;

  background: #27211d;
}

.story-wrap {
  width:
    min(430px, 94vw);

  padding:
    34px 0;

  text-align: center;
}

.story-wrap .tiny {
  color: #c7b7a9;
}

.story canvas {
  display: block;

  width: 100%;
  height: auto;

  box-shadow:
    0 28px 70px
    rgba(0, 0, 0, .53);
}

.story-buttons {
  display: flex;
  justify-content: center;

  gap: 10px;
}

.hint {
  color: #8f8177;

  font-size: 11px;
}


/* =========================================================
   24. FINAL GOODBYE
========================================================= */

.final-goodbye {
  overflow: hidden;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% 40%,
      #f7eee7 0,
      #e6d8cf 42%,
      #cbbab0 100%
    );
}

.goodbye-glow {
  position: absolute;

  width: 70vw;
  height: 70vw;

  border-radius: 50%;

  background:
    rgba(201, 151, 148, .2);

  filter:
    blur(120px);

  animation:
    goodbyeGlow 4s
    ease-in-out
    infinite alternate;
}

@keyframes goodbyeGlow {

  from {
    opacity: .3;

    transform:
      scale(.9);
  }

  to {
    opacity: .55;

    transform:
      scale(1.1);
  }

}

.goodbye-content {
  position: relative;

  z-index: 2;

  width:
    min(620px, 90vw);
}

.goodbye-small,
.goodbye-content h1,
.goodbye-text,
.goodbye-love,
.goodbye-closing {
  opacity: 0;

  transform:
    translateY(14px);
}

.final-goodbye.active .goodbye-small {
  animation:
    goodbyeReveal .65s .05s forwards;
}

.final-goodbye.active h1 {
  animation:
    goodbyeReveal .7s .2s forwards;
}

.final-goodbye.active .goodbye-text {
  animation:
    goodbyeReveal .7s .45s forwards;
}

.final-goodbye.active .goodbye-love {
  animation:
    goodbyeReveal .65s .75s forwards;
}

.final-goodbye.active .goodbye-closing {
  animation:
    goodbyeReveal .5s 1.05s forwards;
}

@keyframes goodbyeReveal {

  to {
    opacity: 1;
    transform: none;
  }

}

.goodbye-small {
  color: #9b7d76;

  font-size: 9px;
  letter-spacing: .28em;
}

.goodbye-content h1 {
  color: #514640;

  font:
    400 clamp(34px, 6vw, 58px) / 1.35
    "DM Serif Display",
    "Noto Sans Thai",
    serif;
}

.goodbye-content h1 i {
  color: #956c6b;

  font-weight: 400;
}

.goodbye-text {
  margin-top: 24px;

  color: #776a62;

  font-size: 14px;
  font-weight: 300;
  line-height: 1.9;
}

.goodbye-love {
  margin-top: 22px;

  color: #8f6262;

  font:
    italic 24px
    "Playfair Display",
    serif;
}

.goodbye-closing {
  display: block;

  margin-top: 28px;

  color:
    rgba(91, 76, 68, .45);

  font-size: 8px;
  letter-spacing: .18em;
}


/* =========================================================
   25. OPTIONAL OLD ELEMENTS
========================================================= */

.mini-camera {
  position: absolute;

  top: 8%;

  width: 220px;
  height: 110px;

  border-radius: 25px;

  background: #d8cfc4;

  box-shadow:
    0 18px 40px
    rgba(102, 88, 76, .13);

  transition: 1s;
}

.mini-lens {
  position: absolute;

  top: 17px;
  left: 75px;

  width: 70px;
  height: 70px;

  border-radius: 50%;

  background: #312d2a;

  box-shadow:
    0 0 0 7px #aaa096;
}

.mini-slot {
  position: absolute;

  bottom: -2px;
  left: 45px;

  width: 130px;
  height: 5px;

  background: #4f4843;
}

.kept {
  position: absolute;

  bottom: 20px;
  left: 22px;

  width: 140px;
  height: 100px;
}

.kept img {
  position: absolute;

  width: 70px;

  border:
    5px solid #f5efe7;

  border-bottom-width:
    14px;

  box-shadow:
    0 7px 18px
    rgba(81, 71, 62, .15);
}


/* =========================================================
   26. MOBILE
========================================================= */

@media (max-width: 760px) {

  .scene {
    padding: 20px;
  }


  /* intro */

  .intro,
  .proposal {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    justify-self: center;

    margin-top: 25px;

    text-align: center;
  }

  .intro h1 {
    font-size: 45px;
  }


  /* camera */

  .camera {
    width: 260px;
    height: 195px;
  }

  .lens {
    top: 52px;

    width: 95px;
    height: 95px;
  }

  .lens div {
    inset: 16px;
  }

  .finder {
    top: 45px;
    right: 25px;

    width: 34px;
    height: 26px;
  }

  .camera-top {
    padding:
      16px 20px;
  }

  .slot {
    bottom: 16px;
  }

  .start {
    margin-top: 15px;
  }


  /* capture */

  .shot-stack {
    right: 2vw;
    bottom: 2vh;

    transform:
      scale(.7);

    transform-origin:
      bottom right;
  }


  /* review */

  .review-head {
    margin-top: 2vh;
  }

  .paper-stack {
    height: 48vh;
  }


  /* memory */

  .polaroid {
    top: 18%;

    width:
      min(300px, 72vw);
  }

  .caption {
    top: 68%;

    padding:
      0 20px;
  }

  .caption .line {
    font-size: 15px;
  }

  .kept {
    display: none;
  }


  /* days */

  .photo-table {
    height: 60vh;
  }

  .table-polaroid {
    width: 38vw;
  }

  .days-copy > strong {
    font-size: 58px;
  }

  .live-time {
    gap: 4px;
  }

  .live-time > div {
    min-width: 44px;
  }

  .live-time b {
    font-size: 19px;
  }

  .live-time small {
    font-size: 6px;
  }


  /* confession */

  .float-pol {
    width: 105px;
  }

  .confession-copy p {
    font-size: 17px;
  }

  .feelings span {
    font-size: 37px;
  }

  .feelings b {
    font-size: 59px;
  }


  /* proposal */

  .proposal {
    overflow: auto;

    padding-top: 40px;
  }

  .proposal-polaroid {
    width: 190px;

    margin-top: 20px;
  }

  .proposal-copy {
    text-align: center;
  }

  .proposal-copy h1 {
    font-size: 32px;
  }

  .choices {
    justify-content: center;
  }


  /* success */

  .new-polaroid {
    width:
      min(270px, 68vw);
  }

  .success h1 {
    font-size: 39px;
  }


  /* heart rain */

  .rain-heart-global {
    /*
      มือถือให้หัวใจเห็นชัดขึ้นนิด
    */

    filter:
      drop-shadow(
        0 2px 5px
        rgba(117, 67, 71, .18)
      );
  }


  /* burst */

  .love-burst-global {
    top: 48vh !important;
  }


  /* story */

  .story-wrap {
    width:
      min(430px, 92vw);
  }


  /* sound */

  .sound {
    top: 14px;
    right: 14px;
  }

}


/* =========================================================
   27. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  .scene {
    transition:
      opacity .5s ease,
      visibility .5s;
  }

}