/* ==========================================================================
   摇出好运 · 卖家幸运签 — 主样式
   设计变量见 css/tokens.css（由视觉同学维护）。此处每个变量都带 fallback，
   即使 tokens.css 缺失也不会崩版。
   ========================================================================== */

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif);
  color: var(--c-ink, #24314C);
  background: var(--c-cream, #FBE5DC);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
}

img { max-width: 100%; display: block; border: 0; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
em { font-style: normal; }
[hidden] { display: none !important; }

/* ---------- 应用容器 ---------- */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

/* ---------- 背景装饰（喜庆暖红 + 金） ---------- */
.bg-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(199, 68, 60, .09) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 0 0;
  opacity: .9;
}

.bg-blob {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .75;
}
.bg-blob--a {
  width: 300px; height: 300px;
  top: -130px; right: -110px;
  background: radial-gradient(circle at 35% 35%, #FFB3A0, #FFE0D4 65%, transparent 72%);
}
.bg-blob--b {
  width: 340px; height: 340px;
  bottom: -170px; left: -130px;
  background: radial-gradient(circle at 60% 40%, #FFB9AC, #FFDCD2 65%, transparent 72%);
}

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.bg-layer .deco {
  position: absolute;
  opacity: .85;
  will-change: transform;
  animation: decoFloat var(--dur, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes decoFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)); }
  50%      { transform: translate3d(0, -14px, 0) rotate(calc(var(--rot, 0deg) + 6deg)); }
}

/* ---------- 屏幕切换 ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 22px
           calc(env(safe-area-inset-bottom, 0px) + 18px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.985);
  transition: opacity .36s ease, transform .36s cubic-bezier(.22, .8, .3, 1), visibility .36s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.screen::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 通用文字 ---------- */
.screen-title {
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: .5px;
}
.screen-title em,
.event-title em,
.draw-hint em {
  position: relative;
  display: inline-block;
  color: var(--c-pink, #2F6BFF);
}
.screen-title em::after,
.event-title em::after,
.draw-hint em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: .08em;
  height: .34em;
  border-radius: 99px;
  background: rgba(255, 90, 70, .30);
  z-index: -1;
}
.screen-sub {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--c-gray, #6B7B93);
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-pill, 999px);
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: .4px;
  background: #fff;
  color: var(--c-ink, #24314C);
  box-shadow: 0 5px 0 var(--c-ink, #24314C), 0 12px 22px -12px rgba(27, 45, 90, .5);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--c-ink, #24314C), 0 6px 14px -12px rgba(27, 45, 90, .6);
}
.btn:focus-visible {
  outline: 3px solid var(--c-blue, #9BC1FF);
  outline-offset: 3px;
}
.btn[disabled],
.btn.is-disabled {
  filter: saturate(.5) brightness(1.02);
  opacity: .75;
  pointer-events: none;
}

.btn--primary {
  background: linear-gradient(180deg, #5B8CFF 0%, var(--c-pink, #2F6BFF) 55%, #1F4FE0 100%);
  color: #fff;
  text-shadow: 0 1.5px 0 rgba(14, 34, 90, .35);
}
.btn--ghost { background: #fff; }
.btn--xl {
  min-height: 60px;
  font-size: 19px;
  padding: 14px 30px;
}
.btn--block { display: flex; width: 100%; }
.btn-ico { flex: 0 0 auto; }
.btn-label { display: inline-block; }

.btn--shake { animation: btnBreathe 2.4s ease-in-out infinite; }
@keyframes btnBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}
.btn--shake:active { animation: none; }

/* ---------- 1. 欢迎页 ---------- */
.screen--welcome { justify-content: space-between; text-align: center; }
.business-card { width: 100%; flex-shrink: 0; padding: 14px; margin: 10px 0; border: 2px solid var(--c-ink, #24314C); border-radius: 18px; background: #fff; font-size: 13px; line-height: 1.65; text-align: left; }
.business-card p { margin: 8px 0; }
.business-card img { display: block; width: 150px; height: 150px; object-fit: contain; margin: 10px auto; }
.business-card [hidden] { display: none; }
.wecom-confirm { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.wecom-confirm input { width: 20px; height: 20px; accent-color: #2F6BFF; flex-shrink: 0; }

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-self: center;
  padding: 7px 15px 7px 9px;
  border-radius: var(--r-pill, 999px);
  background: rgba(255, 255, 255, .78);
  border: 2px solid rgba(27, 45, 90, .14);
  backdrop-filter: blur(6px);
}
.brand-logo img { border-radius: 50%; }
.brand-name { font-size: 14px; font-weight: 900; letter-spacing: .5px; }
.brand-slogan {
  font-size: 11px;
  color: var(--c-gray, #6B7B93);
  padding-left: 8px;
  border-left: 1.5px solid rgba(27, 45, 90, .18);
}

/* 注意：欢迎页 IP 主形象（#ipStage / #ipFigure / #welcomeMascot / .ip-halo /
   .ip-floor / #ipOrbit / #ipBlink / #ipCheer）的布局与动画由 css/fx3d.css 负责，
   这里不再写 .welcome-hero / .mascot 规则，避免双写冲突。 */

.welcome-copy { padding: 4px 0 0; }
.event-title {
  font-size: clamp(30px, 9.2vw, 40px);
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: 1px;
}
.event-subtitle {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #47597A;
  letter-spacing: .2px;
}
.booth-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--c-ink, #24314C);
  background: #fff;
  border: 2px dashed rgba(27, 45, 90, .35);
  border-radius: 999px;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 0 4px;
}
.welcome-actions .btn { width: min(100%, 340px); }
.rule-tip { font-size: 12.5px; color: var(--c-gray, #6B7B93); }

.site-foot {
  padding-top: 14px;
  font-size: 11px;
  color: rgba(140, 123, 107, .85);
  text-align: center;
}

/* ---------- 2. 登记页 ---------- */
.screen--register { justify-content: flex-start; }
.register-head { padding: 6px 2px 16px; text-align: left; }

.form-card {
  position: relative;
  background: #fff;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  border-radius: var(--r-lg, 26px);
  padding: 18px 16px 16px;
  box-shadow: 0 7px 0 rgba(27, 45, 90, .9), 0 18px 30px -18px rgba(27, 45, 90, .55);
}

.field { display: block; margin-bottom: 13px; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--c-ink, #24314C);
}
.req { color: #FF6B81; font-style: normal; }
.opt {
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--c-gray, #6B7B93);
  background: rgba(27, 45, 90, .08);
  border-radius: 99px;
  font-style: normal;
}
.field-box {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 13px;
  background: #FBFCFF;
  border: 2px solid rgba(27, 45, 90, .22);
  border-radius: var(--r-md, 16px);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-box:focus-within {
  border-color: var(--c-pink, #2F6BFF);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, .16);
}
.field-box input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  font-weight: 600;
}
.field-box input::placeholder {
  font-size: 13.5px;
  font-weight: 500;
  color: #A9B6C9;
}
.field-prefix {
  margin-right: 9px;
  padding-right: 9px;
  font-size: 14px;
  font-weight: 800;
  color: var(--c-gray, #6B7B93);
  border-right: 1.5px solid rgba(27, 45, 90, .16);
}
.is-invalid .field-box {
  border-color: #FF6B81;
  background: #FFF5F6;
  animation: fieldNudge .3s ease;
}
@keyframes fieldNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 12px;
  padding: 10px 11px;
  background: rgba(255, 201, 77, .16);
  border-radius: 14px;
  cursor: pointer;
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-box {
  position: relative;
  flex: 0 0 auto;
  width: 21px; height: 21px;
  margin-top: 1px;
  background: #fff;
  border: 2px solid rgba(27, 45, 90, .55);
  border-radius: 7px;
  transition: background .16s, border-color .16s;
}
.consent input:checked + .consent-box {
  background: var(--c-mint, #7ED9C3);
  border-color: var(--c-ink, #24314C);
}
.consent input:checked + .consent-box::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 7px; height: 12px;
  border: solid var(--c-ink, #24314C);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}
.consent input:focus-visible + .consent-box { outline: 3px solid var(--c-blue, #9BC1FF); outline-offset: 2px; }
.consent-text { font-size: 12px; line-height: 1.5; color: #47597A; }

.form-error {
  min-height: 0;
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #E5484D;
}
.form-error:empty { display: none; }

.privacy-note {
  margin-top: 14px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(140, 123, 107, .9);
  text-align: center;
}

/* ---------- 3. 抽签页 ---------- */
.screen--draw { justify-content: space-between; text-align: center; }

.draw-head { padding-top: 8px; }
.draw-hi {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--c-ink, #24314C);
  background: rgba(126, 217, 195, .35);
  border-radius: 999px;
}
.draw-hint {
  font-size: clamp(23px, 6.6vw, 28px);
  line-height: 1.34;
  font-weight: 900;
  letter-spacing: .5px;
}

.tube-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 250px;
  margin: 4px 0;
}
.tube-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tube-stage .tube-shadow {
  position: static;
  width: 152px;
  height: 24px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgba(27, 45, 90, .17);
  filter: blur(7px);
  animation: shadowPulse 3s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: scale(1); opacity: .75; }
  50%      { transform: scale(.9); opacity: .55; }
}
.tube-ring {
  position: absolute;
  width: 250px; height: 250px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 201, 77, .75);
  animation: ringSpin 22s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

.tube-wrap {
  position: relative;
  transform-origin: 50% 92%;
  will-change: transform;
}
.tube-img {
  width: clamp(180px, 55vw, 248px);
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(27, 45, 90, .2));
}
.tube-wrap.is-shaking { animation: tubeShake .62s ease-in-out infinite; }
@keyframes tubeShake {
  0%   { transform: rotate(0deg) translateY(0); }
  12%  { transform: rotate(-8deg) translateY(-9px); }
  26%  { transform: rotate(7deg) translateY(-1px); }
  40%  { transform: rotate(-6deg) translateY(-7px); }
  54%  { transform: rotate(5deg) translateY(-1px); }
  68%  { transform: rotate(-4deg) translateY(-5px); }
  82%  { transform: rotate(3deg) translateY(0); }
  100% { transform: rotate(0deg) translateY(0); }
}
.tube-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .8), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.tube-wrap.is-shaking .tube-shine { opacity: 1; animation: shineFlash .4s ease-in-out infinite alternate; }
@keyframes shineFlash { from { opacity: .35; } to { opacity: .9; } }

.tube-sparkles { position: absolute; inset: 0; pointer-events: none; }
.tube-sparkles i {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--c-yellow, #FFC94D);
  border-radius: 2px;
  opacity: 0;
  transform: rotate(20deg);
}
.tube-sparkles i:nth-child(1) { top: 16%; left: 18%; animation-delay: 0s; }
.tube-sparkles i:nth-child(2) { top: 26%; right: 14%; background: var(--c-pink, #2F6BFF); animation-delay: .7s; }
.tube-sparkles i:nth-child(3) { bottom: 22%; left: 12%; background: var(--c-mint, #7ED9C3); animation-delay: 1.4s; }
.tube-sparkles i:nth-child(4) { bottom: 16%; right: 20%; animation-delay: 2.1s; }
.tube-sparkles i { animation: sparkleIdle 3.2s ease-in-out infinite; }
.tube-stage.is-shaking .tube-sparkles i { animation: sparklePop .7s ease-in-out infinite; }
@keyframes sparkleIdle {
  0%, 100% { opacity: .18; transform: scale(.7) rotate(20deg); }
  50%      { opacity: .95; transform: scale(1) rotate(40deg); }
}
@keyframes sparklePop {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(20deg); }
  50%      { opacity: 1; transform: scale(1.15) rotate(40deg); }
}

.draw-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 2px;
}
.draw-actions .btn { width: min(100%, 330px); }
.shake-tip { font-size: 12.5px; color: var(--c-gray, #6B7B93); }
.draw-counter {
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-gray, #6B7B93);
  background: rgba(255, 255, 255, .8);
  border-radius: 999px;
}
.draw-counter.is-empty { color: #E5484D; background: rgba(255, 107, 129, .12); }

/* ---------- 4. 结果页 ---------- */
.screen--result { justify-content: space-between; }

.result-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  padding: 6px 0;
  perspective: 1200px;
}

.result-card {
  --lv: #7ED9C3;
  --lv-soft: #DCF6F2;
  position: relative;
  width: min(100%, 320px);
  padding: 26px 18px 16px;
  text-align: center;
  background: #fff;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  border-radius: var(--r-xl, 30px);
  box-shadow: 0 8px 0 rgba(27, 45, 90, .9), 0 24px 40px -20px rgba(27, 45, 90, .55);
  background-image: radial-gradient(circle at 50% 0%, var(--lv-soft) 0%, transparent 58%);
}
.result-card[data-level="legend"] { --lv: #2F6BFF; --lv-soft: #E6EEFF; }
.result-card[data-level="epic"]   { --lv: #7FB8F5; --lv-soft: #E1EDFF; }
.result-card[data-level="rare"]   { --lv: #FFB35C; --lv-soft: #FFEBD4; }
.result-card[data-level="good"]   { --lv: #7ED9C3; --lv-soft: #DCF6F2; }
.result-card[data-level="common"] { --lv: #FF9F7A; --lv-soft: #FFE3E9; }

.result-card.is-flip-in { animation: cardFlipIn .78s cubic-bezier(.2, .9, .25, 1.05) both; }
@keyframes cardFlipIn {
  0%   { opacity: 0; transform: rotateY(78deg) scale(.86); }
  55%  { opacity: 1; transform: rotateY(-8deg) scale(1.02); }
  100% { opacity: 1; transform: rotateY(0) scale(1); }
}

.card-ribbon {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 84px;
  padding: 6px 18px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  background: var(--lv);
  border: 2.5px solid var(--c-ink, #24314C);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(27, 45, 90, .9);
  text-shadow: 0 1px 0 rgba(14, 34, 90, .28);
}
.card-ribbon::before,
.card-ribbon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  background: var(--lv);
  border: 2.5px solid var(--c-ink, #24314C);
  transform: rotate(45deg);
  z-index: -1;
}
.card-ribbon::before { left: -9px; }
.card-ribbon::after  { right: -9px; }

.card-stick {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 194px;
  margin: 6px 0 4px;
}
.card-stick img {
  width: auto;
  max-width: 168px;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(27, 45, 90, .16));
  animation: stickPop .6s cubic-bezier(.2, 1.4, .4, 1) both .18s;
}
@keyframes stickPop {
  0% { opacity: 0; transform: translateY(18px) scale(.8) rotate(-6deg); }
  100% { opacity: 1; transform: none; }
}
.card-name {
  margin: 2px 0 6px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
}

.card-prize {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 13px 0;
  padding: 12px 10px;
  background: var(--lv-soft);
  border: 2px dashed rgba(27, 45, 90, .28);
  border-radius: var(--r-md, 16px);
}
.prize-label { font-size: 11px; font-weight: 700; color: var(--c-gray, #6B7B93); letter-spacing: 2px; }
.prize-name { font-size: 19px; font-weight: 900; letter-spacing: .5px; }
.prize-desc { font-size: 11px; color: #5A6B85; }

.card-code-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 2px;
}
.code-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--c-gray, #6B7B93);
}
.card-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--c-ink, #24314C);
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 2px rgba(27, 45, 90, .14);
  user-select: text;
  -webkit-user-select: text;
}
.card-code:active { background: rgba(255, 201, 77, .3); }
.card-code-hint { font-size: 10.5px; color: rgba(140, 123, 107, .95); }

.card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
  padding-top: 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--c-gray, #6B7B93);
  border-top: 1.5px dashed rgba(27, 45, 90, .18);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}
.result-actions .btn--primary { min-height: 54px; font-size: 17px; }

/* ---------- 5. 兑奖说明页 ---------- */
.screen--redeem { justify-content: flex-start; gap: 16px; }
.redeem-card {
  flex-shrink: 0;
  background: #fff;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  border-radius: var(--r-lg, 26px);
  padding: 20px 17px;
  box-shadow: 0 7px 0 rgba(27, 45, 90, .9), 0 18px 30px -18px rgba(27, 45, 90, .5);
}
.redeem-head { text-align: center; }
.redeem-kicker {
  display: inline-block;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--c-gray, #6B7B93);
  background: rgba(255, 201, 77, .3);
  border-radius: 999px;
}
.redeem-prize { margin: 10px 0 6px; font-size: 25px; font-weight: 900; letter-spacing: 1px; }
.redeem-desc { font-size: 12.5px; color: var(--c-gray, #6B7B93); line-height: 1.6; }

.redeem-code-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 16px 0 6px;
  padding: 13px 10px;
  background: linear-gradient(180deg, rgba(126, 217, 195, .18), rgba(255, 201, 77, .18));
  border: 2px dashed rgba(27, 45, 90, .3);
  border-radius: 18px;
}
.redeem-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 4px;
  user-select: text;
  -webkit-user-select: text;
}
.redeem-steps { margin: 16px 0 8px; counter-reset: step; }
.redeem-steps li {
  position: relative;
  padding: 0 0 11px 30px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #47597A;
}
.redeem-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px; height: 20px;
  font-size: 11px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  color: var(--c-ink, #24314C);
  background: var(--c-yellow, #FFC94D);
  border: 1.5px solid var(--c-ink, #24314C);
  border-radius: 50%;
}
.redeem-tip {
  padding: 9px 12px;
  font-size: 11.5px;
  color: #8A6A2F;
  background: rgba(255, 201, 77, .22);
  border-radius: 12px;
  text-align: center;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 70;
  max-width: 76vw;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: rgba(60, 45, 34, .94);
  border-radius: 999px;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translate(-50%, 12px) scale(.94);
  transition: opacity .24s, transform .24s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* 页面底部有主按钮时，toast 上移，避免遮挡 */
.toast.is-lifted { bottom: calc(env(safe-area-inset-bottom, 0px) + 210px); }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(56, 42, 32, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s, visibility .24s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-panel {
  width: min(100%, 320px);
  padding: 20px 18px;
  background: #fff;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  border-radius: var(--r-lg, 24px);
  box-shadow: 0 8px 0 rgba(27, 45, 90, .9);
  transform: scale(.94);
  transition: transform .24s;
}
.modal.is-open .modal-panel { transform: scale(1); }
.modal-title { font-size: 17px; font-weight: 900; margin-bottom: 8px; }
.modal-body { font-size: 13px; line-height: 1.68; color: #47597A; }
.modal-actions { margin-top: 16px; }

/* ---------- confetti ---------- */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}
.confetti .piece {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 13px;
  border-radius: 2.5px;
  opacity: 0;
  animation-name: confettiFall;
  animation-timing-function: cubic-bezier(.32, .08, .6, 1);
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}
@keyframes confettiFall {
  0%   { opacity: 0; transform: translate3d(0, -10vh, 0) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: .95; transform: translate3d(var(--drift, 0px), 112vh, 0) rotate(var(--spin, 540deg)); }
}

/* ---------- noscript ---------- */
.noscript {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: var(--c-cream, #FBE5DC);
}

/* ---------- 小屏微调 ---------- */
@media (max-height: 700px) {
  .event-title { font-size: clamp(26px, 8.4vw, 34px); }
  .card-stick { height: 162px; }
  .tube-img { width: clamp(158px, 46vw, 206px); }
  .tube-stage { min-height: 208px; }
  .screen-title { font-size: 23px; }
  .result-card { padding-top: 22px; }
  /* 登记表单压缩，保证 667 高度下提交按钮不被顶出屏幕 */
  .screen--register { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .register-head { padding-bottom: 10px; }
  .register-head .screen-sub { margin-top: 6px; font-size: 12.5px; }
  .form-card { padding: 14px 13px 12px; border-radius: 22px; }
  .field { margin-bottom: 9px; }
  .field-label { margin-bottom: 4px; font-size: 12px; }
  .field-box { min-height: 45px; }
  .field-box input { height: 41px; font-size: 15.5px; }
  .consent { margin: 2px 0 9px; padding: 8px 9px; }
  .consent-text { font-size: 11.5px; line-height: 1.45; }
  .privacy-note { margin-top: 9px; font-size: 10.5px; }
}
@media (max-height: 680px) {
  /* 640/667 档：结果卡整体再压一档，保证「保存兑奖卡 / 怎么领奖」两个按钮都在首屏 */
  .result-card { padding: 20px 14px 12px; }
  .card-ribbon { top: -13px; font-size: 13px; padding: 4px 14px; }
  .card-stick { height: 148px; margin: 2px 0 2px; }
  .card-name { font-size: 21px; margin: 2px 0 4px; }
  .card-prize { margin: 10px 0; padding: 9px 8px; gap: 2px; }
  .prize-label { font-size: 10px; }
  .prize-name { font-size: 17px; }
  .prize-desc { font-size: 10.5px; }
  .card-code { font-size: 23px; letter-spacing: 2px; }
  .card-code-hint, .code-label { font-size: 10px; }
  .card-brand { margin-top: 9px; padding-top: 7px; }
  .result-actions { gap: 8px; padding-top: 6px; }
  .result-actions .btn--primary { min-height: 48px; font-size: 16px; }
  .screen--redeem { gap: 12px; }
  .redeem-card { padding: 16px 15px; }
  .redeem-prize { font-size: 22px; }
  .redeem-code { font-size: 26px; }
  .redeem-steps li { font-size: 12px; padding-bottom: 9px; }
  .draw-hint { font-size: 21px; }
  .draw-actions .btn { min-height: 50px; font-size: 16.5px; }
}
@media (max-height: 620px) {
  .booth-tag { margin-top: 8px; }
  .site-foot { padding-top: 6px; }
  .result-card { padding: 20px 15px 12px; }
  .card-ribbon { font-size: 13.5px; padding: 5px 15px; }
  .card-stick { height: 138px; margin: 2px 0; }
  .card-name { font-size: 21px; margin-bottom: 4px; }
  .card-prize { margin: 9px 0; padding: 9px 8px; }
  .prize-name { font-size: 17px; }
  .card-code { font-size: 23px; }
  .card-brand { margin-top: 9px; padding-top: 7px; }
  .result-actions .btn--primary { min-height: 48px; font-size: 16px; }
}
@media (min-width: 520px) {
  .screen { padding-left: max(22px, calc((100vw - 460px) / 2)); padding-right: max(22px, calc((100vw - 460px) / 2)); }
}

/* ==========================================================================
   兼容别名层（与 game-dev 的 app.js 类名对齐；两套名字都生效，随便用）
   ========================================================================== */

/* 结果卡：is-reveal == is-flip-in */
.result-card.is-reveal { animation: cardFlipIn .78s cubic-bezier(.2, .9, .25, 1.05) both; }
/* 允许 app.js 用内联 --prize-color / --prize-soft 覆盖签配色 */
.result-card {
  --lv: var(--prize-color, #7ED9C3);
  --lv-soft: var(--prize-soft, #DCF6F2);
}

/* 签筒发光 */
.tube-shine.is-on { opacity: 1; }

/* 按钮忙碌态 */
.btn.is-busy { filter: saturate(.6); cursor: progress; }
.btn.is-busy .btn-label::after { content: "…"; }

/* 表单错误激活 */
.form-error.is-error { font-weight: 800; }

/* 纸屑：.piece 与 i.confetti-piece 两套类名共用同一套动画 */
.confetti i.confetti-piece,
.confetti .piece {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 13px;
  border-radius: 2.5px;
  opacity: 0;
  animation-name: confettiFall, confetti-fall;
  animation-timing-function: cubic-bezier(.32, .08, .6, 1), cubic-bezier(.32, .08, .6, 1);
  animation-fill-mode: forwards, forwards;
  will-change: transform, opacity;
}
@keyframes confetti-fall {
  0%   { opacity: 0; transform: translate3d(0, -10vh, 0) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: .95; transform: translate3d(var(--drift, 0px), 112vh, 0) rotate(var(--spin, 540deg)); }
}

/* 背景装饰：.deco 与 img.bg-deco 两套类名 + 两种 keyframes 名 */
.bg-layer img.bg-deco {
  position: absolute;
  opacity: .85;
  pointer-events: none;
  will-change: transform;
  animation: decoFloat var(--dur, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes float-drift {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)) scale(var(--scale, 1)); }
  100% { transform: translate3d(var(--dx, 10px), var(--dy, -18px), 0) rotate(calc(var(--rot, 0deg) + 8deg)) scale(var(--scale, 1)); }
}
.bg-layer img.bg-deco { animation-name: decoFloat, float-drift; animation-direction: normal, alternate; }
.bg-layer img.bg-deco--plane { animation-timing-function: ease-in-out, linear; }

/* 弹窗内容（game-dev 用 .modal-card / .modal-tip / .modal-close / .modal-img） */
.modal-card {
  width: min(100%, 330px);
  padding: 20px 18px;
  text-align: center;
  background: #fff;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  border-radius: var(--r-lg, 24px);
  box-shadow: 0 8px 0 rgba(27, 45, 90, .9);
  transform: scale(.94);
  transition: transform .24s;
}
.modal.is-open .modal-card { transform: scale(1); }
.modal-img { width: 96px; height: auto; margin: 0 auto 10px; }
.modal-tip { margin-top: 10px; font-size: 13px; line-height: 1.6; color: #47597A; }
.modal-close {
  margin-top: 16px;
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  border: var(--bw, 2.5px) solid var(--c-ink, #24314C);
  background: var(--c-yellow, #FFC94D);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 0 rgba(27, 45, 90, .9);
}
.modal-close:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(27, 45, 90, .9); }

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg-layer .deco { display: none; }
}
