/* 2026-11-09 扭蛋机设计稿，1080 × 1920。版面和奖品卡基于原始合成图，不重画中文文字。 */
:root{--main-blue:#125fa5}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;width:100%;height:100%;min-height:100%;overflow:hidden;background:var(--main-blue);font-family:"Source Han Sans SC","Microsoft YaHei","PingFang SC",Arial,sans-serif}
body{touch-action:none;overscroll-behavior:none;user-select:none;-webkit-user-select:none}
button{border:0;background:transparent;margin:0;padding:0;cursor:pointer;outline-offset:4px}
.stage{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--main-blue)}
.machine{position:relative;flex:none;width:min(100vw,56.25dvh);height:min(177.777778vw,100dvh);aspect-ratio:1080/1920;overflow:hidden;background:var(--main-blue);container-type:inline-size}
.machine-art{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:fill;z-index:1;pointer-events:none}
.balls-layer{position:absolute;inset:0;z-index:5;pointer-events:none}
.psb-ball{position:absolute;height:auto;object-fit:contain;transform-origin:50% 50%;will-change:transform}
/* From 11/9 PSB layer bounds; exact x/y/width relative to 1080x1920 screen. */
.b1{left:6.851852%;top:35.78125%;width:14.907407%}
.b2{left:20.092593%;top:40.052083%;width:14.907407%}
.b3{left:6.851852%;top:44.53125%;width:14.907407%}
.b4{left:29.629630%;top:47.395833%;width:15%}
.b5{left:42.870370%;top:43.020833%;width:14.907407%}
.b6{left:56.759259%;top:47.447917%;width:15.185185%}
.b7{left:60.648148%;top:38.90625%;width:14.907407%}
.b8{left:78.518519%;top:36.458333%;width:15%}
.b9{left:75.092593%;top:44.947917%;width:15.185185%}
.machine.shaking .b1{animation:shakeA .15s linear infinite alternate}
.machine.shaking .b2{animation:shakeB .12s linear infinite alternate-reverse}
.machine.shaking .b3{animation:shakeC .17s linear infinite alternate}
.machine.shaking .b4{animation:shakeB .14s linear infinite alternate}
.machine.shaking .b5{animation:shakeA .13s linear infinite alternate-reverse}
.machine.shaking .b6{animation:shakeC .16s linear infinite alternate}
.machine.shaking .b7{animation:shakeB .12s linear infinite alternate-reverse}
.machine.shaking .b8{animation:shakeA .15s linear infinite alternate}
.machine.shaking .b9{animation:shakeC .13s linear infinite alternate-reverse}
@keyframes shakeA{from{transform:translate3d(-5%,-5%,0) rotate(-6deg)}to{transform:translate3d(6%,5%,0) rotate(6deg)}}
@keyframes shakeB{from{transform:translate3d(5%,-6%,0) rotate(7deg)}to{transform:translate3d(-6%,5%,0) rotate(-7deg)}}
@keyframes shakeC{from{transform:translate3d(-4%,6%,0) rotate(-7deg)}to{transform:translate3d(6%,-5%,0) rotate(7deg)}}
/* PSD number layer x868,y508,width64. Numbers are rasterized with supplied SourceHanSansSC-Regular. */
.progress-number{position:absolute;z-index:12;left:78.25%;top:25.47%;width:10.74%;pointer-events:none}
.progress-number img{display:block;width:100%;height:auto}
/* Five keys: separate transparent hit surfaces align over colored original artwork. */
.count-hotspot{position:absolute;z-index:18;border-radius:50%;touch-action:manipulation}
.count-hotspot.c1{left:7.12963%;top:62.8125%;width:14.25926%;height:6.05%}
.count-hotspot.c2{left:24.90741%;top:62.8125%;width:14.25926%;height:6.05%}
.count-hotspot.c3{left:42.68519%;top:62.8125%;width:14.25926%;height:6.05%}
.count-hotspot.c4{left:60.46296%;top:62.86458%;width:14.25926%;height:6.05%}
.count-hotspot.c5{left:78.33333%;top:62.8125%;width:14.25926%;height:6.05%}
.count-hotspot::before{content:"";position:absolute;left:-3%;right:-3%;top:-6%;bottom:-3%;border:clamp(2px,.34cqw,5px) solid rgba(255,255,255,.98);border-radius:50%;box-shadow:0 0 0 clamp(2px,.18cqw,4px) #1664a6,0 0 1cqw rgba(2,42,87,.35);opacity:0;pointer-events:none}
.count-hotspot.selected::before{opacity:1}
.count-hotspot:active{transform:scale(.97)}
.count-hotspot:disabled{cursor:not-allowed}
/* 11/9 knob: independent original-PNG crop x688,y1562,size249. No hand-drawn replacement. */
.knob-face{position:absolute;z-index:20;left:63.703704%;top:81.354167%;width:23.055556%;aspect-ratio:1;pointer-events:none;transform-origin:50% 50%;will-change:transform}
.knob-ready-ring{position:absolute;z-index:19;left:63.703704%;top:81.354167%;width:23.055556%;aspect-ratio:1;border-radius:50%;pointer-events:none;opacity:0}
.knob-hotspot{position:absolute;z-index:24;left:63%;top:80.96%;width:24.5%;height:14.3%;border-radius:50%;touch-action:manipulation}
.machine.ready .knob-ready-ring{opacity:1;box-shadow:0 0 0 .35cqw rgba(255,255,255,.67),0 0 1.6cqw rgba(81,176,251,.5);animation:knobPulse 1.15s ease-in-out infinite}
.machine.turning .knob-face{animation:knobTurn 1s cubic-bezier(.18,.75,.2,1) both}
.machine.turning .knob-ready-ring{opacity:0;animation:none}
@keyframes knobPulse{50%{transform:scale(1.045);opacity:.6}}
@keyframes knobTurn{0%{transform:rotate(0deg)}28%{transform:rotate(105deg)}68%{transform:rotate(285deg)}100%{transform:rotate(360deg)}}
/* Draw capsule in the glass-front output box, without covering the control knob. */
.eject-ball{position:absolute;z-index:23;left:15.65%;top:84.4%;width:15%;opacity:0;pointer-events:none;transform-origin:50% 50%;will-change:transform,opacity}
.eject-ball.show{animation:ejectBall 1.08s cubic-bezier(.18,.82,.22,1) both}
@keyframes ejectBall{0%{opacity:0;transform:translate3d(0,-90%,0) scale(.2) rotate(-60deg)}18%{opacity:1;transform:translate3d(0,-70%,0) scale(.52) rotate(-44deg)}56%{opacity:1;transform:translate3d(0,5%,0) scale(1.03) rotate(18deg)}73%{transform:translate3d(0,-7%,0) scale(.96) rotate(-7deg)}88%{transform:translate3d(0,2%,0) scale(1.015) rotate(3deg)}100%{opacity:1;transform:translate3d(0,0,0) scale(1) rotate(0deg)}}
/* Transparent background + exact seven 11/9 design cards (700 x 1324). */
.award-mask{position:fixed;z-index:100;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(3,27,57,.64);backdrop-filter:blur(2px);opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s;overflow:hidden}
.award-mask.show{opacity:1;visibility:visible}
.award-shell{position:relative;width:min(82vw,49dvh);line-height:0;opacity:0;transform:translateY(16px) scale(.87);filter:drop-shadow(0 14px 32px rgba(4,20,53,.25))}
.award-mask.show .award-shell{animation:awardPop .45s cubic-bezier(.22,1.35,.4,1) both}
@keyframes awardPop{from{transform:translateY(26px) scale(.8);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}
.award-art{display:block;width:100%;height:auto;max-height:96dvh;object-fit:contain;pointer-events:none}
.award-hotspot{position:absolute;z-index:4;touch-action:manipulation}
.take-hotspot{left:29.43%;top:78.4%;width:41.38%;height:7.25%;border-radius:999px}
.close-hotspot{left:43.14%;top:92.52%;width:13.86%;height:7.33%;border-radius:50%}
.award-seq{position:absolute;z-index:5;left:50%;top:-1.8em;transform:translateX(-50%);padding:.42em .9em;line-height:1.1;font-size:clamp(12px,2.6vw,20px);font-weight:700;color:#145f9b;background:rgba(255,255,255,.94);border-radius:20px;white-space:nowrap;box-shadow:0 3px 12px #0002}
.award-seq:empty{display:none}
.confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.confetti i{position:absolute;top:-16px;width:8px;height:15px;opacity:0;animation:confettiFall var(--d,2s) linear var(--delay,0s) both;transform:rotate(var(--r,0deg))}
@keyframes confettiFall{0%{opacity:1;transform:translate3d(0,0,0) rotate(0)}80%{opacity:1}100%{opacity:0;transform:translate3d(var(--x,15px),100dvh,0) rotate(520deg)}}
.toast{position:fixed;z-index:200;left:50%;bottom:8dvh;transform:translate(-50%,12px);background:rgba(0,24,54,.88);color:white;padding:12px 23px;border-radius:999px;opacity:0;transition:.18s;font-size:clamp(12px,2.9vw,19px);white-space:nowrap;pointer-events:none}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media(prefers-reduced-motion:reduce){.machine.shaking .psb-ball{animation-duration:.08s}.machine.ready .knob-ready-ring{animation:none}.machine.turning .knob-face{animation-duration:.55s}}

/* 2026-11-09 V2 手机长屏适配：使用整个视口，不再让 1080:1920 舞台在中间留上下蓝边。
   仅在比 PSB 更狭长的竖屏中拉伸背景纵向坐标；宽屏仍保持 PSB 原始比例。 */
@media (max-aspect-ratio: 9/16) {
  .machine { width:100vw; height:100dvh; aspect-ratio:auto; }
  /* 背景按设计稿纵向扩展时，独立切图也按原 PSB 纵向比例扩展，防止错位。 */
  .psb-ball { height:8.54%; object-fit:fill; }
  .knob-face { height:12.97%; aspect-ratio:auto; object-fit:fill; }
}
