@font-face {
  font-family: "Cormorant Garamond";
  src: url("./assets/fonts/cormorant-garamond.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./assets/fonts/manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #fcf8fa;
  --text: #533641;
  --muted: #826c76;
  --rose: #9e4566;
  --line: #e9d9e0;
  --soft: #f5e8ee;
  --display: "Cormorant Garamond", Georgia, serif;
  font-family: Manrope, Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; position: relative; isolation: isolate; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--rose); outline-offset: 5px; }
a { color: inherit; }
img { display: block; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.visual-backdrop {
  --fade-start: calc(100% - 180px);
  --fade-end: 100%;
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: max(662px, calc(100svh - 128px));
  background: var(--bg) url("./assets/floral-letter.jpg") center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 var(--fade-start), transparent var(--fade-end));
  mask-image: linear-gradient(to bottom, #000 0, #000 var(--fade-start), transparent var(--fade-end));
  pointer-events: none;
}
.topbar { max-width: 1240px; margin: auto; padding: 30px 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-size: 25px; font-weight: 600; }
.brand img { opacity: .65; }
.header-actions { display: flex; align-items: center; gap: 26px; }
.occasion { color: var(--muted); font-size: 12px; background: #fcf8fae6; padding: 8px 12px; border-radius: 4px; }
.sound { border: 1px solid #dcc5d0; border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; background: #fff9; transition: background .2s, border-color .2s; }
.sound:hover, .sound[aria-pressed=true] { background: #fff; border-color: var(--rose); }
.sound img { opacity: .6; }
#app { max-width: 1080px; margin: 0 auto; padding: 0 32px; outline: none; }
.story, .final-layout, .lock-page { width: min(100%, 600px); margin: auto; min-height: max(560px, calc(100svh - 158px)); padding: 55px 12px 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
h1 { font-family: var(--display); font-weight: 500; font-size: 70px; line-height: 1.02; letter-spacing: 0; margin: 0 0 28px; text-wrap: balance; overflow-wrap: anywhere; }
h1 em { font-style: normal; }
h1.question-title { font-size: 54px; line-height: 1.1; max-width: 540px; }
h2 { font-family: var(--display); font-size: 29px; line-height: 1.25; font-weight: 600; margin: 0 0 18px; }
.story.intro { align-items: flex-start; text-align: left; padding-block: 64px 80px; }
.intro .birthday-title { width: 100%; font-size: clamp(60px, 6.5vw, 76px); line-height: 1.05; margin: 0 0 32px; text-wrap: initial; }
.intro-copy { max-width: 390px; color: #735963; font-size: 15px; line-height: 1.85; }
.intro-copy p { margin: 0; }
.intro-copy p + p { margin-top: 18px; }
.intro .action-area { width: min(100%, 280px); margin-top: 34px; }
.intro .primary { min-height: 56px; justify-content: space-between; }
.lead { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 12px; max-width: 430px; }
.lead strong { color: var(--text); font-weight: 600; }
.eyebrow { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.question-progress { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.question-progress span { width: 24px; height: 3px; background: var(--line); border-radius: 2px; }
.question-progress .complete { background: var(--rose); }
.action-area { margin-top: 28px; width: min(100%, 320px); }
.primary { width: 100%; min-height: 54px; padding: 15px 22px; display: flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid transparent; border-radius: 6px; background: var(--rose); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 6px 16px #9e456618; transition: background .2s, box-shadow .2s; }
.primary:hover { background: #873b58; box-shadow: 0 8px 24px #9e45662b; }
.primary .icon { filter: invert(1); width: 17px; height: 17px; }
.secondary { min-height: 48px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #ffffffb8; font-size: 13px; }
.secondary:hover { background: var(--soft); }
.text-button { padding: 10px 0; min-height: 44px; background: none; border: 0; color: var(--rose); font-size: 12px; text-decoration: underline; text-underline-offset: 5px; }
.choices { display: grid; gap: 10px; margin-top: 10px; width: min(100%, 440px); }
.choice { min-height: 56px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; font-size: 13px; line-height: 1.5; border: 1px solid #e3ced8; background: #ffffffb8; color: var(--text); border-radius: 6px; transition: border-color .2s, background .2s; }
.choice::after { content: ""; border: 1px solid #d0b6c2; width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }
.choice:hover { border-color: var(--rose); background: #fff; }
.choice:hover::after { border: 5px solid var(--rose); }
.result-icon, .scene-symbol { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #dfc8d3; border-radius: 50%; margin-bottom: 24px; background: #fffa; }
.result-icon .icon, .scene-symbol .icon { width: 23px; height: 23px; opacity: .65; }
.answer-reaction { min-height: 180px; display: flex; align-items: center; font-family: var(--display); font-size: 48px; line-height: 1.2; text-wrap: balance; }
.reaction-photo { width: min(100%, 440px); height: auto; aspect-ratio: 1677 / 938; object-fit: contain; margin-bottom: 24px; }
.answer-reaction.with-photo { min-height: 0; }
.reaction-sticker { display: block; width: min(240px, 65vw); flex: 0 0 auto; }
.reaction-sticker.with-caption { margin-bottom: 20px; }
.reaction-sticker img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 10px; box-shadow: 0 8px 24px #53364114; }
.reaction-sticker.cutout img { border-radius: 0; box-shadow: none; }
.answer-reaction.with-sticker { min-height: 0; max-width: 460px; font-size: clamp(32px, 5vw, 44px); }
.scratch-wrap { position: relative; width: min(100%, 460px); height: 224px; margin: 0 0 4px; overflow: hidden; border-radius: 8px; background: #fffdfd; border: 1px solid #ddbfcc; box-shadow: 0 12px 35px #9e45660a; }
.scratch-message { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; font-family: var(--display); font-size: 29px; line-height: 1.35; text-align: center; }
.scratch-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scratch-counter { width: min(100%, 460px); display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; font-size: 12px; color: var(--muted); }
.scratch-counter > span { display: flex; align-items: center; gap: 12px; }
.message-dots { display: flex; gap: 6px; }
.message-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.message-dots .complete { background: var(--rose); }
.delivery-time { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.delivery-time strong { font-size: 18px; font-weight: 500; color: var(--text); }
.waiting-indicator { display: flex; gap: 7px; margin: 12px 0 24px; }
.waiting-indicator span { width: 5px; height: 5px; border-radius: 50%; background: var(--rose); animation: pulse 1.8s ease-in-out infinite; }
.waiting-indicator span:nth-child(2) { animation-delay: .2s; }
.waiting-indicator span:nth-child(3) { animation-delay: .4s; }
.final-layout h1 { font-size: 62px; }
.delivery-arrival h1 { max-width: 560px; line-height: 1.08; }
.delivery-arrival .lead { max-width: 390px; }
.delivery-arrival .action-area { width: min(100%, 280px); }
.small-note { font-size: 12px; line-height: 1.7; color: var(--muted); }
.rehearsal-banner { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; background: #fff9; }
.page-footer { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); font-size: 10px; color: var(--muted); }
.page-footer img { opacity: .35; width: 12px; height: 12px; }
.admin { padding: 45px 0 20px; max-width: 840px; margin: auto; }
.admin h1 { text-align: center; font-size: 54px; margin-bottom: 35px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.admin-card { padding: 26px; border: 1px solid var(--line); background: #ffffffdb; border-radius: 8px; }
.admin-stat { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.admin-stat span { color: var(--muted); }
.admin-stat strong { font-weight: 500; text-align: right; max-width: 60%; }
.admin-notice { color: var(--muted); font-size: 12px; line-height: 1.75; margin-bottom: 20px; }
.admin-notice.arrived { color: #3f7351; background: #edf5ef; padding: 14px; border-radius: 6px; font-size: 18px; }
.admin-card .primary, .admin-card .secondary { width: 100%; margin-top: 10px; }
.admin-card .secondary { text-align: left; }
.delivery-time-form { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.time-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; }
.time-label span { color: var(--muted); font-size: 10px; }
.time-editor { display: flex; align-items: stretch; gap: 8px; }
.time-editor input { min-width: 0; width: 128px; flex: 1 1 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font: 500 16px Manrope, Arial, sans-serif; }
.time-editor .save-time { width: auto; flex: 0 0 auto; margin: 0; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; }
.save-time .icon { width: 16px; height: 16px; opacity: .6; }
.connection { position: relative; z-index: 20; text-align: center; background: #f5e5eb; color: var(--text); padding: 12px 20px; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content; border-radius: 6px; padding: 14px 20px; color: #fff; background: var(--text); font-size: 13px; line-height: 1.6; box-shadow: 0 8px 32px #53364120; }
.loading { min-height: calc(100svh - 180px); display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--rose); animation: rotate 1s linear infinite; flex: 0 0 auto; }
.lock-page .scene-symbol { margin-bottom: 26px; }
.entrance { animation: enter .5s ease both; }
.late-start .entrance { animation-duration: .18s; }
@keyframes pulse { 50% { opacity: .25; transform: translateY(-3px); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 1600px) {
  .visual-backdrop { background-size: 1600px auto; background-color: #fcf8fa; }
}
@media (max-width: 700px) {
  .visual-backdrop { --fade-start: 430px; --fade-end: 650px; height: max(592px, calc(100svh - 146px)); background-size: auto 650px; background-position: 64% top; opacity: .75; }
  .topbar { padding: 22px 24px; gap: 12px; }
  .brand { font-size: 22px; gap: 9px; }
  .brand img { width: 19px; height: 19px; }
  .header-actions { gap: 12px; }
  .occasion { display: none; }
  .sound { width: 38px; height: 38px; }
  #app { padding: 0 24px; }
  .story, .final-layout, .lock-page { min-height: max(510px, calc(100svh - 134px)); padding: 50px 0 45px; }
  h1 { font-size: 56px; margin-bottom: 24px; }
  h1.question-title { font-size: 44px; }
  .story.intro { padding-block: 48px 58px; }
  .intro .birthday-title { font-size: clamp(36px, 11vw, 54px); margin-bottom: 28px; }
  .intro-copy { max-width: 370px; font-size: 14px; line-height: 1.8; }
  .intro-copy p + p { margin-top: 16px; }
  .intro .action-area { margin-top: 28px; }
  .lead { font-size: 13px; line-height: 1.85; max-width: 355px; }
  .action-area { margin-top: 24px; max-width: 300px; }
  .choices { margin-top: 3px; }
  .choice { padding: 14px 17px; }
  .answer-reaction { font-size: 40px; }
  .reaction-sticker { width: min(208px, 100%); }
  .scratch-message { font-size: 27px; padding: 20px; }
  .final-layout h1 { font-size: 48px; }
  .page-footer { font-size: 9px; padding-top: 17px; }
  .rehearsal-banner { top: 82px; }
  .admin { padding-top: 45px; }
  .admin h1 { font-size: 48px; }
  .admin-grid { grid-template-columns: 1fr; gap: 18px; }
  .admin-card { padding: 22px; }
}
@media (max-width: 360px) {
  .topbar { padding-inline: 18px; }
  #app { padding-inline: 20px; }
  .brand { font-size: 20px; }
  h1 { font-size: 48px; }
  h1.question-title { font-size: 39px; }
  .final-layout h1 { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
