.lottery-container {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px var(--space-lg) var(--space-xl);
  z-index: 1;
}

.lottery-title-plaque {
  position: relative;
  width: min(80vw, 340px);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px 12px;
  border-radius: 22px 22px 26px 26px;
  background: var(--color-primary);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.lottery-title-plaque::before,
.lottery-title-plaque::after {
  content: '';
  position: absolute;
  bottom: -10px;
  width: 42px;
  height: 20px;
  border-radius: 0 0 18px 18px;
  background: var(--color-primary-dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.lottery-title-plaque::before {
  left: 28px;
}

.lottery-title-plaque::after {
  right: 28px;
}

.lottery-title-text {
  color: #fff;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
}

.lottery-title-star {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
  background: #fff;
  filter: drop-shadow(0 1px 2px rgba(16, 24, 40, 0.18));
}

.lottery-slogan-bar {
  position: relative;
  min-height: 46px;
  min-width: min(78vw, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: -6px;
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--color-primary-dark);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    inset 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.lottery-slogan-bar .lottery-title-star {
  width: 21px;
  height: 21px;
}

/* Lottery Wheel */
.lottery-wheel-wrapper {
  --wheel-size: min(68vw, 320px);
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  margin: 26px auto 20px;
  isolation: isolate;
}

.lottery-wheel-wrapper::before {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 63%, var(--color-primary-light) 64% 68%, transparent 69%),
    radial-gradient(circle at 36% 25%, rgba(255, 255, 255, 0.92), transparent 18%),
    var(--color-primary-soft);
  box-shadow:
    0 4px 16px rgba(16, 24, 40, 0.10),
    inset 0 0 0 5px rgba(255, 255, 255, 0.78),
    inset 0 0 0 13px var(--color-primary-soft);
  z-index: -1;
}

.lottery-wheel-wrapper::after {
  content: '';
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: -24px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(16, 24, 40, 0.18), transparent 68%);
  filter: blur(2px);
  z-index: -2;
}

.lottery-wheel-lights {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
}

.lottery-wheel-lights span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff 0 18%, var(--color-primary-soft) 19% 58%, var(--color-primary-light) 59% 100%);
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.6),
    inset 0 -2px 3px rgba(2, 132, 199, 0.2);
  transform: rotate(calc(var(--i) * 12.857deg)) translateY(calc(var(--wheel-size) * -0.548)) rotate(calc(var(--i) * -12.857deg));
}

.lottery-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #fff;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-white);
  box-shadow:
    inset 0 0 0 3px var(--color-primary),
    inset 0 0 0 9px rgba(255, 255, 255, 0.7),
    inset 0 0 30px rgba(14, 165, 233, 0.12),
    0 4px 16px rgba(16, 24, 40, 0.10);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  z-index: 2;
}

.lottery-wheel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 23%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle, transparent 0 57%, var(--color-border) 58% 60%, transparent 61%),
    repeating-conic-gradient(from 0deg, var(--color-border) 0deg 1.4deg, transparent 1.5deg 45deg);
  pointer-events: none;
  z-index: 4;
}

.lottery-wheel::after {
  content: '';
  position: absolute;
  inset: 48%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 4;
}

.lottery-wheel-sector {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 0;
  right: 0;
  transform-origin: bottom left;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
  box-shadow:
    inset 2px 0 0 rgba(255, 255, 255, 0.85),
    inset 0 0 16px rgba(255, 255, 255, 0.28);
  z-index: 1;
}

.lottery-wheel-sector:nth-child(even) {
  filter: saturate(1.08);
}

.lottery-wheel-sector-content {
  position: relative;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 82px;
  min-height: 74px;
  padding: 5px 4px 0;
  color: var(--color-text-title);
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
}

.lottery-wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: calc(var(--wheel-size) * 0.22);
  min-width: 66px;
  min-height: 68px;
  transform: translate(-50%, -50%) rotate(var(--label-angle)) translateY(calc(var(--wheel-size) * -0.305)) rotate(var(--label-counter));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-text-title);
  text-align: center;
  pointer-events: none;
}

.lottery-wheel-label-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 4px rgba(16, 24, 40, 0.18));
  line-height: 1;
}

.lottery-prize-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.lottery-prize-star path:first-child {
  fill: var(--color-warning);
  stroke: #fff;
  stroke-width: 3;
}

.lottery-prize-star path:last-child {
  fill: #fff;
  stroke: var(--color-warning);
  stroke-width: 1.5;
}

.lottery-prize-gem path:first-child {
  fill: var(--color-secondary);
  stroke: #fff;
  stroke-width: 3;
}

.lottery-prize-gem path:nth-child(2) {
  fill: none;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 2;
}

.lottery-prize-gem path:last-child {
  fill: #fff;
  stroke: var(--color-secondary);
  stroke-width: 2;
}

.lottery-prize-coin circle:first-child {
  fill: var(--color-warning);
  stroke: #fff;
  stroke-width: 4;
}

.lottery-prize-coin circle:nth-child(2) {
  fill: #fff;
  stroke: var(--color-warning);
  stroke-width: 3;
}

