/* 馬上抽 Lucky Pick Now — 第一版 */
:root {
  --page-bg: #fff9e8;
  --surface: #fffef9;
  --text: #312e24;
  --muted: #746f61;
  --soft-text: #b7a977;
  --gold: #ffca24;
  --gold-dark: #d5a50b;
  --gold-border: #e9c95c;
  --gold-soft: #ffe8a0;
  --gold-shadow: #f2dfa2;
  --focus: #8a6200;
  --danger: #a93a2c;
  --max-width: 604px;
  --radius-card: 22px;
  --radius-control: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.marquee {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(211, 174, 56, 0.2);
  border-bottom: 1px solid rgba(211, 174, 56, 0.22);
  background: #ffeba9;
  color: #998251;
  white-space: nowrap;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 24s linear infinite;
  will-change: transform;
}

.marquee__group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-width: max-content;
}

.marquee span {
  display: inline-block;
  padding: 5px 34px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.page-shell {
  width: min(calc(100% - 36px), var(--max-width));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  text-align: center;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 3px 14px;
  border: 1px solid #e4cb76;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #9a8346;
  font-size: 12px;
  letter-spacing: 0.2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(47px, 6vw, 58px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.hero__subtitle {
  margin: 10px 0 27px;
  color: #575348;
  font-size: 15px;
}

.draw-card {
  padding: 26px 34px 25px;
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 9px 0 var(--gold-shadow);
}

.eyebrow {
  margin-bottom: 0;
  color: #ac9146;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 5px;
  text-align: center;
}

.result-stage {
  display: grid;
  min-height: 105px;
  place-items: center;
}

.result-text {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #d2ba72;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}

.result-text.is-winner {
  color: var(--text);
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.result-text.is-rolling {
  animation: resultPulse 130ms ease-in-out alternate infinite;
}

@keyframes resultPulse {
  from { transform: scale(0.98); opacity: 0.55; }
  to { transform: scale(1.02); opacity: 1; }
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--gold);
  box-shadow: 0 7px 0 var(--gold-dark);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-button svg,
.reset-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:hover:not(:disabled) {
  filter: brightness(0.985);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--gold-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.57;
  box-shadow: 0 4px 0 #c8b36c;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.check-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.check-control__box {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid #bd9e2d;
  border-radius: 4px;
  background: #fff;
  place-items: center;
}

.check-control__box svg {
  width: 13px;
  fill: none;
  stroke: #4b3b00;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.65);
  transition: 100ms ease;
}

.check-control input:checked + .check-control__box {
  background: var(--gold);
}

.check-control input:checked + .check-control__box svg {
  opacity: 1;
  transform: scale(1);
}

.reset-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border: 1px solid #ddc57a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #7d7664;
  cursor: pointer;
  font-size: 13px;
  transition: background 120ms ease, transform 120ms ease;
}

.reset-button:hover {
  background: #fff;
}

.reset-button:active {
  transform: scale(0.97);
}

.counter {
  margin: 12px 0 0;
  color: #aaa18c;
  font-size: 12px;
  text-align: center;
}

.input-section {
  margin-top: 25px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.label-row label {
  font-size: 13px;
  font-weight: 600;
}

.text-button {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: #9d8642;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 205px;
  resize: vertical;
  padding: 13px 15px;
  border: 1px solid #e1c45f;
  border-radius: var(--radius-control);
  outline: none;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea:focus {
  border-color: #bd9311;
  box-shadow: 0 0 0 3px rgba(255, 202, 36, 0.23);
}

textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(169, 58, 44, 0.12);
}

.helper-text,
.error-message {
  margin: 8px 3px 0;
  font-size: 12px;
}

.helper-text {
  color: #918a79;
}

.error-message {
  color: var(--danger);
  font-weight: 600;
}

.info-section {
  margin-top: 47px;
}

.info-section > h2 {
  margin-bottom: 18px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.step-card {
  padding: 20px 16px;
  border: 1px solid rgba(222, 192, 93, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.step-number {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--gold);
  font-size: 14px;
  font-weight: 800;
  place-items: center;
}

.step-card h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.step-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note {
  padding: 24px;
  border-radius: 17px;
  background: rgba(255, 235, 169, 0.48);
  text-align: center;
}

.privacy-note > h2 {
  margin-bottom: 7px;
  font-size: 18px;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  padding: 25px 18px 35px;
  border-top: 1px solid rgba(222, 192, 93, 0.35);
  color: #928a75;
  font-size: 11px;
  text-align: center;
}

.site-footer p {
  margin-bottom: 2px;
}

:focus-visible {
  outline: 3px solid rgba(138, 98, 0, 0.45);
  outline-offset: 3px;
}

@media (max-width: 650px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--max-width));
    padding-top: 28px;
  }

  .title-row {
    flex-direction: column;
    gap: 8px;
  }

  h1 {
    font-size: 46px;
  }

  .hero__subtitle {
    margin-top: 9px;
    font-size: 14px;
  }

  .draw-card {
    padding: 24px 20px 23px;
  }

  .result-stage {
    min-height: 96px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step-card {
    display: grid;
    grid-template-columns: 38px 1fr;
    column-gap: 8px;
    text-align: left;
  }

  .step-number {
    grid-row: 1 / 3;
    margin: 0;
  }

  .step-card h3,
  .step-card p {
    align-self: center;
  }

  .marquee span {
    padding-inline: 24px;
  }
}

@media (max-width: 390px) {
  .control-row {
    align-items: flex-start;
  }

  .check-control {
    padding-top: 6px;
  }

  .primary-button {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .marquee__track {
    transform: none;
  }
}
