*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:system-ui,"Yu Gothic",sans-serif;background:#83bce6;color:white}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation;border:0}button:focus-visible,input:focus-visible{outline:3px solid #ffd75c;outline-offset:4px}canvas{display:block;width:100%;height:100%;touch-action:none}header{position:absolute;top:max(24px,env(safe-area-inset-top));left:6%;right:6%;display:flex;justify-content:space-between;pointer-events:none;font-size:42px;font-weight:650;text-shadow:0 2px 8px #284f4a66}small{font-size:18px;font-weight:500}button.settings{position:absolute;right:5%;top:88px;background:#214639aa;color:white;border-radius:50%;width:42px;height:42px;font-size:23px}#controls{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(360px,88%);text-align:center}#status{font-size:14px;min-height:22px;margin:8px 0;color:white;text-shadow:0 1px 5px #183524;background:#254e3970;border-radius:8px;padding:7px}#aimControls{display:flex;align-items:center;justify-content:center;gap:25px;margin:8px}#aimControls button{background:#234836b8;color:white;border-radius:50%;width:42px;height:42px;font-size:30px}#aimControls span{font-size:13px;text-shadow:0 1px 4px #000}#aimControls.inactive{visibility:hidden}.meter{display:flex;align-items:center;gap:14px;margin:14px 0;font-size:16px;font-weight:600;text-shadow:0 1px 4px #345}#meter{position:relative;flex:1;height:15px;background:#214b3a80;border-radius:4px;overflow:hidden}#level{height:100%;width:0;display:block;background:#ffda58;transition:width 60ms linear}#thresholdMark{position:absolute;top:0;bottom:0;width:2px;background:#fff9}.primary{width:100%;background:#fff8e7;color:#244c36;border-radius:14px;min-height:56px;font-weight:700;font-size:18px;box-shadow:0 4px 0 #2c58354d}.primary:active{transform:translateY(2px)}button:disabled{opacity:.65;cursor:default}dialog{border:0;border-radius:20px;width:min(380px,90vw);padding:26px;color:#244c36;background:#fffdf3}dialog::backdrop{background:#17342680}dialog h2{margin:0 0 24px;font-size:23px}dialog label{display:block;margin:18px 0;font-size:15px}dialog input[type=range]{display:block;width:100%;accent-color:#477e48;margin-top:12px}dialog p{font-size:13px;line-height:1.7;color:#58685a}dialog .primary{background:#356b48;color:#fff}#restart{display:block;background:none;color:#526d59;margin:18px auto 0}#result{position:absolute;inset:0;background:#18372466;place-items:center;text-align:center}#result:not([hidden]){display:grid}#result>div{width:min(300px,85%)}#result p{font-size:25px}#result h1{font-size:100px;margin:12px}#result small{font-size:24px}@media(max-height:530px){header{font-size:30px;top:14px}.settings{top:60px!important}#controls{left:auto;right:20px;transform:none;width:260px;bottom:16px}#aimControls{margin:0}#status{margin:0}.meter{margin:8px 0}}
#minimap{position:absolute;left:6%;top:max(24px,env(safe-area-inset-top));width:112px;height:172px;border:1px solid #ffffff90;border-radius:9px;overflow:hidden;pointer-events:none;box-shadow:0 2px 8px #153d3333}header>div:first-child{position:absolute;left:0;top:180px;font-size:28px}header>div:last-child{margin-left:auto}@media(max-width:480px){#minimap{width:96px;height:148px}header>div:first-child{top:156px;font-size:25px}}@media(max-height:530px){#minimap{top:14px;width:84px;height:129px}header>div:first-child{top:137px;font-size:24px}}

