:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #fff1e3;
  background: #211823;
  --muted: #e2bbc5;
  --gold: #ffd296;
  --border: #704752;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #432731 0%, #211823 68%); }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(97%, 1390px); margin: auto; padding-bottom: 12px; }
.masthead { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 5px 9px; }
.title { display: flex; align-items: center; gap: 12px; }
.age { display: grid; place-items: center; flex: none; width: 47px; height: 47px; border: 1px solid #876048; border-radius: 9px; color: var(--gold); background: #523137; font: 400 29px/.85 Georgia, serif; }
h1 { margin: 0; font-size: clamp(16px, 2.3vw, 25px); letter-spacing: .025em; }
.title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.records-button, .actions button, #records button:not(.close) { min-height: 42px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #392531; }
.records-button:hover, .actions button:hover, #records button:not(.close):hover { background: #5c3747; }
.records-button span { color: var(--gold); margin-right: .3em; }
.room { position: relative; isolation: isolate; container-type: inline-size; overflow: hidden; border: 1px solid #885249; border-radius: 13px; background: #452735; box-shadow: 0 14px 39px #140d1580; }
.art { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.photo-frame { position: absolute; z-index: 2; left: 84%; top: 21.6%; transform: translate(-50%, -50%) rotate(-4deg); width: 10.3%; padding: .62cqw .62cqw .1cqw; color: #4a3036; background: #fff1db; border: 0; border-radius: .2cqw; box-shadow: .18cqw .25cqw .5cqw #190b17b5; }
.photo-frame:hover { transform: translate(-50%, -50%) rotate(0); }
.photo-frame img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 37%; }
.photo-frame span { display: block; font-size: clamp(8px, 1.15cqw, 15px); line-height: 1.45; }
.cake { position: absolute; z-index: 2; left: 50%; top: 58.8%; display: flex; align-items: end; justify-content: center; transform: translate(-50%, -100%); min-width: 44px; min-height: 44px; padding: 0 .15em; border: 0; background: transparent; font: 900 clamp(23px, 4.5cqw, 62px)/.8 Georgia, serif; color: #ffdf9b; gap: .06em; }
.digit { position: relative; -webkit-text-stroke: .082em #8b4144; paint-order: stroke fill; text-shadow: 1px 2px #532736; }
.digit i { opacity: 0; position: absolute; left: 50%; bottom: 84%; width: .17em; height: .29em; margin-left: -.085em; border-radius: 65% 35% 55% 55%; background: #fffac9; box-shadow: 0 0 .1em .06em #ffba4f, 0 0 .27em .15em #ff9a39ab; transform-origin: center bottom; }
[data-candles="lit"] .digit i { opacity: 1; animation: flame .65s alternate infinite ease-in-out; }
[data-candles="lit"] .digit:nth-child(2) i { animation-delay: -.31s; }
@keyframes flame { from { transform: rotate(-7deg) scaleY(.87); } to { transform: rotate(6deg) scaleY(1.13); } }
.marker { position: absolute; z-index: 2; display: grid; place-items: center; transform: translate(-50%, -50%); width: clamp(32px, 4cqw, 51px); aspect-ratio: 1; padding: 0; border: 0; background: transparent; }
.marker span { display: grid; place-items: center; width: 77%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #ffd79e; background: #4b2638eb; color: #ffe1ad; font-size: clamp(13px, 1.6cqw, 22px); line-height: 1; }
.marker:hover span { color: #412734; background: #ffdea9; }
.letter { left: 62%; top: 45%; }
.gift { left: 69%; top: 41%; }
.vinyl { left: 89%; top: 70%; }
canvas { position: absolute; z-index: 3; width: 100%; height: 100%; inset: 0; pointer-events: none; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.actions .primary { background: #f2c384; border-color: #f2c384; color: #392335; font-weight: 700; }
.actions .primary:hover { background: #ffdcaa; }
.status { text-align: center; color: var(--gold); font-size: 13px; margin: 8px 0; }
.status:empty { display: none; }
dialog { width: min(92vw, 450px); max-height: 92dvh; margin: auto; padding: 24px; background: #352330; color: #fff1e3; border: 1px solid #966370; border-radius: 15px; text-align: center; }
dialog::backdrop { background: #150c16d6; }
dialog h2 { margin: 0 36px 13px; font-size: 21px; }
.close { position: absolute; right: 7px; top: 7px; width: 42px; height: 42px; border: 0; background: transparent; font-size: 26px; color: var(--muted); }
.card-icon { color: var(--gold); font-size: 33px; margin-bottom: 9px; }
#card p { white-space: pre-line; line-height: 1.85; color: var(--muted); margin-bottom: 0; }
#gallery { width: min(93vw, 760px); padding: 17px 12px; }
.gallery-stage { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 6px; }
.gallery-photo { display: block; width: 100%; height: min(61dvh, 570px); object-fit: contain; touch-action: pan-y; }
.arrow { height: 45px; background: #5b3c50; border: 1px solid #91717e; border-radius: 8px; font-size: 26px; }
.photo-count { color: var(--muted); margin: 9px 0; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 4px; justify-content: center; }
.thumbs button { width: min(10vw, 51px); padding: 2px; border: 1px solid transparent; border-radius: 5px; background: transparent; }
.thumbs button[aria-current="true"] { border-color: var(--gold); background: #6a444c; }
.thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.track { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; margin: 8px auto 16px; }
.track small { display: block; margin-top: 3px; color: var(--muted); }
.disc { width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle, #492231 0 5%, #e5a87c 6% 25%, #251b26 26% 38%, #3b2f38 39% 42%, #251b26 43% 49%, #3b2f38 50% 53%, #251b26 54% 100%); border: 1px solid #886372; }
#song-player iframe { width: 100%; height: 92px; border: 0; }
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 10px 0 16px; }
.platforms a { color: var(--gold); font-size: 13px; }
@media (max-width: 530px) {
  .shell { width: 98%; }
  .masthead { padding-inline: 8px; min-height: 60px; }
  .age { width: 38px; height: 38px; font-size: 26px; }
  .title { gap: 7px; }
  .records-button, .actions button { font-size: 12px; padding: 6px 10px; }
  .room { border-radius: 7px; }
  .photo-frame { width: max(10.3%, 38px); }
  .actions { gap: 5px; }
  .gallery-stage { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { [data-candles="lit"] .digit i { animation: none; } }
