:root {
  --red: #ed003f;
  --red-deep: #c00033;
  --red-text: #a3002c;
  --pink: #ffe6ed;
  --paper: #fff;
  --ink: #20181c;
  --muted: #65575e;
  --line: #e9dce1;
  --radius: 16px;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  color: var(--paper);
  background: #f6eef0;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #fcb64c; outline-offset: 3px; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.app {
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 460px);
  min-height: 100svh;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--red) 30%, #db003d 100%);
  box-shadow: 0 0 48px #48001624;
}
.app::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 55px 0 0;
  background: #ffb1c4;
  opacity: .48;
  mask: url("assets/dot-wave.svg") center top / 112% auto repeat-y;
  pointer-events: none;
}
.loading { margin: auto; padding: 32px; }
.top {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 62px;
  padding: max(8px, env(safe-area-inset-top)) 19px 8px;
  flex-shrink: 0;
}
.brand { width: clamp(146px, 44vw, 188px); display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: 100%; }
.demo { margin-left: auto; border: 1px solid #fff9; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 750; }
.back { border: 0; background: transparent; color: white; width: 36px; height: 44px; padding: 0; display: grid; place-items: center; }
.back::before, .chevron { content: ""; display: block; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.back::before { transform: rotate(135deg); }

main { flex: 1; display: flex; flex-direction: column; padding: 15px 19px 26px; gap: 17px; }
.with-tabs { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.35; font-weight: 800; letter-spacing: .005em; }
h2 { font-size: 19px; line-height: 1.4; }
p { font-size: 14px; line-height: 1.65; }
.lead { display: grid; gap: 5px; }
.center { text-align: center; }
.home { gap: 10px; }
.home h1 { font-size: clamp(21px, 6.1vw, 27px); }
.hero { display: grid; place-items: center; margin: 2px 0 0; height: clamp(232px, 39svh, 350px); }
.hero img { width: min(85%, 306px); height: 100%; object-fit: contain; filter: drop-shadow(0 13px 14px #64001862); }
.price { font-size: 15px; font-weight: 750; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.price strong { font-size: 34px; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.actions { display: grid; gap: 8px; }
.bottom-actions { margin-top: auto; }
.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  padding: 9px 35px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--paper);
  color: var(--red-text);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
}
.button .chevron { position: absolute; right: 17px; }
.button--quiet { background: transparent; color: #fff; min-height: 44px; }
.button--quiet .chevron { position: static; margin-left: 4px; }
.button--outline { background: transparent; border-color: #fffa; color: #fff; }
.shipping-note { font-size: 12px; text-align: center; font-weight: 700; }
.ship-strip { padding: 10px 13px; color: var(--ink); background: var(--pink); border-radius: 12px; text-align: center; font-weight: 750; }
.ship-strip strong { color: var(--red-text); }
.surface { background: #fff; border-radius: var(--radius); color: var(--ink); padding: 15px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; font-size: 14px; font-weight: 750; }
.row + .row { border-top: 1px solid var(--line); }
.total { font-size: 26px; line-height: 1.2; }
.total small { font-size: 12px; font-weight: 650; }
.step { display: grid; grid-template-columns: 44px 49px 44px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; text-align: center; align-items: center; }
.step button { height: 44px; border: 0; background: #fff6f8; font-size: 19px; }
.notice { font-size: 13px; }
.review { gap: 17px; }

.tabs {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  width: min(100%, 460px);
  height: calc(70px + env(safe-area-inset-bottom));
  padding: 0 12px max(9px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #f0dce4;
  color: var(--ink);
}
.tab { display: flex; position: relative; flex-direction: column; justify-content: center; align-items: center; min-height: 55px; gap: 5px; font-size: 12px; font-weight: 800; text-decoration: none; }
.tab[aria-current="page"] { color: var(--red-text); }
.tab[aria-current="page"]:not(.tab--main) .tab-label { background: var(--pink); border-radius: 12px; padding: 1px 7px; }
.tab--main { justify-content: flex-end; padding-bottom: 1px; color: var(--red-text); }
.tab-circle { display: grid; place-items: center; position: absolute; bottom: 23px; width: 67px; height: 67px; color: white; background: var(--red); border: 3px solid white; border-radius: 50%; box-shadow: 0 2px 5px #70001f26; }
.icon { display: inline-block; position: relative; flex: none; width: 24px; height: 21px; color: inherit; }
.icon--machine { border: 2px solid currentColor; border-radius: 4px; width: 24px; height: 31px; }
.icon--machine::before { content: ""; position: absolute; inset: 3px 3px 10px; border: 1.5px solid currentColor; border-radius: 1px; background: radial-gradient(circle, currentColor 1px, transparent 1.5px) center / 5px 6px; }
.icon--machine::after { content: ""; position: absolute; bottom: 4px; left: 5px; right: 5px; height: 2px; background: currentColor; }
.icon--box { width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 2px; transform: rotate(30deg) skew(-8deg); }
.icon--box::before { content: ""; position: absolute; inset: 0 50% 0 auto; border-right: 2px solid; transform: rotate(48deg); }
.icon--truck { width: 25px; height: 15px; border: 2px solid; border-radius: 3px; margin: 0 0 4px; }
.icon--truck::before { content: ""; position: absolute; top: 0; bottom: 0; right: 6px; border-right: 2px solid; }
.icon--truck::after { content: ""; position: absolute; bottom: -5px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 13px 0 currentColor; }

.list { display: grid; gap: 8px; }
.item { min-height: 74px; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.item strong { font-size: 14px; line-height: 1.42; display: block; overflow-wrap: anywhere; }
.item img { width: 62px; height: 55px; object-fit: contain; }
.item-art { display: flex; justify-content: center; align-items: center; min-width: 0; }
.item-art img:not(:only-child) { width: 33px; }
.pill { display: inline-flex; align-items: center; width: fit-content; margin-top: 4px; padding: 2px 8px; background: #f3edf0; color: #4a3c43; border-radius: 999px; font-size: 11px; font-weight: 750; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters button { min-height: 44px; }
.choice { grid-template-columns: 23px 58px minmax(0,1fr); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--red); }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.empty { padding: 23px 14px; text-align: center; color: var(--muted); }
.history-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.history-details summary::after { content: "＋"; margin-left: auto; }
.history-details[open] summary::after { content: "−"; }
.history-details .list { padding: 4px 0 8px; }

dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 460px);
  max-width: none;
  max-height: 84dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--red-deep);
  color: #fff;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #21000cb5; }
body:has(dialog[open]) { overflow: hidden; }
.sheet { display: flex; flex-direction: column; max-height: 84dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 8px 16px 6px; }
.sheet-close { width: 44px; height: 44px; border: 0; background: transparent; color: white; font-size: 26px; }
.sheet-body { overflow: auto; overscroll-behavior: contain; display: grid; gap: 12px; padding: 0 16px max(18px, env(safe-area-inset-bottom)); }
.tier-list { display: grid; gap: 6px; }
.tier-list h3 { margin: 0; font-size: 15px; }
.tier-badge { display: inline-block; background: #fff; color: var(--red-text); border-radius: 7px; padding: 4px 10px; font-weight: 850; font-size: 14px; }

main.reveal {
  padding: clamp(28px, 6svh, 56px) 6.2% max(42px, 6svh);
  gap: clamp(16px, 3.5svh, 34px);
  overflow: hidden;
}
.app:has(#reveal-message) { background: #d90036; }
.app:has(#reveal-message)::before {
  inset: 70px 0 0;
  opacity: .66;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}
#reveal-message { min-height: 88px; align-content: start; justify-items: start; gap: 7px; }
#reveal-message h1 { font-size: clamp(20px, 6.05vw, 31px); letter-spacing: -.025em; }
#reveal-message:has(.tier-badge) h1 { font-size: clamp(24px, 7.1vw, 36px); }
#reveal-message p { font-size: clamp(12px, 3.4vw, 16px); font-weight: 700; }
#reveal-message .tier-badge { color: #d90036; background: white; padding: 3px 16px; border-radius: 13px; font-size: 20px; }
.reveal-stage { position: relative; isolation: isolate; min-height: clamp(250px, 45svh, 440px); margin-top: auto; }
.slot { position: absolute; bottom: 0; left: 50%; width: 89%; height: clamp(118px, 20svh, 172px); transform: translateX(-50%); border: 10px solid #413137; border-radius: 22px; background: radial-gradient(ellipse at 50% 100%, #423339, #100d0e 74%); box-shadow: 0 0 0 1px #ff94ab, inset 0 5px 14px #000; transition: opacity .25s; }
.reveal-stage { --box-height: clamp(72px, 11.4svh, 110px); --box-bottom: 17px; }
.reveal-box { position: absolute; z-index: 2; bottom: var(--box-bottom); left: 50%; width: 56%; height: var(--box-height); transform: translateX(-50%); background: linear-gradient(#f90b48, #dc0033); border: 1px solid #ff547a; border-radius: 4px 4px 7px 7px; box-shadow: 0 12px 22px #65001380; display: grid; place-items: end center; padding-bottom: calc(var(--box-height) * .26); }
.reveal-box::before { content: ""; position: absolute; top: 0; left: 43%; width: 14%; height: 35%; background: white; clip-path: polygon(0 0,100% 0,100% 100%,50% 73%,0 100%); }
.box-wordmark { display: block; width: 52%; }
.box-wordmark img { width: 100%; }
.lid { position: absolute; z-index: 3; bottom: calc(var(--box-bottom) + var(--box-height) - 2px); left: 50%; width: 58%; height: calc(var(--box-height) * .32); transform: translateX(-50%); border: 1px solid #ff94ad; border-radius: 5px; background: #ff0749; box-shadow: 0 5px #a5002d; transition: transform .58s cubic-bezier(.23,1,.35,1), opacity .25s; }
.reveal-stage::before, .reveal-stage::after { content: ""; position: absolute; left: 50%; bottom: calc(var(--box-bottom) + 10px); transform: translateX(-50%); opacity: 0; transition: opacity .28s; pointer-events: none; }
.reveal-stage::before { width: 90%; height: 58%; background: radial-gradient(ellipse at 50% 70%, #fff8b8 2%, #ffbd63 12%, #ff7a328c 29%, transparent 65%); }
.reveal-stage::after { width: 83%; height: 48%; background: repeating-conic-gradient(from 220deg at 50% 88%, transparent 0deg 13deg, #ffcd7360 15deg 17deg, transparent 20deg 28deg); mask: radial-gradient(ellipse at 50% 84%, black, transparent 66%); }
.prize { position: absolute; z-index: 1; inset: 0 0 calc(var(--box-bottom) + var(--box-height) - 6px); display: flex; align-items: end; justify-content: center; opacity: 0; transform: translateY(31%) scale(.72); transform-origin: center bottom; transition: transform .54s cubic-bezier(.16,1.13,.34,1), opacity .26s; filter: drop-shadow(0 0 15px #ffbd69ad); }
.prize img { max-height: 100%; max-width: 91%; object-fit: contain; }
.prize img:not(:only-child) { width: 48%; }
.reveal-stage[data-phase="lifting"] .slot, .reveal-stage[data-phase="result"] .slot { opacity: 0; }
.reveal-stage[data-phase="lifting"]::before, .reveal-stage[data-phase="lifting"]::after, .reveal-stage[data-phase="result"]::before, .reveal-stage[data-phase="result"]::after { opacity: 1; }
.reveal-stage[data-phase="lifting"] .lid { transform: translate(-55%, -340%) rotate(-13deg); }
.reveal-stage[data-phase="result"] .lid { opacity: 0; transform: translate(-72%, -470%) rotate(-23deg); }
.reveal-stage[data-phase="result"] .prize { opacity: 1; transform: translateY(0) scale(1); }
#reveal-controls { margin-top: 0; }
.reveal:has(.reveal-stage[data-phase="result"]) { padding-bottom: max(76px, 11svh); }
#reveal-controls .button { font-size: clamp(18px, 4.8vw, 24px); min-height: clamp(48px, 7svh, 64px); }
#reveal-controls .button--quiet { font-size: 15px; min-height: 42px; }
#reveal-controls .opening-status { background: transparent; color: white; opacity: 1; }
.reveal-stage[data-phase="complete"] .slot, .reveal-stage[data-phase="complete"] .prize { display: none; }
.reveal-stage[data-phase="complete"] .lid { transform: translate(-54%, -58px) rotate(-16deg); }
.complete-check { position: absolute; z-index: 4; left: calc(50% + 48px); bottom: 18px; width: 49px; height: 49px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--red-text); font-size: 29px; font-weight: 850; }
.error { background: #fff0f3; color: #85112e; margin: 0 18px 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; }

@media (min-width: 600px) { .app { min-height: 100dvh; } }
@media (max-height: 760px) { .hero { height: max(218px, 36svh); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; } }
