/* 馬上抽 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;
}

/* 確保 HTML hidden 屬性永遠能真正隱藏 Cookie 提示與彈窗。
   避免 .modal 的 display:grid 覆蓋 hidden 狀態，造成遮罩無法關閉。 */
[hidden] {
  display: none !important;
}

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 34.3s 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;
  }
}


/* 首頁 FAQ */
.faq-section {
  scroll-margin-top: 24px;
}

.faq-list {
  overflow: hidden;
  border: 1px solid rgba(222, 192, 93, 0.82);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
}

.faq-item + .faq-item {
  border-top: 1px solid rgba(222, 192, 93, 0.52);
}

.faq-item summary {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 14px;
  gap: 14px;
  min-height: 58px;
  align-items: center;
  padding: 15px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  transition: background 140ms ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(222, 192, 93, 0.9);
  border-radius: 50%;
  background: rgba(255, 254, 249, 0.95);
  color: #b48a0d;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.faq-icon::before,
.faq-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-icon {
  border-color: var(--gold);
  background: var(--gold);
  color: #4b3d13;
}

.faq-item[open] .faq-icon::after {
  opacity: 0;
}

.faq-question {
  min-width: 0;
  line-height: 1.55;
}

.faq-chevron {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  justify-self: end;
}

.faq-chevron::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #a18124;
  border-bottom: 1.5px solid #a18124;
  content: "";
  transform: translate(-50%, -68%) rotate(45deg);
  transition: transform 160ms ease;
}

.faq-item[open] .faq-chevron::before {
  transform: translate(-50%, -25%) rotate(225deg);
}

.faq-item summary:hover {
  background: rgba(255, 232, 160, 0.2);
}

.faq-answer {
  padding: 0 46px 18px 58px;
  color: var(--muted);
  font-size: 13px;
}

.faq-answer p {
  margin: 0;
}

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

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

.footer-brand__name {
  margin-bottom: 1px !important;
  color: #756d59;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.footer-brand p:not(.footer-brand__name) {
  margin: 0;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 21px auto 17px;
}

