.chapters [data-locked] { color: #a294a6; }
.chapters [data-locked] .chapter-name { visibility: hidden; }
.chapters [data-locked]::before {
  position: absolute;
  inset-inline-start: calc(50% + 10px);
  top: 10px;
  content: "";
  width: 6px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 1px;
  box-shadow: 0 -2px 0 -1px currentColor;
}
.chapter-toast {
  position: fixed;
  z-index: 12;
  inset: auto 14px max(20px, env(safe-area-inset-bottom));
  width: fit-content;
  max-width: calc(100% - 28px);
  margin-inline: auto;
  padding: 10px 18px;
  border: 1px solid #ae826d;
  border-radius: 999px;
  background: #211b30f5;
  color: var(--ivory);
  opacity: 0;
  text-align: center;
  font-size: 13px;
  transition: opacity .2s;
  pointer-events: none;
}
.chapter-toast.visible { opacity: 1; }
#starlight #moon-button { padding: 0; border: 0; background: none; cursor: pointer; animation: none; }
#moon-button img { position: absolute; inset: 0; pointer-events: none; animation: lunar-drift 18s ease-in-out infinite alternate; }
html[data-paused] #moon-button img { animation-play-state: paused; }
#starlight .orbits { pointer-events: none; }
.passcode-form {
  display: grid;
  grid-template-columns: auto minmax(112px, 130px);
  justify-content: center;
  justify-items: center;
  align-items: center;
  gap: 9px 15px;
  text-align: center;
}
.passcode-entry { width: 100%; text-align: left; }
.passcode-entry label { display: block; margin-bottom: 4px; color: #e4c5bb; font-size: 12px; letter-spacing: .12em; }
#passcode {
  width: 100%;
  min-height: 44px;
  border: 1px solid #a98983;
  border-radius: 9px;
  background: #171429d9;
  color: var(--ivory);
  padding: 0 8px;
  text-align: center;
  font: 24px var(--serif);
  letter-spacing: .28em;
}
#passcode[aria-invalid="true"] { border-color: #f0a4bc; }
#open-surprise, #passcode-status { grid-column: 1 / -1; }
#passcode-status { min-height: 1.6em; font-size: 12px; color: #ffb8ce; }
.vinyl {
  display: grid;
  place-items: center;
  width: clamp(56px, 14vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #7c5a64;
  background: repeating-radial-gradient(circle, transparent 0 3px, #dfc7cd25 3.5px 4px),
    conic-gradient(#12131c, #45404b, #161420, #0a0b13, #332b3b, #12131c);
  box-shadow: 0 4px 20px #05030d7f;
  animation: spin-vinyl 15s linear infinite paused;
}
.vinyl > span {
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: url("../assets/flowers/lisianthus-open.webp") center 21% / 104% auto no-repeat, #58374f;
  box-shadow: inset 0 0 0 1px #f5d7b0b0;
  position: relative;
}
.vinyl > span::after { content: ""; position: absolute; inset: 44%; border-radius: 50%; background: #201422; }
html[data-music-playing]:not([data-paused]) .vinyl { animation-play-state: running; }
.moon-note {
  width: min(calc(100% - 32px), 440px);
  color: var(--ivory);
  background: #19162a;
  border: 1px solid #ccab8c;
  border-radius: 18px;
  padding: clamp(21px, 6vw, 40px);
  text-align: center;
}
.moon-note::backdrop { background: #070818dc; }
.moon-note > p { color: var(--gold); }
.moon-note h2 { margin: 10px 0 21px; font: 400 clamp(20px, 5vw, 28px)/1.55 var(--display-song); }
.moon-note img { max-width: 100%; max-height: 45svh; margin: 0 auto 16px; }
.moon-note audio { width: 100%; margin-bottom: 16px; }
@keyframes spin-vinyl { to { transform: rotate(1turn); } }

.bloom-hold {
  position: absolute;
  z-index: 2;
  top: 29%;
  left: 50%;
  translate: -50% -50%;
  width: min(52%, 190px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.bloom-hold svg { width: 100%; overflow: visible; rotate: -90deg; }
.bloom-hold circle { fill: none; stroke-width: 1.15; }
.hold-track { stroke: #ebd1ad82; }
.hold-progress {
  stroke: #ffd5c4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 4px #f2a6bc);
}
.is-holding .bloom-hold::after, .is-open .bloom-hold::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #f5b8c9;
  border-radius: 50%;
  box-shadow: 0 0 20px #c07b8f88;
  animation: bloom-ripple 1.15s ease-out infinite;
}
.is-open .bloom-hold { cursor: default; pointer-events: none; }
.is-open .bloom-hold svg { opacity: 0; transition: opacity .45s; }
.is-open .bloom-hold::after { border-color: #fff1c9; animation-iteration-count: 1; }
.bloom-hint, .meaning-hint {
  text-align: center;
  color: #f2d5c9;
  font: 400 clamp(13px, 3.8vw, 17px)/1.55 var(--display-song);
}
.bloom-hint { margin: -12px auto 14px; }
.meaning-hint { min-height: 1.55em; margin-bottom: 15px; }
.button[aria-disabled="true"] { opacity: .56; box-shadow: none !important; }
.meaning-touches {
  position: absolute;
  top: 17%;
  left: 50%;
  translate: -50% 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(44px, 1fr));
  gap: 6px 15px;
  rotate: -8deg;
}
.meaning-touches button {
  display: grid;
  place-items: center;
  width: clamp(44px, 13vw, 64px);
  aspect-ratio: 1;
  border: 1px solid #f2d9b9b0;
  border-radius: 70% 48% 76% 36%;
  -webkit-tap-highlight-color: transparent;
  background: #53324964;
  color: #fff2cf;
  cursor: pointer;
  box-shadow: inset 0 0 12px #edabd246, 0 0 10px #f1a7d359;
}
.meaning-touches button:nth-child(even) { translate: 0 10%; border-radius: 48% 70% 36% 76%; }
.meaning-touches button[aria-pressed="true"] {
  background: #efbecc59;
  color: #462038;
  transform: scale(1.09);
  animation: petal-awaken .7s ease-out both;
}
.petals-open .meaning-touches button:not(:focus-visible) { opacity: 0; transition: opacity .5s .35s; }
.meaning:not(.petals-open) .meaning-flower { filter: brightness(.79) saturate(.91); }
.meaning-flower { transition: filter .5s; }
.meaning-note:not([hidden]) { animation: confession-type-in .5s ease-out both; }
@keyframes petal-awaken {
  35% { transform: scale(1.19) rotate(5deg); box-shadow: 0 0 25px #ffe6b5ce; }
}
@keyframes bloom-ripple {
  from { opacity: .8; transform: scale(1); }
  to { opacity: 0; transform: scale(1.43); }
}

.memory-frame { aspect-ratio: auto; border-color: #e2b787ac; }
.memory-crop { display: block; width: 100%; overflow: hidden; }
.memory-frame .memory-crop { border-radius: 3px; }
.memory-crop img { margin-top: calc(0% - var(--crop, 0%)); }
.memory-frame .memory-crop img { height: auto; }
.memory-annotation {
  min-height: 2.85em;
  margin: 2px auto 4px;
  padding: 0 7px;
  max-width: 32em;
  color: #efcfbb;
  text-align: center;
  font: 400 15px/1.5 var(--display-song);
  text-wrap: balance;
}
.memory-timeline {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-auto-columns: minmax(44px, 1fr);
  grid-auto-flow: column;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 4px;
}
.memory-timeline::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 50% 5% auto;
  border-top: 1px dashed #d3a78174;
}
.memory-timeline button {
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #d0ad9b;
  cursor: pointer;
}
.memory-timeline button[aria-pressed="true"] { color: #fff1cc; text-shadow: 0 0 10px #f2a78f; font-size: 22px; }
.envelope-seal-glow {
  position: absolute;
  left: 50%;
  top: 64%;
  width: 14%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}
.letter-stage[data-letter-phase="opening"] .envelope-seal-glow { animation: warm-seal .35s ease-out both; }
.letter-body { animation: confession-type-in .53s .17s ease-out both; }
.letter-signature { animation: confession-type-in .55s .47s ease-out both; }
@keyframes warm-seal {
  30% { background: #ffcdc433; box-shadow: 0 0 25px #fff0cdb8, inset 0 0 17px #fff0be8c; }
  to { opacity: 0; }
}
.celebration-canvas {
  position: fixed;
  z-index: 11;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.celebrating .confession-art::after {
  background: radial-gradient(ellipse at 50% 37%, #e6a7c483, #be897c47 38%, transparent 66%);
  animation: flower-aura 1.8s ease-in-out infinite alternate;
}
html[data-paused] .celebrating .confession-art::after { animation-play-state: paused; }
@keyframes flower-aura { from { opacity: .44; } to { opacity: 1; } }

@font-face {
  font-family: "Starlight Ticket";
  src: url("../assets/fonts/song-ticket.woff2") format("woff2");
  font-display: swap;
}
.keepsake {
  --ticket-edge: #0b1020;
  position: relative;
  isolation: isolate;
  margin: 21px auto 15px;
  width: min(100%, 378px);
  border: 1px solid #d6ab83;
  border-radius: 11px;
  background: linear-gradient(145deg, #11172add, #222137c9 65%, #22162eeb),
    url("../assets/images/midnight-dust.webp") center / cover;
  color: var(--ivory);
  box-shadow: 0 14px 31px #030512a1;
  overflow-wrap: anywhere;
  animation: confession-type-in .5s ease-out both;
}
.keepsake::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #d6ab836b;
  border-radius: 7px;
  pointer-events: none;
}
.ticket-main, .ticket-voucher { position: relative; padding: 24px clamp(17px, 6vw, 32px); }
.ticket-main { isolation: isolate; }
.ticket-main::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 34% 4% 4% 28%;
  background: url("../assets/flowers/lisianthus-meaning.webp") right center / contain no-repeat;
  opacity: .29;
}
.ticket-brand, .ticket-motto, .ticket-footer {
  color: #f0cba7;
  font: 400 12px/1.45 "Starlight Ticket", var(--display-song);
  letter-spacing: .07em;
}
.ticket-number {
  margin-top: 8px;
  color: #efd4b7;
  font: 400 16px var(--serif);
  letter-spacing: .16em;
}
.keepsake h3 {
  margin: 9px -6px 3px;
  font: 400 clamp(23px, 7.5vw, 35px)/1.3 "Starlight Ticket", var(--display-song);
}
.ticket-motto { font: 400 14px var(--serif); letter-spacing: .2em; }
.keepsake dl {
  display: grid;
  gap: 12px;
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid #deb89b65;
  text-align: left;
}
.keepsake dt { font: 400 10px/1.5 "Starlight Ticket", var(--display-song); color: #e9c09c; letter-spacing: .09em; }
.keepsake dd { margin: 2px 0 0; font: 400 clamp(13px, 4vw, 17px)/1.5 "Starlight Ticket", var(--display-song); }
.ticket-stamp {
  position: absolute;
  right: 10%;
  bottom: 9%;
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border: 3px double #dfa1ae;
  border-radius: 3px;
  color: #f6b9c3;
  background: #27142791;
  transform: rotate(-10deg);
  font: 400 clamp(11px, 3vw, 15px) "Starlight Ticket", var(--display-song);
}
.ticket-voucher { border-top: 1px dashed #d6ab83a6; }
.ticket-voucher::before, .ticket-voucher::after {
  content: "";
  position: absolute;
  width: 16px;
  aspect-ratio: 1;
  top: -9px;
  border: 1px solid #d6ab83;
  border-radius: 50%;
  background: var(--ticket-edge);
}
.ticket-voucher::before { left: -9px; clip-path: inset(0 0 0 8px); }
.ticket-voucher::after { right: -9px; clip-path: inset(0 8px 0 0); }
.ticket-wish { margin: 12px auto 16px; max-width: 20em; font: 400 16px/1.65 "Starlight Ticket", var(--display-song); }
.ticket-footer { border-top: 1px solid #deb89b55; padding-top: 12px; font-size: 10px; }
#save-ticket { margin-bottom: 6px; }
.ticket-preview {
  width: min(calc(100% - 24px), 460px);
  max-height: calc(100% - 30px);
  max-height: calc(100dvh - 30px);
  padding: 15px clamp(10px, 4vw, 20px);
  border: 1px solid #d6ab83;
  border-radius: 16px;
  color: var(--ivory);
  background: #171428;
  text-align: center;
}
.ticket-preview::backdrop { background: #050612dc; }
.ticket-preview h2 { font: 400 21px/1.4 "Starlight Ticket", var(--display-song); }
.ticket-preview p { font-size: 12px; margin: 5px 0 10px; color: #edcdbb; }
.ticket-preview img {
  display: block;
  max-width: 100%;
  height: min(59vh, 570px);
  height: min(59dvh, 570px);
  width: auto;
  object-fit: contain;
  margin: 0 auto 11px;
}
