:root{--red:#d7002f;--ink:#222;--line:#ddd}*{box-sizing:border-box}body{margin:0;background:#f5f5f2;color:var(--ink);font:16px system-ui,"Noto Sans TC",sans-serif}header{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;padding:12px max(16px,calc((100% - 1180px)/2));background:#fff;border-bottom:1px solid var(--line)}button{border:0;border-radius:9px;padding:11px 15px;background:var(--red);color:#fff;font-weight:800;cursor:pointer}.brand{display:flex;gap:9px;align-items:center;font-size:28px}.brand span{display:grid}.brand b{font-size:20px}.brand small{font-size:10px;color:var(--red);letter-spacing:.13em}#ticker{padding:9px;text-align:center;background:var(--red);color:#fff;font-weight:800}main{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:20px;max-width:1180px;margin:auto;padding:22px 16px}.hero,aside section{background:#fff;border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:0 10px 32px #0001}.hero{text-align:center}.hero h1{font-size:clamp(34px,6vw,62px);margin:8px}.machine{position:relative;width:280px;height:360px;margin:10px auto;filter:drop-shadow(0 20px 16px #0004);perspective:700px}.glass{position:absolute;left:35px;top:0;width:210px;height:190px;border:7px solid #eee;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fff9,transparent 15%),#bff4ff66;overflow:hidden;transform:rotateY(-8deg)}.ball{position:absolute;width:48px;height:48px;border-radius:50%;border:3px solid #fff;background:linear-gradient(#fff 49%,#ddd 50%);animation:float 2s ease-in-out infinite alternate}.ball:nth-child(3n){background:linear-gradient(#ffd94d 49%,#b78a11 50%)}@keyframes float{to{transform:translate(20px,-14px) rotate(120deg)}}.body{position:absolute;left:20px;top:160px;width:240px;height:160px;border:7px solid #eee;border-radius:22px;background:linear-gradient(120deg,#fa5965,var(--red) 45%,#880018);transform:rotateY(-7deg)}.sushi{position:absolute;left:28px;top:35px;font-size:48px}.body #crank{position:absolute;right:22px;top:34px;width:62px;height:62px;border:8px solid #eee;border-radius:50%;background:#ffc928;color:#333}.spin #crank{animation:spin .3s linear infinite}.spin .glass{animation:shake .12s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@keyframes shake{50%{transform:rotateY(-8deg) translateX(3px)}}.slot{position:absolute;left:75px;bottom:-25px;width:90px;height:45px;border:7px solid #eee;border-radius:10px;background:#222}form,#player{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}input,select{min-width:180px;padding:11px;border:1px solid #ccc;border-radius:9px;background:#fff}#results{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:14px}.result,.row{padding:10px;border:1px solid var(--line);border-radius:10px;background:#fafafa}.result.grand{background:linear-gradient(135deg,#ffd6f6,#d8eaff)}.result.first{background:#fff4c8}.row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:7px 0}.row small{display:block;color:#777}aside section+section{margin-top:18px}nav{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:center;gap:10px;padding:8px;background:#fff;border-top:1px solid #ddd}nav a{color:#a00025;font-weight:700;text-decoration:none;padding:8px}dialog{width:min(920px,94vw);max-height:88vh;border:0;border-radius:18px;padding:24px;box-shadow:0 25px 90px #0006}.close{float:right;background:#eee;color:#222}.tabs{display:flex;gap:5px;flex-wrap:wrap;margin:12px 0}.tabs button{background:#333}.danger{background:#fff;color:#b00028;border:1px solid #d7002f}@media(max-width:780px){main{grid-template-columns:1fr}.hero{padding:18px 10px}.machine{transform:scale(.88);margin:-5px auto -15px}header{padding:10px 12px}#adminBtn{font-size:0}#adminBtn:first-letter{font-size:18px}body{padding-bottom:58px}}

/* Version 2: original storefront proportions, with independent machine and login regions. */
[hidden]{display:none!important}body{background:#f6f6f4;background-image:linear-gradient(90deg,transparent 49.9%,#e9e9e7 50%,transparent 50.1%)}button:disabled{opacity:.55;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e5a900;outline-offset:2px}
header{padding:0 18px;box-shadow:0 2px 14px #1d1d1d12}.header-inner{width:100%;max-width:1240px;min-height:68px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{min-width:0}.brand-icon{width:42px;height:42px;display:grid!important;place-items:center;background:var(--red);border-radius:6px;box-shadow:inset 0 -4px 0 #99001f;font-size:25px}.brand>b{line-height:1}.brand small{font-weight:900}.header-actions{display:flex;align-items:center;gap:9px;min-width:0}.header-actions nav{position:static;display:flex;gap:7px;padding:0;border:0;background:none}.header-actions nav a{padding:9px 11px;border:1px solid #ddd;border-radius:8px;color:#333;background:white;font-size:13px;white-space:nowrap}.header-actions nav a:hover{border-color:var(--red);color:var(--red)}#adminBtn{position:relative;z-index:7;white-space:nowrap}#ticker{border-bottom:4px solid #242424;font-size:12px;letter-spacing:.09em;white-space:nowrap;overflow:auto}main{max-width:1240px;gap:22px;grid-template-columns:minmax(0,1fr) 340px;padding:24px 16px 86px}.hero,aside section{box-shadow:0 12px 35px #20202012}.hero{min-width:0;padding:28px 24px 30px;border-top:6px solid var(--red);background:radial-gradient(circle at 50% 25%,#d7002f0e,transparent 42%),#fff}.eyebrow{display:inline-block;padding:7px 14px;border:1px solid var(--red);border-radius:40px;color:var(--red);background:#fff5f7;font-size:12px;font-weight:900;letter-spacing:.2em}.hero h1{font-family:Impact,"Arial Black",system-ui,sans-serif;letter-spacing:.04em;margin:12px 0 8px}.intro{color:#666;font-size:14px;line-height:1.75;max-width:510px;margin:0 auto}.machine-stage{position:relative;isolation:isolate;height:430px;max-width:660px;margin:0 auto 16px;overflow:hidden}.machine-stage:before{content:"";position:absolute;inset:5% 10% 0;border-radius:50%;background:radial-gradient(circle,#ffd84827,transparent 66%);pointer-events:none}#machine3d{position:absolute;inset:-28px -45px -8px;pointer-events:none;filter:drop-shadow(0 26px 24px #5556)}#machine3d canvas{width:100%;height:100%;display:block}.has-webgl .machine{display:none}#machineStatus{position:absolute;z-index:2;bottom:7px;left:50%;transform:translateX(-50%);padding:8px 13px;border-radius:30px;white-space:nowrap;color:#ad0026;background:#fffffff0;font-size:13px;font-weight:900;box-shadow:0 4px 18px #0002}#machineStatus:empty{display:none}
#login,#player{position:relative;z-index:3;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;max-width:660px;margin:0 auto;padding:14px;border:1px solid #dadada;border-radius:17px;background:#f6f6f4;gap:10px;text-align:left}#login label{display:block;color:#666;font-size:11px;font-weight:800}#login input{display:block;width:100%;min-width:0;margin-top:5px}#login button{min-height:44px}#player{grid-template-columns:minmax(0,1fr) auto 90px auto;align-items:center}.player-name small{display:block;color:#777;font-size:11px}.player-name b{display:block;overflow-wrap:anywhere}.draw-remaining{white-space:nowrap;color:#b00027;font-weight:700}#count{min-width:0;width:100%}#results{max-width:660px;margin:14px auto 0}.result{display:grid;gap:4px;min-width:140px;max-width:100%;padding:11px 13px;background:white;box-shadow:0 8px 18px #3332;overflow-wrap:anywhere}.result b{font-size:11px;color:#777}.result span{font-size:13px;font-weight:900}.result.first{border-color:#e6bd3d}.result.grand{border-color:#b96bce}#msg{color:#bd002a;font-weight:800}#msg:empty{display:none}
aside section{padding:19px}.section-title span{font-size:10px;letter-spacing:.14em;color:var(--red);font-weight:900}.section-title h2{margin:3px 0 16px;font-size:21px}.prize-card{display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:10px;margin:9px 0;padding:10px;border:1px solid #ddd;border-radius:14px;background:#fafafa}.prize-card.grand{border-color:#c786d5}.prize-card.first{border-color:#d9b84e}.prize-art{display:grid;place-items:center;width:56px;height:56px;border-radius:12px;background:#efefed;color:var(--red);font-size:26px;overflow:hidden}.prize-art img{width:100%;height:100%;object-fit:cover}.prize-card small{font-size:9px;color:#747474}.prize-card h3{font-size:13px;line-height:1.3;margin:3px 0;overflow-wrap:anywhere}.prize-card p{font-size:11px;color:#b00027;margin:0}.odds{text-align:right;white-space:nowrap}.odds b{display:block;font-size:13px}.odds span{display:block;margin-top:3px;color:#777;font-size:10px}.winner{display:flex;align-items:start;gap:9px;padding:11px 0;border-bottom:1px solid #eee}.winner i{flex:none;width:10px;height:10px;margin-top:5px;border-radius:50%;background:#ddd}.winner i.first{background:#e7ba29}.winner i.grand{background:conic-gradient(#e85b82,#ffe251,#64d48a,#51acff,#c97cef,#e85b82)}.winner b,.winner small{display:block;font-size:12px}.winner small{margin-top:2px;color:#777}.statistics{display:grid;grid-template-columns:1fr 1fr;text-align:center}.statistics div+div{border-left:1px solid #ddd}.statistics b,.statistics small{display:block}.statistics b{font-size:21px}.statistics small{color:#777;font-size:11px}dialog::backdrop{background:#000a;backdrop-filter:blur(5px)}dialog{color:#222}.row{min-width:0}.row span{min-width:0;overflow-wrap:anywhere}.row input{min-width:0;max-width:100%}.tabs{overflow-x:auto}.tabs button{white-space:nowrap}
@media(max-width:900px){main{grid-template-columns:1fr}.header-actions nav{position:fixed;z-index:6;bottom:0;left:0;right:0;justify-content:center;padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:#fffffff3;border-top:1px solid #ddd;box-shadow:0 -5px 18px #2222}.header-actions nav a{flex:1;max-width:240px;text-align:center;white-space:normal;font-size:12px}.hero{padding:25px 16px}body{padding-bottom:calc(55px + env(safe-area-inset-bottom))}}
@media(max-width:640px){body{background-image:none}.header-inner{min-height:60px}.brand-icon{width:38px;height:38px}.brand b{font-size:18px}.brand small{font-size:9px;letter-spacing:.08em}#adminBtn{font-size:19px;width:42px;height:42px;padding:0}#adminBtn span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.hero{padding:22px 13px}.hero h1{font-size:clamp(31px,9vw,46px)}.intro{font-size:13px}.machine-stage{height:340px;margin:4px auto 18px}#machine3d{inset:-10px -72px -6px}.machine{transform:scale(.84);transform-origin:top center;margin:0 auto}#login{grid-template-columns:1fr;padding:12px}#login button{width:100%}#player{grid-template-columns:1fr auto;gap:9px}#player select,#player button{width:100%}.prize-card{grid-template-columns:50px minmax(0,1fr) auto}.prize-art{width:50px;height:50px}dialog{padding:18px 12px}.row{flex-wrap:wrap}.row>button{max-width:100%}}
@media(max-width:380px){.machine-stage{height:305px}#machine3d{inset:0 -64px}.odds b{font-size:11px}.prize-card{gap:7px;padding:8px}}
@media(prefers-reduced-motion:reduce){.ball,.spin #crank,.spin .glass{animation:none!important}}

/* Player history and four-tier reveal sequence. */
#myRecords{margin:30px auto 0;max-width:660px;padding:18px 16px;border:1px solid #ddd;border-radius:16px;background:#fff;text-align:left}#myRecords h2{margin:0 0 8px;font-size:19px}#mySummary{padding:10px 12px;border-radius:9px;background:#fff1f4;color:#a00026;font-weight:800}#myHistory article{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 10px;padding:12px 2px;border-bottom:1px solid #eee;font-size:12px}#myHistory time{color:#777}#myHistory span{grid-column:1/-1;overflow-wrap:anywhere}#myHistory p{font-size:13px;color:#777}.prize-card.second{border-color:#a1afbb}.winner i.second{background:linear-gradient(135deg,#fff,#9daebd)}
.prize-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0;align-items:end;justify-content:stretch}.prize-form label{font-size:12px;color:#666;font-weight:700}.prize-form input,.prize-form select{display:block;margin-top:5px;width:100%;min-width:0}.prize-form button{min-height:44px}.form-hint{font-size:12px;color:#777}.tabs .active{background:#a60024}
#revealOverlay{position:fixed;z-index:30;inset:0;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 50% 42%,#52122edd,transparent 70%),#080811ed;backdrop-filter:blur(7px);color:#fff;text-align:center}#revealStage{width:min(680px,100%)}#skipReveal{position:absolute;right:18px;top:18px;background:#fff2;border:1px solid #fff5}.reveal-counter{margin-bottom:22px;font-weight:900;letter-spacing:.12em}.capsule-dropzone{display:flex;flex-wrap:wrap;justify-content:center;align-items:end;gap:16px;min-height:170px}.falling-ball,.spotlight-ball{position:relative;width:70px;height:70px;flex:none;border-radius:50%;background:linear-gradient(180deg,#fff 0 46%,#d4dce2 47% 53%,#f9fafb 54%);box-shadow:inset -10px -11px 18px #54637277,inset 6px 5px 13px #fff,0 9px 22px #0008}.falling-ball:after,.spotlight-ball:after{content:"";position:absolute;inset:48% 0 auto;height:5px;border-radius:30px;background:#fff9;box-shadow:0 3px 4px #0004}.falling-ball.grand,.spotlight-ball.grand{background:conic-gradient(#fd597f,#ffda51,#68dc8f,#5bafff,#bf71ff,#fd597f);box-shadow:inset -10px -12px 18px #4a2368aa,0 0 28px #d367ff88,0 12px 25px #0009}.falling-ball.first,.spotlight-ball.first{background:linear-gradient(#ffe89d 0 46%,#a97210 47% 53%,#f8c734 54%);box-shadow:inset -10px -12px 18px #5c360088,0 0 28px #ffc83a66,0 12px 25px #0009}.falling-ball.second,.spotlight-ball.second{background:linear-gradient(#f9fdff 0 46%,#7a8d9e 47% 53%,#b7c4ce 54%);box-shadow:inset -10px -12px 18px #4f647588,0 0 28px #bad8ed66,0 12px 25px #0009}.falling-ball{animation:fall-capsule .75s calc(var(--index)*.16s) cubic-bezier(.2,.8,.28,1.3) both}.spotlight{display:grid;justify-items:center;gap:20px}.spotlight.featured{filter:drop-shadow(0 0 30px #ffffff77)}.spotlight-ball{width:155px;height:155px;animation:closeup .65s both}.spotlight-ball .shell-top,.spotlight-ball .shell-bottom{position:absolute;inset:0;border-radius:50%;background:inherit}.spotlight-ball .shell-top{clip-path:inset(0 0 50%);animation:open-top 1.15s .45s both}.spotlight-ball .shell-bottom{clip-path:inset(50% 0 0);animation:open-bottom 1.15s .45s both}.spotlight-ball{background:transparent!important;box-shadow:none!important}.spotlight-ball:after{display:none}.spotlight-ball.grand .shell-top,.spotlight-ball.grand .shell-bottom{background:conic-gradient(#fd597f,#ffda51,#68dc8f,#5bafff,#bf71ff,#fd597f)}.spotlight-ball.first .shell-top,.spotlight-ball.first .shell-bottom{background:linear-gradient(#ffe89d,#bd8916,#f8c734)}.spotlight-ball.second .shell-top,.spotlight-ball.second .shell-bottom{background:linear-gradient(#fff,#8799aa,#c9d3db)}.spotlight-ball.normal .shell-top,.spotlight-ball.normal .shell-bottom{background:linear-gradient(#fff,#aab8c4,#f7f8fa)}.spotlight-prize{display:grid;gap:7px;min-width:min(340px,90vw);padding:18px;border:1px solid #fff5;border-radius:17px;background:#fff;color:#242424;box-shadow:0 15px 45px #0008;animation:show-prize .5s .7s both}.spotlight-prize small{font-weight:900;color:#a90028}.spotlight-prize strong{font-size:clamp(19px,5vw,31px);overflow-wrap:anywhere}.spotlight.grand .spotlight-prize{border:3px solid #ca89ff;background:linear-gradient(125deg,#fff1fa,#fff9d8,#f0f6ff)}.spotlight.first .spotlight-prize{border:3px solid #ffc94c}.spotlight.second .spotlight-prize{border:3px solid #becbd6}@keyframes fall-capsule{from{opacity:0;transform:translateY(-170px) scale(.55) rotate(-40deg)}70%{opacity:1;transform:translateY(12px) rotate(22deg)}to{opacity:1;transform:translateY(0) rotate(0)}}@keyframes closeup{from{opacity:0;transform:scale(.2) rotate(-40deg)}to{opacity:1;transform:scale(1)}}@keyframes open-top{to{transform:translate(-35px,-48px) rotate(-30deg);opacity:.15}}@keyframes open-bottom{to{transform:translate(35px,38px) rotate(30deg);opacity:.15}}@keyframes show-prize{from{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:none}}@media(max-width:640px){.prize-form{grid-template-columns:1fr}.capsule-dropzone{gap:9px}.falling-ball{width:52px;height:52px}}@media(prefers-reduced-motion:reduce){.falling-ball,.spotlight-ball,.spotlight-ball .shell-top,.spotlight-ball .shell-bottom,.spotlight-prize{animation-duration:.001ms!important;animation-delay:0ms!important}}
