:root {
  --ink: #242226;
  --muted: #706a73;
  --line: #e7dfe4;
  --paper: #fffafa;
  --soft: #f7eef2;
  --rose: #c93d62;
  --rose-dark: #8e2945;
  --gold: #d7952b;
  --mint: #11836f;
  --blue: #3565a8;
  --shadow: 0 18px 45px rgba(81, 45, 58, .14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: linear-gradient(180deg, #fff8fb 0%, #f3f7fb 55%, #ffffff 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .65; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 250, 250, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--rose);
  font-size: 23px;
  font-weight: 800;
}
.brand strong, .brand span { display: block; }
.brand span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tabs { display: flex; gap: 8px; }
.tab, .admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
.tab.is-active, .admin-link.is-active {
  color: white;
  background: var(--ink);
}

main { padding: 28px; }
.view, .admin-page { display: none; }
.view.is-active, .admin-page.is-active { display: block; }
.campaign-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  min-height: 320px;
  padding: 42px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(115deg, rgba(142, 41, 69, .96), rgba(201, 61, 98, .9)),
    url("https://images.unsplash.com/photo-1511285560929-80b456fea0bc?auto=format&fit=crop&w=1400&q=80") center/cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.campaign-copy h1 {
  max-width: 720px;
  margin: 8px 0 14px;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1.03;
}
.campaign-copy p { max-width: 680px; line-height: 1.8; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.inline-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.primary, .secondary, .ghost, .icon-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
}
.primary { color: white; background: var(--rose); }
.secondary { color: white; background: var(--mint); }
.ghost { color: var(--ink); background: white; border: 1px solid var(--line); }
.full { width: 100%; }
.icon-btn { min-width: 42px; padding: 0; background: var(--soft); color: var(--rose-dark); }
.phone-panel { display: flex; align-items: center; justify-content: center; }
.wechat-card {
  width: 100%;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border-radius: 8px;
}
.wechat-card span { color: var(--muted); }
.wechat-card strong { display: block; margin: 12px 0; font-size: 34px; color: var(--rose-dark); }

.user-grid, .workbench, .admin-layout {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}
.user-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.workbench { grid-template-columns: 320px minmax(0, 1fr); }
.admin-layout { grid-template-columns: 220px minmax(0, 1fr); }
.panel, .lottery-area, .login-panel, .merchant-content, .admin-main, .admin-nav {
  padding: 24px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.side-stack { display: grid; gap: 18px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-title h1, .section-title h2 { margin: 0; }
.compact { margin-bottom: 12px; }
.chance-pill, .status {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--rose-dark);
}
.wheel-wrap {
  position: relative;
  display: grid;
  width: min(72vw, 520px);
  aspect-ratio: 1;
  margin: 16px auto;
  place-items: center;
}
.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 12px solid #fff;
  border-radius: 50%;
  background: conic-gradient(#fae3eb 0 40deg, #fff6d9 40deg 80deg, #e1f4ef 80deg 120deg, #fde8dc 120deg 160deg, #eaf0ff 160deg 200deg, #fbe4f2 200deg 240deg, #e8f5de 240deg 280deg, #ffeec2 280deg 320deg, #f1edf9 320deg 360deg);
  box-shadow: inset 0 0 0 1px var(--line), 0 22px 50px rgba(71, 31, 46, .2);
  overflow: hidden;
}
.wheel-light-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background: conic-gradient(from -10deg, transparent 0 24deg, rgba(255, 255, 255, .5) 25deg 35deg, transparent 36deg 360deg);
  mix-blend-mode: screen;
  opacity: .72;
  pointer-events: none;
  transition: transform 6.2s cubic-bezier(.08, .86, .12, 1);
}
.wheel-labels {
  position: absolute;
  inset: 18px;
  z-index: 2;
  border-radius: 50%;
}
.wheel-labels span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  margin-left: -43px;
  transform-origin: 43px 0;
  color: rgba(36, 34, 38, .78);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}
.wheel-labels span:nth-child(1) { transform: rotate(20deg) translateY(-210px) rotate(-20deg); }
.wheel-labels span:nth-child(2) { transform: rotate(60deg) translateY(-210px) rotate(-60deg); }
.wheel-labels span:nth-child(3) { transform: rotate(100deg) translateY(-210px) rotate(-100deg); }
.wheel-labels span:nth-child(4) { transform: rotate(140deg) translateY(-210px) rotate(-140deg); }
.wheel-labels span:nth-child(5) { transform: rotate(180deg) translateY(-210px) rotate(-180deg); }
.wheel-labels span:nth-child(6) { transform: rotate(220deg) translateY(-210px) rotate(-220deg); }
.wheel-labels span:nth-child(7) { transform: rotate(260deg) translateY(-210px) rotate(-260deg); }
.wheel-labels span:nth-child(8) { transform: rotate(300deg) translateY(-210px) rotate(-300deg); }
.wheel-labels span:nth-child(9) { transform: rotate(340deg) translateY(-210px) rotate(-340deg); }
.wheel::after {
  content: "";
  position: absolute;
  inset: 36%;
  z-index: 3;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.pointer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  transition: transform 6.2s cubic-bezier(.08, .86, .12, 1);
}
.pointer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 10px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3ad, #ffb32f 44%, #d71928);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .38), 0 8px 18px rgba(128, 0, 0, .22);
  transform: translateX(-50%);
}
.pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7%;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 34px solid #d71928;
  filter: drop-shadow(0 4px 4px rgba(104, 0, 0, .28));
  transform: translateX(-50%);
}
.spin-btn {
  position: absolute;
  z-index: 4;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  color: white;
  background: var(--rose);
  box-shadow: 0 10px 28px rgba(201, 61, 98, .32);
  font-size: 22px;
  font-weight: 900;
}
.result-text { text-align: center; color: var(--muted); }
.info-list { margin: 0; }
.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 700; }
.form-row, .verify-box { display: flex; gap: 10px; margin-top: 16px; }
input, select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.coupon-list { display: grid; gap: 10px; }
.coupon {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--rose);
  border-radius: 8px;
  background: #fff;
}
.coupon strong { display: block; margin-bottom: 6px; }
.coupon span { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.coupon-qr {
  display: block;
  width: 148px;
  height: 148px;
  margin: 10px auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.login-panel label { display: block; margin: 14px 0 7px; color: var(--muted); }
.login-panel .ghost, .admin-login .ghost { margin-top: 10px; }
.hint { color: var(--muted); line-height: 1.7; font-size: 13px; }
.is-hidden { display: none !important; }
.login-screen {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
}
.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 18px; }
.login-card label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
}
.ticket-preview {
  min-height: 118px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
  line-height: 1.8;
}
.scanner-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}
.scanner-box video {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}
.scanner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: #fff;
}