.footer-links a,
.footer-links button,
.footer-links .footer-link--disabled {
  position: relative;
  padding: 3px 24px;
  border: 0;
  background: transparent;
  color: #746f61;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.footer-links > * + *::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 13px;
  background: rgba(196, 164, 62, 0.4);
  content: "";
  transform: translateY(-50%);
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-copyright {
  margin-top: 3px;
}

/* Cookie 提示 */
.cookie-banner {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  left: 18px;
  margin: auto;
}

.cookie-banner__content {
  width: min(100%, 650px);
  margin-left: auto;
  padding: 22px;
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  background: rgba(255, 254, 249, 0.98);
  box-shadow: 0 18px 55px rgba(70, 55, 10, 0.18);
}

.cookie-banner h2 {
  margin-bottom: 7px;
  font-size: 19px;
  text-align: center;
}

.cookie-banner p {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.cookie-banner__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cookie-choice-button {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: var(--gold);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}

.cookie-choice-button--outline {
  background: #fffef9;
}

.cookie-choice-button:hover {
  filter: brightness(0.98);
}

.cookie-banner__links {
  margin: 11px 0 0 !important;
}

.cookie-banner__links a,
.modal__privacy-link {
  color: #8f7424;
  text-underline-offset: 3px;
}

/* Cookie 設定彈窗 */
.modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 29, 22, 0.58);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 27px 24px 24px;
  border: 1px solid var(--gold-border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.modal__dialog > h2 {
  margin-bottom: 21px;
  font-size: 24px;
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.cookie-setting-card {
  padding: 17px;
  border: 1px solid rgba(222, 192, 93, 0.68);
  border-radius: 14px;
  background: #fffefb;
}

.cookie-setting-card + .cookie-setting-card {
  margin-top: 13px;
}

.cookie-setting-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cookie-setting-card h3 {
  margin-bottom: 2px;
  font-size: 16px;
}

.cookie-setting-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.always-on,
.setting-provider {
  color: #93876a;
  font-size: 12px;
}

.switch-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  opacity: 0;
}

.switch-control__track {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: #aaa9a4;
  transition: background 150ms ease;
}

.switch-control__track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 150ms ease;
}

.switch-control input:checked + .switch-control__track {
  background: var(--gold-dark);
}

.switch-control input:checked + .switch-control__track::after {
  transform: translateX(19px);
}

.cookie-save-button {
  min-height: 52px;
  margin-top: 18px;
  font-size: 16px;
}

.modal__privacy-link {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.has-open-modal {
  overflow: hidden;
  padding-inline-end: var(--scrollbar-compensation, 0px);
}

@media (max-width: 650px) {
  .faq-item summary {
    grid-template-columns: 25px minmax(0, 1fr) 14px;
    gap: 13px;
    min-height: 57px;
    padding: 14px 15px;
    font-size: 13px;
  }

  .faq-icon {
    width: 25px;
    height: 25px;
  }

  .faq-answer {
    padding: 0 42px 16px 53px;
    font-size: 12px;
  }

  .site-footer {
    padding-top: 31px;
  }

  .footer-brand__name {
    font-size: 17px;
  }

  .footer-links {
    width: min(100%, 220px);
    flex-direction: column;
    gap: 0;
    margin-top: 17px;
  }

  .footer-links a,
  .footer-links button,
  .footer-links .footer-link--disabled {
    width: 100%;
    min-height: 36px;
    padding: 6px 0;
  }

  .footer-links > * + *::before {
    display: none;
  }

  .cookie-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .cookie-banner__content {
    padding: 20px 16px;
  }

  .cookie-banner__actions {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 13px;
  }

  .modal__dialog {
    max-height: calc(100vh - 26px);
    padding: 25px 16px 20px;
  }
}

/* 內頁共用版型 */
body.inner-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.inner-page-shell {
  position: relative;
  width: min(calc(100% - 36px), 720px);
  margin: 0 auto;
  padding: 34px 0 72px;
  flex: 1;
}

.back-home {
  display: inline-grid;
  width: 43px;
  height: 43px;
  margin-bottom: 22px;
  border: 1px solid rgba(222, 192, 93, 0.78);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.64);
  color: #9a7a1f;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
  place-items: center;
}

.back-home svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-home:hover {
  border-color: var(--gold-dark);
  background: #fffef9;
}

.back-home:active {
  transform: translateX(-2px);
}

.inner-content-card {
  padding: 44px 46px 46px;
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 9px 0 var(--gold-shadow);
}

.inner-content-card h1 {
  margin: 0 0 17px;
  font-size: clamp(34px, 6vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-align: center;
}

.inner-content-card > p {
  max-width: 530px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.inner-page-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: rgba(255, 232, 160, 0.58);
  color: #b18811;
  place-items: center;
}

.inner-page-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-email {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 28px auto 0;
  padding: 12px 20px;
  border: 1px solid #e1c45f;
  border-radius: 14px;
  background: #fffef9;
  color: #6f5a1d;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.contact-email svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-email:hover {
  border-color: var(--gold-dark);
  background: var(--gold-soft);
}

.contact-email:active {
  transform: scale(0.985);
}

.footer-links [aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 650px) {
  .inner-page-shell {
    width: min(calc(100% - 28px), 720px);
    padding: 24px 0 52px;
  }

  .back-home {
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
  }

  .inner-content-card {
    padding: 34px 20px 36px;
  }

  .inner-content-card h1 {
    font-size: 36px;
  }

  .inner-content-card > p {
    font-size: 14px;
  }

  .inner-page-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 19px;
  }

  .inner-page-icon svg {
    width: 37px;
    height: 37px;
  }

  .contact-email {
    width: 100%;
    padding-inline: 14px;
    font-size: 13px;
  }
}

/* 隱私權政策與法律文件 */
.legal-page-shell {
  width: min(calc(100% - 36px), 860px);
}

.legal-content-card {
  padding: 46px 54px 52px;
}

.legal-header {
  text-align: center;
}

.legal-header .legal-updated {
  margin: -5px 0 18px;
  color: var(--soft-text);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.legal-header .legal-intro {
  max-width: 660px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.legal-header .legal-intro a {
  color: #80630e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-header .legal-intro a:hover {
  color: #4f3c05;
}

.privacy-summary {
  margin: 34px 0 36px;
  padding: 22px 24px;
  border: 1px solid rgba(225, 196, 95, 0.75);
  border-radius: 17px;
  background: rgba(255, 245, 205, 0.66);
}

.privacy-summary h2 {
  margin: 0 0 10px;
  color: #765e1b;
  font-size: 16px;
  letter-spacing: 0;
}

.privacy-summary ul {
  margin: 0;
  padding-left: 1.25em;
}

.privacy-summary li {
  margin-top: 6px;
  color: #5f573f;
  font-size: 14px;
}

.legal-body {
  color: #4d493e;
}

.legal-body section {
  padding-top: 30px;
  border-top: 1px solid rgba(220, 198, 124, 0.42);
}

.legal-body section:first-child {
  padding-top: 0;
  border-top: 0;
}

/* 使用條款：在導言與第一個條款之間加入與各條目一致的分隔線 */
.terms-page .legal-body {
  margin-top: 30px;
}

.terms-page .legal-body section:first-child {
  padding-top: 30px;
  border-top: 1px solid rgba(220, 198, 124, 0.42);
}

.legal-body section + section {
  margin-top: 30px;
}

.legal-body h2 {
  margin: 0 0 13px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.legal-body h3 {
  margin: 22px 0 7px;
  color: #6f5a1d;
  font-size: 15px;
}

.legal-body p,
.legal-body li {
  font-size: 14px;
  line-height: 1.85;
}

.legal-body p {
  margin-bottom: 12px;
}

.legal-body ul {
  margin: 9px 0 14px;
  padding-left: 1.4em;
}

.legal-body li + li {
  margin-top: 5px;
}

.legal-body a,
.legal-disclaimer a {
  color: #80630e;
  text-underline-offset: 3px;
}

.legal-body a:hover,
.legal-disclaimer a:hover {
  color: #4f3c05;
}

.legal-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 17px;
}

.legal-resource-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(222, 192, 93, 0.75);
  border-radius: 999px;
  background: #fffef9;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.legal-contact {
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 245, 205, 0.56);
}

.legal-disclaimer {
  margin: 38px 0 0;
  padding-top: 20px;
  border-top: 1px dashed rgba(197, 165, 59, 0.52);
  color: #8a826e;
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
}

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

  .legal-content-card {
    padding: 32px 20px 38px;
  }

  .legal-header .legal-intro {
    font-size: 14px;
    text-align: left;
  }

  .privacy-summary {
    margin: 27px 0 31px;
    padding: 18px 17px;
  }

  .privacy-summary li,
  .legal-body p,
  .legal-body li {
    font-size: 13px;
  }

  .legal-body h2 {
    font-size: 19px;
  }

  .legal-body section {
    padding-top: 25px;
  }

  .legal-body section + section {
    margin-top: 25px;
  }

  .legal-resource-links {
    flex-direction: column;
  }

  .legal-resource-links a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* V4.5: inactive footer item used only until the formal Terms page is created. */
.footer-links .footer-link--disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
  white-space: nowrap;
}