.lottery-prize-coin path {
  fill: var(--color-warning);
  stroke: #fff;
  stroke-width: 2;
}

.lottery-prize-clover path {
  fill: var(--color-success);
  stroke: #fff;
  stroke-width: 2.5;
}

.lottery-prize-clover path:last-child {
  fill: none;
  stroke: var(--color-success);
  stroke-width: 3;
}

.lottery-wheel-label-text {
  max-width: 100px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-title);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96),
    0 2px 4px rgba(255, 255, 255, 0.86);
}

.lottery-wheel-sector-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 3px 8px rgba(16, 24, 40, 0.12);
  font-size: 17px;
  line-height: 1;
}

.lottery-wheel-sector-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
}

.lottery-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--wheel-size) * 0.31);
  height: calc(var(--wheel-size) * 0.31);
  min-width: 88px;
  min-height: 88px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.78), transparent 27%),
    var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow:
    0 4px 0 var(--color-primary-dark),
    0 10px 18px rgba(16, 24, 40, 0.18),
    inset 0 0 0 5px #fff,
    inset 0 0 0 10px var(--color-primary-light);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lottery-wheel-center::before {
  content: none;
}

.lottery-wheel-center-go {
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 4px rgba(16, 24, 40, 0.22);
}

.lottery-wheel-center-text {
  margin-top: 4px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(16, 24, 40, 0.22);
}

.lottery-wheel-center:active {
  transform: translate(-50%, calc(-50% + 5px)) scale(0.98);
  box-shadow:
    0 2px 0 var(--color-primary-dark),
    0 6px 12px rgba(16, 24, 40, 0.18),
    inset 0 0 0 5px #fff,
    inset 0 0 0 10px var(--color-primary-light);
}

.lottery-wheel-wrapper.is-spinning .lottery-wheel-center {
  pointer-events: none;
  animation: lottery-center-pulse 0.8s ease-in-out infinite alternate;
}

.lottery-wheel-wrapper.no-chance .lottery-wheel-center {
  filter: grayscale(0.25) brightness(0.96);
}

.lottery-wheel-pointer {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 64px;
  z-index: 7;
  filter: drop-shadow(0 6px 8px rgba(16, 24, 40, 0.2));
}

.lottery-wheel-pointer::before {
  content: '';
  position: absolute;
  inset: 0 9px;
  clip-path: polygon(50% 100%, 7% 8%, 93% 8%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 32%),
    var(--color-primary);
  border-radius: 18px;
  box-shadow:
    0 0 0 7px #fff,
    0 0 0 11px var(--color-primary-soft);
}

.lottery-wheel-pointer::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 30px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

/* Check-in button */
.checkin-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-round);
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.10);
}

.checkin-btn.checked {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.checkin-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: var(--color-badge);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

/* Lottery info */
.lottery-chances {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 7px 14px;
  border-radius: var(--radius-round);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    inset 0 0 0 1px var(--color-border);
}

.lottery-chances-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.lottery-chances-num {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 900;
  font-size: var(--font-size-xl);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

/* Prize history */
.prize-history {
  width: 100%;
  margin-top: var(--space-md);
}

.prize-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--font-size-base);
}

body.low-performance .lottery-wheel-wrapper::before {
  box-shadow:
    0 2px 8px rgba(16, 24, 40, 0.08),
    inset 0 0 0 9px rgba(255, 255, 255, 0.52);
}

body.low-performance .lottery-wheel-wrapper::after {
  filter: none;
  opacity: 0.45;
}

body.low-performance .lottery-wheel {
  box-shadow:
    inset 0 0 0 2px var(--color-primary),
    0 4px 12px rgba(16, 24, 40, 0.10);
}

body.low-performance .lottery-wheel::before,
body.low-performance .lottery-wheel::after {
  opacity: 0.45;
}

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

.prize-history-label {
  color: var(--color-text-title);
  font-weight: 600;
}

.prize-history-time {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

@keyframes lottery-center-pulse {
  from {
    box-shadow:
      0 4px 0 var(--color-primary-dark),
      0 10px 18px rgba(16, 24, 40, 0.18),
      inset 0 0 0 5px #fff,
      0 0 0 0 rgba(14, 165, 233, 0.35);
  }
  to {
    box-shadow:
      0 4px 0 var(--color-primary-dark),
      0 10px 18px rgba(16, 24, 40, 0.18),
      inset 0 0 0 5px #fff,
      0 0 0 12px rgba(14, 165, 233, 0);
  }
}

@media (max-width: 380px) {
  .lottery-title-plaque {
    min-height: 62px;
    padding: 8px 20px 12px;
  }

  .lottery-title-text {
    font-size: 34px;
  }

  .lottery-title-star {
    width: 24px;
    height: 24px;
  }

  .lottery-slogan-bar {
    min-height: 46px;
    font-size: 18px;
  }

  .lottery-wheel-label {
    min-width: 66px;
  }

  .lottery-wheel-label-icon {
    width: 40px;
    height: 40px;
  }

  .lottery-wheel-label-text {
    font-size: 14px;
  }

  .lottery-wheel-center-go {
    font-size: 36px;
  }

  .lottery-wheel-center-text {
    font-size: 15px;
  }
}
