/* 消費者流程頁面樣式，對照 docs/Fanta_素材確認網站_Demo與規格描述.html（本機文件，不進 git）的視覺設計。 */
:root{
  --orange:#ff7a00;
  --orange2:#ff9e36;
  --navy:#143657;
  --ink:#172033;
  --muted:#6b7280;
  --bg:#fff8f1;
  --card:#ffffff;
  --line:#eadfd4;
  --soft:#fff1df;
  --green:#0c8a5f;
  --red:#c83f49;
  --shadow:0 16px 40px rgba(54,35,14,.10);
  --radius:24px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(circle at 90% 5%,rgba(255,157,54,.15),transparent 26%),
    linear-gradient(180deg,#fffaf5 0%,#fff6ed 100%);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","Microsoft JhengHei",sans-serif;
}
a{text-decoration:none;color:inherit}
.page{max-width:1080px;margin:0 auto;padding:0 18px 70px}
header{
  position:sticky;top:0;z-index:30;
  backdrop-filter:blur(14px);
  background:rgba(255,250,245,.88);
  border-bottom:1px solid rgba(234,223,212,.85);
}
.header-inner{
  max-width:1080px;margin:0 auto;padding:14px 18px;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
}
.brand{display:flex;align-items:center;gap:12px}
.brandmark{
  width:52px;height:52px;flex:none;display:block;object-fit:contain
}
.brand h1{font-size:19px;margin:0;color:var(--navy)}
.brand p{font-size:12px;color:var(--muted);margin:2px 0 0}
nav{display:flex;gap:8px;flex-wrap:wrap}
nav a{
  background:transparent;color:var(--navy);border:0;
  padding:9px 12px;border-radius:12px;font-weight:800;cursor:pointer
}
nav a:hover,nav a.is-active{background:#fff0df}

.hero-banner{
  position:relative;width:100%;aspect-ratio:16/7;overflow:hidden;
  background:linear-gradient(135deg,#ff8a00 0%,#ff6600 58%,#ef4f00 100%);
}
.hero-banner-fallback{
  position:absolute;inset:0;z-index:1;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;color:#fff;padding:24px;
}
.hero-banner-fallback h2{font-size:clamp(24px,5vw,40px);margin:0 0 10px}
.hero-banner-fallback p{margin:0;max-width:640px;line-height:1.8;font-size:clamp(13px,2vw,16px)}
.hero-banner-img{
  position:relative;z-index:2;
  display:block;width:100%;height:100%;object-fit:cover;
}
.campaign-period{text-align:center;margin:20px 0 0}
.campaign-period span{
  display:inline-block;padding:8px 16px;border-radius:999px;
  background:#fff1df;color:#8d4f11;font-weight:700;font-size:13px;
  border:1px solid #f0d4b3;
}

.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  padding:26px
}
.card h3{font-size:23px;color:var(--navy);margin:0 0 8px}
.lead{color:var(--muted);line-height:1.75;margin:0 0 20px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.full{grid-column:1/-1}
label{display:block;font-size:14px;font-weight:800;margin:0 0 7px}
input,select,textarea{
  width:100%;border:1px solid #d9d1c8;border-radius:14px;
  padding:12px 13px;background:#fff;font:inherit;color:var(--ink);outline:none
}
input:focus,select:focus,textarea:focus{
  border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,122,0,.10)
}
input[readonly]{background:#fbf7f2;color:#6b7280}
textarea{min-height:110px;resize:vertical}
.agree{display:flex;gap:10px;align-items:flex-start;margin-top:4px}
.agree input{width:auto;margin-top:4px}
.agree label{font-weight:500;line-height:1.7;margin:0}
.btnrow{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
button.action,a.action{
  display:inline-flex;align-items:center;justify-content:center;
  border:0;border-radius:14px;padding:13px 18px;cursor:pointer;font-weight:900;font-size:15px
}
.primary{background:var(--orange);color:#fff}
.secondary{background:#edf3f7;color:var(--navy)}
.ghost{background:#fff7ee;color:#8d4f11;border:1px solid #f0d4b3!important}
.result .redirect-note{margin-top:14px;font-size:14px}
.result .redirect-note b{color:var(--orange);font-size:18px}

.side-title{font-size:16px;font-weight:900;color:var(--navy);margin-bottom:12px}
.prize-list{display:grid;gap:10px}
.prize{
  padding:13px;border-radius:15px;background:#fffaf5;border:1px solid #f0dfcf
}
.prize-img{
  display:block;width:100%;aspect-ratio:1/1;object-fit:contain;
  margin:0 0 10px;border-radius:12px;background:#fff
}
.prize strong{display:block;color:var(--navy);margin-bottom:4px}
.prize span{font-size:12px;color:var(--muted);line-height:1.6}
.prize-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}

.draw-overlay{
  position:fixed;inset:0;z-index:100;
  background:rgba(23,32,51,.6);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.draw-overlay.hidden{display:none!important}
.draw-overlay-inner{
  background:var(--card);border-radius:var(--radius);box-shadow:0 30px 70px rgba(0,0,0,.35);
  position:relative;z-index:1;
  max-width:400px;width:100%;max-height:90vh;
  overflow-x:hidden;overflow-y:auto;
  padding:30px 24px 26px;
}

/* 抽獎轉盤（views/public/partials/draw-wheel.ejs + public/js/site.js）
   .wheel-frame 的狀態 class：is-spinning（等待後端結果，快速轉）→ is-slowing（減速停到結果格）→ is-stopped（開出格子閃爍） */
@keyframes wheel-spin-fast{ to{ transform:rotate(360deg); } }
.wheel.spinning{ animation:wheel-spin-fast .85s linear infinite; }

.draw-stage{text-align:center}
.wheel-caption{font-weight:900;color:var(--navy);margin:0 0 10px;font-size:18px;min-height:1.4em}
.wheel-caption.is-win{color:#d4480b}
.wheel-frame{position:relative;width:260px;height:260px;margin:30px auto 0}
.wheel-rim,.wheel,.wheel-glow{position:absolute;inset:0;display:block;width:100%;height:100%}
.wheel-rim{border-radius:50%;box-shadow:0 14px 34px rgba(54,35,14,.35)}
.wheel{transform:rotate(0deg);will-change:transform}
.wheel-star{fill:#ffcf4a;opacity:.9}

.bulb{fill:#ffe7a8}
.wheel-frame.is-spinning .bulb,.wheel-frame.is-slowing .bulb{animation:bulb-blink .5s steps(1) infinite}
.wheel-frame.is-spinning .bulb-b,.wheel-frame.is-slowing .bulb-b{animation-delay:.25s}
.wheel-frame.is-stopped .bulb{animation:bulb-blink .22s steps(1) infinite}
.wheel-frame.is-stopped .bulb-b{animation-delay:.11s}
@keyframes bulb-blink{
  0%{fill:#fff6d6;filter:drop-shadow(0 0 3px #ffcf4a)}
  50%{fill:#7a4a1c;filter:none}
}

.wheel-glow{pointer-events:none;opacity:0}
.wheel-glow path{fill:#fff;fill-opacity:.32;stroke:#ffe07a;stroke-width:2.5}
.wheel-frame.is-stopped .wheel-glow{animation:glow-pulse .45s ease-in-out 3 alternate forwards}
@keyframes glow-pulse{ from{opacity:.15} to{opacity:1} }

.wheel-pointer{
  position:absolute;top:-24px;left:50%;width:30px;height:40px;margin-left:-15px;z-index:5;
  transform-origin:50% 12.5px;
  filter:drop-shadow(0 3px 3px rgba(54,35,14,.45));
}
.wheel-frame.is-spinning .wheel-pointer{animation:pointer-tick .12s ease-in-out infinite alternate}
.wheel-frame.is-slowing .wheel-pointer{animation:pointer-tick .28s ease-in-out infinite alternate}
@keyframes pointer-tick{ from{transform:rotate(-9deg)} to{transform:rotate(7deg)} }
.wheel-frame.is-stopped .wheel-pointer{animation:pointer-land .5s cubic-bezier(.3,1.6,.5,1)}
@keyframes pointer-land{ 0%{transform:rotate(-14deg)} 100%{transform:rotate(0)} }

.wheel-hub{
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:56px;height:56px;border-radius:50%;z-index:4;
  background:#fff;border:3px solid #ffb13b;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 12px rgba(0,0,0,.35);
}
.wheel-hub img{width:40px;height:40px;object-fit:contain}

.wheel-legend{
  list-style:none;margin:22px 0 0;padding:0;
  display:flex;flex-wrap:wrap;justify-content:center;gap:6px 12px;
  font-size:12px;color:var(--muted)
}
.wheel-legend li{display:flex;align-items:center;gap:5px}
.legend-icon{
  width:22px;height:22px;border-radius:50%;flex:none;
  display:inline-flex;align-items:center;justify-content:center
}
.legend-icon.is-orange{background:#ff6b1a}
.legend-icon.is-purple{background:#9b1b8e}
.legend-icon img{max-width:15px;max-height:15px}

/* 中獎彩帶：由 site.js 動態產生在 #drawOverlay 底下，蓋在卡片上面但不擋點擊 */
.confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:2}
.confetti-piece{
  position:absolute;top:-16px;left:var(--x);width:8px;height:13px;border-radius:2px;
  background:var(--c);opacity:.95;
  animation:confetti-fall var(--d) cubic-bezier(.25,.6,.45,1) var(--delay) forwards;
}
@keyframes confetti-fall{
  to{transform:translate(var(--dx),108vh) rotate(var(--r));opacity:.9}
}

.result{
  text-align:center;padding:28px 10px 12px
}
.result .icon{font-size:64px;line-height:1}
.result h2{font-size:31px;color:var(--navy);margin:12px 0 8px}
.result p{color:var(--muted);line-height:1.8;max-width:650px;margin:0 auto}
.code{
  max-width:430px;margin:20px auto 0;padding:17px 18px;border-radius:16px;
  border:1px dashed #e1a14c;background:#fff6df;
  color:#7d4700;font-size:25px;font-weight:900;letter-spacing:1.5px
}

.claim-banner{
  background:#fff7e9;border:1px solid #efc988;border-radius:17px;
  padding:15px 16px;line-height:1.75;color:#6b4d2c;margin-bottom:18px
}
.upload{
  padding:14px;border:1.5px dashed #cfc2b5;border-radius:15px;background:#fffdf9
}
.upload .help{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.55}
.upload-preview{margin:10px 0 0}
.upload-preview[hidden]{display:none}
.upload-preview img{
  display:block;max-width:100%;max-height:220px;
  border:1px solid var(--line);border-radius:10px;object-fit:contain
}
.upload-preview figcaption{font-size:12px;color:#69492c;margin-top:6px;line-height:1.55}
.notice{
  margin-top:16px;padding:13px 14px;border-left:4px solid var(--orange);
  background:#fff7ed;border-radius:9px;color:#69492c;line-height:1.75
}

.history-filter{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.history-list{margin-top:18px;border-top:1px solid var(--line)}
.history-row{
  padding:15px 0;border-bottom:1px solid var(--line);
  display:flex;justify-content:space-between;gap:14px;align-items:center;flex-wrap:wrap
}
.pill{
  font-size:12px;font-weight:900;border-radius:999px;padding:5px 9px;
  background:#edf3f7;color:var(--navy)
}
.pill.pending{background:#fff2df;color:#915000}
.pill.submitted{background:#eef4ff;color:#244a9b}
.pill.reviewing{background:#f5efff;color:#6242a8}
.pill.done{background:#eaf8ef;color:#1d7a4f}
.pill.win{background:#eef8ff;color:#12507c}
.pill.lose{background:#f1f3f5;color:#55606f}
.info-list{
  margin:18px auto 0;max-width:520px;text-align:left;
  border:1px solid #f0dfcf;background:#fffaf5;border-radius:16px;padding:14px 16px
}
.info-list div{
  padding:8px 0;border-bottom:1px solid #f0e7df;font-size:14px;color:#4b5563
}
.info-list div:last-child{border-bottom:0}
.info-list strong{display:inline-block;min-width:86px;color:var(--navy)}
.redeem-steps,.redeem-notes{margin:6px 0 0;padding-left:22px;line-height:1.7}
.redeem-notes{color:var(--muted);font-size:13px}
.history-row .info-list{margin:10px 0 0;max-width:none}
.history-actions{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end
}
.history-action{
  border:0;border-radius:10px;padding:8px 11px;background:var(--orange);
  color:white;font-weight:900;cursor:pointer;font-size:12px
}

#rules,#draw{scroll-margin-top:86px}
.rules-heading{font-size:26px;font-weight:900;color:#182233;margin:32px 0 16px}
.rules-heading:first-child{margin-top:0}
.rules-heading span{
  background-image:linear-gradient(to top, #f7a83c 0 40%, transparent 40% 100%);
  padding:0 6px;
}
.rules{line-height:1.9;color:#4b5563}
.rules li{margin-bottom:8px}
.rules ul{margin:6px 0 0;padding-left:20px}
.rules ul li{margin-bottom:4px}
.rules-prize-list{line-height:1.9;color:#4b5563;margin:0 0 20px}
.rules-prize-list li{margin-bottom:6px}

.hidden{display:none!important}
footer{padding:30px 0 0;text-align:center;color:#9a8d80;font-size:12px}

@media(max-width:820px){
  .header-inner{flex-wrap:wrap;padding:12px 16px}
  .brand{flex:1 1 auto}
  nav{
    order:3;flex:1 1 100%;
    display:flex;justify-content:space-between;gap:4px;
    margin-top:2px;
  }
  nav a{flex:1 1 auto;text-align:center;padding:9px 6px;font-size:13px}
  .grid,.history-filter{grid-template-columns:1fr}
  .hero-banner{aspect-ratio:4/5}
}

@media(max-width:480px){
  .page{padding:0 14px 56px}
  .card{padding:18px 16px;border-radius:18px}
  .card h3{font-size:20px}
  .brand h1{font-size:16px}
  .brand p{font-size:11px}
  .brandmark{width:44px;height:44px}
  .prize-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .prize{padding:10px}
  .btnrow{flex-direction:column}
  .btnrow .action{width:100%}
  .wheel-frame{width:236px;height:236px}
  .draw-overlay-inner{padding:24px 18px 20px}
  .result h2{font-size:26px}
  .result .icon{font-size:52px}
  .code{font-size:20px;padding:14px 12px}
  .history-row{flex-direction:column;align-items:flex-start}
  .history-actions{justify-content:flex-start;width:100%}
  .info-list strong{display:block;min-width:0;margin-bottom:2px}
}
