.family-home{display:flex;align-items:center;justify-content:center;min-height:48px;margin:14px 0;padding:12px 18px;border:1px solid #829670;border-radius:12px;color:#285b40;background:#eff5e6;text-decoration:none;font-weight:700}.family-home[hidden]{display:none}.family-home:focus-visible{outline:4px solid #2447bd;outline-offset:3px}
:root{color-scheme:light;--ink:#293c32;--muted:#58685d;--green:#285b40;--gold:#ffd76a;--fur:#ad7350;--ear:#986141;--belly:#e9bf8b;--snout:#f2d4ae}
#nickname-form{display:flex;flex-wrap:wrap;gap:10px}#nickname-form[hidden]{display:none}#nickname-form label{width:100%;font-size:14px}#nickname{font:inherit;min-height:44px;min-width:0;flex:1;width:100%;padding:8px;border:1px solid #829670;border-radius:8px}#save-name,#logout{min-height:44px;font:inherit;border:1px solid #829670;border-radius:8px;padding:8px 12px;background:#eff5e6;color:#293c32}#leaderboard-list{padding-left:0;list-style:none}#leaderboard-list li{padding:10px 0;border-bottom:1px solid #d8ded1;overflow-wrap:anywhere}#account-status{overflow-wrap:anywhere}#google-login{min-height:44px}
*{box-sizing:border-box}body{margin:0;background:#f7f5ed;color:var(--ink);font-family:system-ui,-apple-system,"Noto Sans TC",sans-serif}button{font:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:4px solid #2447bd;outline-offset:3px}button{touch-action:manipulation}.game{max-width:560px;padding:28px 22px 22px;margin:auto}.heading{position:relative}.badge{display:inline-block;border:1px solid #d8ded1;padding:6px 12px;border-radius:40px;color:var(--green);font-size:12px;font-weight:700;letter-spacing:.08em}.eyebrow{font-size:12px;letter-spacing:.14em;color:var(--muted);margin:22px 0 5px}h1{font-size:clamp(32px,8vw,46px);letter-spacing:.02em;margin:0;line-height:1.3}h1 span{color:#c9822e;margin-left:12px}.subtitle{margin:9px 0 24px;color:var(--muted);font-size:14px}.dashboard{display:grid;grid-template-columns:repeat(3,1fr);background:#fffdf8;border:1px solid #e0e2d5;border-radius:20px;padding:16px 8px;text-align:center;box-shadow:0 4px 0 #e9eadf}.dashboard>div+div{border-left:1px solid #e3e5dc}.label{display:block;color:var(--muted);font-size:12px;font-weight:600;margin-bottom:4px}.dashboard strong{font-size:clamp(25px,6.5vw,36px);font-variant-numeric:tabular-nums;letter-spacing:-.04em}.unit{font-size:11px;margin-left:4px;color:var(--muted)}.time-track{height:6px;margin:16px 4px 20px;background:#e1e5d6;border-radius:8px;overflow:hidden}#time-bar{height:100%;background:var(--green);transform-origin:left;transition:transform .15s linear}.urgent .clock strong{color:#a63d25}.urgent #time-bar{background:#a63d25}.garden{background:#dae8c6;border:1px solid #bccfa6;border-radius:25px;padding:17px 16px 5px;box-shadow:0 6px 0 #c5d4b2;position:relative;overflow:hidden}.garden-caption{display:flex;justify-content:space-between;gap:8px;font-size:11px;font-weight:700;color:#425e3d;margin-bottom:12px}#pace{background:#eff5e6;border-radius:10px;padding:2px 8px;white-space:nowrap}.board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px}.hole{position:relative;isolation:isolate;aspect-ratio:1/1.02;width:100%;border:0;padding:0;background:none;cursor:pointer;user-select:none}.hole:disabled{cursor:default}.hole-shadow{position:absolute;left:3%;right:3%;bottom:6%;height:32%;border-radius:50%;background:#47392b;box-shadow:inset 0 6px 4px #2a251f,0 4px 0 #93ab7b}.mole-mask{position:absolute;left:5%;right:5%;top:0;bottom:15%;overflow:hidden;border-radius:0 0 40% 40%;pointer-events:none}.mole{position:absolute;inset:0;transform:translateY(112%);transition:transform 180ms cubic-bezier(.18,.89,.29,1.22)}.mole svg{width:100%;height:100%;overflow:visible}.mole .fur,.mole .ear{fill:var(--fur)}.mole .ear-inner{fill:#d69b88}.belly{fill:var(--belly)}.snout{fill:var(--snout)}.tuft{fill:var(--fur);stroke:var(--ear);stroke-width:2;stroke-linejoin:round}.eye,.nose{fill:#332b26}.eye{stroke:#332b26}.cheek{fill:#e38e7b;opacity:.8}.mouth{fill:none;stroke:#593827;stroke-width:2.5;stroke-linecap:round}.dazed{display:none;fill:none;stroke:#332b26;stroke-width:4;stroke-linecap:round}.rim{position:absolute;left:0;right:0;bottom:2%;height:15%;border-bottom:7px solid #a9875c;border-radius:50%;pointer-events:none}.up .mole{transform:translateY(0)}.bonus{--fur:#e8b537;--ear:#b98220;--belly:#ffe8a3;--snout:#fff0b7}.bonus-star{display:none;position:absolute;top:0;left:40%;color:#775315;font-size:22px;text-shadow:0 1px #fff3b4}.bonus .bonus-star{display:block}.hit .mole{animation:bonk 360ms ease-in forwards}.hit .eye{display:none}.hit .dazed{display:block}.reward{position:absolute;left:0;right:0;top:4%;z-index:5;font-size:24px;font-weight:900;color:#fff;text-shadow:0 2px 2px #22402b,1px 0 #22402b,-1px 0 #22402b;opacity:0;pointer-events:none}.hit .reward{animation:reward 650ms ease-out forwards}.hammer{position:absolute;right:-12%;top:-22%;width:66%;height:85%;z-index:6;opacity:0;transform-origin:80% 80%;pointer-events:none}.hammer svg{width:100%;height:100%}.swing .hammer{animation:swing 240ms ease-out}.grass{text-align:center;color:#64834f;font-size:17px;letter-spacing:8px;margin:7px 0 0}.status{min-height:22px;text-align:center;font-size:13px;font-weight:600;margin:22px 0 12px}.start{width:100%;min-height:54px;border:0;border-radius:15px;background:var(--green);color:white;font-weight:700;font-size:17px;box-shadow:0 4px 0 #173f2a;cursor:pointer}.start span{margin-left:16px}.start:disabled{background:#647962;box-shadow:0 4px 0 #4c604c;cursor:default}.start:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #173f2a}.result{margin-top:22px;padding:20px;background:#fff4d3;border:1px solid #e9ce89;border-radius:18px;text-align:center}.result h2{font-size:20px;margin:0 0 8px}.result p{margin:5px 0;font-size:14px}.result strong{font-size:26px}.rules{margin-top:30px;border-top:1px solid #dce0d1;padding-top:18px}.rules h2{font-size:15px;margin:0 0 13px}.rule-row{display:flex;align-items:center;gap:12px;margin:8px 0}.rule-icon{background:#e4ecda;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;flex-shrink:0}.gold-icon{background:#ffedba;color:#805914}.rule-row p{margin:0;font-size:12px;line-height:1.8;color:var(--muted)}.rule-row strong{color:var(--ink);font-size:13px}.small{font-size:11px;line-height:1.8;color:var(--muted);margin:14px 0}footer{font-size:10px;text-align:center;color:var(--muted);margin-top:22px;padding-bottom:env(safe-area-inset-bottom)}[hidden]{display:none!important}
@keyframes swing{0%{opacity:1;transform:rotate(40deg) translateY(-10%)}45%{opacity:1;transform:rotate(-35deg) translateY(15%)}75%{opacity:1;transform:rotate(-20deg)}100%{opacity:0;transform:rotate(15deg)}}@keyframes bonk{0%{transform:translateY(0) scaleY(.85)}30%{transform:translateY(0) rotate(-9deg)}100%{transform:translateY(112%) rotate(7deg)}}@keyframes reward{0%{opacity:1;transform:translateY(0) scale(.8)}25%{transform:translateY(-10px) scale(1.1)}100%{opacity:0;transform:translateY(-38px)}}
@media(max-width:360px){.game{padding:20px 14px}.garden{padding:12px 9px 4px}.board{gap:4px 6px}.garden-caption{font-size:10px}.subtitle{margin-bottom:18px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:1ms!important;transition-duration:1ms!important}}
@media(min-width:560px) and (max-height:500px){.hole{aspect-ratio:2.5}.garden{padding:10px 12px 6px}.garden-caption{margin-bottom:6px}.grass{display:none}.time-track{margin:10px 4px 12px}.dashboard{padding:10px 8px}.mole-mask{left:22%;right:22%}.bonus-star{font-size:15px}.hammer{width:38%;right:14%}}
.dashboard{position:sticky;top:8px;z-index:10;grid-template-columns:1.5fr 1fr 1fr;padding:8px;scroll-margin-top:8px}.dashboard>div:first-child{background:var(--green);color:#fff;border-radius:13px;padding:8px 2px}.dashboard>div:first-child .label,.dashboard>div:first-child .unit{color:#fff}.dashboard>div:first-child strong{font-size:clamp(34px,9vw,48px)}.dashboard>div+div{align-self:center;border-left:0}.key-hint{position:absolute;right:4%;bottom:0;min-width:23px;min-height:23px;background:#eff5e6;color:#293c32;border:1px solid #829670;border-radius:7px;font-weight:800;font-size:13px;z-index:3;pointer-events:none}.hole:focus-visible .key-hint{background:#2447bd;color:#fff}
/* Player-first hierarchy. Shared HUD and board travel together, never over holes. */
.game{max-width:1040px;padding:18px 18px 24px}.heading h1{font-size:32px}.subtitle{margin:4px 0 12px}.entry{margin:0 0 14px;padding:0 0 12px;gap:10px}.entry label{min-width:140px;font-size:13px}.entry .small{font-size:12px}.dashboard{position:static}.start{margin:4px 0 16px}.small{font-size:12px}summary{cursor:pointer;min-height:44px;padding:12px 4px;font-size:14px;font-weight:700}summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #2447bd;outline-offset:2px}details{border-bottom:1px solid #d8ded1}.room-main{min-width:0}.room-play{display:grid;gap:16px}#room-hud{position:static;grid-template-columns:1fr 1fr;margin-bottom:12px}#room-hud.active-hud{position:sticky;top:8px;z-index:10}#room-score{font-size:44px;line-height:1.1}#room-time{font-size:36px;line-height:1.1}#room-rank{grid-column:1/-1;margin:4px 0 0}#room-status{margin:6px 0 10px;font-size:14px}#room-readiness{font-weight:700;font-size:17px;margin:10px 0}.feedback-line{height:52px;display:flex;align-items:center;justify-content:center;text-align:center;margin:10px 0;font-size:15px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}.feedback-line[data-kind=hit]{color:#285b40;background:#e8f4db;border-radius:10px}.feedback-line[data-kind=miss]{color:#8f301b}.feedback-line[data-kind=claimed]{color:#5c526b}.copy-feedback{min-height:24px;margin:4px 0}.personal-result{margin:8px 0}#room-personal-score{font-size:44px}.room-list .is-me{font-weight:800;background:#e8f4db;padding:10px;border-radius:8px}#multiplayer-shell .start{background:var(--green);color:white}#room-board .hole{margin:0;padding:0}#room-secondary{min-width:0}#room-panel[data-phase=lobby] .room-main,#room-panel[data-phase=ended] .room-main{display:none}#room-panel[data-phase=lobby] #room-invite{order:-1}#room-secondary{display:flex;flex-direction:column}#room-panel[data-phase=countdown] #room-time{font-size:52px}#room-panel[data-phase=countdown] .feedback-line{font-size:15px}body[data-room-phase=countdown] .heading,body[data-room-phase=running] .heading,body[data-solo-phase=running] .heading{display:none}body[data-room-phase=running] .room-main,body[data-room-phase=countdown] .room-main{position:sticky;top:8px;align-self:start;background:#f7f5ed;z-index:10;border-radius:20px}body[data-room-phase=running] .game>section.rules,body[data-room-phase=countdown] .game>section.rules,body[data-solo-phase=running] .game>section.rules{display:none}body[data-solo-phase=running] #solo-panel>.dashboard{position:sticky;top:8px}body[data-solo-phase=running] #account-details{display:none}.claimed::after,.empty-hit::after{position:absolute;inset:25% 0 auto;text-align:center;z-index:7;font-size:13px;font-weight:800;background:#fffdf8;padding:6px;border-radius:8px;pointer-events:none}.claimed::after{content:'被搶先'}.empty-hit::after{content:'空敲 -10'}.score-pulse{animation:score-pulse 450ms ease-out}@keyframes score-pulse{50%{transform:scale(1.12)}}
@media(min-width:800px){.room-play{grid-template-columns:minmax(0,600px) minmax(240px,1fr);align-items:start}#solo-panel{max-width:560px;margin:auto}.entry{max-width:560px}.heading{margin-bottom:8px}#room-panel[data-phase=lobby] .room-play,#room-panel[data-phase=ended] .room-play{grid-template-columns:1fr}#room-panel[data-phase=lobby] #room-secondary,#room-panel[data-phase=ended] #room-secondary{max-width:600px}.personal-result,.room-primary-actions,#room-readiness{max-width:600px}.room-main .garden{max-width:600px}}
@media(max-width:799px){.game{max-width:560px;padding:14px 16px}.heading h1{font-size:30px}.entry label{min-width:130px}.entry .small{font-size:11px}.rules{margin-top:16px;padding-top:8px}}
@media(max-width:360px){.game{padding:12px}.entry label{min-width:130px}#room-hud{padding:6px}#room-panel .garden{padding:9px}.feedback-line{font-size:14px}}
/* Ephemeral targets use normalized center coordinates supplied by engine/room. */
/* Active-only viewport surface: secondary documents may scroll without clipping targets. */
.play-surface{min-width:0;scroll-margin-top:10px}
.play-surface[data-active="true"]{position:fixed;top:10px;left:50%;transform:translateX(-50%);width:calc(100% - 24px);max-width:560px;z-index:12;background:#f7f5ed}
body:has(.play-surface[data-active="true"]) .game::after{content:"";display:block;height:100dvh}
.play-surface[data-active="true"] .dashboard,#room-hud.active-hud{position:static}
.play-surface[data-active="true"] .garden{width:min(100%,max(295px,calc(100dvh - 280px)));margin-inline:auto;padding:9px!important}
.play-surface[data-active="true"] .board{aspect-ratio:1;width:100%;grid-template-rows:repeat(3,minmax(0,1fr));min-height:0}
.play-surface[data-active="true"] .board:not(.random-board) .hole{aspect-ratio:auto;min-width:44px;min-height:44px}
.play-surface[data-active="true"] .garden-caption,.play-surface[data-active="true"] .grass{display:none}
.play-surface[data-active="true"] .time-track{margin:8px 4px}
.play-surface[data-active="true"] .status,.play-surface[data-active="true"] .feedback-line{margin:8px 0;font-size:16px;min-height:48px;height:auto}
.size-guidance{position:fixed;inset:0 0 auto;z-index:30;margin:0;padding:12px;background:#fff2c6;color:#532b00;font-size:16px;font-weight:700}
.result-actions{display:flex;flex-wrap:wrap;gap:8px;scroll-margin:12px}
.result-actions button,.result-actions a{min-height:44px;margin:0;padding:10px 14px;border:1px solid #829670;border-radius:10px;background:#eff5e6;color:var(--green);font:inherit}
.result-actions .start{width:100%;background:var(--green);color:white}
#room-result-actions{position:sticky;top:12px;z-index:2;background:#fff4d3}
#room-share,.room-list,.entry label,.entry .small,.small,.subtitle,.label,#nickname-form label,summary,#room-status,.feedback-line,.status,.result p{font-size:16px!important}
@media(min-width:560px) and (max-height:500px){
 .play-surface[data-active="true"]{max-width:900px;display:grid;grid-template-columns:180px minmax(0,1fr);grid-template-rows:1fr auto;gap:6px 12px;height:calc(100dvh - 20px)}
 .play-surface[data-active="true"] .dashboard{grid-column:1;grid-row:1;grid-template-columns:1fr!important;margin:0!important;padding:6px}
 .play-surface[data-active="true"] .garden{grid-column:2;grid-row:1/3;width:min(100%,calc(100dvh - 24px));align-self:center}
 .play-surface[data-active="true"] .time-track{display:none}
 .play-surface[data-active="true"] .status,.play-surface[data-active="true"] .feedback-line{grid-column:1;grid-row:2;align-self:start;line-height:1.4}
 #room-panel[data-phase=countdown] #room-time{font-size:52px}
}
.random-board{display:block;position:relative;width:100%;aspect-ratio:1/1;min-width:275px;min-height:0;overflow:hidden;touch-action:manipulation}
.random-board .hole{position:absolute;width:16%;height:16%;min-width:44px;min-height:44px;aspect-ratio:1;transform:translate(-50%,-50%)}
.hole[hidden]{display:none!important}
#room-board .hole{border:0;padding:0;margin:0;background:none}
#room-panel .garden:has(.random-board){padding:9px}
.random-board .mole-mask{left:5%;right:5%}
.entry{display:flex;flex-wrap:wrap;gap:12px}.entry label{flex:1;min-width:180px}.entry .small{width:100%;margin:0}
select,input{font:inherit;min-height:44px;max-width:100%;min-width:0;border:1px solid #829670;border-radius:8px;padding:8px;background:#fffdf8;color:var(--ink)}select{display:block;width:100%;margin-top:6px}
#multiplayer-shell button{min-height:44px;border:1px solid #829670;border-radius:10px;padding:10px 12px;margin:6px 4px 6px 0;color:var(--green);background:#eff5e6}
#multiplayer-shell button:disabled{opacity:.6}#room-join-form{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}#room-join-form label{width:100%}#room-code{flex:1;width:100%}#room-share{width:100%;margin-top:18px;font-size:12px}#room-panel .dashboard{grid-template-columns:1fr 1fr}#room-panel h2,#room-status,.room-list{overflow-wrap:anywhere}.room-list{list-style:none;padding:0;font-size:13px}.room-list li{padding:8px 0;border-bottom:1px solid #d8ded1}#room-panel .garden{padding:12px}#room-board .hole{min-height:44px}
@media(max-width:360px){.game{padding-left:12px;padding-right:12px}.entry label{min-width:100%}.garden:has(.random-board){padding-left:9px;padding-right:9px}}
@media(min-width:560px) and (max-height:500px){.dashboard>div:first-child strong{font-size:34px}.dashboard>div:first-child{padding:4px 2px}.dashboard{padding:6px}.dashboard .label{margin-bottom:2px}}
/* Keep the entire play unit visible on short desktops; secondary content scrolls separately. */
body[data-room-phase=running] .phase-status,body[data-room-phase=countdown] .phase-status{display:none}
body[data-room-phase=running] .game>details,body[data-room-phase=countdown] .game>details,body[data-room-phase=running] footer,body[data-room-phase=countdown] footer{display:none}
#room-hud.active-hud{top:auto}
#room-board .hole.hit[hidden]{display:block!important}
.entry label{min-width:130px}.needs-login{display:none}
@media(min-width:800px){body[data-room-phase=running] .room-main .garden,body[data-room-phase=countdown] .room-main .garden{width:min(100%,max(301px,calc(100dvh - 300px)));margin-inline:auto}body[data-room-phase=running] #room-secondary{max-height:calc(100dvh - 50px);overflow:auto}}