:root {
  --brand-primary: #C0392B;   /* 酒紅：主要按鈕、強調色 */
  --brand-dark: #1B3A5C;      /* 冰霜深藍：標題、指針 */
  --brand-gold: #D9A15B;      /* 焦糖金：點綴 */
  --brand-pine: #2F6E51;      /* 松綠：點綴 */
  --brand-bg-top: #EAF6FF;    /* 雪霧藍 */
  --brand-bg-bottom: #CFE3F2; /* 冰藍 */
  --text-main: #1B3A5C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--brand-bg-top), var(--brand-bg-bottom));
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 簡易飄雪效果，之後有主視覺素材可以直接移除或替換 */
.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.snow::before,
.snow::after {
  content: "";
  position: absolute;
  inset: -20% 0 0 0;
  background-image:
    radial-gradient(circle, #fff 1.5px, transparent 1.6px),
    radial-gradient(circle, #fff 1px, transparent 1.1px);
  background-size: 140px 180px, 90px 120px;
  background-repeat: repeat;
  opacity: 0.7;
  animation: snowfall 12s linear infinite;
}

.snow::after {
  background-position: 40px 60px;
  opacity: 0.4;
  animation-duration: 18s;
}

@keyframes snowfall {
  from { transform: translateY(-10%); }
  to { transform: translateY(10%); }
}

.page {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  margin-bottom: 8px;
}

.header h1 {
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--brand-dark);
}

.header p {
  margin: 0;
  opacity: 0.8;
  font-size: 14px;
  line-height: 1.5;
}

.wheel-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.wheel-wrap {
  position: relative;
  width: min(88vw, 340px);
  aspect-ratio: 1 / 1;
}

.wheel-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(27, 58, 92, 0.3));
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--brand-dark);
  z-index: 5;
}

.spin-btn {
  margin-top: 28px;
  padding: 14px 48px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-primary);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(192, 57, 43, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.spin-btn:active { transform: scale(0.96); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sold-out-notice {
  margin-top: 20px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 14px;
  color: var(--brand-dark);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
  box-shadow: 0 6px 16px rgba(27, 58, 92, 0.12);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 92, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal.hidden { display: none; }

.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.modal-eyebrow {
  margin: 0;
  font-size: 13px;
  color: var(--brand-primary);
  font-weight: 700;
}

.modal-card h2 {
  margin: 6px 0 20px;
  font-size: 24px;
  color: var(--brand-dark);
}

.claim-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.claim-form label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.claim-form input {
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-family: inherit;
}

.submit-btn {
  margin-top: 6px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-dark);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.form-error {
  color: #e03131;
  font-size: 13px;
  margin: 0;
}

.thank-you-product {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-pine);
  margin: 0 0 8px;
}

.thank-you p {
  font-size: 15px;
  line-height: 1.6;
}

.hidden { display: none !important; }
