:root { color-scheme: light; --bg: #fbf5ef; --ink: #51323a; --muted: #795e63; --rose: #97435d; --line: #e7d4d3; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.65; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: var(--rose); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--rose); outline-offset: 5px; }
button:disabled { cursor: default; }
.birthday-nav { max-width: 1120px; margin: auto; min-height: 88px; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.home-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: .85rem; font-weight: 600; }
.nav-wordmark { font-family: Georgia, serif; font-style: italic; font-size: 1.15rem; }
.nav-wordmark span { padding-left: 8px; color: var(--rose); }
.text-button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font-size: .8rem; }
.birthday-wrap { max-width: 1000px; margin: auto; padding: 0 32px; }
.intro-panel { max-width: 600px; margin: 80px auto; padding: 44px 28px; text-align: center; border: 1px solid var(--line); border-radius: 28px; background: #fffaf6; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -.045em; margin: 22px 0; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.035em; margin: 12px 0 16px; }
h3 { font-size: 1.5rem; margin: 10px 0; }
p { color: var(--muted); }
.eyebrow { font-size: .67rem; font-weight: 700; letter-spacing: .2em; color: var(--rose); }
.welcome { position: relative; overflow: clip; text-align: center; padding: 70px 40px 42px; }
.welcome h1 { max-width: 650px; margin-left: auto; margin-right: auto; }
.welcome-copy { max-width: 520px; margin: 0 auto; font-size: 1.03rem; }
.welcome-note { font-family: Georgia, serif; font-style: italic; margin: 20px 0 28px; }
.journey-link { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; text-decoration: none; font-size: .75rem; }
.journey-link span { font-size: 1.4rem; }
.gift-drawing { position: relative; width: 54px; height: 48px; margin: 48px auto 30px; background: #f0d0d3; border: 1px solid #b87587; border-radius: 4px; transform: rotate(-5deg); animation: gift-sway 5s ease-in-out infinite; }
.gift-drawing::before { content: ''; position: absolute; left: -5px; right: -5px; top: -5px; height: 12px; background: #f6dce0; border: 1px solid #b87587; border-radius: 3px; }
.gift-drawing::after { content: '୨୧'; position: absolute; top: -40px; left: 5px; color: #a25b71; font-size: 36px; line-height: 1; }
.gift-drawing span { display: block; width: 14px; height: 100%; margin: auto; background: #b87587; color: white; padding-top: 12px; font-size: 14px; }
.floral { position: absolute; color: #a7777a; opacity: .4; font-family: Georgia, serif; font-size: 64px; line-height: 1; pointer-events: none; }
.floral span { display: block; font-size: 110px; }
.floral-left { top: 150px; left: 0; transform: rotate(-30deg); }
.floral-right { bottom: 50px; right: 0; transform: rotate(150deg); }
.day-strip { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0; border-block: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 9px; background: var(--rose); border-radius: 50%; }
.timeline-section, .memories-section { padding-top: 64px; }
.section-heading { max-width: 650px; }
.section-heading p { margin-top: 0; font-size: .92rem; }
.reveal-notice:empty { display: none; }
.reveal-notice { padding: 12px 18px; background: #f4e2e5; border-radius: 12px; color: var(--rose); }
.timeline { padding: 0; margin: 24px 0; list-style: none; display: grid; gap: 18px; }
.event-card { position: relative; padding: 26px 28px; background: #fffaf7; border: 1px solid var(--line); border-radius: 18px; transition: background .3s, border-color .3s; }
.event-card::before { content: '♡'; position: absolute; right: 20px; bottom: -17px; color: #a65e80; font-size: 24px; background: var(--bg); padding: 0 10px; }
.event-card[data-state=available] { border-color: #bb7d90; background: #fff3f4; }
.event-card[data-state=available]::before { color: var(--rose); }
.event-card[data-state=opened] { background: #fffdf9; }
.event-meta { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.event-time { color: var(--rose); font-size: .75rem; font-weight: 700; letter-spacing: .08em; }
.birthday-chapters-edition .event-time { font-size: .85rem; line-height: 1.6; letter-spacing: .02em; }
.birthday-chapters-edition .event-meta { align-items: flex-start; }
.event-badge { font-size: .67rem; padding: 3px 10px; background: #f0e6e3; border-radius: 20px; color: #6e555c; }
[data-state=available] .event-badge { background: #ead2db; color: #713048; }
.event-title { display: flex; gap: 10px; align-items: baseline; }
.event-icon { color: var(--rose); font-size: 1.3rem; }
.event-teaser { font-size: .9rem; margin: 8px 0 18px; max-width: 620px; }
.event-button { min-height: 44px; padding: 9px 16px; border: 1px solid #ccacb4; border-radius: 10px; background: transparent; color: #81374f; font-size: .8rem; font-weight: 600; }
.event-button:disabled { border-color: #e2d6d4; color: #745e64; }
.event-button:not(:disabled):hover, .text-button:hover { background: #f4e0e5; }
.event-reveal { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); white-space: pre-line; }
.event-reveal p { color: var(--ink); }
.event-reveal img { max-width: 100%; max-height: 400px; border-radius: 12px; object-fit: contain; }
.memories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.memory { margin: 0; padding: 12px 12px 18px; background: #fffcf8; border: 1px solid #e9dbd3; box-shadow: 0 6px 20px #51323a08; transform: rotate(-2deg); }
.memory:nth-child(2) { transform: rotate(2deg); }
.memory:nth-child(3) { transform: rotate(-1deg); }
.memory-image { aspect-ratio: 1 / 1; display: grid; place-content: center; gap: 10px; background: #efe4dc; text-align: center; color: #84656c; overflow: hidden; }
.memory-image span { font-size: 2rem; font-family: Georgia, serif; }
.memory-image small { font-size: .7rem; letter-spacing: .06em; }
.memory-image img { width: 100%; height: 100%; object-fit: contain; }
.memory:has(img) .memory-image { display: block; }
.memory figcaption { padding: 18px 6px 0; font-family: Georgia, serif; font-style: italic; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.letter-section { text-align: center; margin-top: 80px; padding: 48px 24px; border: 1px solid var(--line); border-radius: 24px; background: #f6e9e6; }
.letter-section > p { max-width: 400px; margin: 16px auto 26px; font-size: .9rem; }
.envelope-mark { position: relative; display: grid; place-items: center; width: 68px; height: 46px; margin: 0 auto 28px; border: 1px solid #b58291; border-radius: 4px; color: #97435d; background: linear-gradient(150deg, transparent 49%, #d9b9c2 50%, transparent 52%) left top/50% 100% no-repeat, linear-gradient(210deg, transparent 49%, #d9b9c2 50%, transparent 52%) right top/50% 100% no-repeat, #fff6f1; font-size: 1.5rem; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border: 1px solid var(--rose); border-radius: 12px; background: var(--rose); color: white; font-size: .85rem; font-weight: 600; text-decoration: none; transition: transform .2s, background .2s; }
.primary-button:hover { background: #7b334b; }
.primary-button:active, .event-button:active { transform: scale(.98); }
.letter-paper { max-width: 620px; margin: 30px auto 0; padding: 36px; text-align: left; background: #fffdf5; border: 1px solid #e3d7c4; border-radius: 4px; box-shadow: 0 10px 24px #51323a08; font-family: Georgia, serif; font-size: 1.12rem; line-height: 1.9; animation: paper-open .5s ease; }
.letter-paper p { white-space: pre-line; color: var(--ink); }
.letter-signature { font-style: italic; }
.finale { text-align: center; padding: 70px 24px 40px; }
.finale-heart { display: block; font-size: 3.5rem; color: var(--rose); margin-top: 20px; }
.finale p { max-width: 540px; margin: 20px auto; white-space: pre-line; }
.progress-status { text-align: center; font-size: .7rem; margin-top: 34px; }
.action-error { text-align: center; color: #a1293d; }
.birthday-footer { text-align: center; margin-top: 30px; padding: 24px; border-top: 1px solid var(--line); font-family: Georgia, serif; font-style: italic; color: var(--muted); font-size: .85rem; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; z-index: 10; background: white; }
.skip-link:focus { top: 16px; }
@keyframes gift-sway { 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes paper-open { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .birthday-nav { padding: 12px 18px; gap: 10px; min-height: 72px; }
  .nav-wordmark { font-size: .9rem; }
  .nav-wordmark span { display: none; }
  .birthday-wrap { padding: 0 20px; }
  .welcome { padding: 46px 0 30px; }
  .welcome h1 { max-width: 330px; }
  .welcome-copy { max-width: 330px; font-size: .93rem; }
  .floral { font-size: 34px; opacity: .22; }
  .floral span { font-size: 62px; }
  .floral-left { top: 100px; left: -8px; }
  .floral-right { bottom: 30px; right: -8px; }
  .day-strip { flex-wrap: wrap; font-size: .7rem; }
  .timeline-section, .memories-section { padding-top: 44px; }
  .timeline { padding-left: 0; margin-left: 0; }
  .event-card { padding: 22px 18px; }
  .event-card::before { left: auto; }
  .event-meta { gap: 8px; }
  .event-time { font-size: .68rem; }
  h3 { font-size: 1.35rem; }
  .memories { grid-template-columns: 1fr; gap: 28px; max-width: 320px; margin: 28px auto 0; padding: 0 8px; }
  .letter-section { margin-top: 52px; padding: 36px 18px; }
  .letter-paper { padding: 24px 20px; font-size: 1.02rem; }
  .intro-panel { margin-top: 44px; padding: 32px 22px; }
}
.sound-controls { display: flex; justify-content: flex-end; padding-top: 16px; }
.day-world { position: relative; min-height: var(--scatter-height, 700px); }
.day-main { position: relative; margin: 0 165px; padding-bottom: 48px; }
.day-main .welcome { padding: 38px 0 24px; }
.day-main h1 { font-size: clamp(2.3rem, 4.5vw, 3.8rem); }
.day-main .floral { display: none; }
.day-main .timeline-section { padding-top: 30px; }
.day-main h2 { font-size: 2rem; }
.day-main .gift-drawing { margin-top: 34px; }
.rsvp { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; border: 0; padding: 16px 0 0; margin: 14px 0 0 auto; max-width: 100%; border-top: 1px dashed var(--line); }
.rsvp legend { float: right; width: 100%; padding: 0 0 8px; text-align: right; font-family: Georgia, serif; font-style: italic; font-size: .85rem; color: var(--rose); }
.rsvp-choice { position: relative; cursor: pointer; }
.rsvp-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rsvp-choice span { display: flex; align-items: center; min-height: 44px; padding: 6px 10px; border-radius: 20px; border: 1px solid #dcc4cc; font-size: .7rem; color: #75394e; background: #fffcfa; transition: background .2s, transform .2s; }
.rsvp-choice:hover span { background: #f8e3eb; }
.rsvp-choice input:checked + span { background: #97435d; border-color: #97435d; color: white; }
.rsvp-choice input:focus-visible + span { outline: 3px solid var(--rose); outline-offset: 3px; }
.keepsakes { margin-top: 32px; }
.keepsakes summary { min-height: 48px; padding: 12px 0; color: var(--rose); cursor: pointer; font-family: Georgia, serif; font-style: italic; }
.keepsakes ol { padding: 0; list-style: none; display: grid; gap: 24px; }
.photo-scatter { --photo-width: min(220px, calc(143px + max(0px, (100vw - 1000px) / 2))); --photo-growth: calc(var(--photo-width) - 143px); position: fixed; top: clamp(100px, 18vh, 180px); bottom: 24px; left: 50%; width: min(936px, calc(100% - 64px)); transform: translateX(-50%); pointer-events: none; z-index: 3; }
.photo-card { position: relative; width: 100%; transform: rotate(var(--tilt)); isolation: isolate; }
/* Grow into the outer margins, leaving the central page layout untouched. */
.photo-scatter .photo-card { position: absolute; top: calc(var(--photo-slot) * 100%); left: var(--photo-side); right: var(--photo-other); width: var(--photo-width); margin-inline: calc(-1 * var(--photo-growth)); transform: translateY(calc(var(--photo-slot) * -100%)) rotate(var(--tilt)); pointer-events: auto; }
.photo-card::before { content: ''; position: absolute; top: -10px; left: 31%; width: 38%; height: 22px; z-index: 2; background: #d8bc9d90; transform: rotate(-6deg); pointer-events: none; }
.photo-card:nth-child(2n)::before { background: #d7aab990; transform: rotate(8deg); }
.photo-flip { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: center; perspective: 1000px; border-radius: 5px; }
.photo-inner { display: grid; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.is-flipped .photo-inner { transform: rotateY(180deg); }
.photo-front, .photo-back { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; padding: 9px; border: 1px solid #e3d4c7; background: #fffdf6; box-shadow: 0 8px 24px #51323a18; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.photo-front .memory-image { display: grid; width: 100%; aspect-ratio: 1; min-height: 0; }
.photo-front .memory-image:has(img) { display: block; }
.photo-front .memory-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-caption { display: block; font: italic .8rem/1.4 Georgia, serif; padding: 12px 2px 5px; }
.flip-hint { color: #8b5365; font-size: .62rem; padding-bottom: 4px; }
.photo-back { transform: rotateY(180deg); justify-content: center; padding: 16px 12px; background: repeating-linear-gradient(#fff9ed 0 27px, #eeded177 27px 28px); }
.photo-heart { color: var(--rose); font: 1.5rem Georgia, serif; margin-bottom: 12px; }
.photo-message { white-space: pre-line; overflow-wrap: anywhere; font: italic .82rem/1.7 Georgia, serif; }
.photo-chapter { position: relative; isolation: isolate; padding: 54px 0 30px; animation: paper-open .7s ease; }
.gallery-lyrics { position: absolute; inset: 0; z-index: -1; pointer-events: none; user-select: none; }
.gallery-lyric { position: absolute; display: block; width: min(290px, calc(100% - 24px)); left: clamp(12px, calc(var(--lyric-x, 50%) - 145px), max(12px, 100% - 302px)); font: 18px/1.55 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: #bc7589; opacity: 0; white-space: pre-line; overflow-wrap: anywhere; text-align: center; transform: translateY(-50%) rotate(var(--lyric-tilt, 0deg)); transition: opacity .85s ease; }
.gallery-lyric.is-visible { opacity: .42; }
.gallery-lyric.lyric-blue { color: #7c9bb9; }
.lyric-measure { visibility: hidden; transform: none; }
.has-gallery-lyrics .photo-garden { row-gap: var(--lyric-gap, 210px); padding-top: var(--lyric-gap, 210px); padding-bottom: var(--lyric-gap, 210px); }
.photo-chapter > .section-heading { text-align: center; margin: auto; }
.photo-chapter .eyebrow { font-size: .7rem; }
.photo-garden { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 46px 32px; padding: 36px 16px 48px; }
.photo-garden .photo-card:nth-child(3n+2) { margin-top: 40px; }
@media (min-width: 851px) {
  .photo-garden { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .photo-garden > .photo-card { grid-column: span 4; }
  .photo-garden > .photo-card:nth-child(n+4):nth-child(-n+7) { grid-column: span 3; }
}
.photo-garden .photo-front, .photo-garden .photo-back { min-height: 350px; padding: 14px; }
.photo-garden .photo-caption { font-size: 1rem; }
.photo-garden .photo-message { font-size: 1rem; }
.photo-garden .has-envelope .photo-back { padding-bottom: 140px; }
.scrapbook-heading { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0 auto 24px; color: #835e3b; }
.scrapbook-heading > span:first-child { padding: 7px 22px; background: #f6dda0; transform: rotate(-3deg); font: italic 1rem Georgia, serif; box-shadow: 2px 3px 0 #d9ba8255; }
.scrapbook-heading > span:last-child { font-size: 2.5rem; color: #b8667d; transform: rotate(16deg); }
.photo-garden .photo-card { --paper: #fae6a8; --paper-line: #b3975330; --paper-edge: #d5b76b; --tape: #d6a2b9aa; --sticker: #a65871; }
.photo-garden .photo-card:nth-child(even) { --paper: #f5ced6; --paper-line: #ac62772b; --paper-edge: #d8a1af; --tape: #e5c66cbb; --sticker: #956d2f; }
.photo-garden .photo-card:nth-child(4n+3) { --paper: #f9eec5; --tape: #b4c4aaa6; }
.photo-garden .photo-card::before { top: -9px; height: 28px; width: 42%; left: 28%; background: repeating-linear-gradient(90deg, transparent 0 5px, #fff3 5px 7px), var(--tape); }
.photo-garden .photo-front, .photo-garden .photo-back { position: relative; padding: 23px 19px 26px; border-color: var(--paper-edge); border-radius: 2px 5px 2px 3px; background: repeating-linear-gradient(0deg, transparent 0 29px, var(--paper-line) 29px 30px), repeating-linear-gradient(93deg, #fff1 0 1px, transparent 1px 5px), var(--paper); box-shadow: 2px 10px 18px #67422624, inset 0 0 28px #fff3; }
.photo-garden .photo-front::after, .photo-garden .photo-back::after { content: ''; position: absolute; bottom: 0; right: 0; width: 25px; height: 25px; background: linear-gradient(135deg, #fff5 0 48%, #b7834f33 49% 52%, var(--bg) 53%); border-radius: 4px 0 0; pointer-events: none; }
.paper-label { display: block; color: #6b4a3e; text-transform: uppercase; font: 600 .58rem/1.5 system-ui, sans-serif; letter-spacing: .13em; margin-bottom: 18px; }
.stage-photo-hint { text-align: center; color: var(--rose); font: italic .95rem/1.7 Georgia, serif; }
.stage-recording { margin: 24px 0; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; background: #fff9f1; }
.stage-recording-title { color: var(--rose); font-style: italic; }
.stage-recording audio, .stage-recording video { display: block; width: 100%; max-height: 55vh; border-radius: 10px; }
.stage-recording video { background: #38242e; }
.stage-media-status { font: .8rem/1.6 Georgia, serif; }
.photo-garden .photo-front .memory-image { width: 94%; align-self: center; border: 5px solid #fffaf0; box-shadow: 1px 4px 8px #634a3522; background: #fff8e5b3; transform: rotate(-3deg); }
.photo-garden .photo-card:nth-child(even) .memory-image { transform: rotate(3deg); background: #fff1edb3; }
.photo-garden .photo-caption { padding-top: 20px; font: italic 1.05rem/1.45 Georgia, serif; color: #684438; }
.photo-garden .flip-hint { margin-top: auto; padding-top: 12px; color: #754938; }
.paper-sticker { position: absolute; right: -9px; top: 22px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px dashed #b88f74; border-radius: 50%; background: #fff8e6; color: var(--sticker); font: 1.8rem Georgia, serif; transform: rotate(12deg); z-index: 2; pointer-events: none; box-shadow: 1px 3px 3px #67422612; }
.photo-garden .photo-back .paper-label { margin-bottom: 24px; }
.photo-garden .photo-message { color: #5c3d35; line-height: 1.85; }
.photo-garden .photo-heart { color: #9a4961; }
.paper-flower { position: absolute; top: -22px; left: 14px; width: 46px; height: 46px; z-index: 3; background: url('./blue-paper-flower.svg') center / contain no-repeat; transform: rotate(-12deg); pointer-events: none; }
.photo-card:nth-child(9) .paper-flower { transform: rotate(18deg); }
.photo-card:nth-child(14) .paper-flower { transform: rotate(-28deg); }
.photo-envelope { position: absolute; left: 10%; bottom: 14px; width: 80%; padding: 12px 5px; border: 1px solid #d6acb7; border-radius: 10px; background: #fffbf4; color: var(--rose); box-shadow: 0 4px 15px #97435d18; animation: paper-open .6s ease; }
.photo-envelope .envelope-mark { margin-bottom: 8px; width: 48px; height: 32px; font-size: 1.2rem; }
.photo-envelope > span:not(.envelope-mark) { display: block; font: italic .9rem Georgia, serif; }
.photo-envelope small { display: block; margin-top: 8px; font-size: .7rem; }
#emptyEnvelope { position: relative; min-height: 150px; max-width: 300px; margin: auto; }
#photoHint { text-align: center; font-family: Georgia, serif; font-style: italic; }
.music-box { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 620px; margin: 30px auto; padding: 16px 20px; border: 1px solid var(--line); background: #fff9f5; border-radius: 18px; }
.music-box > span { color: var(--rose); font-size: 2rem; }
.music-box > div { flex: 1; min-width: 0; font-size: .8rem; }
.music-box p { font-size: .7rem; margin: 3px 0 0; }
.music-box button { flex-shrink: 0; }
.soundtrack-corner { margin: 40px 0 55px; padding: 46px 34px; text-align: center; border: 1px solid #ddc49d; border-radius: 40px 8px 40px 8px; background: radial-gradient(#b78b4922 .8px, transparent 1px) 0 0 / 8px 8px, #f7ebd5; }
.soundtrack-corner > p { max-width: 490px; margin: 16px auto 26px; font-family: Georgia, serif; font-style: italic; }
.soundtrack-player { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 28px; margin-top: 38px; }
.mixtape { position: relative; padding: 24px 18px 20px; border: 2px solid #9b626b; border-radius: 16px; background: linear-gradient(135deg, #f3bfc8, #dca6b1); box-shadow: 5px 8px 0 #bd9b7040; transform: rotate(-4deg); }
.mixtape::before, .mixtape::after { content: '⊕'; position: absolute; top: 3px; font-size: .65rem; color: #8a5961; }
.mixtape::before { left: 7px; } .mixtape::after { right: 7px; }
.mixtape-label { display: block; padding: 9px; border-radius: 4px 4px 0 0; background: repeating-linear-gradient(#fff2ce 0 23px, #d7b56a44 23px 24px); font: italic 1.3rem Georgia, serif; color: #744e4a; }
.tape-window { display: flex; align-items: center; justify-content: space-around; gap: 12px; padding: 14px 12px; background: #63474d; border: 7px solid #fff2ce; border-top: 0; border-radius: 0 0 8px 8px; }
.tape-reel { display: grid; place-items: center; flex-shrink: 0; height: 44px; width: 44px; border: 6px solid #eccf9d; border-radius: 50%; color: #714a50; background: #fff6dc; font: 1.9rem Georgia, serif; }
.tape-thread { flex: 1; height: 20px; border-block: 2px solid #d4a377; background: #48373e; }
.mixtape-foot { display: block; margin-top: 20px; font: 600 .55rem system-ui, sans-serif; letter-spacing: .12em; }
.is-playing .tape-reel { animation: tape-turn 6s linear infinite; }
@keyframes tape-turn { to { transform: rotate(360deg); } }
.soundtrack-now h3 { font-size: 1.6rem; overflow-wrap: anywhere; }
.soundtrack-now > p { margin: 8px 0 20px; font-size: .8rem; }
.soundtrack-controls { display: flex; justify-content: center; gap: 8px; }
.soundtrack-controls .primary-button { padding: 10px 16px; }
.soundtrack-controls .text-button { min-width: 44px; background: #fff7e7; }
.soundtrack-controls button:disabled { opacity: .4; }
#soundtrackStatus { min-height: 3em; margin-top: 14px; font-size: .75rem; }
.soundtrack-tracks { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; border-top: 1px solid #cfb895; text-align: left; }
.soundtrack-song { display: grid; grid-template-columns: 30px 1fr; gap: 3px 12px; width: 100%; padding: 16px 12px; color: var(--ink); border: 0; border-bottom: 1px solid #cfb89588; background: transparent; text-align: left; }
.soundtrack-song .song-number { grid-row: span 2; font-family: Georgia, serif; color: #966f4e; }
.soundtrack-song small { grid-column: 2; color: #795e63; }
.soundtrack-song[aria-current=true] { background: #fff8e7aa; }
.soundtrack-song:hover { background: #f4d9d3; }
#returnToReasons { grid-column: 1 / -1; justify-self: center; }
@media (max-width: 700px) {
  .soundtrack-corner { padding: 34px 20px; }
  .soundtrack-player { grid-template-columns: minmax(0, 1fr); }
  .mixtape { width: min(100%, 320px); margin: 0 auto 14px; }
}
.surprise-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 42px 32px 32px; border: 1px solid #d7a6b4; border-radius: 24px; background: #fff8f1; color: var(--ink); box-shadow: 0 24px 100px #51323a33; text-align: center; }
.surprise-dialog[open] { animation: paper-open .4s ease; }
.surprise-dialog::backdrop { background: #51323a66; backdrop-filter: blur(5px); }
.surprise-dialog p { white-space: pre-line; }
.surprise-dialog img { max-width: 100%; max-height: 45vh; object-fit: contain; border-radius: 12px; }
.surprise-dialog .primary-button { margin-top: 20px; }
.confetti { position: fixed; inset: 0; overflow: hidden; z-index: 10000; pointer-events: none; }
.confetti-piece { position: absolute; top: -35px; left: var(--x); font-size: 17px; animation: heart-confetti 2.6s var(--delay) ease-in forwards; }
@keyframes heart-confetti { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translate(var(--drift), 105vh) rotate(260deg); opacity: 0; } }
@media (max-width: 850px) {
  .day-world { min-height: 0; }
  .day-main { margin: 0; }
  body:has(#experience:not([hidden]) #dayChapter:not([hidden])) { padding-bottom: 200px; }
  html { scroll-padding-bottom: 200px; }
  .photo-scatter { top: auto; bottom: 0; left: 0; right: 0; width: 100%; transform: none; display: flex; justify-content: safe center; align-items: center; gap: 16px; padding: 20px 16px 16px; background: linear-gradient(#fbf5ef00, #fbf5eff5 20%, #fbf5ef); overflow-x: auto; pointer-events: auto; }
  .photo-scatter .photo-card { position: relative; flex: 0 0 clamp(96px, 28vw, 140px); top: auto; left: auto; right: auto; width: auto; margin-inline: 0; transform: rotate(var(--tilt)); }
  .photo-scatter .photo-inner { height: 150px; }
  .photo-scatter .photo-front, .photo-scatter .photo-back { min-height: 0; overflow: auto; padding: 7px; }
  .photo-scatter .photo-caption { font-size: .65rem; padding: 5px 0; }
  .photo-scatter .flip-hint { font-size: .58rem; }
  .photo-scatter .photo-heart { font-size: 1rem; margin-bottom: 5px; }
  .photo-scatter .photo-message { font-size: .75rem; line-height: 1.5; }
  .photo-scatter .photo-back { justify-content: flex-start; }
  .photo-garden { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .day-main .welcome { padding-top: 28px; }
  .photo-garden { grid-template-columns: minmax(0, 1fr); max-width: 340px; margin: auto; padding: 32px 22px; }
  .photo-garden .photo-card:nth-child(3n+2) { margin-top: 0; }
  .photo-garden .photo-front, .photo-garden .photo-back { min-height: 360px; }
  .music-box { flex-wrap: wrap; padding: 15px; gap: 10px; }
  .music-box > div { flex-basis: 70%; }
  .music-box button { width: 100%; }
  .surprise-dialog { padding: 32px 22px; }
}
.dev-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 20px; background: #fbf5eff5; border-bottom: 1px solid var(--line); font-size: .72rem; }
.birthday-chapters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff9f3; }
.birthday-chapters p { width: 100%; margin: 0 0 6px; text-align: center; font-family: Georgia, serif; font-style: italic; }
.birthday-chapters button { background: #fffdf8; }
#replayBirthday { color: #81374f; border-color: #c694a5; background: #fff0f4; }
.dev-toolbar.preview-active { background: #fff1d8; border-color: #c89c52; }
.dev-toolbar > span { margin-right: auto; color: #674919; }
.dev-toolbar button { background: #fffaf4; flex-shrink: 0; }
.preview-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #bfa585; border-radius: 20px; background: #fffaf4; color: var(--ink); }
.preview-dialog::backdrop { background: #30202777; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-heading h2 { font-size: 1.8rem; }
.preview-dialog p { font-size: .85rem; }
.preview-dialog label { display: block; margin: 18px 0 8px; font-size: .85rem; }
.preview-dialog input { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.preview-dialog .preview-caption { font-size: .75rem; }
#previewError { color: #a1293d; }
@media (max-width: 540px) { .dev-toolbar { flex-wrap: wrap; padding: 6px 12px; gap: 6px; } .dev-toolbar > span { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
