:root {
  --paper: #f4ead8;
  --paper-deep: #ead9be;
  --ink: #2a2118;
  --muted: #7a6b58;
  --gold: #b8904a;
  --gold-bright: #d4b36a;
  --seal: #8c2f2f;
  --rose: #6e2d36;
  --shadow: rgba(42, 33, 24, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  background: #14110e;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.stage {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.phone {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 430px;
  background: #2a2118;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.bg-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(247, 239, 223, 0.42) 0%, rgba(244, 234, 216, 0.34) 45%, rgba(239, 226, 201, 0.46) 100%);
}

@media (min-width: 760px) {
  .phone {
    height: min(844px, 92dvh);
    border-radius: 28px;
    box-shadow:
      0 0 0 10px #1c1814,
      0 30px 80px rgba(0, 0, 0, 0.45);
  }
}

[hidden] {
  display: none !important;
}

.loader,
.cover,
.pages {
  position: absolute;
  inset: 0;
}

.loader {
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 16px;
  text-align: center;
  background: var(--paper);
}

.loader-names {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 36px;
}

.loader-bar {
  width: 132px;
  height: 2px;
  margin: 0 auto;
  background: rgba(42, 33, 24, 0.12);
  overflow: hidden;
}

.loader-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
}

.loader-hint,
.cover-kicker,
.page-en,
.card-kicker {
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--muted);
}

.cover {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 36px;
  text-align: center;
  text-shadow: 0 1px 12px rgba(247, 239, 223, 0.55);
}

.cover.leaving {
  animation: cover-leave 0.7s ease forwards;
}

.petals {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 70% 0 70% 0;
  background: linear-gradient(135deg, #e8c4c0, #b85a5a);
  opacity: 0.55;
  animation: fall linear infinite;
}

.ornament {
  pointer-events: none;
  position: absolute;
  width: 88px;
  height: 88px;
  border: 1px solid rgba(184, 144, 74, 0.45);
}

.ornament::before,
.ornament::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(184, 144, 74, 0.28);
}

.ornament-tl {
  top: 22px;
  left: 22px;
  border-right: 0;
  border-bottom: 0;
}

.ornament-br {
  right: 22px;
  bottom: 22px;
  border-left: 0;
  border-top: 0;
}

.cover-names {
  margin: 18px 0 10px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(42px, 12vw, 58px);
  font-weight: 700;
  line-height: 1.15;
}

.cover-names em {
  display: block;
  margin: 4px 0;
  font-style: normal;
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  color: var(--gold);
}

.cover-line {
  margin: 8px 0 18px;
  font-size: 22px;
  letter-spacing: 0.36em;
}

.cover-date {
  font-size: 28px;
  font-weight: 700;
  color: #111;
}

.seal {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  margin-top: 42px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #c24a4a, var(--seal) 62%);
  color: #f6e6c8;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 38px;
  box-shadow:
    0 10px 24px rgba(140, 47, 47, 0.28),
    inset 0 0 0 4px rgba(246, 230, 200, 0.18);
  animation: pulse 2.2s ease-in-out infinite;
  cursor: pointer;
}

.pages {
  z-index: 2;
  overflow: hidden;
}

.page-en,
.brush {
  text-shadow: 0 1px 10px rgba(247, 239, 223, 0.5);
}

.pages-track {
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
  will-change: transform;
}

