:root {
  --paper: #F3DCCF;
  --paper-deep: #E9C7B6;
  --red: #D41F3A;
  --red-deep: #9E1328;
  --gold: #F0DA4E;
  --gold-line: #F7EDC2;
  --wine: #4A0D16;
  --display: "Zen Antique", "Songti SC", serif;
  --body: "Zen Kaku Gothic New", "PingFang SC", system-ui, sans-serif;
  /* embossed foil coins: round coin with a square hole, tiled */
  --coins: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke-width='1.2'%3E%3Ccircle cx='22' cy='22' r='9' stroke='%23ffffff' stroke-opacity='.55'/%3E%3Ccircle cx='22.8' cy='22.8' r='9' stroke='%239E1328' stroke-opacity='.10'/%3E%3Crect x='19' y='19' width='6' height='6' stroke='%23ffffff' stroke-opacity='.55'/%3E%3Ccircle cx='0' cy='0' r='4' stroke='%23ffffff' stroke-opacity='.4'/%3E%3Ccircle cx='44' cy='44' r='4' stroke='%23ffffff' stroke-opacity='.4'/%3E%3Ccircle cx='44' cy='0' r='4' stroke='%23ffffff' stroke-opacity='.4'/%3E%3Ccircle cx='0' cy='44' r='4' stroke='%23ffffff' stroke-opacity='.4'/%3E%3C/g%3E%3C/svg%3E");
  --gold-coins: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg fill='none' stroke='%23F0DA4E' stroke-opacity='.22'%3E%3Ccircle cx='15' cy='15' r='6'/%3E%3Crect x='13' y='13' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) var(--coins);
  color: var(--wine);
  font: 17px/1.6 var(--body);
}
a { color: var(--red-deep); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 4vw, 48px); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--wine); font: 26px/1 var(--display); }
.connect {
  background: var(--wine); color: var(--gold-line); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: 15px;
}

main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 40px; }

/* ---------- the fan of latest packets */
.hand { height: 200px; position: relative; margin-top: 4px; overflow: hidden; }
.fan { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; }
.card {
  position: absolute; left: -46px; bottom: 0; width: 92px; height: 128px;
  transform-origin: 50% 620px;
  background: var(--red) var(--gold-coins); border: 0; border-radius: 10px; padding: 0;
  box-shadow: 0 6px 14px rgba(74, 13, 22, 0.25);
  color: var(--gold-line); text-align: center;
  transition: transform 0.35s cubic-bezier(.2, .9, .3, 1.2), box-shadow 0.2s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 44px; background: var(--red-deep); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 10px 10px 0 0; }
.card::after { content: ""; position: absolute; left: 50%; top: 34px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--gold); }
.card b { position: absolute; left: 0; right: 0; top: 64px; font: 17px/1 var(--display); }
.card small { position: absolute; left: 0; right: 0; top: 86px; font-size: 11px; opacity: 0.9; }
.card.done { filter: saturate(0.25) brightness(1.1); }
.card:hover, .card:focus-visible { box-shadow: 0 10px 22px rgba(74, 13, 22, 0.35); outline: none; }
.card.sel { box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(74, 13, 22, 0.35); }
.fan-empty { position: absolute; left: -150px; width: 300px; bottom: 40px; text-align: center; font-size: 15px; opacity: 0.7; }

/* ---------- the open envelope */
.stage {
  display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 64px); align-items: center;
  background: rgba(255, 248, 242, 0.55); border: 1px solid rgba(158, 19, 40, 0.15);
  border-radius: 24px; padding: clamp(20px, 4vw, 44px); margin-top: 18px;
}
.env { position: relative; width: 260px; height: 340px; margin: 70px auto 0; perspective: 900px; }
.env-back { position: absolute; inset: 0; background: var(--red-deep); border-radius: 16px; }
.env-front {
  position: absolute; inset: 0; z-index: 3; border-radius: 16px;
  background: var(--red) var(--gold-coins);
  clip-path: polygon(0 26%, 50% 44%, 100% 26%, 100% 100%, 0 100%);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.06);
}
.seal {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--red-deep); font: 40px/1 var(--display);
  box-shadow: inset 0 0 0 4px #e3c43a, 0 3px 0 rgba(74, 13, 22, 0.25);
}
.flap {
  position: absolute; left: 0; right: 0; top: 0; height: 46%; z-index: 4;
  background: var(--red-deep); border-radius: 16px 16px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 56%, 50% 96%, 0 56%);
  transform-origin: 50% 0; transform: rotateX(0deg);
  transition: transform 0.6s cubic-bezier(.5, 0, .3, 1), z-index 0s 0.3s;
}
.slip {
  position: absolute; left: 18px; right: 18px; top: 14px; height: 270px; z-index: 2;
  background: var(--gold-line); border-radius: 8px; text-align: center; padding: 26px 14px 0;
  border: 2px solid var(--gold);
  transform: translateY(0); transition: transform 0.7s cubic-bezier(.2, .8, .2, 1) 0.45s;
}
.slip-wish { margin: 14px 0 0; font-size: 14px; line-height: 1.4; }
.slip-amount { margin: 0; font: 46px/1 var(--display); color: var(--red); opacity: 0.25; }
.slip-unit { margin: 4px 0 0; font-weight: 700; letter-spacing: 0.1em; font-size: 13px; }
.env.opened .flap { transform: rotateX(180deg); z-index: 1; }
.env.opened .slip { transform: translateY(-58%); }
.env.opened .slip-amount { animation: stamp 0.45s cubic-bezier(.2, 1.4, .4, 1) 1.15s both; }
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  70% { opacity: 1; transform: scale(0.92) rotate(-6deg); }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}