/* V4.10: 依確認設計重製 404 頁面 */
.error-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 246, 218, 0.78), transparent 36%),
    var(--page-bg);
  color: var(--text);
}

.error-page-shell {
  width: min(calc(100% - 36px), 940px);
  margin: 0 auto;
  padding: 72px 0 38px;
}

.error-panel {
  position: relative;
  display: flex;
  min-height: 1040px;
  flex-direction: column;
  align-items: center;
  padding: 112px 66px 92px;
  border: 1.5px solid rgba(232, 185, 74, 0.7);
  border-radius: 42px;
  background: rgba(255, 253, 247, 0.55);
  box-shadow: inset 0 0 54px rgba(248, 213, 125, 0.08);
  text-align: center;
}

.error-panel__ornament {
  position: absolute;
  left: 50%;
  display: grid;
  width: 74px;
  height: 38px;
  place-items: center;
  background: var(--page-bg);
  color: #f0bd47;
  font-size: 29px;
  line-height: 1;
  transform: translateX(-50%);
}

.error-panel__ornament--top {
  top: -19px;
}

.error-panel__ornament--bottom {
  bottom: -19px;
}

.error-ticket-illustration {
  width: min(54vw, 390px);
  margin-top: 66px;
  filter: drop-shadow(0 18px 25px rgba(207, 151, 31, 0.12));
  transform: rotate(-7deg);
}