.merchant-h5-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 226, 146, .7), transparent 30%),
    linear-gradient(180deg, #d9163b 0%, #f44768 42%, #fff5ed 100%);
}
.merchant-h5-page main { padding: 0; }
.merchant-h5-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  color: #3a111b;
}
.merchant-login-screen {
  display: grid;
  min-height: 100vh;
  align-content: center;
  gap: 22px;
}
.merchant-login-hero {
  color: #fff;
  text-align: center;
}
.merchant-logo {
  display: inline-grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff6c8, #ffb12d);
  color: #bd102e;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(108, 16, 30, .26);
}
.merchant-login-hero p {
  margin: 14px 0 5px;
  font-size: 15px;
  font-weight: 700;
}
.merchant-login-hero h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}
.merchant-login-card, .merchant-status-card, .merchant-scan-panel, .merchant-manual-card,
.merchant-ticket-card, .merchant-list-section {
  border: 1px solid rgba(255, 214, 190, .78);
  border-radius: 8px;
  background: rgba(255, 252, 247, .96);
  box-shadow: 0 18px 38px rgba(126, 30, 44, .18);
}
.merchant-login-card {
  padding: 24px;
}
.merchant-login-card label {
  display: block;
  margin: 16px 0 8px;
  color: #8b4b50;
  font-size: 14px;
  font-weight: 700;
}
.merchant-login-card input, .merchant-code-row input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #f0c9bb;
  border-radius: 8px;
  background: #fff;
  color: #3a111b;
  outline: 0;
}
.merchant-login-card input {
  padding: 0 14px;
}
.merchant-primary-btn, .merchant-scan-btn, .merchant-section-title button, .merchant-code-row button {
  border-radius: 8px;
  color: white;
  font-weight: 900;
  background: linear-gradient(180deg, #ff4c64, #d91537);
  box-shadow: 0 12px 24px rgba(205, 18, 51, .24);
}
.merchant-primary-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  font-size: 17px;
}
.merchant-login-tip {
  margin: 14px 0 0;
  color: #936066;
  font-size: 13px;
  line-height: 1.7;
}
.merchant-app {
  display: grid;
  gap: 12px;
}
.merchant-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 4px;
  color: #fff;
}
.merchant-app-head h1 {
  margin: 2px 0 0;
  font-size: 24px;
}
.merchant-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  font-weight: 800;
}
.merchant-logout-btn {
  min-width: 64px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
}
.merchant-status-card {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
}
.merchant-status-card span {
  color: #d51638;
  font-size: 13px;
  font-weight: 900;
}
.merchant-status-card strong {
  font-size: 14px;
  line-height: 1.5;
}
.merchant-scan-panel, .merchant-manual-card, .merchant-ticket-card, .merchant-list-section {
  padding: 14px;
}
.merchant-scan-btn {
  display: grid;
  width: 100%;
  min-height: 112px;
  place-items: center;
  gap: 4px;
  font-size: 17px;
}
.merchant-scan-btn span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #d91537;
  background: #fff8cf;
}
.merchant-scan-btn span::before {
  content: "";
  width: 25px;
  height: 25px;
  border: 3px solid currentColor;
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px #fff8cf;
}
.merchant-manual-card p {
  margin: 0 0 10px;
  color: #8b4b50;
  font-weight: 800;
}
.merchant-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}
.merchant-code-row input {
  padding: 0 12px;
  font-size: 13px;
}
.merchant-code-row button {
  min-height: 50px;
}
.merchant-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.merchant-section-title h2 {
  margin: 0;
  font-size: 18px;
}
.merchant-section-title span {
  color: #936066;
  font-size: 13px;
}
.merchant-section-title button {
  min-height: 38px;
  padding: 0 14px;
}
.merchant-h5-page .ticket-preview {
  margin: 0;
  min-height: 120px;
  background: #fff7f2;
  color: #6b2934;
}
.ticket-mobile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ticket-mobile-title strong {
  font-size: 19px;
  color: #bf1735;
}
.ticket-mobile-title span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: #11836f;
  font-size: 12px;
}
.ticket-mobile-info {
  display: grid;
  gap: 8px;
  margin: 0;
}
.ticket-mobile-info div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}
.ticket-mobile-info dt {
  color: #936066;
}
.ticket-mobile-info dd {
  margin: 0;
  word-break: break-word;
}
.merchant-coupon-list {
  display: grid;
  gap: 10px;
}
.merchant-coupon-card {
  padding: 13px;
  border: 1px solid #f1d0c3;
  border-radius: 8px;
  background: #fffaf7;
}
.merchant-coupon-card div, .merchant-coupon-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.merchant-coupon-card strong {
  color: #c71939;
  font-size: 15px;
}
.merchant-coupon-card span, .merchant-coupon-card em {
  color: #936066;
  font-size: 12px;
  font-style: normal;
}
.merchant-coupon-card p {
  margin: 8px 0 10px;
  color: #5f3038;
}
.merchant-coupon-card mark {
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: #11836f;
  font-size: 12px;
}
.merchant-coupon-card mark.status-redeemed { background: #706a73; }
.merchant-coupon-card mark.status-expired, .merchant-coupon-card mark.status-cancelled { background: #8e2945; }
.merchant-empty {
  padding: 18px;
  border: 1px dashed #e8bdb0;
  border-radius: 8px;
  color: #936066;
  text-align: center;
  background: #fff8f3;
}
.merchant-h5-page .scanner-box {
  border-color: rgba(255, 255, 255, .16);
}
.merchant-h5-page .scanner-actions {
  align-items: stretch;
  flex-direction: column;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 680px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #fbf7f9; font-size: 13px; }
.admin-nav { align-self: start; display: grid; gap: 8px; }
.admin-login {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.admin-login label { color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric {
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}
.metric span { color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 30px; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 22px; }
.funnel { display: grid; gap: 10px; }
.funnel-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(201, 61, 98, .2), rgba(17, 131, 111, .14));
}
.risk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.risk-grid label span { display: block; margin-bottom: 7px; color: var(--muted); }
.editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfd;
}
.editor-grid input,
.editor-grid select,
.editor-grid button {
  min-width: 0;
}
.editor-grid #prizeInstructions {
  grid-column: span 3;
}
.merchant-editor {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.toast {
  position: fixed;
  left: 50%;
  top: max(18px, env(safe-area-inset-top));
  z-index: 90;
  width: min(92vw, 420px);
  padding: 13px 16px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: .2s;
  text-align: center;
  line-height: 1.55;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tiny { min-height: 32px; padding: 0 10px; font-size: 13px; }
.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}
.admin-prize-thumb {
  display: block;
  width: 52px;
  height: 40px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .topbar, .campaign-band, .user-grid, .workbench, .admin-layout, .split {
    grid-template-columns: 1fr;
  }
  .topbar { align-items: stretch; flex-direction: column; }
  .tabs { overflow-x: auto; }
  main { padding: 16px; }
  .campaign-band { padding: 26px; }
  .metric-grid, .risk-grid { grid-template-columns: 1fr 1fr; }
  .editor-grid, .merchant-editor { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .metric-grid, .risk-grid { grid-template-columns: 1fr; }
  .editor-grid, .merchant-editor { grid-template-columns: 1fr; }
  .editor-grid #prizeInstructions { grid-column: auto; }
  .brand span { display: none; }
  .form-row, .verify-box { flex-direction: column; }
  .wheel-wrap { width: 100%; }
  .wheel-labels span {
    width: 70px;
    margin-left: -35px;
    transform-origin: 35px 0;
    font-size: 12px;
  }
  .wheel-labels span:nth-child(1) { transform: rotate(20deg) translateY(-39vw) rotate(-20deg); }
  .wheel-labels span:nth-child(2) { transform: rotate(60deg) translateY(-39vw) rotate(-60deg); }
  .wheel-labels span:nth-child(3) { transform: rotate(100deg) translateY(-39vw) rotate(-100deg); }
  .wheel-labels span:nth-child(4) { transform: rotate(140deg) translateY(-39vw) rotate(-140deg); }
  .wheel-labels span:nth-child(5) { transform: rotate(180deg) translateY(-39vw) rotate(-180deg); }
  .wheel-labels span:nth-child(6) { transform: rotate(220deg) translateY(-39vw) rotate(-220deg); }
  .wheel-labels span:nth-child(7) { transform: rotate(260deg) translateY(-39vw) rotate(-260deg); }
  .wheel-labels span:nth-child(8) { transform: rotate(300deg) translateY(-39vw) rotate(-300deg); }
  .wheel-labels span:nth-child(9) { transform: rotate(340deg) translateY(-39vw) rotate(-340deg); }
}

/* Poster-style user activity page */
.lottery-page {
  min-height: 100vh;
  color: #7b130f;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 225, 229, .75) 0 7%, transparent 18%),
    radial-gradient(circle at 86% 16%, rgba(255, 188, 190, .55) 0 6%, transparent 18%),
    radial-gradient(circle at 18% 44%, rgba(255, 105, 122, .6) 0 9%, transparent 24%),
    linear-gradient(180deg, #d90b2e 0%, #f22a49 42%, #d3072c 100%);
  overflow-x: hidden;
}

.lottery-page::before,
.lottery-page::after {
  content: "❤";
  position: fixed;
  z-index: 0;
  color: rgba(255, 238, 217, .46);
  font-size: 120px;
  pointer-events: none;
}
.lottery-page::before { left: -28px; top: 180px; transform: rotate(-18deg); }
.lottery-page::after { right: -18px; top: 420px; transform: rotate(16deg); }

.poster-shell {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 18px 116px;
}

.poster-hero {
  position: relative;
  min-height: 250px;
  padding: 18px 96px 10px;
  text-align: center;
  color: #fff6d3;
}
.poster-brand {
  margin: 0;
  color: #fff9dd;
  font-size: clamp(26px, 6vw, 48px);
  font-weight: 900;
  text-shadow: 0 3px 0 #a70a18, 0 10px 26px rgba(83, 0, 14, .3);
}
.poster-hero h1 {
  margin: 2px 0 8px;
  color: #ffe8a3;
  font-size: clamp(44px, 10vw, 86px);
  line-height: 1.02;
  font-weight: 950;
  text-shadow:
    0 3px 0 #8e120b,
    0 6px 0 #f05a28,
    0 12px 26px rgba(80, 0, 0, .46);
}
.poster-subtitle {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 26px;
  border-radius: 999px;
  color: #c51122;
  background: linear-gradient(180deg, #fff7c9, #ffd76d);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 10px 22px rgba(101,0,10,.28);
  font-size: clamp(16px, 3vw, 24px);
  font-weight: 900;
}
.floating-badge {
  position: absolute;
  top: 22px;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  color: white;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 32% 25%, #fff 0 8%, #ff7d88 20%, #dc1534 68%);
  box-shadow: 0 12px 28px rgba(102, 0, 13, .28);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.05;
  transform: rotate(-9deg);
}
.floating-badge.left { left: 28px; }
.floating-badge.right { right: 28px; transform: rotate(9deg); }
.cupid {
  position: absolute;
  left: 26px;
  bottom: 14px;
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  border-radius: 50%;
  color: #e0102b;
  background: #fff1d6;
  box-shadow: 0 12px 28px rgba(102, 0, 13, .22);
  font-size: 44px;
}

.wheel-stage {
  position: relative;
  margin-top: -18px;
  padding: 8px 0 22px;
  text-align: center;
}
.poster-chance {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 10px;
  color: #9e1010;
  border: 2px solid #ffd47b;
  background: linear-gradient(180deg, #fff9df, #ffd883);
  box-shadow: 0 8px 20px rgba(92, 0, 10, .22);
}
.poster-wheel-wrap {
  width: min(86vw, 690px);
  margin-top: 0;
  filter: drop-shadow(0 26px 0 #991b18) drop-shadow(0 28px 30px rgba(87, 0, 0, .38));
}
.poster-wheel {
  border: 18px solid #f94a21;
  background:
    repeating-conic-gradient(from -20deg, #fff4dd 0 39deg, #ffead0 39deg 40deg),
    conic-gradient(#fff2d8 0 40deg, #ffe8c7 40deg 80deg, #fff2d8 80deg 120deg, #ffe8c7 120deg 160deg, #fff2d8 160deg 200deg, #ffe8c7 200deg 240deg, #fff2d8 240deg 280deg, #ffe8c7 280deg 320deg, #fff2d8 320deg 360deg);
  box-shadow:
    inset 0 0 0 3px #ffbe5a,
    inset 0 0 0 16px rgba(255, 199, 86, .55),
    0 0 0 10px #ffb13d,
    0 0 0 18px #bd2418,
    0 30px 55px rgba(92, 0, 0, .3);
}
.poster-wheel::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: repeating-conic-gradient(#fff7ba 0 4deg, transparent 4deg 13deg);
  mask: radial-gradient(circle, transparent 0 48%, #000 49% 52%, transparent 53%);
  pointer-events: none;
}
.poster-wheel::after {
  inset: 38%;
  background: radial-gradient(circle, #fff6c7 0 18%, rgba(255, 255, 255, .5) 19% 100%);
}
.poster-wheel .wheel-labels span {
  --angle: 0deg;
  --radius: 178px;
  width: 106px;
  min-height: 78px;
  margin-left: 0;
  transform-origin: center center;
  color: #a50f13;
  font-size: 16px;
  line-height: 1.2;
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--radius))) rotate(calc(-1 * var(--angle))) translate(-50%, -50%);
}
.wheel-prize {
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: center;
  padding: 6px 5px;
  border-radius: 12px;
  background: rgba(255, 248, 226, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
}
.wheel-prize img {
  display: block;
  width: 62px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(112, 31, 8, .16));
}
.wheel-prize em {
  font-style: normal;
  font-weight: 950;
  text-shadow: 0 1px 0 #fff5da;
}
.poster-spin {
  width: min(26vw, 162px);
  height: min(26vw, 162px);
  min-width: 112px;
  min-height: 112px;
  color: #fff6bd;
  border: 8px solid #ffbd48;
  background: radial-gradient(circle at 50% 24%, #ff6365, #cf071f 72%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 0 0 7px #d57213, 0 12px 24px rgba(106, 0, 0, .35);
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1.08;
}
.poster-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 20px auto 0;
  padding: 0 20px;
  border-radius: 999px;
  color: #a40f14;
  background: #fff1cf;
  font-weight: 800;
}
.poster-actions {
  justify-content: center;
  margin-top: 16px;
}
.poster-actions .primary,
.poster-actions .secondary,
.poster-actions .ghost,
.bottom-actions .primary,
.bottom-actions .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 28px;
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.42), 0 8px 18px rgba(104,0,12,.24);
}
.poster-actions .primary,
.bottom-actions .primary {
  color: #9d070f;
  background: linear-gradient(180deg, #fff7c1, #ffc044);
}
.poster-actions .secondary {
  background: linear-gradient(180deg, #45d775, #139f4b);
}
.poster-actions .ghost,
.bottom-actions .ghost {
  color: #fff6ce;
  background: #d30b29;
  border: 2px solid #fff1b9;
}

.poster-card {
  margin-top: 18px;
  padding: 18px;
  border: 4px solid #ff9368;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8eb, #ffe6cf);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 10px 22px rgba(95, 0, 10, .22);
}
.poster-card h2 {
  margin: -34px auto 16px;
  text-align: left;
}
.poster-card h2 span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 28px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #ff4b62, #d20725);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 7px 14px rgba(111,0,12,.24);
  font-size: 24px;
  font-weight: 950;
}
.step-grid,
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.step-grid article,
.benefit-grid article {
  position: relative;
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 12px;
  border: 2px solid #f3be91;
  border-radius: 12px;
  text-align: center;
  background: linear-gradient(180deg, #fffaf0, #ffe6ce);
}
.step-grid b {
  position: absolute;
  left: 10px;
  top: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #ef334a;
}
.step-grid strong,
.benefit-grid strong {
  font-size: 18px;
  line-height: 1.25;
}
.step-grid span,
.benefit-grid span {
  color: #c21720;
  font-weight: 800;
}
.benefit-grid article span {
  font-size: 58px;
  line-height: 1;
}
.qr-mini {
  width: 54px;
  height: 54px;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0/18px 18px,
    linear-gradient(#111 50%, transparent 0) 0 0/18px 18px,
    #fff;
  border: 6px solid #fff;
  box-shadow: 0 0 0 1px #ddd;
}
.poster-split {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 18px;
}
.ticket-card dl,
.identity-card dl {
  margin: 0;
}
.ticket-card dl div,
.identity-card .info-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #eec39d;
}
.ticket-card dt,
.identity-card dt {
  color: #7f3928;
}
.ticket-card dd,
.identity-card dd {
  color: #d90a24;
  font-weight: 900;
}
.invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.invite-card p { margin: 4px 0 0; }
.invite-card strong {
  flex: 0 0 auto;
  padding: 14px 28px;
  border-radius: 999px;
  color: #c20d19;
  background: linear-gradient(180deg, #fff9b8, #ffd447);
  font-size: 24px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 8px 18px rgba(95,0,10,.18);
}
.poster-coupons .coupon {
  border-color: #efb274;
  border-left-color: #e10825;
  background: #fffaf1;
}
.prize-page { padding-bottom: 0; }
.prize-shell {
  width: min(96vw, 760px);
  padding-bottom: 28px;
}
.prize-page-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 16px 0 12px;
  color: #fff;
}
.prize-page-head a,
.prize-page-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.prize-page-head div { text-align: center; }
.prize-page-head h1 {
  margin: 2px 0 0;
  color: #fff7bf;
  font-size: clamp(30px, 8vw, 46px);
  text-shadow: 0 4px 0 #9e1010, 0 9px 18px rgba(95, 0, 0, .35);
}
.prize-login-card,
.prize-list-card {
  margin-top: 14px;
  padding: 18px;
  border: 4px solid #ff9368;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7, #fff0d9);
  box-shadow: 0 12px 0 rgba(169, 31, 23, .22), 0 24px 34px rgba(91, 0, 0, .22);
}
.prize-login-card h2 {
  margin: 0 0 8px;
  color: #c80c25;
}
.prize-login-card p {
  margin: 0;
  color: #8a4b38;
  line-height: 1.7;
}
.prize-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.prize-list-title strong {
  color: #c80c25;
  font-size: 22px;
}
.prize-list-title span {
  color: #8a4b38;
  font-weight: 800;
}
.prize-coupon-list {
  display: grid;
  gap: 12px;
}
.prize-coupon {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #f3bd7e;
  border-radius: 14px;
  background: #fffaf1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.prize-coupon:focus {
  outline: 3px solid rgba(255, 194, 52, .9);
  outline-offset: 2px;
}
.prize-coupon img {
  width: 64px;
  height: 54px;
  object-fit: contain;
}
.prize-coupon strong {
  display: block;
  margin-bottom: 5px;
  color: #c80c25;
  font-size: 18px;
}
.prize-coupon span {
  display: block;
  color: #8a4b38;
  font-size: 13px;
  line-height: 1.55;
}
.prize-coupon mark {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: #11836f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.prize-coupon mark.status-redeemed { background: #706a73; }
.prize-coupon mark.status-expired,
.prize-coupon mark.status-cancelled { background: #8e2945; }
.prize-empty {
  margin: 0;
  padding: 24px 12px;
  border: 2px dashed #efb274;
  border-radius: 14px;
  color: #8a4b38;
  text-align: center;
  background: rgba(255, 250, 241, .75);
}
.coupon-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 18px;
}
.coupon-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(61, 0, 12, .58);
  backdrop-filter: blur(5px);
}
.coupon-modal-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 22px 18px 18px;
  border: 4px solid #ffca61;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7, #fff1dc);
  box-shadow: 0 24px 60px rgba(61, 0, 12, .42);
}
.coupon-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: #d20b2a;
  font-size: 24px;
  line-height: 1;
}
.coupon-modal-panel h2 {
  margin: 0 42px 16px 0;
  color: #c80c25;
}
.coupon-modal-prize {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #8a4b38;
  text-align: center;
}
.coupon-modal-prize img {
  width: 92px;
  height: 72px;
  object-fit: contain;
}
.coupon-modal-prize strong {
  color: #c80c25;
  font-size: 22px;
}
.coupon-modal-qr {
  display: block;
  width: 220px;
  height: 220px;
  margin: 18px auto;
  padding: 10px;
  border: 2px solid #f3bd7e;
  border-radius: 14px;
  background: #fff;
}
.coupon-modal-info {
  display: grid;
  gap: 9px;
  margin: 0;
}
.coupon-modal-info div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1d4bd;
}
.coupon-modal-info dt { color: #8a4b38; }
.coupon-modal-info dd {
  margin: 0;
  color: #bd102e;
  font-weight: 900;
  word-break: break-word;
}
.follow-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 18px;
}
.follow-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(61, 0, 12, .62);
  backdrop-filter: blur(5px);
}
.follow-modal-panel {
  position: relative;
  z-index: 1;
  width: min(410px, 100%);
  padding: 22px 18px 18px;
  border: 4px solid #ffca61;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7, #fff1dc);
  text-align: center;
  box-shadow: 0 24px 60px rgba(61, 0, 12, .42);
}
.follow-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: #d20b2a;
  font-size: 24px;
  line-height: 1;
}
.follow-modal-panel h2 {
  margin: 0 36px 10px;
  color: #c80c25;
}
.follow-modal-panel p {
  margin: 0 auto 14px;
  max-width: 300px;
  color: #8a4b38;
  line-height: 1.7;
}
.follow-modal-panel img {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  padding: 10px;
  border: 2px solid #f3bd7e;
  border-radius: 14px;
  background: #fff;
}
.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.alert-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(61, 0, 12, .62);
  backdrop-filter: blur(5px);
}
.alert-modal-panel {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  padding: 22px 18px 18px;
  border: 4px solid #ffca61;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7, #fff1dc);
  box-shadow: 0 24px 60px rgba(61, 0, 12, .42);
  text-align: center;
}
.alert-modal-panel h2 {
  margin: 0 0 10px;
  color: #c80c25;
  font-size: 22px;
}
.alert-modal-panel p {
  margin: 0 0 18px;
  color: #6b2934;
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.rule-card ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin: 0;
  padding-left: 26px;
  font-size: 17px;
  line-height: 1.7;
}
.bottom-actions {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: min(930px, calc(100vw - 28px));
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .poster-shell { padding: 12px 10px 104px; }
  .poster-hero { min-height: 210px; padding: 12px 64px 4px; }
  .floating-badge {
    width: 64px;
    height: 64px;
    font-size: 16px;
  }
  .floating-badge.left { left: 2px; }
  .floating-badge.right { right: 2px; }
  .cupid { display: none; }
  .poster-subtitle {
    padding: 8px 14px;
    line-height: 1.35;
  }
  .poster-wheel-wrap { width: min(94vw, 520px); }
  .poster-wheel .wheel-labels span {
    --radius: 31vw;
    width: 72px;
    min-height: 56px;
    margin-left: 0;
    transform-origin: center center;
    font-size: 11px;
  }
  .wheel-prize { gap: 2px; }
  .wheel-prize img {
    width: 38px;
    height: 30px;
  }
  .step-grid,
  .benefit-grid,
  .poster-split,
  .rule-card ol {
    grid-template-columns: 1fr 1fr;
  }
  .poster-card { padding: 14px; border-radius: 14px; }
  .poster-card h2 span { font-size: 20px; }
  .invite-card { align-items: stretch; flex-direction: column; }
  .invite-card strong { text-align: center; font-size: 20px; }
  .bottom-actions { grid-template-columns: 1fr 1fr; }
  .bottom-actions .primary,
  .bottom-actions .ghost {
    min-height: 52px;
    padding: 0 12px;
    font-size: 17px;
  }
}

@media (max-width: 460px) {
  .poster-hero h1 { font-size: 40px; }
  .step-grid,
  .benefit-grid,
  .poster-split,
  .rule-card ol {
    grid-template-columns: 1fr;
  }
  .benefit-grid article { min-height: 108px; }
  .benefit-grid article span { font-size: 48px; }
  .prize-shell { width: min(100vw, 430px); padding-inline: 10px; }
  .prize-page-head {
    grid-template-columns: 82px minmax(0, 1fr) 58px;
    gap: 6px;
  }
  .prize-page-head a,
  .prize-page-head button {
    min-height: 34px;
    font-size: 12px;
  }
  .prize-login-card,
  .prize-list-card {
    padding: 14px;
    border-radius: 14px;
  }
  .prize-coupon {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .prize-coupon img {
    width: 54px;
    height: 46px;
  }
  .prize-coupon mark {
    grid-column: 2;
    justify-self: start;
  }
  .coupon-modal { padding: 10px; }
  .coupon-modal-panel { border-radius: 16px; }
}
