:root {
  --ink: #090909;
  --paper: #fffefc;
  --pink: #f064ba;
  --pink-soft: #ffd5ec;
  --green-soft: #e2fbd4;
  --muted: #66625f;
  --danger: #b32152;
  --shadow: 0 9px 0 var(--ink);
  --radius: 34px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 14%, var(--pink-soft), transparent 38%),
    radial-gradient(circle at 84% 82%, var(--green-soft), transparent 40%),
    #f3f3f3;
  overflow-x: hidden;
}

button, input, select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
  padding: 32px 18px;
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  width: min(520px, calc(100vw - 24px));
  height: min(820px, calc(100svh - 24px));
  min-height: 620px;
  border: 11px solid #8f8f8f;
  border-radius: 58px;
  box-shadow: inset 0 0 0 4px #6f6f6f, 0 24px 55px rgb(0 0 0 / 13%);
  pointer-events: none;
}

.card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(440px, calc(100vw - 56px));
  max-height: calc(100svh - 84px);
  padding: clamp(28px, 5vh, 48px) clamp(22px, 6vw, 42px);
  overflow-y: auto;
  text-align: center;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 36px rgb(0 0 0 / 13%);
  animation: card-in 430ms cubic-bezier(.2,.9,.24,1.15) both;
}

.hidden { display: none !important; }

.avatar {
  width: 108px;
  height: 108px;
  margin-bottom: 22px;
  object-fit: cover;
  border: 4px solid var(--ink);
  border-radius: 27px;
  box-shadow: 10px 10px 0 var(--pink);
}

.avatar-small { width: 86px; height: 86px; }

.badge {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 24px;
  font-size: 40px;
  background: var(--pink);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
}

h1, h2 {
  margin: 0;
  max-width: 100%;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -.045em;
}

h1 { font-size: clamp(29px, 7.6vw, 42px); }
h2 { font-size: clamp(28px, 7vw, 38px); }

.subtitle {
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 700;
  line-height: 1.55;
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; min-height: 62px; }

.button {
  min-width: 128px;
  min-height: 52px;
  padding: 12px 23px;
  color: var(--ink);
  font-weight: 900;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 11px 0 var(--ink); }
.button:active { transform: translateY(6px); box-shadow: 0 3px 0 var(--ink); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { background: var(--pink); }
.button-secondary { background: var(--paper); }
.button-wide { width: 100%; margin-top: 10px; }

:focus-visible {
  outline: 4px solid #2563eb;
  outline-offset: 4px;
}

.form, .custom-food {
  display: grid;
  width: 100%;
  gap: 10px;
  text-align: left;
}

.form label, .custom-food label { margin-top: 6px; color: var(--muted); font-weight: 850; }

input, select {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 15px;
  box-shadow: 5px 5px 0 var(--ink);
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
}

.food-option {
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 8px;
  font-size: 28px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
}

.food-option span { font-size: 14px; font-weight: 900; }
.food-option[aria-pressed="true"] { background: var(--pink-soft); transform: translateY(4px); box-shadow: 2px 2px 0 var(--ink); }
.custom-food { margin: 18px 0 6px; }

.status { min-height: 22px; margin: 18px 0 0; font-size: 14px; font-weight: 850; }
.status:empty { min-height: 0; margin-top: 0; }
.status-error { color: var(--danger); }

.date-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin: 4px 0 22px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
}

.date-menu div { min-width: 0; padding: 13px 6px; }
.date-menu div + div { border-left: 2px solid var(--ink); }
.date-menu dt { font-size: 11px; font-weight: 950; letter-spacing: .12em; }
.date-menu dd { margin: 6px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 850; }
.heart-row { color: var(--pink); font-size: 24px; letter-spacing: 7px; }

.petal { position: absolute; z-index: 3; color: #e642a1; font-size: 29px; animation: drift 4.8s ease-in-out infinite alternate; pointer-events: none; }
.petal-one { top: 9%; right: 22%; }
.petal-two { bottom: 10%; left: 23%; animation-delay: -1.4s; }
.petal-three { top: 56%; left: 8%; animation-delay: -2.7s; }

@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes drift { to { transform: translate(10px, -14px) rotate(14deg); } }

@media (max-width: 480px) {
  .stage { padding: 22px 10px; }
  .stage::before { width: calc(100vw - 14px); height: calc(100svh - 14px); min-height: 0; border-width: 8px; border-radius: 42px; }
  .card { width: calc(100vw - 40px); max-height: calc(100svh - 54px); padding: 28px 20px; border-radius: 28px; }
  .avatar { width: 92px; height: 92px; }
  .petal-one { right: 12%; }
  .petal-two { left: 9%; }
}

@media (max-height: 720px) {
  .avatar { width: 78px; height: 78px; margin-bottom: 14px; }
  .badge { width: 68px; height: 68px; margin-bottom: 16px; font-size: 34px; }
  .subtitle { margin: 12px 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