.error-ticket-illustration svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ticket-art__outer,
.ticket-art__inner,
.ticket-art__dash {
  fill: rgba(255, 254, 249, 0.68);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-art__outer {
  stroke: #c89225;
  stroke-width: 7;
}

.ticket-art__inner {
  fill: none;
  stroke: #e9b954;
  stroke-width: 3;
}

.ticket-art__dash {
  fill: none;
  stroke: rgba(232, 181, 77, 0.72);
  stroke-width: 2.5;
  stroke-dasharray: 13 12;
}

.ticket-art__star {
  fill: #f3bd43;
}

.ticket-art__number {
  fill: url(#errorGold);
  font-family: Arial, "Noto Sans TC", sans-serif;
  font-size: 104px;
  font-weight: 800;
  letter-spacing: -5px;
}

.error-copy {
  margin-top: 74px;
}

.error-copy h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 62px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.error-copy p {
  margin: 24px 0 0;
  color: #6f674f;
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.65;
}

.error-home-button {
  display: flex;
  width: min(100%, 680px);
  min-height: 94px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
  padding: 18px 32px;
  border-radius: 25px;
  background: linear-gradient(90deg, #ffc63d 0%, #ffdd72 48%, #ffc64a 100%);
  box-shadow: 0 11px 0 #d6a321, 0 18px 34px rgba(200, 145, 20, 0.12);
  color: #3d3421;
  font-size: 30px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.error-home-button svg {
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.error-home-button:hover {
  filter: brightness(0.99);
  transform: translateY(-1px);
}

.error-home-button:active {
  box-shadow: 0 4px 0 #d6a321;
  transform: translateY(7px);
}

.error-footer {
  padding: 0 20px 48px;
  color: #84785d;
  font-size: 14px;
  text-align: center;
}

.error-footer p {
  margin: 4px 0;
}

.error-footer__brand {
  color: #6d624a;
  font-size: 20px;
}

.error-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  margin: 18px 0 13px;
}

.error-footer__links a,
.error-footer__links button {
  border: 0;
  background: transparent;
  color: #756b54;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.error-footer__links a:hover,
.error-footer__links button:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 650px) {
  .error-page-shell {
    width: min(calc(100% - 24px), 940px);
    padding: 42px 0 28px;
  }

  .error-panel {
    min-height: 720px;
    padding: 58px 20px 58px;
    border-radius: 28px;
  }

  .error-panel__ornament {
    width: 58px;
    height: 28px;
    font-size: 22px;
  }

  .error-panel__ornament--top {
    top: -14px;
  }

  .error-panel__ornament--bottom {
    bottom: -14px;
  }

  .error-ticket-illustration {
    width: min(70vw, 260px);
    margin-top: 38px;
  }

  .error-copy {
    margin-top: 50px;
  }

  .error-copy h1 {
    font-size: clamp(33px, 10vw, 46px);
  }

  .error-copy p {
    margin-top: 17px;
    font-size: 16px;
  }

  .error-home-button {
    min-height: 70px;
    gap: 12px;
    margin-top: 31px;
    padding: 14px 18px;
    border-radius: 20px;
    box-shadow: 0 8px 0 #d6a321, 0 13px 24px rgba(200, 145, 20, 0.11);
    font-size: 22px;
  }

  .error-home-button svg {
    width: 25px;
    height: 25px;
  }

  .error-footer {
    padding-bottom: 35px;
    font-size: 12px;
  }

  .error-footer__brand {
    font-size: 17px;
  }

  .error-footer__links {
    flex-direction: column;
    gap: 10px;
  }
}


/* V4.11：恢復 404 跑馬燈，並壓縮桌機版高度以適合單一視窗 */
.error-page {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
}

.error-page > .marquee {
  flex: 0 0 auto;
}

.error-page-shell {
  display: grid;
  width: min(calc(100% - 36px), 880px);
  flex: 1 0 auto;
  margin: 0 auto;
  padding: clamp(18px, 2.4vh, 28px) 0 clamp(12px, 1.8vh, 20px);
  place-items: center;
}

.error-panel {
  width: 100%;
  min-height: 0;
  padding: clamp(34px, 4.4vh, 48px) 54px clamp(31px, 4vh, 44px);
  border-radius: 34px;
}

.error-ticket-illustration {
  width: clamp(190px, 27vh, 270px);
  margin-top: clamp(14px, 2.2vh, 24px);
}

.error-copy {
  margin-top: clamp(23px, 3.4vh, 38px);
}

.error-copy h1 {
  font-size: clamp(36px, 4.5vw, 50px);
}

.error-copy p {
  margin-top: clamp(10px, 1.5vh, 15px);
  font-size: clamp(16px, 1.65vw, 20px);
}

.error-home-button {
  width: min(100%, 590px);
  min-height: clamp(62px, 7.5vh, 72px);
  gap: 14px;
  margin-top: clamp(20px, 2.8vh, 29px);
  padding: 12px 28px;
  border-radius: 21px;
  box-shadow: 0 8px 0 #d6a321, 0 13px 25px rgba(200, 145, 20, 0.11);
  font-size: clamp(22px, 2.4vw, 27px);
}

.error-home-button svg {
  width: 27px;
  height: 27px;
}

.error-footer {
  flex: 0 0 auto;
  padding: 0 20px clamp(15px, 2vh, 23px);
  font-size: 11px;
}

.error-footer__brand {
  font-size: 16px;
}

.error-footer__links {
  gap: 5px 15px;
  margin: 8px 0 5px;
}

@media (min-width: 651px) and (max-height: 820px) {
  .error-page-shell {
    padding-top: 12px;
    padding-bottom: 9px;
  }

  .error-panel {
    padding-top: 26px;
    padding-bottom: 26px;
  }

  .error-ticket-illustration {
    width: 190px;
    margin-top: 8px;
  }

  .error-copy {
    margin-top: 18px;
  }

  .error-copy h1 {
    font-size: 36px;
  }

  .error-copy p {
    margin-top: 8px;
    font-size: 16px;
  }

  .error-home-button {
    min-height: 58px;
    margin-top: 17px;
    font-size: 21px;
  }

  .error-footer__links {
    margin-top: 4px;
  }
}

@media (max-width: 650px) {
  .error-page {
    min-height: 100svh;
  }

  .error-page-shell {
    width: min(calc(100% - 24px), 880px);
    padding: 24px 0 22px;
  }

  .error-panel {
    min-height: 0;
    padding: 45px 20px 45px;
    border-radius: 28px;
  }

  .error-ticket-illustration {
    width: min(60vw, 225px);
    margin-top: 20px;
  }

  .error-copy {
    margin-top: 36px;
  }

  .error-home-button {
    width: 100%;
    min-height: 66px;
    margin-top: 26px;
  }

  .error-footer {
    padding-bottom: 28px;
  }
}


/* V4.12: 首頁與 404 按鈕圖示與色彩統一 */
.primary-button .dice-icon,
.error-home-button .dice-icon {
  flex: 0 0 auto;
}

.error-home-button {
  background: var(--gold);
  box-shadow: 0 7px 0 var(--gold-dark);
}

.error-home-button:hover {
  filter: brightness(0.985);
}

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

@media (max-width: 650px) {
  .error-home-button {
    box-shadow: 0 7px 0 var(--gold-dark);
  }

  .error-home-button:active {
    box-shadow: 0 2px 0 var(--gold-dark);
  }
}


/* V4.13: use the dice artwork from the reference site */
.dice-icon-image {
  display: block;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  object-fit: contain;
}

.error-home-button .dice-icon-image {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
}

@media (max-width: 650px) {
  .dice-icon-image {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .error-home-button .dice-icon-image {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
}


/* V4.14: 404 頁主內容與 Footer 分隔線 */
.error-footer {
  padding-top: clamp(15px, 2vh, 23px);
  border-top: 1px solid rgba(222, 192, 93, 0.38);
}

@media (max-width: 650px) {
  .error-footer {
    padding-top: 22px;
  }
}


/* V4.16: dynamic draw timing, larger results, and Quick Mode */
.result-stage {
  min-height: 125px;
  padding-block: 8px;
}

.result-text.is-rolling {
  color: var(--text);
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 750;
  line-height: 1.22;
}

.result-text.is-winner {
  font-size: clamp(38px, 7vw, 48px);
  line-height: 1.2;
}

.result-text.is-rolling.is-long {
  font-size: clamp(25px, 4.5vw, 30px);
}

.result-text.is-rolling.is-very-long {
  font-size: clamp(22px, 4vw, 27px);
}

.result-text.is-rolling.is-extra-long {
  font-size: clamp(19px, 3.5vw, 24px);
  line-height: 1.3;
}

.result-text.is-winner.is-long {
  font-size: clamp(32px, 6vw, 42px);
}

.result-text.is-winner.is-very-long {
  font-size: clamp(27px, 5vw, 35px);
}

.result-text.is-winner.is-extra-long {
  font-size: clamp(22px, 4.2vw, 30px);
  line-height: 1.3;
}

.draw-option-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

@media (max-width: 650px) {
  .result-stage {
    min-height: 112px;
    padding-block: 6px;
  }

  .result-text.is-rolling {
    font-size: clamp(27px, 8vw, 32px);
  }

  .result-text.is-winner {
    font-size: clamp(34px, 10vw, 42px);
  }
}

@media (max-width: 390px) {
  .draw-option-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}


/* V4.17: bilingual language switch and non-forced language suggestion */
.page-shell {
  position: relative;
}

.home-top-actions {
  position: absolute;
  z-index: 4;
  top: 36px;
  right: 0;
  display: flex;
  justify-content: flex-end;
}

.inner-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.inner-page-actions .back-home {
  margin-bottom: 0;
}

.language-switch {
  display: inline-grid;
  min-width: 43px;
  height: 43px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid rgba(222, 192, 93, 0.88);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  color: #8d711e;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.language-switch:hover {
  border-color: var(--gold-dark);
  background: #fffef9;
}

.language-switch:active {
  transform: translateY(1px);
}

.error-panel {
  position: relative;
}

.error-language-action {
  position: absolute;
  z-index: 3;
  top: 24px;
  right: 26px;
}

.language-prompt {
  position: fixed;
  z-index: 65;
  right: 20px;
  bottom: 20px;
  width: min(calc(100% - 40px), 330px);
  padding: 21px 18px 17px;
  border: 1px solid var(--gold-border);
  border-radius: 19px;
  background: rgba(255, 254, 249, 0.985);
  box-shadow: 0 18px 55px rgba(70, 55, 10, 0.17);
  text-align: center;
}

.language-prompt__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #9a8346;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.language-prompt h2 {
  margin: 0 28px 6px;
  font-size: 19px;
  line-height: 1.25;
}

.language-prompt p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.language-prompt__actions {
  display: grid;
  gap: 9px;
}

.language-prompt__primary,
.language-prompt__secondary {
  display: grid;
  min-height: 44px;
  padding: 9px 12px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.language-prompt__primary {
  background: var(--gold);
  box-shadow: 0 4px 0 var(--gold-dark);
  color: var(--text);
}

.language-prompt__secondary {
  background: #fffef9;
  color: #7f6b35;
}

html[lang="en"] .title-row h1 {
  font-size: clamp(40px, 5.4vw, 55px);
  letter-spacing: -0.045em;
}

html[lang="en"] .step-card p,
html[lang="en"] .faq-answer p,
html[lang="en"] .legal-body,
html[lang="en"] .inner-content-card > p {
  line-height: 1.72;
}

html[lang="en"] .eyebrow {
  letter-spacing: 3px;
}

@media (max-width: 650px) {
  .home-top-actions {
    position: static;
    margin-bottom: 4px;
  }

  .inner-page-actions {
    margin-bottom: 18px;
  }

  .language-switch {
    min-width: 40px;
    height: 40px;
  }

  .language-prompt {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }

  .error-language-action {
    top: 16px;
    right: 16px;
  }

  html[lang="en"] .title-row h1 {
    font-size: clamp(39px, 11vw, 48px);
  }

  html[lang="en"] .label-row {
    align-items: flex-start;
    gap: 8px;
  }
}


/* V4.17 English hero spacing */
html[lang="en"] .title-row {
  flex-direction: column;
  gap: 8px;
}

html[lang="en"] .title-row h1 {
  font-size: clamp(42px, 5vw, 50px);
}

html[lang="en"] .language-switch {
  min-width: 54px;
}
