/* 明亮兒童風:白底卡片、橘色主按鈕、藍色點綴 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #dfeaf5; font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; color: #24323f; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.fade { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .35s ease; z-index: 5; }
.fade.on { opacity: 1; }
/* 加速時的速度線 */
.speed { position: fixed; inset: -20%; pointer-events: none; opacity: 0; z-index: 2;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0) 0deg 5deg, rgba(255,255,255,.55) 5.4deg 5.9deg, rgba(255,255,255,0) 6.3deg 11deg);
  -webkit-mask-image: radial-gradient(circle, transparent 34%, #000 78%); mask-image: radial-gradient(circle, transparent 34%, #000 78%); }

.hud { position: fixed; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left)); pointer-events: none; }
.hud[hidden] { display: none; }
.pill { background: #fff; border-radius: 999px; padding: 7px 16px 7px 12px; font-size: 20px; font-weight: 800; box-shadow: 0 3px 0 rgba(0,0,0,.12), 0 6px 16px rgba(0,0,0,.14); min-width: 86px; }
.pill b { font-variant-numeric: tabular-nums; }
.pill.pop { animation: pop .25s ease; }
@keyframes pop { 40% { transform: scale(1.18); } }
.where { flex: 1; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.dots { display: flex; gap: 6px; }
.dots span { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.75); color: #6b7a88; white-space: nowrap; }
.dots span.on { background: #ff8a1f; color: #fff; }
.dots span.done { background: #35b56a; color: #fff; }
.bar { width: 100%; height: 8px; border-radius: 99px; background: rgba(255,255,255,.7); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc93a, #ff8a1f); border-radius: 99px; }
.round { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.12), 0 6px 16px rgba(0,0,0,.14); cursor: pointer; }

.toast { position: fixed; left: 50%; top: 22%; transform: translate(-50%, -50%); z-index: 6; text-align: center; pointer-events: none; animation: toast 2.4s ease both; white-space: nowrap; }
.toast[hidden] { display: none; }
.toast small { display: block; font-size: 17px; font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.toast b { display: block; font-family: "Chiron GoRound TC", inherit; font-size: clamp(34px, 9vw, 60px); color: #fff; -webkit-text-stroke: 2px rgba(20,40,70,.35); text-shadow: 0 4px 0 rgba(20,40,70,.45), 0 8px 22px rgba(0,0,0,.45); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.9); } 14%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -64%) scale(1); } }
.hint { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; background: rgba(255,255,255,.94); border-radius: 999px; padding: 10px 18px; font-size: 16px; font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; pointer-events: none; }
.hint[hidden] { display: none; }

.screen { position: fixed; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; padding: 18px; }
.screen[hidden] { display: none; }
.screen.splash { background: linear-gradient(#e9f5ff, #fff6e6); }
.screen.bottom { align-items: flex-end; padding-bottom: calc(22px + env(safe-area-inset-bottom)); pointer-events: none; }
.screen.bottom .card { pointer-events: auto; }
.card { width: min(420px, 100%); background: rgba(255,255,255,.95); border-radius: 26px; padding: 20px 22px 18px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.25); }
.logo { margin: 0 0 6px; font-family: "Chiron GoRound TC", inherit; font-size: clamp(30px, 8.4vw, 42px); line-height: 1.15; color: #ff8a1f; text-shadow: 0 3px 0 #ffe2bd; }
.logo small { display: block; font-size: 15px; color: #2f8fe6; text-shadow: none; letter-spacing: .2em; }
.msg { margin: 6px 0 12px; font-size: 16px; line-height: 1.6; font-weight: 600; color: #46566a; }
.fine { margin: 10px 0 0; font-size: 12px; color: #8a97a5; }
.btn { width: 100%; border: 0; border-radius: 18px; padding: 14px; font: inherit; font-size: 22px; font-weight: 900; color: #fff; background: #ff8a1f; box-shadow: 0 5px 0 #d96a05; cursor: pointer; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #d96a05; }
.load { height: 12px; border-radius: 99px; background: #e6edf4; overflow: hidden; }
.load i { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, #6cc6ff, #2f8fe6); border-radius: 99px; transition: width .3s ease; }
.card h2 { margin: 0 0 4px; font-family: "Chiron GoRound TC", inherit; font-size: 32px; color: #2f8fe6; }
.medal { font-size: 46px; letter-spacing: 6px; margin: 4px 0; }
.medal span.off { filter: grayscale(1); opacity: .28; }
.big { margin: 2px 0 0; font-size: 30px; font-weight: 900; }
.big span { font-size: 18px; color: #8a97a5; }
