@font-face {
  font-family: TrungThuScript;
  src: url(./fonts/DancingScript-Bold.ttf) format("truetype");
  font-weight: 700;
  font-display: swap;
}
#tt-letter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: #0c0e1fba;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s, visibility .28s;
  touch-action: none;
}
#tt-letter-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}
.popup.tt-open {
  z-index: 1101;
  --tt-ink:#57392c;
  --tt-accent:#963f34;
  --tt-gold:#b18b4c;
  width: min(420px, calc(100vw - 32px));
  min-width: 0;
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 22px;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
  color: var(--tt-ink);
  font:
    400 16px/1.65 Georgia,
    "Times New Roman",
    serif;
  transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1);
}
.popup.tt-open:before {
  display: none;
}
.popup:not(.show) {
  visibility: hidden;
}
.popup.tt-open .close-popup {
  top: 9px;
  right: 9px;
  width: 44px;
  height: 44px;
  z-index: 5;
  border: 0;
  border-radius: 50%;
  background: #faefd8eb;
  color: #826648;
  font: 400 25px/1 Arial, sans-serif;
  opacity: 1;
  box-shadow: none;
}
.popup.tt-open .close-popup:hover {
  background: #f0dfbd;
  color: #873a30;
  transform: none;
}
.popup.tt-open .close-popup:focus-visible,
.tt-thiep__inner:focus-visible {
  outline: 2px solid var(--tt-accent);
  outline-offset: -5px;
}
.tt-thiep {
  position: relative;
  isolation: isolate;
  width: 100%;
  border: 1px solid #dbbe89;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 5% 0%,
      #f1d79b40,
      transparent 48%),
    radial-gradient(
      ellipse at 95% 100%,
      #ecd2a254,
      transparent 42%),
    #fff9ec;
  box-shadow: 0 28px 90px #02051370, 0 3px 12px #02051324;
}
.tt-thiep__frame {
  position: absolute;
  inset: 9px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid #c8a66766;
  border-radius: 14px;
}
.tt-thiep__frame:before,
.tt-thiep__frame:after {
  content: "\2726";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 7px;
  background: #fff7e6;
  color: var(--tt-gold);
  font: 12px/1 Georgia, serif;
}
.tt-thiep__frame:before {
  top: -6px;
}
.tt-thiep__frame:after {
  bottom: -6px;
}
.tt-thiep__inner {
  position: relative;
  max-height: calc(100vh - 34px);
  max-height: calc(100dvh - 34px);
  padding: 26px 32px 27px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c9ad7e transparent;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.tt-thiep__header {
  position: relative;
  margin: 0 0 19px;
}
.tt-thiep__art {
  display: block;
  width: min(100%, 284px);
  height: 92px;
  margin: 0 auto 5px;
  object-fit: contain;
  pointer-events: none;
}
.tt-thiep__badge {
  margin: 0 0 5px;
  color: #896b47;
  font: 500 10px/1.6 Arial, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.tt-thiep__title {
  margin: 0;
  color: var(--tt-accent);
  font:
    700 clamp(35px, 10vw, 44px)/1.22 TrungThuScript,
    Georgia,
    serif;
  text-shadow: none;
  text-wrap: balance;
}
.tt-thiep__subtitle {
  margin: 5px 0 0;
  color: #84684c;
  font: 400 12px/1.5 Georgia, serif;
  letter-spacing: .04em;
}
.tt-thiep__photo-wrap {
  position: relative;
  display: table;
  max-width: 100%;
  margin: 0 auto 21px;
  padding: 7px;
  border: 1px solid #dbc7a3;
  border-radius: 5px;
  background: #fffdf6;
  box-shadow: 0 5px 14px #70502b13;
}
.tt-thiep__photo-wrap:before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 50%;
  width: 48px;
  height: 15px;
  background: #dbc38c90;
  transform: translateX(-50%) rotate(-4deg);
}
.tt-thiep__photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(29vh, 234px);
  max-height: min(29dvh, 234px);
  border-radius: 2px;
  object-fit: contain;
}
.tt-thiep__message {
  position: relative;
}
.tt-thiep__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 13px;
  color: var(--tt-gold);
  font: 12px/1 Georgia, serif;
}
.tt-thiep__divider:before,
.tt-thiep__divider:after {
  content: "";
  width: 36px;
  height: 1px;
  background: #d8c5a1;
}
.tt-thiep__wish {
  margin: 0;
  color: var(--tt-ink);
  font:
    400 clamp(16px, 4.2vw, 18px)/1.75 Georgia,
    "Times New Roman",
    serif;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.tt-thiep__signature {
  margin: 19px 0 0;
}
.tt-thiep__sign-label {
  display: block;
  margin-bottom: 2px;
  color: #917556;
  font: 400 10px/1.5 Arial, sans-serif;
  letter-spacing: .09em;
}
.tt-thiep__sign {
  margin: 0;
  color: var(--tt-accent);
  font:
    700 23px/1.4 TrungThuScript,
    Georgia,
    serif;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.tt-thiep__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 21px 0 0;
  color: #967951;
  font: 400 9px/1.5 Arial, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.tt-thiep__footer:before,
.tt-thiep__footer:after {
  content: "\b7";
  color: var(--tt-gold);
}
.tt-thiep--hang-nga {
  --tt-accent:#87413d;
}
.tt-thiep--tho-vang {
  --tt-accent:#8c542d;
}
.tt-thiep--long-den {
  --tt-accent:#98412e;
}
.tt-thiep--vu-tru {
  --tt-accent:#526953;
}
@media (max-height: 680px) {
  .tt-thiep__inner {
    padding: 20px 27px 23px;
  }
  .tt-thiep__art {
    height: 56px;
    margin-bottom: 3px;
  }
  .tt-thiep__header {
    margin-bottom: 14px;
  }
  .tt-thiep__title {
    font-size: 36px;
  }
  .tt-thiep__photo-wrap {
    margin-bottom: 17px;
  }
  .tt-thiep__photo {
    max-height: 24vh;
    max-height: 24dvh;
  }
  .tt-thiep__wish {
    font-size: 16px;
    line-height: 1.65;
  }
  .tt-thiep__signature {
    margin-top: 13px;
  }
  .tt-thiep__footer {
    margin-top: 15px;
  }
}
@media (max-width: 480px) {
  .tt-thiep__title {
    font-size: 36px;
  }
  .tt-thiep__inner {
    padding-left: 27px;
    padding-right: 27px;
  }
}
@media (max-width: 360px) {
  .popup.tt-open {
    width: calc(100vw - 24px);
  }
  .tt-thiep__inner {
    padding-right: 23px;
    padding-left: 23px;
  }
  .tt-thiep__badge {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .popup.tt-open,
  #tt-letter-backdrop {
    transition: none;
  }
}
#stars,
#shooting-stars,
#moon {
  will-change: transform;
  transition: none;
}
#three-container canvas {
  cursor: grab;
  touch-action: none;
}
