:root{--bg:#09111f;--panel:#111827;--ink:#f8fafc;--muted:#94a3b8;--blue:#3b82f6;--green:#22c55e;--yellow:#facc15;--red:#ef4444}
*{box-sizing:border-box}body{margin:0;background:linear-gradient(#08111f,#111827);color:var(--ink);font-family:system-ui,-apple-system,"Noto Sans TC","Segoe UI",sans-serif}.wrap{max-width:1540px;margin:auto;padding:14px}.head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.head h1{margin:0;font-size:clamp(25px,3vw,38px)}.head p{margin:5px 0 0;color:var(--muted)}button{border:0;border-radius:12px;padding:11px 16px;font:inherit;font-weight:850;cursor:pointer}.primary{background:var(--blue);color:white}.ghost{background:#243047;color:#e5edf8}button:disabled{opacity:.45}.status{margin:11px 0;background:#111827;border:1px solid #334155;border-radius:13px;padding:10px 13px;color:#dbeafe}.layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:13px;align-items:start}@media(max-width:980px){.layout{grid-template-columns:1fr}}.stage{position:relative;aspect-ratio:16/9;min-height:570px;background:#111;border-radius:22px;overflow:hidden;border:1px solid #334155;box-shadow:0 18px 50px #0007}.stage canvas{position:absolute;inset:0;width:100%;height:100%}.rearMirror{position:absolute;left:50%;top:10px;transform:translateX(-50%);width:30%;min-width:240px;aspect-ratio:3.2/1;overflow:hidden;border:5px solid #334155;border-radius:42px 42px 18px 18px;z-index:22;box-shadow:0 8px 24px #0008;background:#020617}.rearMirror video{width:100%;height:100%;object-fit:cover;object-position:center 26%;transform:scaleX(-1);filter:saturate(.92) contrast(1.03)}.mirrorLabel{position:absolute;left:50%;bottom:3px;transform:translateX(-50%);font-size:10px;color:#dbeafe;background:#020617a8;padding:2px 7px;border-radius:999px}.topHud{position:absolute;left:14px;top:14px;z-index:18;display:flex;gap:7px;flex-wrap:wrap;max-width:38%}.chip{background:#020617cc;border:1px solid #ffffff22;padding:7px 10px;border-radius:12px;backdrop-filter:blur(6px);font-size:13px}.chip b{font-size:17px}.chip .gold{color:#fde047}.gameMsg{position:absolute;left:50%;top:19%;transform:translateX(-50%);z-index:19;background:#052e16e8;color:#dcfce7;border:2px solid #86efac;border-radius:14px;padding:9px 16px;font-weight:900;text-align:center;white-space:nowrap}.gameMsg.warn{background:#7f1d1de8;color:#fee2e2;border-color:#fca5a5}.dashboard{position:absolute;left:0;right:0;bottom:0;height:19%;z-index:10;background:linear-gradient(#1e293be8,#0f172afa);border-top:2px solid #475569;clip-path:polygon(0 22%,12% 0,88% 0,100% 22%,100% 100%,0 100%)}.wheel{position:absolute;z-index:16;border:22px solid #172033;border-radius:50%;box-shadow:0 0 0 8px #475569,0 15px 30px #0009;background:#11182728;transform:translate(-50%,-50%) rotate(0deg);pointer-events:none}.wheel:before,.wheel:after{content:"";position:absolute;left:50%;top:50%;width:44%;height:18px;background:#263548;border-radius:999px;transform-origin:left center}.wheel:before{transform:translateY(-50%)}.wheel:after{transform:translateY(-50%) rotate(180deg)}.hub{position:absolute;left:50%;top:50%;width:29%;aspect-ratio:1;border-radius:50%;background:#0f172a;border:8px solid #475569;transform:translate(-50%,-50%)}.grip{position:absolute;z-index:20;width:92px;height:112px;border-radius:30px;border:6px dashed #facc15;background:#facc1528;transform:translate(-50%,-50%);pointer-events:none;transition:border-color .12s,background .12s}.grip.ok{border-style:solid;border-color:#22c55e;background:#22c55e38;box-shadow:0 0 0 9px #22c55e20}.grip.grace{border-color:#fb923c;background:#fb923c35}.menu{position:absolute;inset:0;z-index:40;background:#020617bd;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(6px)}.menu.hide{display:none}.menuCard{width:min(560px,88%);text-align:center;background:#101827f2;border:1px solid #475569;border-radius:24px;padding:24px}.menuCard h2{font-size:32px;margin:0 0 7px}.menuCard p{color:#cbd5e1;line-height:1.55}.gestureButtons{display:grid;gap:12px;margin-top:18px}.gbtn{position:relative;padding:18px 16px;border-radius:17px;background:#1e293b;border:2px solid #475569;font-weight:900;font-size:20px;overflow:hidden}.gbtn.active{border-color:#60a5fa;transform:scale(1.02)}.gbtn .fill{position:absolute;left:0;bottom:0;height:7px;width:0;background:#60a5fa}.cursor{position:absolute;z-index:60;width:32px;height:32px;border:4px solid white;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;display:none;box-shadow:0 0 0 5px #60a5fa55}.cursor.show{display:block}.count3{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);font-size:120px;font-weight:950;color:white;text-shadow:0 10px 30px #000;z-index:45;display:none}.count3.show{display:block}.coinPop{position:absolute;left:50%;top:39%;z-index:31;transform:translate(-50%,-50%);font-weight:950;font-size:42px;color:#fde047;text-shadow:0 4px 12px #000;opacity:0}.coinPop.show{animation:pop .46s ease-out}@keyframes pop{0%{opacity:0;transform:translate(-50%,-50%) scale(.5)}28%{opacity:1;transform:translate(-50%,-50%) scale(1.25)}100%{opacity:0;transform:translate(-50%,-72%) scale(1)}}.panel{background:#111827;border:1px solid #334155;border-radius:18px;padding:13px}.card{background:#172033;border-radius:14px;padding:12px;margin-bottom:10px}.card:last-child{margin:0}.card h3{margin:0 0 9px}.metric{display:flex;justify-content:space-between;padding:7px 0;border-bottom:1px dashed #334155}.metric:last-child{border-bottom:0}.metric b{font-variant-numeric:tabular-nums}.legend{color:#94a3b8;font-size:12px;line-height:1.6}.mono{font:12px ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;color:#cbd5e1}.progress{height:10px;background:#334155;border-radius:999px;overflow:hidden;margin-top:9px}.bar{height:100%;width:0;background:#60a5fa}.soundState{font-size:12px;color:#a7f3d0}.edgeAlert{position:absolute;left:50%;top:27%;transform:translateX(-50%);z-index:25;min-width:280px;text-align:center;padding:8px 14px;border-radius:999px;font-weight:900;opacity:0;transition:.15s}.edgeAlert.caution{opacity:1;background:#9a3412e8;color:#ffedd5;border:2px solid #fdba74}.edgeAlert.danger{opacity:1;background:#991b1be8;color:#fee2e2;border:2px solid #fca5a5;animation:edgePulse .45s infinite alternate}.stage.edgeDanger:after{content:'';position:absolute;inset:0;z-index:14;pointer-events:none;box-shadow:inset 0 0 75px 18px rgba(239,68,68,.48)}@keyframes edgePulse{from{transform:translateX(-50%) scale(1)}to{transform:translateX(-50%) scale(1.04)}}