:root{--blue:#2342BF;--green:#DFFF48;--cream:#F5F0E3;--pink:#F5C3CF;--sky:#BCD2FF;--yellow:#FFDAA0;--red:#BD4038;font-family:'Noto Sans TC',sans-serif;color:var(--cream);background:var(--blue);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button{font:inherit}button:focus-visible{outline:3px solid var(--cream);outline-offset:6px}.filters{position:absolute;width:0;height:0}.simple{min-height:100svh;display:grid;place-content:center;gap:20px;text-align:center}.primary{border:1px solid var(--green);background:var(--green);color:var(--blue);padding:16px 38px;min-width:230px;font-weight:700;font-size:18px;cursor:pointer;transition:background .15s,transform .15s}.primary:hover:not(:disabled){background:var(--cream);border-color:var(--cream);transform:translateY(-2px)}.primary:disabled{background:transparent;color:#a6b5f0;border-color:#7489da;cursor:not-allowed}.primary.completed:disabled{background:var(--green);color:var(--blue);border-color:var(--green)}
.stage{min-height:100svh;padding:40px 48px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:34px}
.ballot-wrap{width:min(1180px,100%);perspective:1200px}
/* 抖動掛在外層容器。掛在 .ballot 上的話，移除 class 會讓它的常駐 arrive 動畫重播，整張紙閃一下。 */
.ballot-wrap.rejected{animation:nudge .4s ease-in-out}
.ballot{position:relative;overflow:hidden;background:var(--paper);color:var(--blue);padding:25px;box-shadow:0 3px 0 #0002,0 13px 24px #10258b55;isolation:isolate;animation:arrive .4s ease-out}
.ballot:after,.sheet:after{content:'';position:absolute;inset:0;pointer-events:none;z-index:2;opacity:.16;mix-blend-mode:multiply;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23888' filter='url(%23n)' opacity='.6' d='M0 0h180v180H0z'/%3E%3C/svg%3E")}
.ballot.leaving{animation:cast .4s ease-in forwards}
.ballot-layout{display:grid;grid-template-columns:30% 1fr;gap:18px;min-height:470px}
.award{position:relative;border:1.5px solid var(--blue);display:flex;flex-direction:row-reverse;align-items:center;justify-content:center;gap:12px;padding:24px 14px;isolation:isolate;overflow:hidden}
.event-title{writing-mode:vertical-rl;font-size:17px;letter-spacing:.16em;line-height:1.7}
.award h1{writing-mode:vertical-rl;font-size:29px;font-weight:700;letter-spacing:.16em;line-height:1.6;margin:0;z-index:1}
.award p{writing-mode:vertical-rl;font-size:13px;line-height:1.9;letter-spacing:.1em;max-height:385px;margin:0;z-index:1}
.event-seal{position:absolute;left:18px;top:50%;transform:translateY(-50%) rotate(-3deg);width:110px;height:110px;display:grid;place-content:center;writing-mode:vertical-rl;border:8px solid var(--red);outline:2px solid var(--red);outline-offset:3px;color:var(--red);opacity:.86;filter:url(#ink);z-index:-1;font-family:serif;font-size:36px;font-weight:900;line-height:1.12;letter-spacing:.02em}
.event-seal span{display:block}
.candidates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.candidate{position:relative;color:var(--blue);border:1.5px solid var(--blue);background:transparent;padding:0;display:flex;flex-direction:column;align-items:center;cursor:pointer;min-width:0}
.candidate:hover:not(:disabled){background:#ffffff18}.candidate:focus-visible{outline:3px solid var(--blue);outline-offset:-5px}.candidate:disabled{cursor:default}
.stamp-area{height:104px;display:grid;place-items:center;width:100%;border-bottom:1.5px solid var(--blue);flex-shrink:0}
.stamp{position:absolute;z-index:1;pointer-events:none;height:64px;width:64px;color:var(--red);filter:url(#ink);animation:stamp-press .22s ease-out;transform:translate(-50%,-50%) rotate(var(--angle))}
.number{width:100%;height:57px;display:grid;place-items:center;border-bottom:1.5px solid var(--blue);flex-shrink:0}
.number span{font-size:32px;font-weight:500;line-height:1}
.photo{margin:17px 12px 14px;width:calc(100% - 24px);height:112px;background:#2342bf0b;display:grid;place-content:center;border:1px solid #2342bf35;position:relative;overflow:hidden;flex-shrink:0}
.photo img{width:100%;height:100%;object-fit:cover;position:absolute;inset:0}.photo-placeholder{font-size:11px;letter-spacing:.12em;opacity:.65}
.shop{writing-mode:vertical-rl;text-orientation:upright;text-align:start;max-height:200px;min-height:150px;padding:0 0 20px;font-weight:500;font-size:23px;letter-spacing:.2em;line-height:1.6}
.dots{display:flex;gap:17px;align-items:center;height:16px}.dot{width:7px;height:7px;border-radius:50%;background:#f5f0e34d}.dot.done{background:var(--green)}.dot.current{background:var(--green);outline:1px solid var(--green);outline-offset:4px}
.status{max-width:560px;padding:30px;line-height:1.8}
.stamp-hint{position:absolute;z-index:3;left:25px;right:25px;padding:13px 16px;background:var(--red);color:var(--paper);font-size:17px;font-weight:700;letter-spacing:.04em;line-height:1.5;text-align:center;animation:arrive .2s ease-out backwards}
.finish{gap:28px}
.finish-seal,.finish-seal-image{justify-self:center;width:132px;height:132px;animation:stamp .34s ease-out .25s both}
.finish-seal{--angle:-3deg;display:grid;place-content:center;writing-mode:vertical-rl;border:9px solid var(--green);outline:2px solid var(--green);outline-offset:4px;color:var(--green);filter:url(#ink);font-family:serif;font-size:42px;font-weight:900;line-height:1.12;letter-spacing:.02em}
.finish-seal span{display:block}
.finish-seal-image{--angle:0deg;object-fit:contain}
.finish-line{margin:0;font-size:20px;letter-spacing:.08em}
.finish .primary{animation:arrive .35s ease-out .95s both}
@keyframes stamp{from{opacity:0;transform:scale(1.5) rotate(var(--angle))}to{opacity:1;transform:scale(1) rotate(var(--angle))}}@keyframes stamp-press{from{opacity:0;transform:translate(-50%,-50%) scale(1.5) rotate(var(--angle))}to{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(var(--angle))}}@keyframes nudge{10%,90%{transform:translateX(-7px)}30%,70%{transform:translateX(10px)}50%{transform:translateX(-10px)}}@keyframes cast{to{opacity:0;transform:translateY(160px) rotateX(18deg) scale(.94)}}@keyframes arrive{from{opacity:0;transform:translateY(-24px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:760px) and (min-width:701px){.stage{padding:25px 35px;gap:24px}.ballot{padding:20px}.ballot-layout{min-height:410px}.stamp-area{height:78px}.photo{height:95px;margin-top:12px;margin-bottom:12px}.shop{font-size:21px;min-height:140px;max-height:166px}.award p{max-height:345px}}
@media(max-width:900px){.stage{padding:25px 18px}.ballot{padding:16px}.ballot-layout{grid-template-columns:27% 1fr;gap:12px}.candidates{gap:8px}.award{gap:7px;padding:18px 8px}.event-title{font-size:13px}.award h1{font-size:24px}.award p{font-size:11px}.event-seal{width:105px;height:105px;font-size:34px;left:12px;border-width:5px}.shop{font-size:20px}.photo{margin-left:7px;margin-right:7px;width:calc(100% - 14px)}}
@media(max-width:600px){.stage{padding:20px 8px}.ballot{padding:10px}.ballot-layout{grid-template-columns:24% 1fr;gap:7px;min-height:400px}.candidates{gap:4px}.award{gap:5px;padding:12px 4px}.event-title{display:none}.award h1{font-size:19px}.award p{font-size:10px;max-height:340px;line-height:1.4}.event-seal{left:5px;width:65px;height:80px;font-size:24px}.stamp-area{height:80px}.stamp{height:42px;width:42px}.number{height:45px}.number span{font-size:25px}.photo{height:75px;margin:12px 4px;width:calc(100% - 8px)}.photo-placeholder{font-size:9px;writing-mode:vertical-rl}.shop{font-size:17px;max-height:175px;min-height:150px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

.event-seal-image{position:absolute;left:18px;top:50%;transform:translateY(-50%);width:110px;height:110px;object-fit:contain;z-index:-1}
@media(max-width:900px){.event-seal-image{left:12px;width:105px;height:105px}}
@media(max-width:600px){.event-seal-image{left:5px;width:65px;height:80px}}

/* 印章左右置中，垂直比正中央再低一點；文字印章與日後的 PNG 共用同一組位置。 */
.event-seal,.event-seal-image{--seal-drop:40px;left:50%;top:calc(50% + var(--seal-drop));bottom:auto;transform:translate(-50%,-50%);opacity:.60}
.event-seal{transform:translate(-50%,-50%) rotate(-3deg)}
@media(max-width:900px){.event-seal,.event-seal-image{--seal-drop:32px}}
@media(max-width:600px){.event-seal,.event-seal-image{--seal-drop:22px}}

/* 解鎖頁沿用說明頁的綠框藍底。密碼錯誤時整張框抖一下，沿用票單那組 nudge。 */
.gate{justify-self:center;width:min(430px,calc(100% - 32px));display:grid;justify-items:center;gap:18px;padding:38px 30px 32px;border:1.5px solid var(--green);animation:arrive .35s ease-out}
.gate.rejected{animation:nudge .4s ease-in-out}
.gate h1{margin:0;font-size:16px;font-weight:700;letter-spacing:.3em;text-indent:.3em;color:var(--green)}
.gate p{margin:0;font-size:14px;line-height:1.9;letter-spacing:.04em}
.gate-code{width:100%;padding:10px 0 14px;border:none;border-bottom:1.5px solid #f5f0e359;background:transparent;color:var(--cream);font-family:inherit;font-size:34px;font-weight:700;letter-spacing:.55em;text-indent:.55em;text-align:center}
.gate-code:focus{outline:none;border-bottom-color:var(--green)}
.gate .gate-error{min-height:1.4em;margin-top:-6px;color:var(--green);font-size:13px;letter-spacing:.03em}
@media(max-width:600px){.gate{padding:30px 20px 26px}.gate .primary{width:100%;min-width:0}}

/* 第一頁留在藍底上。logo 用 mask 填成米白，和內文同色；投票須知用綠框圈起來，
   標題壓在上框線上，所以框線不會把「投票須知」四個字關在裡面。 */
.intro{min-height:100svh;padding:40px 48px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:32px}
.intro-sheet{width:min(760px,100%);display:grid;justify-items:center;gap:22px;animation:arrive .4s ease-out}
/* logo 檔是白色去背，拿它當版用 mask 上色，不另外存一份有色的圖。 */
.intro-logo{width:min(420px,88%);aspect-ratio:2000/359;background:var(--green);-webkit-mask:url(assets/logo.webp) center/contain no-repeat;mask:url(assets/logo.webp) center/contain no-repeat}
.intro-title{margin:0;width:100%;display:flex;align-items:center;justify-content:center;gap:16px;font-size:15px;font-weight:500;letter-spacing:.5em;text-indent:.5em}
.intro-title:before,.intro-title:after{content:'';flex:1;max-width:110px;height:1px;background:#f5f0e359}
.intro-lead{margin:0;font-size:16px;line-height:2.05;letter-spacing:.04em;text-align:center;text-wrap:pretty}
.notice{position:relative;width:100%;margin-top:14px;padding:30px 28px 26px;border:1.5px solid var(--green);text-align:start}
/* 標題底色要跟頁面同色，才切得開框線。 */
.notice h2{position:absolute;top:0;left:24px;transform:translateY(-50%);margin:0;padding:0 14px;background:var(--blue);color:var(--green);font-size:15px;font-weight:700;letter-spacing:.3em;text-indent:.3em}
.notice ol{margin:0;padding-inline-start:1.9em;display:grid;gap:10px}
.notice li{font-size:15px;line-height:1.9;letter-spacing:.03em}
.notice li::marker{color:var(--green)}
@media(max-height:760px) and (min-width:701px){.intro{padding:28px 36px;gap:24px}.intro-sheet{gap:16px}.intro-logo{width:min(330px,76%)}.intro-lead{font-size:15px;line-height:1.9}.notice{margin-top:10px;padding:24px 24px 20px}.notice ol{gap:7px}.notice li{font-size:14px;line-height:1.75}}
@media(max-width:600px){.intro{padding:26px 14px;gap:24px}.intro-sheet{gap:18px}.intro-logo{width:92%}.intro-title{font-size:13px;letter-spacing:.4em;text-indent:.4em;gap:10px}.intro-title:before,.intro-title:after{max-width:34px}.intro-lead{font-size:15px;line-height:1.95}.notice{padding:26px 16px 22px}.notice h2{left:14px;padding:0 10px;font-size:13px;letter-spacing:.24em;text-indent:.24em}.notice ol{padding-inline-start:1.7em}.notice li{font-size:14px}.intro .primary{width:100%;min-width:0}}