.page {
  height: 100%;
  padding: 36px 24px 56px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.swipe-hint {
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.swipe-hint i {
  width: 10px;
  height: 10px;
  border-top: 1.5px solid var(--gold);
  border-left: 1.5px solid var(--gold);
  transform: rotate(45deg);
  animation: hint 1.4s ease-in-out infinite;
}

.swipe-hint.is-end {
  display: none;
}

.flip-tip {
  position: absolute;
  right: 0;
  bottom: 56px;
  left: 0;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 10px;
  pointer-events: none;
  color: #1a1410;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 1px 10px rgba(247, 239, 223, 0.7);
}

.flip-tip[hidden] {
  display: none;
}

.flip-tip i {
  width: 16px;
  height: 16px;
  border-top: 2.5px solid var(--gold);
  border-left: 2.5px solid var(--gold);
  transform: rotate(45deg);
  animation: hint 1.4s ease-in-out infinite;
}

.brush {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 6px 0 22px;
}

.letter,
.card,
.form,
.shot,
.wishes li {
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(184, 144, 74, 0.22);
  box-shadow: 0 10px 28px var(--shadow);
}

.letter {
  padding: 28px 22px;
  line-height: 2.05;
  font-size: 21px;
  font-weight: 600;
}

.letter-honor,
.letter-sign {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}

.letter-body,
.letter-story,
.letter-place {
  margin: 16px 0;
  color: #1a1410;
  font-weight: 600;
  white-space: pre-line;
}

.letter-sign {
  margin-top: 20px;
  font-size: 30px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.countdown div {
  padding: 14px 0 10px;
  text-align: center;
  background: rgba(255, 252, 246, 0.7);
  border: 1px solid rgba(184, 144, 74, 0.22);
}

.countdown strong {
  display: block;
  font-size: 34px;
  color: var(--rose);
}

.countdown span {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.schedule time {
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.schedule {
  list-style: none;
  display: grid;
  gap: 12px;
}

.schedule li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}

.schedule li.no-time {
  grid-template-columns: 1fr;
}

.schedule h3 {
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.schedule p {
  color: #111;
  font-size: 19px;
  font-weight: 600;
}

.card {
  padding: 20px 18px;
  margin-bottom: 14px;
}

.card-hall {
  margin: 8px 0 6px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #111;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.card-sub,
.card-addr,
.card-time {
  color: #1a1410;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.75;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.card-actions .btn {
  flex: 1;
  min-width: 42%;
}

.btn {
  appearance: none;
  border: 1px solid rgba(184, 144, 74, 0.4);
  background: transparent;
  padding: 14px 16px;
  letter-spacing: 0.08em;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2118;
  border-color: transparent;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.gallery-sub {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #1a1410;
}

.gallery-note {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #5a4a3a;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shot {
  padding: 0;
  border: 1px solid rgba(184, 144, 74, 0.22);
  background: #1c1610;
  overflow: hidden;
  cursor: pointer;
}

.shot img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(20, 16, 12, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(244, 234, 216, 0.92);
  color: #2a2118;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 14px;
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-nav.prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 19px;
  font-weight: 700;
  color: #1a1410;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 1px solid rgba(184, 144, 74, 0.28);
  background: #fffdf8;
  padding: 14px;
  font-size: 20px;
  font-weight: 600;
  outline: none;
}

.form-inline {
  grid-template-columns: 72px 1fr auto;
  align-items: center;
}

.form-ok,
.form-err {
  text-align: center;
  color: var(--rose);
}

.wishes {
  list-style: none;
  margin-top: 16px;
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
}

.wishes li {
  padding: 12px 14px;
}

.wishes strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
}

.footer-sign {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 700;
}

.music-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(184, 144, 74, 0.45);
  border-radius: 50%;
  background: rgba(244, 234, 216, 0.8);
  cursor: pointer;
}

.music-disc {
  display: block;
  width: 16px;
  height: 16px;
  margin: 9px auto;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.music-btn.on .music-disc {
  animation: spin 3s linear infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}

@keyframes cover-leave {
  to {
    opacity: 0;
    transform: scale(1.04);
    visibility: hidden;
  }
}

@keyframes fall {
  to {
    transform: translate3d(20px, 110vh, 0) rotate(360deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hint {
  0%,
  100% {
    opacity: 0.2;
    transform: rotate(45deg) translate(4px, 4px);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) translate(-2px, -2px);
  }
}
