/* ==================== 1. 首页样式 ==================== */
@charset "UTF-8";
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#f79fc2}body{font-family:system-ui,sans-serif;overflow-x:hidden}.home{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.scene{position:relative;width:min(100%,177.68vh);width:min(100%,177.68dvh);aspect-ratio:1672/941;isolation:isolate}canvas{width:100%;height:100%;display:block}.start-game{position:absolute;left:38.1%;top:70.45%;width:23.8%;height:11.2%;border:0;background:transparent;border-radius:999px;padding:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:box-shadow .18s,background .18s}.start-game:hover:not(:disabled){background:#fff4d91a;box-shadow:0 0 22px #fff5e033}.start-game:active:not(:disabled),.start-game.is-pressed{background:#fff6de33}.start-game:focus-visible,.music:focus-visible{outline:3px solid #fff4d1;outline-offset:5px}.start-game:disabled{cursor:wait}.music{position:absolute;right:1.25%;bottom:1.1%;border:1px solid #5e233b40;background:#fff7e9dd;color:#5e233b;border-radius:999px;padding:5px 9px;font:600 clamp(9px,.7vw,12px) system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){.start-game{transition:none}}

/* START GAME：鼠标悬停与键盘聚焦时高亮。 */
.start-game:hover:not(:disabled),.start-game:focus-visible{background:#fff5cf22;box-shadow:inset 0 0 24px #fff2c866,0 0 0 3px #ffe9ac,0 0 34px #ffdc7999}

/* ==================== 2. 角色选择样式 ==================== */

*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#f7d6dc}body{font-family:system-ui,sans-serif;overflow-x:hidden}.character-page{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.character-scene{position:relative;width:min(100%,177.68vh);width:min(100%,177.68dvh);aspect-ratio:1672/941;isolation:isolate}canvas{display:block;width:100%;height:100%}.hotspot{position:absolute;display:block;padding:0;border:0;background:transparent;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:box-shadow .2s,background .2s;outline:none}.hotspot:disabled{cursor:wait}.hotspot:focus-visible{outline:3px solid #ffbb64;outline-offset:3px;box-shadow:0 0 20px #fff4d5}.back{left:1.9%;top:3.6%;width:12.6%;height:7.4%;border-radius:999px}.back:hover{background:#ffffff22}.choice{left:1.5%;width:15.6%;height:25.9%;border-radius:50%}.choice-seven{top:20.9%}.choice-milk{top:54.8%}.choice:hover:not(:disabled){box-shadow:0 0 0 3px #fff5e6aa,0 0 24px #e49bad77}.choice:active:not(:disabled){background:#fff8e81c}.go{left:68.8%;top:77.9%;width:28.2%;height:14.4%;border-radius:999px}.go:hover:not(:disabled),.go:focus-visible{background:#fff4d51c;box-shadow:inset 0 0 25px #fff3c766,0 0 0 3px #ffe3a6,0 0 30px #ffdea088}.go:active:not(:disabled){background:#fff1cc40}.ready-message{position:absolute;left:50%;bottom:2.5%;transform:translateX(-50%);background:#fff8ecee;color:#602039;padding:8px 20px;border-radius:999px;font-size:clamp(11px,1vw,16px);box-shadow:0 3px 15px #70304712;margin:0;pointer-events:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}[hidden]{display:none!important}@media(max-width:700px){.go:before,.back:before{content:"";position:absolute;inset:-9px;border-radius:inherit}.choice{width:17%;left:.7%}}@media(prefers-reduced-motion:reduce){.hotspot{transition:none}}

/* ==================== 3. 同页切换 ==================== */
[hidden]{display:none!important}body[data-page="home"]{background:#f79fc2}body[data-page="characters"]{background:#f7d6dc}

/* ==================== Race: layout and controls ==================== */
body[data-page="race"]{background:#f9d5de;font-family:Daruma,system-ui,sans-serif;color:#643b3f}
.race-page{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.race-stage{width:min(100%,177.778dvh);aspect-ratio:16/9;position:relative;isolation:isolate;overflow:hidden;background:#f9d5de;container-type:inline-size}
#race-canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.race-page button{font-family:Daruma,system-ui,sans-serif;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.race-page button:focus-visible{outline:3px solid #d26c8d;outline-offset:4px}
.race-page button:disabled{cursor:default;opacity:.45}
.race-hud{position:absolute;inset:2.7% 2.6% auto;display:flex;gap:1.4%;align-items:center;height:8%;pointer-events:none}
.race-score{display:flex;align-items:center;gap:1.2cqw;background:#fff8e9f2;border:3px solid #774348;border-radius:999px;padding:.5cqw 1.3cqw;box-shadow:0 3px #b56a6b25;white-space:nowrap;font-size:2cqw;min-width:22%}
.race-score strong{font-weight:400}.race-score span{border-left:2px solid #d5a5a3;padding-left:1.1cqw;color:#8f5c43}
.race-progress{height:2.4cqw;flex:1;border:3px solid #774348;border-radius:999px;position:relative;background:#fff8e9e6;overflow:hidden}
#race-progress-fill{position:absolute;inset:4px auto 4px 4px;width:0;background:linear-gradient(90deg,#ffabc1,#ee769d);border-radius:999px}
.finish-squares{position:absolute;inset:0 0 0 auto;width:2.1cqw;border-left:2px solid #774348;background:repeating-conic-gradient(#774348 0 25%,#fff4df 0 50%) 0 0/.8cqw .8cqw}
#race-time{font-size:2cqw;min-width:7%;text-align:center;background:#fff7e8ed;border:2px solid #bf888c;border-radius:99px;padding:.35cqw .5cqw}
.race-small{pointer-events:auto;border:3px solid #774348;border-radius:25%;background:#fff7e8;color:#774348;font-size:2.5cqw;line-height:1;width:4.2cqw;height:4.2cqw;padding:0}
.race-small:hover{background:#fff}.race-camera-card{position:absolute;right:2.8%;top:15%;width:18.5%;border:2px solid #98646b;border-radius:1.1cqw;background:#fff7e9ed;padding:.4cqw;box-shadow:0 .4cqw 1.6cqw #8f4f5c12}
.race-camera-image{aspect-ratio:16/9;position:relative;overflow:hidden;background:#f3dbe0;border-radius:.7cqw}
#race-video,#race-skeleton{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}#race-video{transform:scaleX(-1)}
#race-camera-empty{position:absolute;inset:0;display:grid;place-items:center;font-size:1.3cqw;margin:0;color:#9b7278}
#race-camera-live{position:absolute;top:.35cqw;left:.4cqw;font:700 .65cqw system-ui,sans-serif;background:#fff9eddf;border-radius:99px;padding:.2cqw .5cqw;color:#86614b}
#race-camera-live:before{content:"";display:inline-block;width:.4cqw;height:.4cqw;background:#8ca96b;border-radius:50%;margin-right:.3cqw}
#race-camera-status{font:500 .85cqw/1.3 system-ui,sans-serif;margin:.4cqw .2cqw;min-height:1.2em}
.race-signals{display:flex;flex-wrap:wrap;gap:.25cqw}.race-signals span{font:600 .62cqw system-ui,sans-serif;background:#f4e6df;padding:.25cqw .4cqw;border-radius:99px;color:#977b77}.race-signals .seen{background:#e0edcb;color:#506a3b}.race-signals .triggered{background:#ffdf8d;color:#705021}
.race-controls{position:absolute;bottom:2%;left:3%;right:3%;display:flex;align-items:center;gap:1cqw}
#race-mode-label{font-size:1.15cqw;background:#fff5e4dd;padding:.5cqw 1cqw;border-radius:99px;margin-right:auto}
.race-controls button{border:2px solid #855256;background:#fff6e6e8;color:#6e4247;border-radius:999px;padding:.4cqw 1.4cqw;font-size:1.5cqw;min-width:10%;box-shadow:0 .2cqw #b5776f55}
.race-controls button:active,.race-controls button.is-active{background:#ffe6a8;transform:translateY(2px)}.race-controls small{font:600 .7cqw system-ui,sans-serif;margin-left:.4cqw}
.race-announcement{position:absolute;left:50%;top:19%;transform:translateX(-50%);margin:0;background:#fff6dedf;border:2px solid #d69d6d;border-radius:999px;padding:.7cqw 2cqw;font-size:2.4cqw;white-space:nowrap;color:#a26237;text-shadow:0 2px #fff}
.race-overlay{position:absolute;inset:0;display:grid;place-items:center;background:#ffedf22e;z-index:5;pointer-events:none}
.race-dialog{pointer-events:auto;width:43%;max-height:91%;overflow:auto;background:#fff9eefa;border:3px solid #8b515c;border-radius:2.6cqw;padding:1.5cqw 2.5cqw;text-align:center;box-shadow:0 .6cqw 0 #bd7f8633,0 1cqw 4cqw #9b5e771c;scrollbar-width:thin;outline:none;position:relative;margin-right:1%}
.race-eyebrow{letter-spacing:.15em;font:600 .75cqw system-ui,sans-serif;color:#ad7e83;margin:.2cqw 0 .6cqw}
.race-dialog h1{font-weight:400;font-size:3.9cqw;line-height:1;margin:.6cqw 0 1.2cqw;color:#7b434e}
#race-dialog-copy,#race-pause-copy{font:500 1cqw/1.55 system-ui,sans-serif;margin:.7cqw 0 1.2cqw}
.race-mode-buttons{display:flex;gap:.65cqw;justify-content:center}.race-primary,.race-secondary{border:2px solid #955a67;border-radius:999px;font-size:1.3cqw;padding:.65cqw 1.2cqw;color:#fff8e9;background:#e187a3;box-shadow:0 2px #b46a7d55;transition:background .15s,box-shadow .15s}
.race-primary:hover:not(:disabled){background:#ec9cb5;box-shadow:0 0 0 3px #ffe5a477}.race-secondary{color:#83585a;background:#f8e7dc;border-color:#c69b95}.race-secondary:hover:not(:disabled){background:#fff1dd}
#race-setup-status{font:600 .85cqw/1.4 system-ui,sans-serif;margin:.7cqw 0;min-height:2.5em;color:#a05f70}
.race-how{text-align:left;font:500 .86cqw/1.45 system-ui,sans-serif;margin:.7cqw 0}.race-how p{margin:.45cqw 0}.race-how b{display:inline-block;min-width:4cqw;color:#a46970}
.race-wide{width:100%;margin:.4cqw 0}.race-text{font-size:1cqw;color:#9a7376;background:none;border:0;padding:.7cqw 1cqw;margin-top:.35cqw}.race-text:hover{color:#713b4b;text-decoration:underline}
.race-result-stats{display:flex;justify-content:space-around;gap:1cqw;margin:1.4cqw 0 1.8cqw}.race-result-stats span{font:600 .65cqw system-ui,sans-serif;color:#a07b78}.race-result-stats strong{display:block;font:400 2.5cqw Daruma,system-ui;color:#8f5361;margin-bottom:.4cqw}
.race-stage[data-state="countdown"] .race-announcement{font-size:5cqw;padding:.5cqw 2.5cqw;top:28%}
@media(max-width:700px){.race-stage{width:100%;aspect-ratio:auto;min-height:100dvh}.race-hud{top:2%;height:7%;gap:2%}.race-score{font-size:4cqw;min-width:35%;padding:1cqw 2cqw;gap:2cqw;border-width:2px}.race-progress{height:4.5cqw;border-width:2px}.finish-squares{width:4cqw;background-size:1.5cqw 1.5cqw}#race-time{font-size:3.5cqw}.race-small{width:8cqw;height:8cqw;font-size:5cqw;border-width:2px}.race-camera-card{top:10%;width:36%;right:3%;border-radius:2cqw;padding:1cqw}#race-camera-status{font-size:2.3cqw;margin:1cqw .2cqw}.race-signals span{font-size:1.6cqw;padding:.5cqw}.race-camera-image{border-radius:1.5cqw}#race-camera-empty{font-size:3cqw}#race-camera-live{font-size:1.7cqw;padding:.5cqw 1cqw}#race-camera-live:before{width:1.2cqw;height:1.2cqw}.race-dialog{width:90%;padding:5cqw;border-radius:7cqw;max-height:70%;margin:0;box-shadow:0 2cqw 8cqw #9b5e7720}.race-dialog h1{font-size:10cqw;margin:2cqw 0 3cqw}.race-eyebrow{font-size:2.1cqw}#race-dialog-copy,#race-pause-copy{font-size:3cqw}.race-primary,.race-secondary{font-size:3.5cqw;padding:2.3cqw 3cqw}.race-mode-buttons{gap:2cqw}#race-setup-status{font-size:2.6cqw;margin:2cqw 0}.race-how{font-size:2.7cqw;margin:3cqw 0}.race-how p{margin:2cqw 0}.race-how b{min-width:13cqw}.race-wide{margin:1.4cqw 0}.race-text{font-size:3cqw;padding:2cqw;margin-top:1cqw}.race-controls{bottom:3%;flex-wrap:wrap;gap:3cqw}.race-controls button{font-size:4.5cqw;padding:2.2cqw 6cqw;min-height:44px}.race-controls small{font-size:2.3cqw}#race-mode-label{font-size:2.8cqw;width:100%;background:none;padding:0}.race-announcement{font-size:5cqw;padding:1.8cqw 4cqw;top:32%}.race-stage[data-state="countdown"] .race-announcement{font-size:12cqw;top:35%}.race-result-stats{margin:5cqw 0}.race-result-stats strong{font-size:8cqw}.race-result-stats span{font-size:2cqw}}
@media(prefers-reduced-motion:reduce){.race-primary,.race-secondary{transition:none}}

.global-music{position:fixed;right:12px;bottom:8px;z-index:9;font:600 11px system-ui,sans-serif;background:#fff7e9ee;border:1px solid #a77b83;color:#774b54;border-radius:999px;padding:6px 10px;cursor:pointer}.global-music:focus-visible{outline:3px solid #e9aa76;outline-offset:3px}@media(max-width:700px){body[data-page="race"] .global-music{top:auto;bottom:5px;right:8px;font-size:10px}}