:root {
  color-scheme: light;
  --ink: #493842;
  --muted: #ad8497;
  --pink: #bb4880;
  --purple: #9870b5;
  --paper: rgba(255, 251, 245, .97);
  --line: #f0dfe4;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #f7ccd6; }
body {
  min-height: 100vh; min-height: 100svh; margin: 0; overflow-x: hidden; color: var(--ink);
  background: linear-gradient(118deg, #f7d6c5 0%, #f6bfd0 48%, #ead0ef 100%);
  background-size: 180% 180%; animation: background-drift 22s ease-in-out infinite alternate;
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }
.page-shell { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 42px 18px; position: relative; z-index: 1; }
.card {
  width: min(420px, 100%); min-height: 440px; padding: 35px 30px 31px; position: relative;
  border-radius: 25px; background: var(--paper); text-align: center;
  box-shadow: 0 18px 44px rgba(133, 72, 104, .12); isolation: isolate;
}
.screen[hidden] { display: none !important; }
.screen-active { display: block; animation: appear .48s cubic-bezier(.2,.8,.2,1) both; }
.invitation-card { min-height: 350px; padding-top: 42px; display: flex; flex-direction: column; justify-content: center; }
.invitation-card.screen-active { display: flex; }
.recipient { margin: 0 0 29px; color: #a87991; font-size: 16px; letter-spacing: .18em; }
h1 { margin: 0 0 29px; font-size: clamp(23px, 6vw, 28px); line-height: 1.45; font-weight: 750; letter-spacing: .045em; }
.answer-buttons { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.button {
  border: 0; border-radius: 999px; color: #fff; cursor: pointer; font-weight: 750;
  transition: transform .24s ease, filter .2s, box-shadow .2s; touch-action: manipulation;
}
.button:focus-visible, .food-option:focus-visible, .stepper:focus-visible, .month-arrow:focus-visible, .back-button:focus-visible {
  outline: 3px solid #694281; outline-offset: 3px;
}
.button:active { filter: brightness(.96); }
.button-yes { width: 180px; height: 60px; background: var(--pink); font-size: 18px; box-shadow: 0 6px 15px #ae437522; }
.button-yes:hover { transform: translateY(-2px); box-shadow: 0 9px 19px #ae43753b; }
.button-no { width: 92px; height: 52px; background: var(--purple); font-size: 15px; }
.button-primary { min-height: 54px; padding: 0 34px; background: var(--pink); font-size: 17px; box-shadow: 0 6px 15px #ae437522; }
.next-button { min-width: 150px; margin: 22px auto 0; }
.button:disabled { opacity: .44; cursor: not-allowed; box-shadow: none; }
.back-button { position: absolute; top: 27px; left: 25px; padding: 5px; border: 0; background: none; color: #a77e91; font-size: 15px; cursor: pointer; }
.card:has(.back-button) { padding-top: 62px; }
.calendar-wrap { padding: 10px 15px 16px; border: 1px solid var(--line); border-radius: 21px; background: #fffdfa; }
.month-bar { height: 39px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.month-bar h2 { margin: 0; font-size: 15px; font-weight: 700; }
.month-arrow { width: 34px; height: 34px; justify-self: center; border: 0; background: transparent; color: #a88499; font-size: 25px; cursor: pointer; }
.month-arrow:disabled { opacity: .32; cursor: default; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.weekday, .day-cell { min-width: 0; display: grid; place-items: center; }
.weekday { height: 30px; color: #b395a4; font-size: 12px; }
.weekday:first-child { color: #c17a92; }
.weekday:last-child { color: #8f78ad; }
.day-cell { aspect-ratio: 1; }
.day-button { width: min(38px, 100%); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #695663; font-size: 13px; cursor: pointer; }
.day-button:disabled { color: #d8ced2; cursor: default; }
.day-button.selected { color: white; background: var(--pink); box-shadow: 0 3px 9px #ae437544; }
.day-button:not(:disabled):hover { background-color: #f8e8ef; }
.day-button.selected:hover { background: var(--pink); }
.time-block { margin-top: 19px; }
.time-block h2, .food-fieldset legend { margin: 0 0 9px; font-size: 15px; font-weight: 700; }
.time-pickers { display: flex; align-items: center; justify-content: center; gap: 10px; }
.time-picker { display: flex; align-items: center; gap: 6px; color: #80677a; }
.time-picker output { min-width: 28px; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ink); }
.time-picker span { font-size: 13px; }
.stepper { width: 27px; height: 28px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #9a7891; cursor: pointer; }
.time-colon { margin-top: -8px; color: #9d8292; }
.chosen-time { margin: -11px 0 20px; color: #af8b9d; font-size: 14px; }
.food-fieldset { margin: 0; padding: 0; border: 0; }
.food-fieldset legend { margin-bottom: 12px; }
.food-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.food-option {
  min-height: 108px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
  border: 2px solid var(--line); border-radius: 20px; background: #fffdfa; color: var(--ink); cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.food-option span { font-size: 28px; line-height: 1.1; }
.food-option b { font-size: 14px; }
.food-option:hover { transform: translateY(-2px); }
.food-option.selected { border-color: #c55a8b; background: #fff3f7; box-shadow: 0 4px 14px #b1447220; }
.summary { max-width: 310px; margin: 0 auto; padding: 17px 18px; border: 1px solid var(--line); border-radius: 17px; background: #fffdfa; text-align: left; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed #eee0e5; font-size: 14px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span:first-child { color: #a47d90; }
.summary-row strong { text-align: right; }
.confirm-note { margin: 19px 0 0; color: #a17b8e; font-size: 14px; }
.form-message { min-height: 24px; margin: 10px 0 0; color: #a63d70; font-size: 13px; }
.reaction-screen { min-height: 390px; display: grid; place-items: center; align-content: center; gap: 15px; overflow: hidden; }
.reaction-screen h1 { max-width: 330px; margin: 0 0 6px; font-size: 21px; }
.bomb { width: 142px; height: 142px; position: relative; display: grid; place-items: center; border-radius: 50%; background: #44394e; color: white; font-size: 57px; animation: bomb-bob .55s ease-in-out infinite alternate; }
.bomb::before { content: ""; width: 19px; height: 27px; position: absolute; top: -13px; left: 72px; border-radius: 4px; background: #473b4f; transform: rotate(28deg); }
.bomb-fuse { width: 28px; height: 25px; position: absolute; top: -27px; left: 84px; border-top: 6px solid #9a744f; border-right: 5px solid #9a744f; border-radius: 0 16px 0 0; transform: rotate(25deg); }
.bomb .spark { position: absolute; top: -37px; right: -9px; color: #ffb640; font-size: 25px; animation: spark .35s ease-in-out infinite alternate; }
.bomb-face { margin-top: 15px; font-size: 48px; transform: rotate(90deg); opacity: .85; }
.cross-dog { position: absolute; inset: 0; display: grid; place-items: center; animation: appear .45s ease both; }
.cross-mark { position: absolute; inset: 0; display: grid; place-items: center; color: #c3487e; font-family: Arial, sans-serif; font-size: 150px; font-weight: 300; line-height: 1; text-shadow: 0 3px #fff; }
.retry-button { position: absolute; bottom: 22px; left: 50%; min-height: 43px; transform: translateX(-50%); font-size: 14px; }
.animals, .floaties { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.animal { position: absolute; display: block; filter: drop-shadow(0 3px 3px #62425620); user-select: none; animation: animal-float 3.8s ease-in-out infinite; }
.animal-cat { top: max(18px, calc(50% - 235px)); left: calc(50% + 170px); font-size: 43px; animation-delay: -.8s; }
.animal-bunny { top: calc(50% - 110px); left: calc(50% - 215px); font-size: 40px; animation-delay: -1.5s; }
.animal-bear { top: calc(50% - 108px); left: calc(50% + 175px); font-size: 40px; animation-delay: -2.4s; }
.animal-puppy { top: calc(50% + 190px); left: calc(50% + 130px); font-size: 42px; animation-delay: -.3s; }
.floaty { position: absolute; bottom: -40px; color: #c98eaa; opacity: .34; animation: float-up var(--duration) linear infinite; animation-delay: var(--delay); font-size: var(--size); }
@keyframes appear { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes animal-float { 0%,100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -11px; rotate: 4deg; } }
@keyframes float-up { 0% { transform: translate3d(0,0,0) rotate(-12deg); opacity: 0; } 10% { opacity: .36; } 90% { opacity: .26; } 100% { transform: translate3d(var(--sway),-110vh,0) rotate(18deg); opacity: 0; } }
@keyframes background-drift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes bomb-bob { to { transform: translateY(-7px) rotate(3deg); } }
@keyframes spark { to { transform: scale(1.2) rotate(35deg); } }
@media (max-width: 520px) {
  .page-shell { padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
  .card { width: min(100%, 420px); min-height: 0; padding: 30px 21px 29px; border-radius: 23px; }
  .invitation-card { min-height: 330px; }
  .card:has(.back-button) { padding: 58px 18px 25px; }
  .recipient { margin-bottom: 24px; }
  h1 { font-size: clamp(22px, 6vw, 28px); margin-bottom: 25px; }
  .answer-buttons { gap: 12px; }
  .button-yes { width: min(180px, 58vw); height: 58px; }
  .calendar-wrap { padding: 8px 8px 12px; }
  .day-button { width: min(37px, 100%); }
  .animal-cat { top: 4%; left: auto; right: 5%; font-size: 37px; }
  .animal-bunny { top: 37%; left: 2%; font-size: 34px; }
  .animal-bear { top: 37%; left: auto; right: 2%; font-size: 34px; }
  .animal-puppy { top: auto; bottom: 6%; left: auto; right: 10%; font-size: 37px; }
  .food-grid { gap: 9px; }
  .food-option { min-height: 95px; border-radius: 17px; }
  .reaction-screen { min-height: 390px; }
}
@media (max-height: 690px) and (min-width: 521px) {
  .page-shell { padding-block: 18px; }
  .card { min-height: 0; padding-block: 25px; }
  .animal-cat { top: 4%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
