* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #5aa9ea; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
.stage { position: fixed; left: 50%; top: 0; height: 100dvh; width: calc(100dvh * 2 / 3); max-width: 100vw; max-height: calc(100vw * 1.5); transform: translateX(-50%); container-type: size; }
.stage .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }

/* 坐标均按参考图 1024x1536 换算成百分比 */
.hud, .pane, .hot, .cool, .snd-off { position: absolute; }
.hud { color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; text-shadow: 0 2px 0 rgba(0,40,90,.45); background: #3563a8; white-space: nowrap; }
.hud b { color: #ffd23a; margin: 0 .25em; font-size: 1.25em; }
.best { left: 83.5%; top: 3.2%; width: 13%; height: 4.4%; border-radius: 10px; flex-direction: column; font-size: 2.15cqw; line-height: 1.15; }
.best b { margin: 0; color: #fff; font-size: 2.7cqw; }
.timer { left: 17%; top: 10.9%; width: 14%; height: 3.5%; font-size: 4.4cqw; justify-content: flex-start; padding-left: 1cqw; }
.timer.low { color: #ff6b5e; }
.lvl { left: 41.5%; top: 10.9%; width: 18%; height: 3.5%; font-size: 3.6cqw; }
.hints { left: 76%; top: 10.9%; width: 12.5%; height: 3.5%; font-size: 3.2cqw; border-radius: 8px; }
.track { left: 8%; top: 15.55%; width: 80.5%; height: 1.9%; border-radius: 99px; background: #2c5698; justify-content: flex-start; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(#ffe05a, #f5b400); transition: width .35s; }
.badge { left: 60.8%; top: 89.6%; width: 5.6%; height: 3.7%; border-radius: 50%; background: #e63b3b; font-size: 3.2cqw; border: 2px solid #fff; }

.pane { left: 3.9%; width: 92.3%; cursor: pointer; border-radius: 4cqw; overflow: hidden; }
#paneA { top: 19.6%; height: 33.3%; }
#paneB { top: 54.5%; height: 33%; }

.hot { background: transparent; border: 0; padding: 0; border-radius: 50%; cursor: pointer; }
.back { left: 3.4%; top: 1.9%; width: 9.8%; height: 6.6%; }
.snd { left: 13.8%; top: 90.2%; width: 11%; height: 7.4%; }
.hint { left: 35.5%; top: 90%; width: 29%; height: 7.6%; border-radius: 40px; }
.pause { left: 75%; top: 90.2%; width: 11%; height: 7.4%; }
.snd-off { left: 13.8%; top: 90.2%; width: 11%; height: 7.4%; border-radius: 50%; background: rgba(20,40,80,.55); display: none; pointer-events: none; }
.snd-off.on { display: block; }
.snd-off::after { content: ""; position: absolute; left: 20%; right: 20%; top: 48%; height: 5%; background: #fff; transform: rotate(-45deg); border-radius: 4px; }
.cool { left: 35.5%; top: 90%; width: 29%; height: 7.6%; border-radius: 40px; background: rgba(60,40,10,.55); color: #fff; font-weight: 800; font-size: 4cqw; display: none; align-items: center; justify-content: center; pointer-events: none; }
.cool.on { display: flex; }

/* 标记圈 */
.mark { position: absolute; width: 11cqw; height: 11cqw; margin: -5.5cqw 0 0 -5.5cqw; border: .9cqw solid #ff3b3b; border-radius: 50%; box-shadow: 0 0 0 .5cqw #fff, 0 0 2cqw rgba(255,60,60,.8); pointer-events: none; animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
.mark.hintm { border-color: #ffd23a; animation: pop .45s both, blink .6s .45s 4; }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .25; } }
.miss { position: absolute; width: 7cqw; height: 7cqw; margin: -3.5cqw 0 0 -3.5cqw; color: #ff3b3b; font-size: 7cqw; font-weight: 900; line-height: 7cqw; text-align: center; pointer-events: none; animation: fade .6s forwards; }
@keyframes fade { to { opacity: 0; transform: translateY(-2cqw); } }
.shake { animation: shake .3s; }
@keyframes shake { 20% { transform: translateX(-1.2cqw); } 40% { transform: translateX(1.2cqw); } 60% { transform: translateX(-.8cqw); } 80% { transform: translateX(.8cqw); } }

/* 选关 / 结算层 */
.layer { position: absolute; inset: 0; background: rgba(20,50,100,.62); display: flex; align-items: center; justify-content: center; z-index: 10; }
.layer[hidden] { display: none; }
.panel { width: 84%; max-height: 82%; overflow-y: auto; background: linear-gradient(#fff8e6, #ffe9bd); border: .8cqw solid #fff; border-radius: 6cqw; padding: 5cqw 4.5cqw; text-align: center; box-shadow: 0 2cqw 6cqw rgba(0,30,80,.4); color: #6b3d10; }
.panel h2 { margin: 0 0 2cqw; font-size: 6.4cqw; }
.panel p { margin: 1cqw 0 3cqw; font-size: 3.6cqw; color: #8a5a28; }
.grp { text-align: left; font-weight: 800; font-size: 3.6cqw; margin: 3cqw 0 1.5cqw; color: #c4630f; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2cqw; }
.lv { aspect-ratio: 1; border: 0; border-radius: 3cqw; background: #fff; color: #6b3d10; font-weight: 800; font-size: 5cqw; box-shadow: 0 .8cqw 0 #e0b25f; position: relative; padding: 0; cursor: pointer; }
.lv small { display: block; font-size: 2.3cqw; font-weight: 700; color: #c4630f; }
.lv.done { background: #fff2b8; }
.lv.cur { outline: .8cqw solid #ff8a3d; }
.btn { display: block; width: 100%; margin-top: 3cqw; padding: 3.2cqw 0; border: 0; border-radius: 99px; background: linear-gradient(#ffb347, #ff8a3d); color: #fff; font-weight: 800; font-size: 4.6cqw; box-shadow: 0 1cqw 0 #c4630f; cursor: pointer; text-shadow: 0 .4cqw 0 rgba(120,50,0,.4); }
.btn.alt { background: linear-gradient(#6ab0f5, #3b82d6); box-shadow: 0 1cqw 0 #2257a0; }
.stats { display: flex; justify-content: space-around; font-size: 3.6cqw; margin: 2cqw 0; }
.stats b { display: block; font-size: 5.6cqw; color: #ff8a3d; }