.on-title #hud,.on-title #minimap,.on-title #settingsButton,.on-title #controls{display:none}
#titleScreen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:max(105px,20vh) 24px max(48px,env(safe-area-inset-bottom));background:#17432d18;text-align:center}
#titleScreen[hidden]{display:none}.title-heading h1{font-size:clamp(48px,10vw,76px);letter-spacing:.08em;margin:0;font-weight:800;text-shadow:0 3px 12px #234b4755}.title-heading p{font-size:15px;letter-spacing:.04em;margin:16px 0;color:#fff;text-shadow:0 2px 6px #244e37}
.title-actions{width:min(300px,88vw)}.title-secondary{display:block;color:#fff;background:#244b3b85;border-radius:12px;min-height:44px;padding:10px 24px;margin:16px auto 0;font-size:15px}.text-button{display:block;background:none;color:#526d59;min-height:44px;margin:8px auto 0}#settings{max-height:90dvh;overflow:auto}@media(max-height:530px){#titleScreen{padding:40px 24px 24px}.title-heading h1{font-size:48px}.title-heading p{margin:8px 0}.title-secondary{margin-top:10px}}
#restart[hidden],#toTitle[hidden]{display:none}
#windHud{position:absolute;right:6%;top:90px;display:flex;align-items:center;gap:6px;color:#fff;font-size:16px;font-weight:600;text-shadow:0 1px 5px #244d3a;background:#254e3970;padding:6px 10px;border-radius:8px;pointer-events:none}#windHud small{font-size:12px}.on-title #windHud{display:none}button.settings{top:145px}@media(max-height:530px){#windHud{top:60px;right:calc(5% + 52px)}button.settings{top:60px}}

#holeHud{position:absolute;top:max(24px,env(safe-area-inset-top));left:calc(6% + 124px);font-size:14px;text-shadow:0 1px 5px #244d3a}.on-title #holeHud,.on-result #controls,.on-result #settingsButton{display:none}#result{background:#193b2ce8;overflow-y:auto;padding:24px}#result>div{width:min(340px,90%)}#result #resultHeading{font-size:22px;margin:0 0 14px}#result #resultNote{font-size:16px;margin:0}#result h1{font-size:80px;margin:4px 0}#result #roundSummary,#result #bestRecord{font-size:15px;margin:12px 0}#scorecard{width:100%;border-collapse:collapse;margin:20px 0 24px}#scorecard th{font-size:13px;font-weight:400;color:#d8e7d7;padding:8px}#scorecard td{font-size:22px;padding:10px 8px;border-top:1px solid #ffffff40}#again[hidden],#nextHole[hidden]{display:none}@media(max-width:480px){#holeHud{left:calc(6% + 108px);font-size:12px;top:max(27px,env(safe-area-inset-top))}}@media(max-height:530px){#holeHud{left:calc(6% + 94px);top:16px}#result h1{font-size:52px}#scorecard{margin:8px 0}#result #roundSummary,#result #bestRecord{margin:6px 0}#result #resultHeading{margin-bottom:6px}}
.shot-buttons{display:flex;gap:10px}.shot-buttons .primary{flex:1;min-width:0;font-size:16px}@media(max-height:530px){.shot-buttons{gap:6px}.shot-buttons .primary{font-size:14px}}
/* コースに重ねる小さなスコアカード。共有画像は展開時だけ表示。 */
#result{inset:auto max(24px,env(safe-area-inset-right)) auto auto;top:50%;transform:translateY(-50%);width:350px;max-height:calc(100dvh - 32px);background:#faf5e8;color:#234b37;padding:20px 22px 10px;overflow-y:auto;border:1px solid #fff7dc;border-top:5px solid #315e43;border-radius:4px 4px 16px 16px;box-shadow:0 12px 32px #173a3540;text-align:left;scrollbar-width:thin}
#result:not([hidden]){display:block}#result>div{width:100%}
.result-brand{display:flex;align-items:center;gap:9px;padding-bottom:13px;border-bottom:1px solid #cbd0bc;font-size:14px;font-weight:750}.result-brand svg{width:24px;height:30px;stroke:#315e43;stroke-width:2;fill:none}.result-brand .flag-cloth{fill:#d66545;stroke:#d66545}.result-course{margin-left:auto;font-size:11px;font-weight:500;color:#5c6e59}
#result #resultHeading{font-size:17px;margin:15px 0 5px;font-weight:750}.result-overview{display:flex;align-items:center;justify-content:space-between;gap:8px}#result #resultNote{font-size:13px;margin:0;color:#53684e}#result #resultMode{font-size:11px;margin:5px 0;color:#53684e}#result h1{font-size:62px;line-height:1.05;margin:0;font-weight:800;letter-spacing:-.04em}#result h1 small{font-size:18px;margin-left:5px;letter-spacing:0}
#result #roundSummary{font-size:13px;margin:9px 0 0}#scorecard{margin:13px 0 10px;border-top:1px solid #b8c4ac;border-bottom:1px solid #b8c4ac;text-align:center}#scorecard th{padding:7px 4px 2px;color:#52694e;font-size:11px}#scorecard td{border-top:0;padding:2px 4px 8px;font-size:22px;font-weight:700}#scorecard th+th,#scorecard td+td{border-left:1px solid #d7dbc8}
#result #bestRecord{font-size:12px;margin:8px 0 12px;padding-left:9px;border-left:3px solid #b78b37}#result.perfect-round{border-top-color:#bd8d32}#result.perfect-round #resultNote{color:#805613;font-weight:700}
#result .primary{min-height:44px;font-size:15px;border-radius:8px;box-shadow:0 2px 0 #163d29;background:#315e43;color:#fff9eb}#shareControls{margin:12px 0 0}#shareRecord::before{content:'↗';margin-right:9px;font-size:19px}#recordPreview{margin-top:6px}#recordPreview summary{cursor:pointer;min-height:36px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:12px;color:#4d654e;list-style:none}#recordPreview summary::after{content:'＋'}#recordPreview[open] summary::after{content:'−'}#recordImage{display:block;width:100%;height:auto;border:1px solid #d0d5c2}#recordPreview[hidden],#shareControls[hidden],#shareText[hidden]{display:none}
.share-options{display:flex;gap:8px;margin:8px 0}.share-options button{flex:1;min-height:44px;font-size:12px;border:1px solid #aebca3;border-radius:6px;background:transparent;color:#315e43}
#result #again{background:transparent;color:#315e43;box-shadow:none;border:1px solid #9cad90;margin:4px 0 0;min-height:44px;font-size:14px}#resultTitle{background:transparent;color:#52694e;font-size:12px;min-height:36px;margin:0 auto;padding:6px 12px}#result #shareStatus,#result #imageStatus{font-size:12px;line-height:1.5;margin:6px 0}#shareStatus:empty,#imageStatus:empty{display:none}#shareText{width:100%;min-height:110px;font-size:13px}
.on-result #hud,.on-result #windHud,.on-result #holeHud{visibility:hidden}.on-result #minimap{visibility:visible}
#result button:focus-visible,#result summary:focus-visible{outline:3px solid #bd8d32;outline-offset:2px}
@media(max-width:699px) and (min-height:531px){#result{top:auto;bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px;transform:none;width:auto;max-height:52dvh;padding:12px 18px 6px}.result-brand{padding-bottom:7px}.result-brand svg{height:23px}#result #resultHeading{margin:8px 0 2px;font-size:16px}#result h1{font-size:48px}#result #roundSummary{margin:5px 0 0;font-size:12px}#scorecard{margin:8px 0 6px}#scorecard th{padding-top:4px}#scorecard td{padding-bottom:5px;font-size:20px}#result #bestRecord{margin:6px 0}#shareControls{margin-top:8px}}
@media(max-height:530px){#result{right:12px;width:min(330px,48vw);padding:12px 18px 6px;max-height:calc(100dvh - 24px)}.result-brand{padding-bottom:7px}#result #resultHeading{margin-top:8px}#result h1{font-size:44px}}
/* 中央の一枚に全操作を収める。最終結果には月桂樹と二重の金縁。 */
#result{inset:auto;left:50%;top:50%;bottom:auto;right:auto;transform:translate(-50%,-50%);width:min(360px,calc(100vw - 32px));max-height:none;overflow:visible;padding:15px 22px 10px;text-align:center;border:1px solid #bbcca8;border-top:4px solid #315e43;border-radius:12px;box-shadow:0 10px 32px #102c3155}
#result .result-brand{text-align:left;padding-bottom:8px}#result .result-laurel{display:none}#result.final-record{border:2px solid #bd9651;outline:1px solid #e6cc93;outline-offset:-7px;background:#faf5e8;box-shadow:0 12px 36px #102c3166}#result.final-record .result-laurel{display:block;width:130px;height:58px;margin:9px auto 0;color:#a67c31}
#result #resultHeading{margin:10px 0 5px;font-size:18px}#result .result-overview{justify-content:center;gap:22px}#result h1{font-size:60px}#result #roundSummary{margin:8px 0;font-size:13px}#result #bestRecord{border:0;padding:5px 0;margin:6px 0 8px;color:#825e25;font-weight:700;font-size:12px}#result #bestRecord::before,#result #bestRecord::after{content:'◆';font-size:7px;margin:0 10px;vertical-align:middle}#result #scorecard{margin:10px 0}#result #shareControls{margin:8px 0}#result #again{margin:0;min-height:44px}#resultTitle{min-height:36px}#result #imageStatus,#result #shareStatus{font-size:11px;line-height:1.4;margin:4px 0}#result #resultMode:empty{display:none}#result.perfect-round .result-laurel{color:#b9861c}
@media(max-height:700px) and (min-height:481px){#result{padding:12px 18px 7px}#result.final-record .result-laurel{height:38px;margin:4px auto 0}#result #resultHeading{margin:5px 0}#result h1{font-size:46px}#result #scorecard{margin:6px 0}#result #roundSummary{margin:4px 0}}
@media(max-height:480px){#result{width:min(590px,calc(100vw - 24px));padding:12px 20px 8px}#result>div{display:grid;grid-template-columns:1fr 1fr;column-gap:24px;align-items:center}#result .result-brand{grid-column:1/-1}#result.final-record .result-laurel{display:none}#result #resultHeading{grid-column:1;margin:8px 0 2px;font-size:16px}#result .result-overview{grid-column:1;grid-row:3;gap:12px}#result h1{font-size:48px}#result #roundSummary{grid-column:1;grid-row:4;margin:4px 0;font-size:11px}#result #scorecard{grid-column:2;grid-row:2/4;margin:8px 0}#result #bestRecord{grid-column:2;grid-row:4;margin:4px 0;padding:0;font-size:11px}#result #shareControls{grid-column:1;grid-row:5/7;margin:4px 0}#result #again,#result #nextHole{grid-column:2;grid-row:5;margin:4px 0}#result #resultTitle{grid-column:2;grid-row:6;min-height:30px}#result #imageStatus{grid-column:1;grid-row:7}#result .primary{font-size:13px;min-height:44px}}
/* タイトル：声の波形から旗へ飛ぶボールをロゴに添える。 */
#titleScreen{justify-content:center;gap:clamp(32px,7vh,66px);padding:24px 20px max(24px,env(safe-area-inset-bottom));background:#143e2412}
.title-heading{position:relative;transform:rotate(-3deg)}.title-emblem{display:block;width:250px;height:90px;margin:0 auto -6px;filter:drop-shadow(0 3px 0 #24583e)}.title-heading h1{display:flex;align-items:baseline;justify-content:center;font-size:clamp(56px,13vw,86px);font-weight:900;letter-spacing:.02em;color:#fff9df;-webkit-text-stroke:1px #fff9df;text-shadow:0 5px 0 #285d42,3px 6px 0 #285d42,-3px 6px 0 #285d42,0 10px 20px #173c3550}.title-voice{color:#ffdc67;-webkit-text-stroke-color:#ffdc67;display:inline-block;transform:rotate(-7deg);margin-right:5px}
.title-actions{width:min(300px,86vw)}#startGame{background:#ffda66;color:#244a35;box-shadow:0 4px 0 #2b603e;min-height:58px;font-size:20px;border:2px solid #ffedaa;border-radius:13px}.title-utilities{display:flex;gap:10px;margin-top:16px}.title-utilities .title-secondary{flex:1;white-space:nowrap;margin:0;padding:10px 8px;background:#244b3bc9;border:1px solid #fff5cd70;min-height:44px;font-size:14px}
#micTest{max-height:calc(100dvh - 32px);overflow-y:auto}#micTest h2{margin-bottom:12px}#micTestStatus{min-height:44px}#micTestMeter{height:24px;background:#dce5ce;border-radius:5px;overflow:hidden}#micTestLevel{display:block;width:0;height:100%;background:#427653}.mic-scale{display:flex;justify-content:space-between;font-size:12px;margin:7px 0 22px;color:#53664e}#micTestClose{margin-bottom:0}
@media(max-height:530px){#titleScreen{gap:20px;padding:16px;flex-direction:row}.title-heading{width:48%}.title-emblem{width:180px;height:65px}.title-heading h1{font-size:56px}.title-actions{width:min(270px,42vw)}.title-utilities{margin-top:12px}}
/* 浮遊はタイトルの待機中だけ。操作パネルは静止させる。 */

@keyframes buttons-hover{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.on-title .title-heading{animation:title-hover 6s linear infinite}.on-title .title-actions{animation:buttons-hover 4.5s cubic-bezier(0.77,0,0.175,1) infinite}
#titleScreen.mic-check-open .title-actions{animation-play-state:paused}
@media(hover:hover) and (pointer:fine){.title-actions:hover{animation-play-state:paused}}
#titleScreen.mic-check-open{gap:16px}.mic-check-open .title-emblem{height:58px}.mic-check-open .title-heading h1{font-size:56px}
#micTest[hidden]{display:none}#micTest{margin:14px 0 0;padding:14px 16px 10px;background:#223b34f5;color:#f3f4e8;border:1px solid #ffffff35;border-radius:12px;max-height:none;overflow:visible;text-align:left;box-shadow:0 6px 18px #16352b38}
.mic-check-heading{display:flex;align-items:center;justify-content:space-between}#micTest h2{font-size:14px;margin:0}#micTestClose{font-size:24px;background:transparent;color:#d9e1d6;width:36px;height:36px;line-height:1;padding:0}.mic-input-state{display:flex;justify-content:space-between;font-size:11px;color:#bbd2c1;margin:1px 0 8px;font-variant-numeric:tabular-nums}
#micTestMeter{height:15px;background:#50635a;border-radius:2px;mask-image:repeating-linear-gradient(to right,#000 0,#000 calc(5% - 3px),transparent calc(5% - 3px),transparent 5%)}#micTestLevel{width:100%;height:100%;transform:scaleX(0);transform-origin:left;background:#7ee2a3}
#micTest .mic-gain-label{display:flex;align-items:center;gap:12px;font-size:12px;margin:14px 0;color:#d8e2d6}#micTestGain{min-width:0;flex:1;accent-color:#7ee2a3;cursor:pointer;height:20px}#micTestStart{font-size:13px;min-height:38px;border-radius:6px;background:#dce9d6;color:#234734;box-shadow:none}#micTestStatus{font-size:11px;line-height:1.5;min-height:33px;margin:8px 0 0;color:#c3d4c4}
@media(max-height:650px) and (min-height:531px){#titleScreen.mic-check-open{gap:8px;padding:12px 16px}.mic-check-open .title-emblem{height:40px}.mic-check-open .title-heading h1{font-size:44px}.mic-check-open #startGame{min-height:46px}.mic-check-open .title-utilities{margin-top:10px}#micTest{margin-top:8px;padding-top:6px}}
@media(max-height:530px){#titleScreen.mic-check-open{gap:20px}.mic-check-open .title-emblem{height:65px}.mic-check-open .title-heading h1{font-size:56px}.mic-check-open #startGame{min-height:42px}.mic-check-open .title-utilities{margin-top:8px}#micTest{margin-top:8px;padding:5px 12px}#micTest .mic-gain-label{margin:7px 0}#micTestStatus{min-height:0;margin-top:5px}#micTestStart{min-height:36px}.mic-check-heading{height:30px}}
@media(prefers-reduced-motion:reduce){.on-title .title-heading,.on-title .title-actions{animation:none}}

/* 展開前後でアンカーを固定し、マイクパネルだけ下へ表示する。 */
#titleScreen,#titleScreen.mic-check-open{--actions-top:clamp(180px,calc(50dvh - 55px),380px);padding:0;gap:0;display:block}
#titleScreen .title-heading{position:absolute;top:calc(var(--actions-top) - 185px);left:50%;width:max-content;translate:-50% 0}
#titleScreen .title-emblem{height:70px;width:230px}#titleScreen .title-heading h1{font-size:70px;line-height:1.25}
#titleScreen .title-actions{position:absolute;top:var(--actions-top);left:50%;translate:-50% 0;transform:none;animation:none;width:min(300px,86vw)}
#titleScreen #startGame{min-height:54px}#titleScreen .title-utilities{margin-top:14px}
#titleScreen #micTest{position:absolute;top:100%;left:0;right:0;margin-top:12px;padding:12px 16px 8px}

@keyframes button-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5px)}}
.on-title #startGame,.on-title .title-utilities>button{animation:button-bob 1.8s ease-in-out infinite}.on-title #titleSettings{animation-delay:-.6s}.on-title #titleMicTest{animation-delay:-1.2s}
#titleScreen button:active{animation-play-state:paused}
@media(hover:hover) and (pointer:fine){#titleScreen button:hover{animation-play-state:paused}}
@media(max-height:650px) and (min-height:531px){#titleScreen,#titleScreen.mic-check-open{--actions-top:180px}#titleScreen .title-heading{top:30px}#titleScreen .title-emblem{height:55px;width:210px}#titleScreen .title-heading h1{font-size:56px}#titleScreen #startGame{min-height:46px}#titleScreen .title-utilities{margin-top:10px}#titleScreen #micTest{margin-top:10px;padding-top:6px}}
@media(max-height:530px){#titleScreen .title-heading{left:25%;top:50%;translate:-50% -50%;width:46%}#titleScreen .title-emblem{width:180px;height:65px}#titleScreen .title-heading h1{font-size:56px}#titleScreen .title-actions{left:75%;top:18px;width:min(270px,42vw)}#titleScreen #startGame{min-height:42px}#titleScreen .title-utilities{margin-top:8px}#titleScreen #micTest{margin-top:8px;padding:5px 12px}}
@media(prefers-reduced-motion:reduce){.on-title #startGame,.on-title .title-utilities>button,.on-title .title-heading{animation:none}}
/* 選択ボタンだけを少し下へ。タイトルの位置は維持。 */
#titleScreen .title-actions{top:calc(var(--actions-top) + 24px)}
@media(max-height:650px) and (min-height:531px){#titleScreen .title-actions{top:calc(var(--actions-top) + 12px)}}
@media(max-height:530px){#titleScreen .title-actions{top:30px}}

/* 正弦波を1周期ずつ補間。上下18pxを維持し、回転は±0.35度に抑える。 */
@keyframes title-hover{
0.0000%{transform:translate(0.0000px,0.0000px) rotate(-3.0000deg)}
1.6667%{transform:translate(0.1254px,-0.0493px) rotate(-2.9634deg)}
3.3333%{transform:translate(0.2495px,-0.1967px) rotate(-2.9272deg)}
5.0000%{transform:translate(0.3708px,-0.4405px) rotate(-2.8918deg)}
6.6667%{transform:translate(0.4881px,-0.7781px) rotate(-2.8576deg)}
8.3333%{transform:translate(0.6000px,-1.2058px) rotate(-2.8250deg)}
10.0000%{transform:translate(0.7053px,-1.7188px) rotate(-2.7943deg)}
11.6667%{transform:translate(0.8030px,-2.3117px) rotate(-2.7658deg)}
13.3333%{transform:translate(0.8918px,-2.9778px) rotate(-2.7399deg)}
15.0000%{transform:translate(0.9708px,-3.7099px) rotate(-2.7168deg)}
16.6667%{transform:translate(1.0392px,-4.5000px) rotate(-2.6969deg)}
18.3333%{transform:translate(1.0963px,-5.3394px) rotate(-2.6803deg)}
20.0000%{transform:translate(1.1413px,-6.2188px) rotate(-2.6671deg)}
21.6667%{transform:translate(1.1738px,-7.1288px) rotate(-2.6576deg)}
23.3333%{transform:translate(1.1934px,-8.0592px) rotate(-2.6519deg)}
25.0000%{transform:translate(1.2000px,-9.0000px) rotate(-2.6500deg)}
26.6667%{transform:translate(1.1934px,-9.9408px) rotate(-2.6519deg)}
28.3333%{transform:translate(1.1738px,-10.8712px) rotate(-2.6576deg)}
30.0000%{transform:translate(1.1413px,-11.7812px) rotate(-2.6671deg)}
31.6667%{transform:translate(1.0963px,-12.6606px) rotate(-2.6803deg)}
33.3333%{transform:translate(1.0392px,-13.5000px) rotate(-2.6969deg)}
35.0000%{transform:translate(0.9708px,-14.2901px) rotate(-2.7168deg)}
36.6667%{transform:translate(0.8918px,-15.0222px) rotate(-2.7399deg)}
38.3333%{transform:translate(0.8030px,-15.6883px) rotate(-2.7658deg)}
40.0000%{transform:translate(0.7053px,-16.2812px) rotate(-2.7943deg)}
41.6667%{transform:translate(0.6000px,-16.7942px) rotate(-2.8250deg)}
43.3333%{transform:translate(0.4881px,-17.2219px) rotate(-2.8576deg)}
45.0000%{transform:translate(0.3708px,-17.5595px) rotate(-2.8918deg)}
46.6667%{transform:translate(0.2495px,-17.8033px) rotate(-2.9272deg)}
48.3333%{transform:translate(0.1254px,-17.9507px) rotate(-2.9634deg)}
50.0000%{transform:translate(0.0000px,-18.0000px) rotate(-3.0000deg)}
51.6667%{transform:translate(-0.1254px,-17.9507px) rotate(-3.0366deg)}
53.3333%{transform:translate(-0.2495px,-17.8033px) rotate(-3.0728deg)}
55.0000%{transform:translate(-0.3708px,-17.5595px) rotate(-3.1082deg)}
56.6667%{transform:translate(-0.4881px,-17.2219px) rotate(-3.1424deg)}
58.3333%{transform:translate(-0.6000px,-16.7942px) rotate(-3.1750deg)}
60.0000%{transform:translate(-0.7053px,-16.2812px) rotate(-3.2057deg)}
61.6667%{transform:translate(-0.8030px,-15.6883px) rotate(-3.2342deg)}
63.3333%{transform:translate(-0.8918px,-15.0222px) rotate(-3.2601deg)}
65.0000%{transform:translate(-0.9708px,-14.2901px) rotate(-3.2832deg)}
66.6667%{transform:translate(-1.0392px,-13.5000px) rotate(-3.3031deg)}
68.3333%{transform:translate(-1.0963px,-12.6606px) rotate(-3.3197deg)}
70.0000%{transform:translate(-1.1413px,-11.7812px) rotate(-3.3329deg)}
71.6667%{transform:translate(-1.1738px,-10.8712px) rotate(-3.3424deg)}
73.3333%{transform:translate(-1.1934px,-9.9408px) rotate(-3.3481deg)}
75.0000%{transform:translate(-1.2000px,-9.0000px) rotate(-3.3500deg)}
76.6667%{transform:translate(-1.1934px,-8.0592px) rotate(-3.3481deg)}
78.3333%{transform:translate(-1.1738px,-7.1288px) rotate(-3.3424deg)}
80.0000%{transform:translate(-1.1413px,-6.2188px) rotate(-3.3329deg)}
81.6667%{transform:translate(-1.0963px,-5.3394px) rotate(-3.3197deg)}
83.3333%{transform:translate(-1.0392px,-4.5000px) rotate(-3.3031deg)}
85.0000%{transform:translate(-0.9708px,-3.7099px) rotate(-3.2832deg)}
86.6667%{transform:translate(-0.8918px,-2.9778px) rotate(-3.2601deg)}
88.3333%{transform:translate(-0.8030px,-2.3117px) rotate(-3.2342deg)}
90.0000%{transform:translate(-0.7053px,-1.7188px) rotate(-3.2057deg)}
91.6667%{transform:translate(-0.6000px,-1.2058px) rotate(-3.1750deg)}
93.3333%{transform:translate(-0.4881px,-0.7781px) rotate(-3.1424deg)}
95.0000%{transform:translate(-0.3708px,-0.4405px) rotate(-3.1082deg)}
96.6667%{transform:translate(-0.2495px,-0.1967px) rotate(-3.0728deg)}
98.3333%{transform:translate(-0.1254px,-0.0493px) rotate(-3.0366deg)}
100.0000%{transform:translate(-0.0000px,0.0000px) rotate(-3.0000deg)}
}
/* ショット操作：ドラッグ案内を一つに、声量を波形で表示。 */
#controls{width:min(330px,88%)}#status:empty{display:none}#status{font-size:13px}#aimControls{gap:10px;margin:0 0 16px;color:#fff7e5;pointer-events:none}#aimControls svg{stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}#aimControls span{font-size:13px;letter-spacing:.04em}
#voicePanel{padding:10px 17px 8px;margin-bottom:12px;background:#234735e8;border:1px solid #ffffff55;border-radius:12px;color:#f3f4dc}.voice-caption{display:flex;justify-content:center;align-items:center;gap:8px;font-size:12px;letter-spacing:.04em}#voiceIcon{width:17px;height:21px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round}.mic-light{width:6px;height:6px;border-radius:50%;background:#91a393}#controls #meter{background:transparent;border-radius:0;height:42px;margin-top:5px;overflow:visible}#meter svg{width:100%;height:100%}.wave-base,.wave-fill{fill:none;stroke-width:4;stroke-linecap:round}.wave-base{stroke:#738e73}.wave-fill{stroke:#ffe091}#controls #level{transition:none}
#controls #swing{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:62px;gap:3px;font-size:18px;touch-action:none;user-select:none;-webkit-user-select:none}#swingHint{font-size:11px;color:inherit;font-weight:500}#swingHint[hidden]{display:none}
#controls[data-state=armed] #voicePanel,#controls[data-state=measuring] #voicePanel{border:2px solid #a5edba;padding:9px 16px 7px;color:#bdffce;box-shadow:0 0 0 4px #b6f5b826}#controls[data-state=armed] .mic-light,#controls[data-state=measuring] .mic-light{background:#a5ffbd;box-shadow:0 0 8px #c2ffcd}#controls[data-state=armed] #swing{background:#d3f5d2}#controls[data-state=measuring] #swing{background:#ffe091}#controls[data-state=measuring] #voicePanel{border-color:#ffe091;color:#ffe091}#controls[data-state=flight] #voicePanel{opacity:.75}
@keyframes listening-glow{0%,100%{opacity:.5}50%{opacity:1}}#controls[data-state=armed] #voiceIcon{animation:listening-glow 1.6s ease-in-out infinite}
@media(max-height:530px){#controls{width:245px}#aimControls{margin-bottom:8px}#voicePanel{margin-bottom:8px;padding-top:7px;padding-bottom:5px}#controls #meter{height:30px}#controls #swing{min-height:54px}}
@media(prefers-reduced-motion:reduce){#controls[data-state=armed] #voiceIcon{animation:none}}
/* マイクスイッチと波形を横一列にまとめる。 */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.voice-controls{display:flex;align-items:center;gap:10px}#controls #swing{flex:0 0 64px;width:64px;height:64px;min-height:64px;padding:14px;border-radius:12px;border:1px solid #fff8e577;background:#254b3bec;color:#dce5cf;box-shadow:none;touch-action:none}#swing svg{width:30px;height:32px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.switch-hold{display:none}#controls[data-manual=true] .switch-mic{display:none}#controls[data-manual=true] .switch-hold{display:block}#controls[data-state=armed] #swing,#controls[data-state=measuring] #swing{background:#c5edce;color:#214c36;border-color:#b8f4c9}#swing[aria-pressed=true] .mic-slash{display:none}#controls[data-state=charging] #swing{background:#ffe091;color:#31543a}#voicePanel{flex:1;min-width:0;margin:0;padding:9px 12px 6px;border:1px solid #ffffff40}.voice-caption{justify-content:flex-start;font-size:11px;gap:7px}#voiceIcon{display:none}.mic-light{margin-left:auto}#controls #meter{height:32px;margin-top:4px}#controls[data-state=armed] #voicePanel,#controls[data-state=measuring] #voicePanel{padding:9px 12px 6px;border-width:1px;box-shadow:none}#controls #swing:disabled{opacity:.55}#aimControls{margin-bottom:12px}
button:focus,input:focus,summary:focus,button:focus-visible,input:focus-visible,summary:focus-visible,#result button:focus-visible,#result summary:focus-visible{outline:none}
body.keyboard-nav button:focus-visible,body.keyboard-nav input:focus-visible,body.keyboard-nav summary:focus-visible{outline:2px solid #c8dfcf;outline-offset:3px}

/* 音声受付中だけ、操作ボタンの上に広い声量表示を出す。ボタン位置は固定。 */
#voiceStage{display:none;position:absolute;bottom:86px;left:50%;transform:translateX(-50%);width:min(740px,92vw);height:clamp(160px,24vh,230px);padding:22px 26px 16px;border-radius:24px;background:#173e35ed;color:#c8f6d3;pointer-events:none;box-shadow:0 8px 24px #153a3526}
#controls[data-state=armed] #voiceStage,#controls[data-state=measuring] #voiceStage{display:flex;flex-direction:column}
.voice-stage-heading{display:flex;align-items:center;justify-content:center;gap:12px;font-size:22px;font-weight:700;letter-spacing:.06em}
.voice-stage-heading svg{width:30px;height:32px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.voice-stage-heading i{width:9px;height:9px;border-radius:50%;background:currentColor}
.voice-stage-wave{width:100%;flex:1;min-height:0;margin-top:16px;overflow:visible}
#liveVoiceWave{fill:none;stroke:currentColor;stroke-width:5;stroke-linecap:round}
#controls[data-state=measuring] #voiceStage{color:#ffe091;background:#234a39f2}
#controls[data-state=armed] #voicePanel,#controls[data-state=measuring] #voicePanel{visibility:hidden}
@media(max-width:480px){#voiceStage{padding:20px 18px 14px;height:clamp(160px,23vh,210px)}.voice-stage-heading{font-size:21px}}
@media(max-height:530px){#voiceStage{width:min(560px,75vw);height:125px;bottom:76px;left:auto;right:0;transform:none;padding:12px 20px}.voice-stage-heading{font-size:18px}.voice-stage-heading svg{width:24px;height:26px}.voice-stage-wave{margin-top:8px}}

/* 音声操作は中央のマイクスイッチだけを常設。ON時に大きなパネルを表示。 */
#controls[data-manual=false] .voice-controls{justify-content:center}
#controls[data-manual=false] #voicePanel{display:none}


#cupCelebration{position:absolute;top:24%;left:50%;transform:translateX(-50%);width:94%;text-align:center;pointer-events:none;color:#fff9e6;text-shadow:0 3px 0 #365b46,0 5px 18px #183e35b3}
#cupCelebration[hidden]{display:none}#cupScoreName{display:block;font-size:clamp(28px,5vw,54px);letter-spacing:.05em;font-weight:900}#cupScoreDetail{display:block;margin-top:12px;font-size:16px;font-weight:700}.cup-score-emblem{display:block;width:100px;height:56px;margin:0 auto 8px;color:#fff9e6;filter:drop-shadow(0 2px 2px #244b3dcc)}.cup-laurels{display:none}
#cupCelebration.is-ace{color:#ffe397}.is-ace .cup-score-emblem{width:128px;height:72px;color:#ffe397}.is-ace .cup-laurels{display:block}
#cupCelebration:not([hidden]){animation:cup-score-enter .35s ease-out both}@keyframes cup-score-enter{from{opacity:0;transform:translate(-50%,10px) scale(.94)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
#result #resultShotName{font-size:16px;color:#234b37;font-weight:700;letter-spacing:.04em;margin:6px 0 8px}
@media(max-height:530px){#cupCelebration{top:17%}#cupScoreName{font-size:30px}.cup-score-emblem,.is-ace .cup-score-emblem{height:44px;width:80px;margin:0 auto 4px}#cupScoreDetail{margin-top:6px}#result #resultShotName{font-size:13px;margin:3px 0}}
@media(prefers-reduced-motion:reduce){#cupCelebration:not([hidden]){animation:none}}

/* カップインの一度きりの再現。文字は動かさず、一定の水平速度と重力による放物線で球をカップへ落とす。 */
.cup-emblem-ball{transform-box:fill-box;transform-origin:center;transform:translate(-32px,-5px)}
#cupCelebration:not([hidden]) .cup-emblem-ball{animation:emblem-ball-in 900ms linear 200ms both}
@keyframes emblem-ball-in{0%{transform:translate(-32.000px,-5.000px);opacity:1.000}2.5%{transform:translate(-31.200px,-5.873px);opacity:1.000}5%{transform:translate(-30.400px,-6.690px);opacity:1.000}7.5%{transform:translate(-29.600px,-7.452px);opacity:1.000}10%{transform:translate(-28.800px,-8.160px);opacity:1.000}12.5%{transform:translate(-28.000px,-8.813px);opacity:1.000}15%{transform:translate(-27.200px,-9.410px);opacity:1.000}17.5%{transform:translate(-26.400px,-9.953px);opacity:1.000}20%{transform:translate(-25.600px,-10.440px);opacity:1.000}22.5%{transform:translate(-24.800px,-10.872px);opacity:1.000}25%{transform:translate(-24.000px,-11.250px);opacity:1.000}27.5%{transform:translate(-23.200px,-11.572px);opacity:1.000}30%{transform:translate(-22.400px,-11.840px);opacity:1.000}32.5%{transform:translate(-21.600px,-12.053px);opacity:1.000}35%{transform:translate(-20.800px,-12.210px);opacity:1.000}37.5%{transform:translate(-20.000px,-12.313px);opacity:1.000}40%{transform:translate(-19.200px,-12.360px);opacity:1.000}42.5%{transform:translate(-18.400px,-12.352px);opacity:1.000}45%{transform:translate(-17.600px,-12.290px);opacity:1.000}47.5%{transform:translate(-16.800px,-12.172px);opacity:1.000}50%{transform:translate(-16.000px,-12.000px);opacity:1.000}52.5%{transform:translate(-15.200px,-11.773px);opacity:1.000}55%{transform:translate(-14.400px,-11.490px);opacity:1.000}57.5%{transform:translate(-13.600px,-11.153px);opacity:1.000}60%{transform:translate(-12.800px,-10.760px);opacity:1.000}62.5%{transform:translate(-12.000px,-10.313px);opacity:1.000}65%{transform:translate(-11.200px,-9.810px);opacity:1.000}67.5%{transform:translate(-10.400px,-9.252px);opacity:1.000}70%{transform:translate(-9.600px,-8.640px);opacity:1.000}72.5%{transform:translate(-8.800px,-7.973px);opacity:1.000}75%{transform:translate(-8.000px,-7.250px);opacity:1.000}77.5%{transform:translate(-7.200px,-6.473px);opacity:1.000}80%{transform:translate(-6.400px,-5.640px);opacity:1.000}82.5%{transform:translate(-5.600px,-4.753px);opacity:1.000}85%{transform:translate(-4.800px,-3.810px);opacity:1.000}87.5%{transform:translate(-4.000px,-2.813px);opacity:1.000}90%{transform:translate(-3.200px,-1.760px);opacity:1.000}92.5%{transform:translate(-2.400px,-0.652px);opacity:0.750}95%{transform:translate(-1.600px,0.510px);opacity:0.500}97.5%{transform:translate(-0.800px,1.727px);opacity:0.250}100%{transform:translate(0.000px,3.000px);opacity:0.000}}
@media(prefers-reduced-motion:reduce){#cupCelebration:not([hidden]) .cup-emblem-ball{animation:none;transform:translate(-12px,-5px);opacity:1}}

.cup-emblem-goal{transform-box:view-box;transform-origin:64px 57px}
#cupCelebration:not([hidden]) .cup-emblem-goal{animation:emblem-goal-catch 300ms ease-out 1010ms both}
@keyframes emblem-goal-catch{0%{transform:translateY(0) scaleY(1)}35%{transform:translateY(2px) scaleY(.96)}70%{transform:translateY(-.6px) scaleY(1.015)}100%{transform:translateY(0) scaleY(1)}}
@media(prefers-reduced-motion:reduce){#cupCelebration:not([hidden]) .cup-emblem-goal{animation:none}}

/* 入力中もコースを見渡せる、下端のコンパクトなマイク表示。 */
#voiceStage{width:100%;height:76px;bottom:76px;left:0;right:auto;transform:none;padding:9px 14px;border-radius:12px;background:#173e35ed}
.voice-stage-heading{justify-content:flex-start;font-size:12px;gap:7px;letter-spacing:.02em}.voice-stage-heading svg{width:15px;height:17px}.voice-stage-heading i{width:6px;height:6px;margin-left:auto}
.voice-stage-wave{margin-top:5px}#liveVoiceWave{stroke-width:2;stroke-linecap:round}
@media(max-height:530px){#voiceStage{height:60px;bottom:72px;padding:7px 12px}.voice-stage-heading{font-size:11px}.voice-stage-heading svg{width:13px;height:15px}}

#controls[data-state=flight]{visibility:hidden}

#micTestStart{margin:6px 0 12px}

#soundVolumeValue{float:right;font-variant-numeric:tabular-nums}

@media(max-height:530px){}

#voiceStage{height:96px}.voice-stage-wave{margin-top:7px}#liveVoiceWave{stroke-width:5;stroke-linecap:round}@media(max-height:530px){#voiceStage{height:70px}}

/* スマホでは波形の寸法を保ち、下端とスイッチ間の余白だけを詰める。 */
@media(max-width:699px) and (min-height:531px){#controls{bottom:max(8px,env(safe-area-inset-bottom))}#voiceStage{bottom:68px}}
