:root {
  --panel-width: min(402px, calc(100vw - 14px));
  --ui-scale: calc(var(--panel-width) / 402);
  /* 兜底值(= 当前奖品数 32)；运行时由 script.js 按 SEGMENTS.length 动态覆盖，改奖品数不用再改这里 */
  --wheel-segment-angle: calc(360deg / 32);
  --wheel-double-segment-angle: calc(var(--wheel-segment-angle) * 2);
  /* 1763 澳门新葡京：香槟白金底 + 描金 + 节庆红（区别于 722 的黑金底）。
     bg.jpg 是浅香槟绸缎，所有页面文字必须走深色系——沿用 722 的浅金字会在浅底上完全读不出来。
     --gold-pale 在本主题语义反转：不再是"深底上的浅金字"，而是"浅底上的深棕金字"。 */
  --gold: #c9a227;
  --gold-deep: #9a7318;
  --gold-pale: #6b5426;
  --red: #c8102a;
  --text-red: #c62828;
  --ink: #4a3a1e;
  --sector-a: #e9c179;
  --sector-b: #fdf6e7;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background: #f2e6d6; }
body.overlay-open { overflow: hidden; }

.page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 18px;
  background-image: url("./assets/bg.jpg");
  background-size: cover;
  background-position: center top;
  overflow-x: hidden;
}
@media (min-width: 460px) {
  body { background: radial-gradient(circle at 50% -6%, #fbf3e6 0%, #ece0cd 46%, #e2d4bd 100%); }
  .page { box-shadow: 0 0 32px rgba(122, 96, 48, 0.22); }
}

.title-spacer { width: 100%; height: clamp(64px, calc(var(--panel-width) * 0.19), 78px); flex: 0 0 auto; }

.winner-marquee {
  width: var(--panel-width); height: 32px; margin: 2px auto 10px;
  overflow: hidden; background: rgba(255, 253, 247, 0.72);
  border: 1px solid rgba(201, 162, 39, 0.55); border-radius: 16px;
  display: flex; align-items: center;
}
.marquee-track { display: flex; flex-wrap: nowrap; white-space: nowrap; width: max-content; will-change: transform; animation: marquee 32s linear infinite; }
.winner-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-item { display: inline-flex; align-items: center; gap: 4px; padding: 0 16px; font-size: 13px; color: var(--gold-pale); font-weight: 600; }
.marquee-item .m-prize { color: #b8860b; font-weight: 700; }
.marquee-item .m-sep { color: rgba(154, 115, 24, 0.6); }

.wheel-section { width: var(--panel-width); margin-top: 2px; position: relative; }
.wheel-stack { width: 100%; aspect-ratio: 1 / 1; position: relative; display: grid; place-items: center; }
.wheel-outer { width: 100%; height: auto; user-select: none; pointer-events: none; }

.wheel-inner-wrapper {
  position: absolute; width: 84.62%; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      var(--sector-a) 0 var(--wheel-segment-angle),
      var(--sector-b) var(--wheel-segment-angle) var(--wheel-double-segment-angle)
    );
  box-shadow: inset 0 0 0 1px rgba(232, 192, 100, 0.55);
  transition: transform 5s cubic-bezier(0.16, 0.86, 0.32, 1);
}
.wheel-inner { display: none; }

.wheel-prizes { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.wheel-prize {
  position: absolute; left: 50%; top: 50%;
  width: 32px;
  height: 92px;
  display: flex; align-items: center; justify-content: center;
  transform-origin: center;
  color: #2f2f2f; font-weight: 800;
  pointer-events: none;
}
.prize-name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  -webkit-text-orientation: mixed;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  max-height: 88px; overflow: hidden;
}
.wheel-prize.seg-cash .prize-name { color: #b22222; }
.wheel-prize.seg-thanks .prize-name { color: #555; font-weight: 700; }

.spin-btn { position: absolute; width: 29%; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; transition: transform 0.18s ease; }
.spin-btn img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.spin-btn:active { transform: scale(0.96); }
.spin-btn.locked { filter: grayscale(0.3) brightness(0.86); cursor: not-allowed; }
.wheel-base { width: 111%; margin-left: -5.5%; margin-top: -42px; user-select: none; pointer-events: none; }

.account-bar { width: var(--panel-width); margin: 4px auto 2px; }
/* 活动未开始:隐藏账号/会员ID/确认输入区,避免提前暴露参与条件(仅未开始;进行中/已结束不受影响) */
body.frontend-not-started .account-bar { display: none; }
/* 首屏防闪:config 判定前(frontend-loading)先藏输入区,JS 拿到活动状态后再决定显隐,
   避免 fetch page.config.json 前那一瞬间闪出输入框(FOUC)。判定后 init 会移除本类。 */
body.frontend-loading .account-bar { display: none; }
.account-row {
  display: flex; gap: 8px; align-items: center;
  padding: 7px;
  background: linear-gradient(135deg, rgba(255, 253, 246, 0.86), rgba(248, 238, 219, 0.72));
  border: 1px solid rgba(201, 162, 39, 0.5);
  box-shadow: 0 6px 18px rgba(122, 96, 48, 0.18);
  border-radius: 17px;
  backdrop-filter: blur(8px);
}
/* 输入行改纵向堆叠：会员账号 / 会员ID / 确认 三件各占整行，避免横排在移动端被挤窄 */
#accountInputRow { flex-direction: column; align-items: stretch; }
#accountInput, #memberIdInput {
  flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 15px;
  font-size: 18px; font-weight: 700; color: #243;
  background: #fff;
  border: 1px solid rgba(201, 162, 39, 0.6);
  border-radius: 13px; outline: none;
}
#accountInput::placeholder, #memberIdInput::placeholder { color: rgba(74, 84, 98, 0.72); font-weight: 700; }
#accountInput:focus, #memberIdInput:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.24);
}
/* 会员ID 引导文案：降低抄写摩擦，告诉会员去平台个人中心查（1763 香槟白金主题，深棕金字） */
.account-help { margin: 6px 2px 0; font-size: 12px; line-height: 1.4; text-align: center; color: var(--gold-pale); }
#accountConfirmBtn, #accountLogoutBtn {
  flex: 0 0 auto; height: 42px; padding: 0 18px;
  font-size: 15px; font-weight: 800; color: #fff;
  border: 0; border-radius: 13px; cursor: pointer;
}
#accountConfirmBtn {
  min-width: 92px;
  color: #4a3208;
  background: linear-gradient(180deg, #fbeec2 0%, #cfa63c 100%);
  box-shadow: 0 6px 12px rgba(150, 112, 32, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
#accountConfirmBtn:disabled { opacity: 0.6; cursor: not-allowed; }
#accountLogoutBtn {
  height: 32px; padding: 0 13px; border-radius: 999px;
  font-size: 13px; background: linear-gradient(180deg, #ff8f8f, #d42a24);
  box-shadow: 0 4px 10px rgba(200, 30, 30, 0.28);
}
.member-panel {
  padding: 10px 12px 11px;
  color: var(--gold-pale);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 34%),
    linear-gradient(135deg, rgba(255, 253, 246, 0.9), rgba(246, 235, 214, 0.78));
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 17px;
  box-shadow: 0 8px 20px rgba(122, 96, 48, 0.2);
  backdrop-filter: blur(10px);
}
.member-panel-head,
.member-panel-body { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-panel-head { justify-content: space-between; margin-bottom: 8px; }
.member-panel-body { display: grid; grid-template-columns: 0.9fr 1.35fr; }
.member-account,
.member-stat {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(201, 162, 39, 0.34);
  border-radius: 12px;
}
.member-account { flex: 1 1 auto; }
.member-label {
  display: block; margin-bottom: 2px;
  font-size: 11px; line-height: 1; color: rgba(107, 84, 38, 0.86); font-weight: 800;
}
.member-value {
  display: block; min-width: 0;
  font-size: 14px; line-height: 1.25; color: #4a3a1e; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-stat:first-child .member-value { color: var(--text-red); }
.member-record .member-value { color: var(--gold); }
.member-record .member-value.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.member-record .member-value.clickable:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}
.account-hint { margin: 6px 2px 0; font-size: 12px; line-height: 1.4; text-align: center; color: var(--gold-pale); }
.account-hint.warn { color: var(--text-red); }
.account-hint.ok { color: #1f8a3b; }

.gift-panel { width: var(--panel-width); position: relative; margin-top: 6px; }
.board-bg { width: 100%; display: block; user-select: none; pointer-events: none; }
.gift-viewport { position: absolute; left: 4%; right: 4%; top: 54px; bottom: 6px; overflow: hidden; }
.gift-track { display: flex; align-items: flex-start; height: 100%; width: max-content; will-change: transform; animation: gift-scroll 24s linear infinite; }
.gift-viewport:hover .gift-track { animation-play-state: paused; }
@keyframes gift-scroll { from { transform: translateX(0); } to { transform: translateX(-33.3333%); } }
.gift-card { flex: 0 0 auto; width: 72px; margin-right: 8px; padding-bottom: 8px; text-align: center; }
.gift-thumb {
  width: 100%; height: 61px;
  background: url("./assets/gift-frame.png") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid; place-items: center;
  overflow: hidden;
}
.gift-thumb img {
  width: 82%; height: 82%; object-fit: contain; display: block;
  user-select: none; -webkit-user-drag: none;
}
.gift-name {
  min-height: 36px; margin-top: 4px;
  font-size: clamp(11px, calc(13px * var(--ui-scale)), 13px);
  color: #5a3410; font-weight: 700; line-height: 1.12;
  white-space: normal; overflow: visible;
}

.info-panel {
  width: var(--panel-width); margin: 10px auto 0;
  padding: 8px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.82), rgba(246, 235, 214, 0.66));
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(122, 96, 48, 0.18);
  backdrop-filter: blur(6px);
}
.info-panel-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0; margin-bottom: 8px;
  background: transparent;
}
.info-tab {
  height: 36px; border: 1px solid rgba(201, 162, 39, 0.6); padding: 0 10px;
  color: #6b5426;
  background: linear-gradient(180deg, #fffdf7 0%, #f2e6cd 100%);
  border-radius: 999px;
  font-size: 15px; font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(122, 96, 48, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
.info-tab.active {
  color: #4a3208;
  border-color: rgba(154, 115, 24, 0.9);
  background: linear-gradient(180deg, #fbeec2 0%, #cfa63c 100%);
  box-shadow:
    0 7px 16px rgba(150, 112, 32, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    inset 0 -3px 0 rgba(154, 115, 24, 0.35);
  transform: translateY(-1px);
}
.info-panel-tabs.single { grid-template-columns: 1fr; }
.info-panel-body {
  min-height: 68px;
  padding: 13px 15px;
  font-size: 13px; line-height: 1.75; color: #3a2a12;
  background:
    radial-gradient(circle at 82% 0, rgba(255, 250, 232, 0.95), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, rgba(253, 246, 227, 0.97), rgba(247, 236, 210, 0.94));
  border: 1px solid rgba(232, 192, 100, 0.6);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  white-space: pre-wrap; word-break: break-word;
  max-height: 230px; overflow-y: auto;
}

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.overlay-card { width: min(340px, 90vw); background: #fff; border-radius: 16px; padding: 24px 20px 22px; position: relative; box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28); text-align: center; }
body.overlay-open .marquee-track,
body.overlay-open .gift-track {
  animation-play-state: paused;
}
.overlay-close { position: absolute; top: 6px; right: 12px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: #aaa; cursor: pointer; }
.overlay-title { font-size: 19px; margin: 2px 0 12px; color: var(--gold-deep); }
.overlay-title.win { color: var(--text-red); }
.overlay-body { font-size: 14px; line-height: 1.7; color: #333; white-space: pre-wrap; word-break: break-word; }
.win-record-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  max-height: min(360px, 62vh);
  overflow-y: auto;
  white-space: normal;
}
.win-record-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 8px;
  text-align: left;
  background: linear-gradient(135deg, #fff7e2, #fdeecb);
  border: 1px solid rgba(232, 192, 100, 0.62);
  border-radius: 13px;
}
.win-record-badge {
  padding: 3px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(180deg, #ff8b4a, #de3c2f);
  border-radius: 999px;
}
.win-record-item strong {
  color: #5a3410;
  font-size: 15px;
  line-height: 1.35;
}
.win-record-item em {
  grid-column: 2;
  color: #8a6a3a;
  font-size: 12px;
  font-style: normal;
}
.overlay.image-only {
  background:
    radial-gradient(circle at 50% 46%, rgba(164, 105, 22, 0.12) 0%, rgba(10, 8, 6, 0.66) 44%, rgba(3, 3, 3, 0.84) 100%);
  -webkit-backdrop-filter: grayscale(0.58) brightness(0.58) blur(2px);
  backdrop-filter: grayscale(0.58) brightness(0.58) blur(2px);
}
.overlay.image-only .overlay-card {
  width: min(720px, 94vw);
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.overlay.image-only .overlay-close {
  display: grid;
  place-items: center;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  z-index: 2;
  background: linear-gradient(145deg, rgba(70, 42, 13, 0.88), rgba(12, 8, 4, 0.82));
  border: 1px solid rgba(255, 218, 124, 0.62);
  border-radius: 50%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 239, 194, 0.2);
}
.overlay.image-only .overlay-title { display: none; }
.overlay.image-only .overlay-body {
  line-height: 0;
  color: transparent;
  white-space: normal;
}
.overlay.status-image {
  background: rgba(0, 0, 0, 0.68);
}
.overlay.status-image .overlay-card {
  width: min(390px, 94vw);
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.overlay.status-image .overlay-close {
  display: grid;
  place-items: center;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  z-index: 2;
  background: rgba(18, 11, 4, 0.7);
  border-radius: 50%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  touch-action: manipulation;
}
.overlay.status-image.locked .overlay-close {
  display: none;
}
.overlay.status-image .overlay-title {
  display: none;
}
.overlay.status-image .overlay-body {
  line-height: 0;
  color: transparent;
  white-space: normal;
}
.status-popup {
  display: grid;
  place-items: center;
  margin: 0 auto;
}
/* 1763 的 popup-not-started / popup-ended 是自带白金牌匾底的完整图,不需要浅色承托卡,
   直接裸浮在暗遮罩上(区别于 615:615 的结束图底部为深色文案,才需 .status-popup--ended 承托卡)。 */
.status-popup-img {
  display: block;
  width: clamp(300px, 84vw, 392px);
  max-height: calc(100vh - 64px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.42));
}
.result-visual { display: grid; place-items: center; margin: 0 auto; }
.result-art {
  width: min(720px, 92vw);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); max-width: 86vw; padding: 9px 18px; font-size: 13px; color: #fff; text-align: center; background: rgba(28, 28, 28, 0.88); border-radius: 20px; z-index: 60; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
.toast.show { opacity: 1; visibility: visible; }

.hidden { display: none !important; }

@media (min-width: 768px) {
  .overlay.image-only .overlay-card,
  .result-art {
    width: min(560px, 80vw);
  }
  .result-art { max-height: calc(100vh - 96px); }
}

@media (max-width: 420px) {
  .wheel-prize { width: 30px; height: 90px; }
  .prize-name { font-size: 12px; max-height: 86px; }
  .gift-card { width: 64px; margin-right: 7px; padding-bottom: 8px; }
  .gift-thumb { height: 56px; }
  .gift-viewport { top: 58px; bottom: 6px; }
  .gift-name { min-height: 33px; font-size: 12px; }
  .marquee-item { font-size: 12px; padding: 0 13px; }
}

/* ── 人机验证弹层（captcha）───────────────────────────── */
/* 强调色主题感知：有 --blue 用蓝(531/615)，否则退 --gold(722 金红)，再退中性红。 */
.captcha-box { white-space: normal; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.captcha-imgrow { display: flex; align-items: center; gap: 8px; }
.captcha-image { width: 200px; height: 72px; object-fit: cover; border: 1px solid #e2e2e2; border-radius: 8px; background: #f6f7fb; cursor: pointer; }
.captcha-refresh { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; font-size: 18px; line-height: 1; color: #666; cursor: pointer; }
.captcha-refresh:hover { color: var(--blue, var(--gold, #c8102e)); border-color: var(--blue, var(--gold, #c8102e)); }
.captcha-input { width: 100%; box-sizing: border-box; height: 40px; padding: 0 12px; font-size: 16px; letter-spacing: 2px; text-align: center; border: 1px solid #dcdcdc; border-radius: 8px; outline: none; }
.captcha-input:focus { border-color: var(--blue, var(--gold, #c8102e)); }
.captcha-submit { width: 100%; height: 40px; border: 0; border-radius: 8px; background: var(--blue, var(--gold, #c8102e)); color: #fff; font-size: 15px; cursor: pointer; }
.captcha-submit:disabled { opacity: .6; cursor: default; }
.captcha-tip { margin: 0; font-size: 12px; color: #999; }
.captcha-tip.warn { color: var(--text-red, #e53935); }

/* 滑动拼图 */
.captcha-slider { white-space: normal; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.captcha-slider-stage { position: relative; width: 260px; max-width: 100%; border-radius: 8px; overflow: hidden; border: 1px solid #e2e2e2; background: #f6f7fb; }
.captcha-slider-bg { display: block; width: 100%; }
.captcha-slider-piece { position: absolute; top: 0; left: 0; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.captcha-slider-track { position: relative; width: 260px; max-width: 100%; height: 38px; border-radius: 19px; background: #eef0f5; }
.captcha-slider-handle { position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--blue, var(--gold, #c8102e)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: grab; touch-action: none; }
.captcha-slider-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #aaa; pointer-events: none; }
