:root {
  color-scheme: light;
  --red: #e42619;
  --red-dark: #7b0908;
  --cream: #fffaf0;
  --ink: #24130f;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #eee8e4; }
body { margin: 0; min-height: 100svh; color: var(--ink); background: #eee8e4; }
button, input { font: inherit; }
button { touch-action: manipulation; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#app { position: relative; width: min(100%, 520px); min-height: 100svh; margin: 0 auto; overflow: hidden; background: white; box-shadow: 0 0 44px rgba(44, 18, 10, .16); }
.loading-view { min-height: 100svh; background: white; }
.page { min-height: 100svh; }

/* The source image is clipped to artwork only. The keypad below is real DOM, so there is one interaction layer. */
.hero-crop { position: relative; width: 100%; aspect-ratio: 1280 / 1370; overflow: hidden; background: #e52b1b; }
.hero-crop img { display: block; width: 100%; height: auto; transform: translateY(-10.3%); }
.code-card { position: relative; z-index: 2; margin-top: -14px; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #fffdf6; }
.code-card h1 { margin: 0 0 16px; font-size: 21px; font-weight: 600; letter-spacing: .18em; text-align: center; }
.code-input { display: block; width: 76%; height: 62px; margin: 0 auto 18px; padding: 0 18px; border: 1.5px solid #aa7d6b; border-radius: 8px; color: #23140f; background: white; font-size: 30px; font-weight: 700; letter-spacing: .42em; text-align: center; }
.code-input:focus-visible, button:focus-visible { outline: 3px solid #246dcd; outline-offset: 3px; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.keypad button { min-height: 68px; border: 1px solid #b51b12; border-radius: 12px; color: white; background: linear-gradient(#f23b25, #e22216); box-shadow: 0 4px 0 #a81710; font-size: 27px; font-weight: 700; cursor: pointer; }
.keypad button:active { transform: translateY(2px); box-shadow: 0 2px 0 #a81710; }
.keypad .key-text { font-size: 20px; }

.page-choice { padding: max(24px, env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 3%, #70372e, #220303 52%, #080000); }
.choice-backdrop { min-height: 145px; padding-top: 10px; color: white; text-align: center; }
.choice-backdrop p { width: fit-content; margin: 0 auto 10px; padding: 3px 12px; color: #2e9cb7; background: rgba(0,0,0,.32); font-size: 16px; font-weight: 800; }
.choice-backdrop h1 { margin: 0; color: #176c84; font-size: clamp(28px, 9vw, 44px); line-height: 1.1; text-shadow: 2px 2px 0 #071e27, -1px -1px 0 #77d1e0; }
.choice-sheet { position: relative; padding: 52px 10px 20px; border-radius: 20px; background: rgba(30, 4, 2, .54); }
.choice-sheet > h2 { position: absolute; top: -25px; left: 50%; margin: 0; transform: translateX(-50%); color: white; font-size: 46px; text-shadow: 0 4px 0 #e78200, 0 0 12px #ffba32; white-space: nowrap; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-grid button { min-height: 158px; padding: 12px 8px; border: 2px solid rgba(255,255,255,.86); border-radius: 18px; color: #3e241d; background: linear-gradient(145deg, #fffdf6, #ffe6b9); box-shadow: 0 8px 20px rgba(0,0,0,.32); cursor: pointer; }
.choice-grid.is-covered button { position: relative; overflow: hidden; border-color: #41120e; background: radial-gradient(circle at 50% 38%, #5a1c15, #190504 72%); box-shadow: inset 0 0 0 3px rgba(234, 171, 74, .12), 0 8px 20px rgba(0,0,0,.5); }
.choice-grid.is-covered button::before { content: "口味王"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(225, 168, 70, .38); font-family: "STKaiti", "KaiTi", serif; font-size: 23px; font-weight: 900; letter-spacing: .08em; writing-mode: vertical-rl; text-shadow: 0 1px 0 #000; }
.choice-grid.is-covered button > * { visibility: hidden; }
.choice-grid button[aria-pressed="true"] { border: 6px solid white; box-shadow: 0 0 0 5px #333, 0 0 25px 9px white; transform: translateY(-2px); }
.choice-grid span, .choice-grid strong, .choice-grid b, .choice-grid em { display: block; }
.choice-grid span { font-size: 13px; line-height: 1.45; }
.choice-grid strong { margin-top: 8px; color: #c30d08; font-size: 31px; }
.choice-grid small { margin-left: 2px; color: #33211d; font-size: 12px; }
.choice-grid b { margin-top: 5px; color: #b40f0b; font-size: 14px; line-height: 1.45; }
.choice-grid em { margin-top: 6px; color: #b40f0b; font-size: 12px; font-style: normal; }
.next-button { display: block; min-width: 150px; min-height: 50px; margin: 22px auto 0; padding: 0 28px; border: 2px solid white; border-radius: 999px; color: white; background: transparent; font-size: 20px; cursor: pointer; }
.next-button:disabled { opacity: .4; cursor: not-allowed; }

.page-reward { padding: max(20px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 16%, #fdfdff, #e6efff 58%, #dfe7fa); }
.reward-header { display: flex; flex-direction: column; width: fit-content; color: #ee2018; }
.reward-header strong { font-size: 27px; }
.reward-header span { font-size: 14px; font-weight: 800; letter-spacing: .24em; }
.reward-title { display: grid; width: min(72%, 330px); min-height: 360px; margin: 28px auto 32px; place-content: center; justify-items: center; border: 4px solid #d6352d; border-radius: 30px; background: #fff9e9; box-shadow: 0 14px 0 #8e2a25, 0 22px 25px rgba(74,34,31,.28), inset 0 0 0 7px white; }
.reward-title > span { align-self: start; margin-top: -4px; padding: 8px 46px 12px; border-radius: 0 0 20px 20px; color: white; background: #dd2f27; font-size: 22px; font-weight: 800; }
.reward-title h1 { margin: 70px 0 0; color: #d3221b; font-family: Georgia, serif; font-size: 76px; font-weight: 500; }
.reward-title small { margin-left: 8px; color: #16100e; font-family: inherit; font-size: 28px; font-weight: 700; }
.member-card { padding: 14px; border: 5px solid #555; border-radius: 18px; background: white; }
.member-card > p { margin: 0; padding: 10px 12px; color: white; background: #d11314; font-size: 15px; font-weight: 700; }
.member-benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 10px; }
.member-benefits > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; padding: 16px 12px; border: 1px solid #e6e2df; background: white; }
.member-benefits strong { color: #cf1a15; font-size: 34px; }
.member-benefits b { font-size: 16px; }
.member-benefits span { grid-column: 1 / -1; margin-top: 8px; color: #777; font-size: 13px; }
.safety-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px; border: 2px solid #5793c6; border-radius: 8px; color: #5d666d; background: #e8f4ff; }
.safety-bar > span { display: grid; width: 46px; aspect-ratio: 1; place-items: center; color: white; background: #267cc1; clip-path: polygon(50% 0, 95% 22%, 84% 78%, 50% 100%, 16% 78%, 5% 22%); font-size: 12px; font-weight: 800; }
.safety-bar strong { font-size: 14px; }
.product-banner { display: flex; flex-direction: column; min-height: 130px; justify-content: center; padding: 18px 20px; color: #ffe8a6; background: linear-gradient(135deg, #d11310, #f22d17 60%, #9e100c); text-shadow: 0 2px 0 #8a150d; }
.product-banner strong { font-size: 28px; }
.product-banner span { font-size: 22px; font-weight: 800; }
.claim-button { width: 100%; min-height: 58px; margin-top: 18px; border: 0; border-radius: 12px; color: white; background: #e42118; box-shadow: 0 7px 0 #a8150f; font-size: 20px; font-weight: 800; cursor: pointer; }
.claim-button:disabled { opacity: .62; cursor: wait; }

.page-success { position: relative; display: grid; min-height: 100svh; place-items: center; padding: 26px 20px; background: #4d0002; }
.success-backdrop { position: absolute; inset: 0; padding-top: 11vh; color: rgba(238, 204, 90, .26); background: radial-gradient(circle at 50% 10%, #b40b0e, #4d0002 64%); text-align: center; }
.success-backdrop h1 { margin: 0; font-size: 54px; line-height: 1.05; }
.success-dialog { position: relative; z-index: 2; width: 100%; padding: 0 22px 36px; border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.48); text-align: center; }
.success-dialog > h2 { margin: 0 -22px 18px; padding: 24px 14px 34px; border-radius: 18px 18px 0 0; color: white; background: #ed1018; font-size: 29px; }
.success-safety { margin: -36px 0 22px; text-align: left; }
.success-safety small { font-size: 13px; font-weight: 500; }
.success-dialog h3 { margin: 20px 0; font-size: 25px; }
.stamp { display: grid; width: min(74%, 280px); aspect-ratio: 1.55; margin: 0 auto; place-content: center; border: 7px double #cf0b13; border-radius: 50%; color: #cf0b13; font-size: 31px; font-weight: 800; transform: rotate(-8deg); }
.stamp small { font-size: 23px; letter-spacing: .14em; }

.page-message { position: fixed; z-index: 20; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 460px); margin: 0; padding: 12px 16px; transform: translateX(-50%); border-radius: 10px; color: white; background: rgba(24, 15, 12, .92); font-size: 14px; line-height: 1.5; text-align: center; box-shadow: 0 8px 26px rgba(0,0,0,.28); }
.fatal-view { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 28px; background: white; text-align: center; }
.fatal-view button { min-width: 140px; min-height: 48px; border: 0; border-radius: 10px; color: white; background: #dc251b; font-weight: 700; }

@media (max-width: 380px) {
  .keypad button { min-height: 60px; }
  .choice-grid { gap: 8px; }
  .choice-grid button { min-height: 142px; padding-inline: 5px; }
  .choice-grid b { font-size: 12px; }
  .reward-title { min-height: 320px; }
}

@media (min-width: 768px) {
  body { padding: 28px 0; }
  #app { border-radius: 24px; }
}

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