/* Coupon invitations borrow the surrounding menu or settlement palette. */
.coupon-entry, .coupon-entry * { box-sizing: border-box; }
.coupon-entry {
  display: flex;
  align-items: center;
  gap: .25rem .65rem;
  width: 100%;
  text-align: left;
}
.coupon-lobby {
  max-width: var(--container);
  margin: 0 auto .85rem;
  padding: 0 .8rem;
  border: var(--card-border);
  border-radius: var(--r-card);
  background: rgba(255,250,248,.94);
  color: var(--brown);
  font: 700 13px/1.4 var(--round);
}
.coupon-lobby b { flex: 1; }
.coupon-result { padding: 0 .15rem; color: inherit; font-size: 13px; justify-content: flex-end; }
.coupon-holding { flex: 1; line-height: 1.4; }
.coupon-holding:empty { display: none; }
.coupon-entry-mine {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  white-space: nowrap;
  font: 800 12px/1.25 system-ui, sans-serif;
  text-underline-offset: 3px;
}
.coupon-feed {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .48rem;
  min-width: 0;
  max-width: 100%;
  margin: .8rem 0 0;
  padding: .24rem .45rem .24rem .7rem;
  color: #664034;
  background: #fff7e8;
  border: 1px solid #e8cbb0;
  border-radius: 12px;
  font: 750 13px/1.5 system-ui, sans-serif;
}
.coupon-feed-icon { color: #87513c; }
.coupon-feed-sample {
  flex: none; padding: .12rem .28rem; border-radius: 4px;
  color: #6f422d; background: #f1ddc6; font-size: 11px; letter-spacing: .04em;
}
.coupon-feed-window { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.coupon-feed-window[data-static="true"] { overflow-x: auto; scrollbar-width: none; }
.coupon-feed-line { display: inline-block; }
.coupon-feed button {
  flex: none; width: 28px; height: 28px;
  padding: 0; border: 0; border-radius: 7px;
  color: #734b3a; background: #f6e7d3; font: bold 15px/1 system-ui, sans-serif; cursor: pointer;
}
.coupon-feed [hidden] { display: none; }
.coupon-feed :focus-visible { outline: 2px solid #925b50; outline-offset: 1px; }
.coupon-burst {
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; place-items: center;
  isolation: isolate; overflow: hidden;
  background: #21162ed1;
  color: #fff0bf;
  font: 700 14px/1.4 system-ui, sans-serif;
}
.coupon-burst-beam {
  position: absolute; z-index: -1; inset: 4% 10% 22%;
  clip-path: polygon(46% 0, 54% 0, 87% 100%, 13% 100%);
  background: linear-gradient(transparent, #ffdd8066 72%, #ffe398b3);
  animation: coupon-beam .5s ease-out both;
}
.coupon-burst-card { display: grid; justify-items: center; gap: .38rem; text-align: center; text-shadow: 0 2px 5px #241438; }
.coupon-burst-card img {
  width: 112px; height: 132px; object-fit: contain;
  margin: 0 auto .45rem; filter: drop-shadow(0 0 18px #ffdb79d1);
  animation: coupon-pop .72s cubic-bezier(.2,.73,.28,1.12) both;
}
.coupon-burst-card span { color: #fff0bf; }
.coupon-burst-card strong { color: #fff7e5; font-size: 29px; }
@keyframes coupon-pop {
  from { transform: translateY(120px) rotate(-18deg) scale(.45); opacity: 0; }
  60% { transform: translateY(-20px) rotate(9deg) scale(1.12); opacity: 1; }
  to { transform: translateY(0) rotate(0) scale(1); }
}
@keyframes coupon-beam { from { opacity: 0; transform: scaleX(.18); } to { opacity: 1; transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .coupon-burst-card img, .coupon-burst-beam { animation: none; }
}
.coupon-page, .coupon-page * { box-sizing: border-box; }
.coupon-page {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: #f9efd8; color-scheme: dark;
  background: radial-gradient(ellipse at 95% 7%, #423145 0, transparent 43%), #211a30;
  font: 500 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}
.coupon-shell {
  width: min(100%, 35rem); min-height: 100vh; min-height: 100dvh; display: flex;
  flex-direction: column; margin: auto; padding: max(1.1rem,env(safe-area-inset-top)) clamp(1.15rem,5vw,2.5rem) max(1rem,env(safe-area-inset-bottom));
}
.coupon-mast { display: flex; align-items: baseline; justify-content: space-between; padding: .35rem 0 .9rem; border-bottom: 1px solid #57475c; }
.coupon-mast strong { font-size: 15px; letter-spacing: .12em; color: #ffcc89; }
.coupon-mast a { font-size: 13px; color: #e4d4dd; text-underline-offset: 4px; }
#coupon-main { flex: 1; padding: 1.6rem 0; }
#coupon-main h1, #coupon-main h2, #confirm-redemption h2 { line-height: 1.25; letter-spacing: -.045em; margin: 0; }
#coupon-main h1 { font-size: clamp(2rem,8.8vw,3rem); margin: .25rem 0 1.3rem; }
#coupon-main h2, #confirm-redemption h2 { font-size: clamp(1.55rem,6vw,2rem); }
.coupon-ticket {
  position: relative; margin: 0 0 1.15rem; overflow: hidden; border-radius: 17px;
  color: #392836; background: #fff1d9; box-shadow: 0 .45rem 1.5rem #130f1d48;
}
.coupon-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1.1rem 1.2rem 0; }
.coupon-ticket-head > span { font-size: .75rem; font-weight: 850; letter-spacing: .15em; color: #775334; }
.coupon-state { border: 1px solid #a47f56; border-radius: 5px; padding: .18em .65em; font-size: 13px; letter-spacing: .08em; color: #6f4a2a; background: #fff3de; }
.coupon-ticket-body { position: relative; isolation: isolate; overflow: hidden; min-height: 8.5rem; padding: 1.5rem 6.35rem 1.55rem 1.2rem; }
.coupon-store { display: block; font-size: 14px; font-weight: 650; margin-bottom: .35rem; color: #6b5240; }
#coupon-main .coupon-ticket-body h2 { font-size: clamp(1.65rem,7.4vw,2.3rem); overflow-wrap: anywhere; }
.coupon-figure { position: absolute; bottom: -.45rem; right: .45rem; z-index: -1; width: 6.3rem; height: 6.3rem; object-fit: contain; }
.coupon-stub { position: relative; border-top: 2px dashed #cfb999; padding: 1rem 1.2rem 1.1rem; }
.coupon-stub::before, .coupon-stub::after { content: ""; position: absolute; top: -10px; width: 16px; height: 16px; border-radius: 50%; background: #282032; }
.coupon-stub::before { left: -8px; } .coupon-stub::after { right: -8px; }
.coupon-row { display: flex; align-items: baseline; justify-content: space-between; gap: .7em; flex-wrap: wrap; padding: .62rem 0; border-bottom: 1px solid #d9c5a9; font-size: 13px; }
.coupon-row:last-child { border: 0; padding-bottom: 0; }
.coupon-row span { color: #685443; }
.coupon-row strong { font-variant-numeric: tabular-nums; }
.coupon-intro { margin: -.5rem 0 1rem; line-height: 1.6; color: #e1cfd6; }
.coupon-stub .coupon-intro { font-size: 14px; color: #664c3e; margin: .45rem 0; }
.coupon-panel { padding: 1.35rem; border-radius: 14px; border: 1px solid #64516a; background: #35293d; margin: .7rem 0 1.2rem; }
.coupon-panel p { color: #eee0df; }
.coupon-button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
  margin: .75rem 0 0; padding: .7rem .8rem; border: 1px solid transparent; border-radius: .7rem;
  font-family: inherit; font-size: 16px; font-weight: 800; line-height: 1.4;
  text-decoration: none; text-align: center; cursor: pointer;
}
.coupon-button.primary { background: #ffc173; color: #39263a; }
.coupon-page .coupon-button.coupon-google {
  margin-top: 0;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #747775;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  font: 500 14px/20px "Coupon Google Sans", system-ui, sans-serif;
}
@font-face {
  font-family: "Coupon Google Sans";
  src: url("/coupon/identity/google-sans-medium.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}
.coupon-google img { object-fit: contain; flex: none; }
.coupon-page .coupon-google:hover { background: #f2f6fc; }
.coupon-login-instruction { margin: .65rem 0 .75rem; font-size: 15px; line-height: 1.55; color: #f6e4da; }
.coupon-win-usage { margin: 1.3rem 0 .45rem; font-size: 14px; color: #e1cfd6; }
.coupon-page .coupon-button.coupon-forfeit-open {
  width: fit-content;
  margin-top: 0;
  min-height: 44px;
  color: #eee0e7;
  font-size: 14px;
  font-weight: 650;
}
.coupon-forfeit-confirm {
  margin-top: .7rem;
  padding: .85rem;
  border: 1px solid #766079;
  border-radius: 12px;
  background: #35293d;
}
.coupon-forfeit-confirm p { margin: 0; font-size: 15px; }
.coupon-forfeit-choices { display: flex; gap: .55rem; }
.coupon-forfeit-choices .coupon-button { flex: 1; min-height: 44px; font-size: 14px; }
.coupon-forfeit-keep, .coupon-forfeit-done { color: #39263a; background: #ffda9f; }
.coupon-forfeit-done { padding: .85rem 1rem; border-radius: 12px; }
.coupon-ticket .coupon-button.primary { background: #49334e; color: #fff4de; }
.coupon-button.quiet { background: transparent; border-color: #766079; color: #f4e2df; }
.coupon-ticket .coupon-button.quiet, #confirm-redemption .coupon-button.quiet { color: #533b4c; border-color: #bda58d; }
.coupon-page :focus-visible, .coupon-entry :focus-visible { outline: 3px solid #1a9c99; outline-offset: 3px; }
.coupon-page button:disabled, .coupon-entry button:disabled { opacity: .65; cursor: wait; }
.coupon-preview-note { display: block; color: #d8bfcb; }
.coupon-notice { background: #4c3142; color: #ffe0a9; padding: .8rem 1rem; border-radius: 8px; }
.coupon-seal { display: flex; align-items: center; gap: .9rem; color: #45324a; padding: .25rem 0 .5rem; }
.coupon-seal-icon {
  flex: none; display: grid; place-items: center; width: 3.8rem; height: 3.8rem;
  font-size: 2.15rem; line-height: 1; border: 2px solid var(--ink); border-radius: 50%;
  color: var(--ink); background: var(--wash);
}
.coupon-seal-icon::first-letter { color: var(--ink); }
.coupon-seal b, .coupon-seal small, .coupon-staff-row strong, .coupon-staff-row small { display: block; }
.coupon-seal b { font-size: 1.28rem; color: var(--ink); }
.coupon-seal small, .coupon-clock small { font-size: .78rem; font-weight: 750; }
.coupon-seal.violet { --ink: #63367d; --wash: #ead7ef; }
.coupon-seal.green { --ink: #305e36; --wash: #d4e7c7; }
.coupon-seal.gold { --ink: #82530c; --wash: #ffe2a1; }
.coupon-seal.red { --ink: #983c35; --wash: #ffd5c6; }
.coupon-seal.pink { --ink: #873955; --wash: #f5cfdd; }
.coupon-seal.blue { --ink: #2f597a; --wash: #d3e8ed; }
#coupon-main > .coupon-seal { padding: 1rem; border-radius: 12px; background: #fff1d9; }
.coupon-clock { border-top: 1px solid #d5bea3; border-bottom: 1px solid #d5bea3; margin: .65rem 0 .1rem; padding: .8rem 0; }
.coupon-clock small { color: #695347; }
.coupon-clock div { display: flex; gap: .45rem; align-items: baseline; }
.coupon-clock strong { font: 800 clamp(2rem,11vw,3.4rem)/1.14 ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.coupon-clock div span { font-size: 14px; font-weight: 700; }
.coupon-redemption-seal { flex-wrap: wrap; }
.coupon-redemption-badge {
  margin-inline-start: auto; padding: .4em .65em; border-radius: 6px;
  background: #305e36; color: #fff; font-size: .82rem; font-weight: 850; line-height: 1.35;
}
.coupon-ticket.is-stale { background: #e1dfdd; color: #37343a; }
.coupon-ticket.is-stale .coupon-figure { filter: grayscale(1); opacity: .65; }
.coupon-ticket.is-stale .coupon-ticket-head > span,
.coupon-ticket.is-stale .coupon-store,
.coupon-ticket.is-stale .coupon-row span,
.coupon-ticket.is-stale .coupon-clock small { color: #555157; }
.coupon-ticket.is-stale .coupon-state { border-color: #8b868d; background: #eeecec; color: #514d54; }
.coupon-ticket.is-stale .coupon-stub,
.coupon-ticket.is-stale .coupon-row { border-color: #b1adb2; }
.coupon-ticket.is-stale .coupon-redemption-badge { background: #514e56; }
.coupon-ticket.is-stale .coupon-clock {
  padding-inline: .75rem; border: 1px solid #b1adb2; border-radius: .55rem;
  background: #d4d2d5; color: #37343a;
}
.coupon-staff-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #614e64; }
.coupon-staff-row:last-child { border: none; }
.coupon-staff-row small { color: #dcc9d4; font-variant-numeric: tabular-nums; }
.coupon-staff-row > b { font: 800 1.6rem/1.2 ui-monospace,monospace; letter-spacing: .1em; color: #ffcd8d; }
.coupon-foot { padding: .8rem 0 .4rem; border-top: 1px solid #57475c; }
.coupon-foot a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: #e4d4dd; text-underline-offset: 4px; }
#confirm-redemption { width: min(calc(100% - 2.5rem), 25rem); padding: 1.4rem; color: #3c2e39; border: 0; border-radius: 18px; background: #fff1d9; }
#confirm-redemption::backdrop { background: #150d1ee0; }
#confirm-redemption .coupon-eyebrow { display: block; color: #805c3d; margin-bottom: .55rem; font-size: 13px; font-weight: 750; }
#confirm-warning { font-weight: 750; }
#confirm-redemption .primary { color: #fff5e2; background: #57354d; }

.coupon-foot small { display: block; color: var(--muted); }

.coupon-feed-notice { margin: .2rem 0 .85rem; color: #f0d9b7; font-size: .85rem; }

/* Prize art shares the same three frames across the reveal and the coupon. */
[data-prize-frame="regular"] {
  --prize-paper: #fff2dc;
  --prize-rim: #ac794b;
  --prize-inset: #d6b58d;
  --prize-halo: #edcd995e;
}
[data-prize-frame="special"] {
  --prize-paper: #edf4e9;
  --prize-rim: #5e826e;
  --prize-inset: #91b19a;
  --prize-halo: #a2c6ae68;
}
[data-prize-frame="boss"] {
  --prize-paper: #f4e9f5;
  --prize-rim: #835b8b;
  --prize-inset: #c19252;
  --prize-halo: #d4aad374;
}
.coupon-burst-card[data-prize-frame] {
  width: min(16rem, calc(100vw - 2.5rem));
  gap: .45rem;
  padding: 1.05rem .65rem 1.2rem;
  border: 2px solid var(--prize-rim);
  border-radius: 1.15rem;
  background: radial-gradient(ellipse at center 43%, var(--prize-halo), transparent 67%), var(--prize-paper);
  box-shadow: inset 0 0 0 4px var(--prize-paper), inset 0 0 0 5px var(--prize-inset),
    0 16px 40px #210f37a6, 0 0 36px #ffdb797d;
  color: #422d38;
  text-shadow: none;
  animation: coupon-pop .72s cubic-bezier(.2,.73,.28,1.12) both;
}
.coupon-burst-card[data-prize-frame] img {
  width: 10.35rem;
  height: 9.5rem;
  margin: .12rem 0 0;
  filter: drop-shadow(0 8px 6px #80583024);
  animation: none;
}
.coupon-burst-card[data-prize-frame] span {
  order: -1;
  color: #614b45;
  font-size: .8rem;
  letter-spacing: .09em;
}
.coupon-burst-card[data-prize-frame] strong {
  color: inherit;
  font-size: clamp(1.2rem, 5.7vw, 1.52rem);
  line-height: 1.25;
}
.coupon-burst-card[data-prize-frame="boss"] {
  border-width: 3px;
  box-shadow: inset 0 0 0 4px var(--prize-paper), inset 0 0 0 6px var(--prize-inset),
    0 16px 42px #210f37c7, 0 0 62px #ffd482b5;
}
.coupon-ticket[data-prize-frame]:not(.is-stale) {
  border: 1px solid var(--prize-rim);
  background: var(--prize-paper);
  box-shadow: inset 0 3px 0 var(--prize-inset), 0 .45rem 1.5rem #130f1d48;
}
.coupon-ticket[data-prize-frame="special"]:not(.is-stale),
.coupon-ticket[data-prize-frame="boss"]:not(.is-stale) {
  box-shadow: inset 0 3px 0 var(--prize-inset), inset 0 6px 0 var(--prize-paper),
    inset 0 7px 0 var(--prize-rim), 0 .45rem 1.5rem #130f1d48;
}
.coupon-ticket[data-prize-frame]:not(.is-stale) .coupon-stub { border-top-color: var(--prize-inset); }
.coupon-ticket[data-prize-frame] .coupon-ticket-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(4.3rem, 25vw, 7.1rem);
  grid-template-rows: 1fr auto 1fr;
  min-height: 8.5rem;
  padding: .4rem .9rem .6rem 1.2rem;
}
.coupon-ticket[data-prize-frame] .coupon-store {
  grid-area: 1 / 1;
  align-self: end;
}
#coupon-main .coupon-ticket[data-prize-frame] .coupon-ticket-body h2 {
  grid-area: 2 / 1;
  font-size: clamp(1.25rem, 6vw, 1.85rem);
  letter-spacing: -.035em;
}
.coupon-ticket-art {
  grid-area: 1 / 2 / 4;
  display: grid;
  place-items: center;
  min-width: 0;
  background: radial-gradient(ellipse, var(--prize-halo), transparent 73%);
}
.coupon-ticket-art .coupon-figure {
  position: static;
  z-index: auto;
  width: 100%;
  height: 7.2rem;
  filter: drop-shadow(0 5px 5px #80583023);
}
.coupon-ticket.is-stale .coupon-ticket-art { background: none; }

@media (prefers-reduced-motion: reduce) {
  .coupon-burst-card[data-prize-frame] { animation: none; }
}