.stage-info h1 { font-size: clamp(32px, 5vw, 56px); color: var(--red-deep); }
.lead { font-size: 18px; max-width: 560px; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 28px; margin: 18px 0; }
.facts dt { font-size: 13px; opacity: 0.75; }
.facts dd { margin: 0; font: 26px/1.2 var(--display); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.open-btn, .make-btn {
  background: var(--red); color: #fff; border: 0; border-radius: 14px; padding: 14px 24px;
  font-weight: 900; font-size: 18px; box-shadow: 0 5px 0 var(--red-deep);
}
.open-btn:active, .make-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-deep); }
.ghost { background: transparent; border: 2px solid var(--wine); color: var(--wine); border-radius: 14px; padding: 11px 18px; font-weight: 700; }
.note { min-height: 1.6em; margin: 12px 0 0; font-weight: 700; }
.note.bad { color: var(--red); }

/* ---------- make and feed */
.lower { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 28px; }
.make, .feed-col { background: #FBEDE4; border-radius: 20px; padding: 24px; border: 1px solid rgba(158, 19, 40, 0.15); }
.make { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 14px; align-content: start; }
.make h2, .feed-col h2 { font-size: 30px; grid-column: 1 / -1; margin-bottom: 4px; }
.make label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.make .wide, .make .small, .make-btn { grid-column: 1 / -1; }
.make input, .make select {
  font: 17px var(--body); padding: 10px 12px; border-radius: 10px; border: 2px solid var(--paper-deep);
  background: #fff; color: var(--wine); width: 100%;
}
.make input:focus, .make select:focus { outline: none; border-color: var(--red); }
.small { font-size: 13px; opacity: 0.8; margin: 0; }
.feed { list-style: none; margin: 10px 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px dashed rgba(158, 19, 40, 0.25); font-size: 15px; }
.feed li b { color: var(--red); font-family: var(--display); font-size: 18px; }
.feed li span { grid-column: 1 / -1; font-size: 13px; opacity: 0.75; }
.feed .empty { display: block; opacity: 0.7; }

.how { margin-top: 40px; }
.how h2 { font-size: 36px; color: var(--red-deep); }
.how ol { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.how li { counter-increment: s; background: var(--red) var(--gold-coins); color: var(--gold-line); border-radius: 18px; padding: 22px; }
.how li::before { content: counter(s); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--red-deep); font: 20px/1 var(--display); margin-bottom: 10px; }
.how h3 { font-size: 24px; margin-bottom: 6px; color: #fff; }
.how p { margin: 0; font-size: 15px; }

.foot { margin-top: 48px; padding-top: 20px; border-top: 2px solid var(--red); font-size: 14px; }
.foot p { margin: 4px 0; overflow-wrap: anywhere; }
.foot .built { font: 20px/1.3 var(--display); }
.addr { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .facts, .actions { justify-content: center; }
  .lower { grid-template-columns: 1fr; }
  .how ol { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hand { height: 150px; }
  .card { width: 72px; height: 100px; left: -36px; transform-origin: 50% 420px; }
  .card b { top: 48px; font-size: 14px; }
  .card small { top: 66px; font-size: 10px; }
  .card::before { height: 34px; }
  .card::after { top: 26px; width: 16px; height: 16px; margin-left: -8px; }
  .make { grid-template-columns: 1fr 1fr; }
  .make label:nth-of-type(3) { grid-column: 1 / -1; }
  .env { transform: scale(0.9); margin-top: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; transition-delay: 0s !important; animation-delay: 0s !important; }
}
