* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  background: #eef0f6;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: #ffffff;
  overflow: hidden;
  padding-bottom: 48px;
}

/* ---------- 顶部 logo 与胶囊按钮 ---------- */
.top {
  position: relative;
  z-index: 2;
  padding: 18px 18px 0 18px;
}

.logo-img {
  display: block;
  height: 30px;
  width: auto;
}

.pills {
  position: absolute;
  top: 74px;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pill {
  border: none;
  cursor: pointer;
  background: #1d3fae;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  padding: 7px 16px 7px 14px;
  border-radius: 999px 0 0 999px;
  box-shadow: 0 3px 8px rgba(29, 63, 174, 0.25);
}

.pill:active {
  background: #16339a;
}

/* ---------- 装饰圆 ---------- */
.deco {
  position: absolute;
  border-radius: 50%;
  background: #dfe5f2;
  z-index: 0;
  pointer-events: none;
}

.d1 { width: 46px;  height: 46px;  top: 116px;  right: 56px; }
.d2 { width: 22px;  height: 22px;  left: 12px;  top: 210px;  background: #e6eaf6; }
.d3 { width: 130px; height: 130px; right: -52px; top: 430px; background: #e3e9f7; }
.d4 { width: 34px;  height: 34px;  left: 30px;  top: 480px;  background: #f3e4e4; }
.d5 { width: 18px;  height: 18px;  left: 96px;  top: 18px;  background: #eceff8; }

/* ---------- 头图 ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
  padding: 0 12px;
}

.mascot {
  width: 148px;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(20, 40, 110, 0.14));
}

.big-title {
  margin-top: -18px;
  font-size: clamp(46px, 13.5vw, 62px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #1d2f8f;
  font-style: italic;
  transform: skewX(-8deg) rotate(-3deg);
  -webkit-text-stroke: 2px #1d2f8f;
  text-shadow:
    0 3px 0 #ffffff,
    0 6px 0 #ffffff,
    0 9px 0 #ffffff,
    0 12px 14px rgba(29, 47, 143, 0.22);
  white-space: nowrap;
}

/* ---------- 九宫格 ---------- */
.board {
  position: relative;
  z-index: 1;
  margin: 30px 12px 0;
  background: #2b3990;
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(43, 57, 144, 0.28);
}

.grid {
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 104px;
  padding: 10px 6px 12px;
  background: #e9ecf8;
  border-radius: 14px;
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.cell .badge {
  font-size: 10px;
  font-weight: 700;
  color: #132e6d;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.cell .cup {
  width: 54px;
  height: 67px;
}

.cell .packet {
  width: 46px;
  height: 58px;
}

.cell .name {
  font-size: 14px;
  font-weight: 700;
  color: #1c2b6e;
  white-space: nowrap;
}

.cell.thanks .name {
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 4px;
  text-indent: 4px;
  color: #1c2b6e;
}

/* 转动时高亮 */
.cell.active {
  background: #ffffff;
  box-shadow: 0 0 0 3px #2b3990 inset, 0 4px 12px rgba(43, 57, 144, 0.22);
  transform: scale(1.05);
}

.cell.won {
  background: #fff6df;
  box-shadow: 0 0 0 3px #f0b429 inset;
  animation: wonPulse 0.5s ease;
}

@keyframes wonPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1.05); }
}

/* 中央抽奖按钮 */
.draw {
  width: 100%;
  aspect-ratio: 1;
  align-self: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 2px;
  color: #ffffff;
  background: radial-gradient(circle at 36% 28%, #ff7078 0%, #e33a4b 45%, #c8102e 100%);
  box-shadow:
    0 0 0 6px rgba(227, 58, 75, 0.14),
    0 8px 18px rgba(200, 16, 46, 0.4);
  transition: transform 0.12s ease;
  animation: breathe 1.6s ease-in-out infinite;
}

.draw:active {
  transform: scale(0.94);
}

.draw:disabled {
  cursor: default;
  animation: none;
  filter: saturate(0.7);
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 6px rgba(227, 58, 75, 0.14), 0 8px 18px rgba(200, 16, 46, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(227, 58, 75, 0.08), 0 8px 18px rgba(200, 16, 46, 0.35); }
}

/* ---------- 中奖弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 24, 42, 0.68);
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mask[hidden] {
  display: none;
}

.mask.show {
  opacity: 1;
}

.popup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 380px;
  transform: translateY(14px) scale(0.94);
  transition: transform 0.26s cubic-bezier(0.18, 1.3, 0.5, 1);
}

.mask.show .popup-wrap {
  transform: translateY(0) scale(1);
}

.popup {
  position: relative;
  width: 100%;
  background: #ffffff;
  border-radius: 26px;
  padding: 74px 24px 30px;
  text-align: center;
}

.popup-mascot {
  position: absolute;
  top: -62px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(20, 40, 110, 0.18));
}

.win-text {
  font-size: 31px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: #dd1f3a;
  transform: skewX(-7deg);
  text-shadow: 0 3px 0 rgba(255, 214, 214, 0.7);
}

.prize-card {
  margin: 26px auto 24px;
  width: 86%;
  padding: 26px 12px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #eef1fb 0%, #e2e7f7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.prize-badge {
  font-size: 13px;
  font-weight: 700;
  color: #132e6d;
  letter-spacing: 0.3px;
}

.prize-badge[hidden] {
  display: none;
}

.prize-cup {
  width: 100px;
  height: 124px;
  filter: drop-shadow(0 6px 10px rgba(18, 41, 94, 0.16));
}

.prize-name {
  font-size: 21px;
  font-weight: 800;
  color: #1c2b6e;
  letter-spacing: 0.5px;
}

.exchange {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: #1d3fae;
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 13px 52px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(29, 63, 174, 0.32);
  transition: transform 0.12s ease;
}

.exchange:active {
  transform: scale(0.96);
}

.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.close-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

/* 彩带 */
.confetti {
  position: fixed;
  top: -16px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  z-index: 49;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}

/* 轻提示 */
.toast[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 80;
  background: rgba(20, 24, 40, 0.78);
  color: #ffffff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  white-space: nowrap;
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 活动规则 / 我的奖品 弹层 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(18, 24, 42, 0.58);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet-mask[hidden] {
  display: none;
}

.sheet-mask.show {
  opacity: 1;
}

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 0 22px 20px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet-mask.show .sheet {
  transform: translateY(0);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
  flex: none;
}

.sheet-title {
  font-size: 19px;
  font-weight: 800;
  color: #1c2b6e;
  letter-spacing: 0.5px;
}

.sheet-x {
  border: none;
  background: transparent;
  color: #9aa3bd;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.75;
  color: #3c4663;
}

.sheet-ok {
  flex: none;
  margin-top: 16px;
  border: none;
  cursor: pointer;
  background: #1d3fae;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 12px 0;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(29, 63, 174, 0.28);
}

.sheet-ok:active {
  transform: scale(0.98);
}

/* 规则列表 */
.rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-list li {
  position: relative;
  padding-left: 16px;
}

.rule-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1d3fae;
}

.rule-list b {
  color: #1c2b6e;
}

.rule-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f2f4fb;
  font-size: 12.5px;
  line-height: 1.7;
  color: #79819c;
}

/* 我的奖品 */
.stat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-num {
  font-size: 32px;
  font-weight: 900;
  font-style: italic;
  color: #dd1f3a;
}

.stat-label {
  font-size: 13px;
  color: #79819c;
}

.prize-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.sum-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef1fb 0%, #e3e8f8 100%);
}

.sum-name {
  font-size: 14px;
  font-weight: 700;
  color: #1c2b6e;
}

.sum-count {
  font-size: 14px;
  font-weight: 800;
  color: #dd1f3a;
}

.rec-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #79819c;
  margin-bottom: 4px;
}

.rec-list {
  display: flex;
  flex-direction: column;
}

.rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed #e4e8f2;
  font-size: 13.5px;
}

.rec-item:last-child {
  border-bottom: none;
}

.rec-name {
  font-weight: 600;
  color: #2b3860;
}

.rec-time {
  flex: none;
  font-size: 12px;
  color: #98a0b8;
}

.empty {
  padding: 26px 0 20px;
  text-align: center;
  font-size: 13.5px;
  color: #9aa3bd;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #5b6787;
}
