:root {
  --azure: #0072ce;
  --malibu: #0098ff;
  --glow: rgba(100, 200, 255, 0.45);
  --navy: #003661;
  --font: "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: #000; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: #fff; background: #000;
  min-height: 100vh; display: flex; justify-content: center;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; }

/* 手機版容器：桌機置中呈現 */
.page {
  width: 100%; min-height: 100vh; min-height: 100dvh; position: relative;
  background:
    radial-gradient(ellipse 70% 10% at 50% 0, rgba(0,114,206,.55), transparent 70%),
    radial-gradient(ellipse 36% 1% at 50% 100%, rgba(0,114,206,.45), transparent 70%),
    radial-gradient(ellipse 90% 260px at 50% 100%, rgba(0,114,206,.3), transparent),
    #000;
  display: flex; flex-direction: column; overflow: hidden;
}
.view { display: flex; flex-direction: column; align-items: center; padding-top: 28px; flex: 1; width: 100%; max-width: 480px; margin: 0 auto; }
.view-home { gap: 40px; }
.blue { color: var(--azure); }
.small { font-size: 12px; line-height: 18px; }

/* hero */
.hero { width: 100%; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.banner-event { width: calc(100% - 32px); height: auto; }
.banner-imax { width: 100%; height: auto; }

/* features */
.features { width: 100%; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.glow-title {
  font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: 1px; text-align: center;
  color: #0098ff; text-shadow: 0 0 40px rgba(0,111,185,.9);
  background: linear-gradient(to top, #000, #0098ff 54%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.feature-list { list-style: none; display: flex; gap: 20px; width: 100%; }
.feature-list li { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.feature-list img { height: 153px; width: auto; }
.feature-list p { font-size: 16px; line-height: 20px; font-weight: 500; text-align: center; letter-spacing: .08px; text-shadow: 0 0 14px rgba(100,200,255,.5); }

/* video */
.video { width: 100%; aspect-ratio: 393/183.39; background: #000; position: relative; }
.video-poster, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; transform: translate(-50%,-50%);
  border-radius: 50%; background: rgba(0,0,0,.45); border: 1px solid var(--glow); box-shadow: 0 0 20px rgba(100,200,255,.5);
}
.play::after { content: ""; position: absolute; left: 22px; top: 17px; border-left: 17px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }

/* join sheet */
.join { width: 100%; padding: 0 20px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.sheet {
  width: 100%; max-width: 353px; padding: 24px 20px; border-radius: 20px; border: 1px solid rgba(100,200,255,.3);
  background: linear-gradient(to bottom, rgba(0,111,185,.28), rgba(0,111,185,.06));
  box-shadow: 0 0 40px rgba(0,111,185,.3), inset 0 0 40px rgba(0,111,185,.14);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.intro { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--malibu); font-size: 15px; font-weight: 700; letter-spacing: 7.5px; white-space: nowrap; }
.intro .line, .success-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--glow)); }
.intro .line:last-child, .success-title .line:last-child { background: linear-gradient(270deg, transparent, var(--glow)); }
.intro span:nth-child(2) { margin-right: -7.5px; }
.headline { font-weight: 900; font-size: 24px; line-height: 33.6px; letter-spacing: .5px; text-align: center; filter: drop-shadow(0 0 16px rgba(0,0,0,.55)); display: flex; flex-direction: column; align-items: center; }
.headline .row { display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.num { font-size: 36px; font-weight: 900; letter-spacing: .48px; background: linear-gradient(-63.5deg, #006fb9 3%, #a9e0ff 50%, #006fb9 97%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.date-pill { padding: 6px 18px; border: 1px solid var(--glow); border-radius: 999px; box-shadow: 0 0 14px rgba(100,200,255,.35); color: var(--malibu); font-size: 15px; font-weight: 700; line-height: 24px; letter-spacing: .5px; white-space: nowrap; }
.desc { display: flex; flex-direction: column; gap: 4px; text-align: center; font-size: 15px; line-height: 25.5px; letter-spacing: .15px; width: 100%; }
.desc .small { letter-spacing: 0; }
.form { width: 100%; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.note { text-align: center; }
.input {
  height: 52px; padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(100,200,255,.3); background: rgba(255,255,255,.06);
  color: #fff; font: 400 16px/normal var(--font); letter-spacing: .5px; text-align: center; outline: none; width: 100%;
}
.input::placeholder { color: rgba(255,255,255,.45); }
.input:focus { border-color: var(--glow); box-shadow: 0 0 14px rgba(100,200,255,.35); }
.input.invalid { border-color: #ff6b6b; }
.err { color: #ff8a8a; font-size: 12px; text-align: center; margin-top: -8px; }
.btn-join {
  height: 52px; border-radius: 12px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.4);
  font-size: 16px; font-weight: 700; letter-spacing: .5px; transition: background .2s, color .2s;
}
.btn-join:not(:disabled) { background: var(--azure); color: #fff; }
.btn-join:disabled { cursor: not-allowed; }
.btn-join.loading, .btn-join.loading:disabled { background: var(--azure); color: #fff; cursor: progress; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-join.loading::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  box-shadow: 0 0 10px var(--glow); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-join.loading::before { animation-duration: 2s; } }
.agree { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; line-height: 18px; letter-spacing: .5px; cursor: pointer; }
.agree input { position: absolute; opacity: 0; pointer-events: none; }
.agree .box { width: 16px; height: 16px; border-radius: 6px; border: 1px solid var(--azure); background: rgba(255,255,255,.06); flex: none; position: relative; }
.agree input:checked + .box { background: var(--azure); }
.agree input:checked + .box::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.agree input:focus-visible + .box { outline: 2px solid var(--glow); outline-offset: 2px; }
.agree a { color: var(--azure); text-decoration: underline; }
.agree:has(input:disabled) { cursor: not-allowed; }
.agree:has(input:disabled) .box { opacity: .5; }
.agree:has(input:disabled) a { cursor: pointer; }
.agree a.nudge { display: inline-block; animation: nudge .5s ease-in-out 2; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); text-shadow: none; }
  20%, 60% { transform: translateX(-3px); text-shadow: 0 0 8px var(--glow); color: #7fcfff; }
  40%, 80% { transform: translateX(3px); text-shadow: 0 0 8px var(--glow); color: #7fcfff; }
}
@media (prefers-reduced-motion: reduce) { .agree a.nudge { animation: none; color: #7fcfff; text-shadow: 0 0 8px var(--glow); } }
.agree-hint { color: #ff8a8a; font-size: 12px; text-align: center; margin-top: -8px; }
.btn-ghost { height: 44px; padding: 0 20px; display: inline-flex; align-items: center; border: 1px solid var(--glow); border-radius: 999px; color: rgba(255,255,255,.78); font-size: 14px; font-weight: 500; text-decoration: none; }

/* stamp view */
.stamp-top { width: 100%; padding: 0 20px 28px; display: flex; flex-direction: column; align-items: center; }
.stamp-top .banner-event { width: 100%; }
.stamp-copy { width: 100%; padding-top: 16px; display: flex; flex-direction: column; gap: 24px; align-items: center; }
.success-title { width: 100%; display: flex; align-items: center; gap: 8px; filter: drop-shadow(0 0 7.5px rgba(100,200,255,.6)); }
.success-title h2 { font-size: 30px; font-weight: 900; line-height: 33.6px; letter-spacing: .48px; white-space: nowrap; background: linear-gradient(-48deg, #006fb9 3%, #a9e0ff 50%, #006fb9 97%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rewards-card { width: 100%; aspect-ratio: 786/379; object-fit: cover; filter: drop-shadow(0 0 16px rgba(100,200,255,.55)); }
.achievement { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font-size: 15px; width: 311px; max-width: 100%; }
.achievement b { color: var(--malibu); font-size: 20px; font-weight: 700; letter-spacing: .5px; margin: 0 4px; }
.achievement .small { margin-top: 4px; }
.share-wrap { width: 100%; padding: 20px 40px; display: flex; justify-content: center; }
.btn-share { width: 100%; max-width: 311px; height: 52px; border-radius: 12px; background: var(--azure); font-size: 16px; font-weight: 700; letter-spacing: .5px; }

/* footer */
.footer { width: 100%; max-width: 480px; margin: 0 auto; padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--navy); font-size: 12px; line-height: 20.4px; letter-spacing: .5px; text-align: center; }
.footer hr { width: 100%; border: 0; height: 1px; background: rgba(0,74,134,.25); }
.socials { display: flex; gap: 16px; align-items: center; }

/* terms dialog */
.terms { margin: auto; width: min(348px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid rgba(100,200,255,.3); border-radius: 20px; background: linear-gradient(to bottom, #07233a, #040d15); color: #fff; padding: 0; overflow: hidden; box-shadow: 0 0 20px rgba(0,111,185,.55); }
.terms[open] { display: flex; flex-direction: column; gap: 12px; }
.terms::backdrop { background: rgba(0,0,0,.65); }
.sheet-head { padding: 22px 20px 14px; text-align: center; font-size: 18px; font-weight: 900; line-height: 28.8px; letter-spacing: .72px; }
.terms-body { padding: 15px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; max-height: 294px; font-size: 13px; line-height: 22.75px; color: rgba(255,255,255,.88); display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.terms-body h3 { color: var(--malibu); font-size: 15px; font-weight: 700; line-height: 26.25px; }
.terms-body ol { list-style: none; counter-reset: t; display: flex; flex-direction: column; gap: 12px; }
.terms-body li { counter-increment: t; display: flex; gap: 6px; }
.terms-body li::before { content: counter(t) "."; flex: none; width: 20.8px; }
.sheet-foot { padding: 14px 20px 20px; }
.sheet-foot .btn-share { max-width: none; }

/* save view */
.view-save { gap: 20px; }
.save-hint { width: 100%; padding: 0 20px; }
.save-hint p { padding: 8px 0; text-align: center; font-size: 16px; font-weight: 700; letter-spacing: .5px; background: linear-gradient(90deg, rgba(0,114,206,0), rgba(0,114,206,.55), rgba(0,114,206,0)); }
.save-img { width: 100%; height: auto; min-height: 200px; -webkit-touch-callout: default; user-select: auto; }
.btn-close { max-width: 120px; }
.page[data-view="save"] .footer { display: none; }
/* 截圖時 .stamp-top 自帶頁面的藍色光暈底色 (對應 Figma 存圖頁) */
.stamp-top.capturing {
  background:
    radial-gradient(ellipse 95% 280px at 50% 0, rgba(0,114,206,.5), rgba(0,114,206,0)),
    radial-gradient(ellipse 95% 220px at 50% 100%, rgba(0,111,185,.4), rgba(0,111,185,0)),
    #000;
}
.sheet-foot .btn-share:focus:not(:focus-visible) { outline: none; }
.page[data-view="save"] { background: #000; }

/* 存圖頁：關閉按鈕下方預留空間，避免被手機瀏覽器工具列/底部手勢列擋住 */
.view-save { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
