:root{color-scheme:light;--paper:#f7f2e9;--ink:#33291e;--muted:#71604b;--orange:#b84916;--green:#267556;--line:#d5c9b7;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif;color:var(--ink);background:#e9e2d5;font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button{font:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid var(--green);outline-offset:4px}button:disabled{cursor:default}::selection{background:#f4c39f;color:#33291e}[hidden]{display:none!important}
#game{width:min(100%,480px);height:100svh;min-height:540px;margin:auto;display:flex;flex-direction:column;background:var(--paper);padding:max(16px,env(safe-area-inset-top)) 24px max(16px,env(safe-area-inset-bottom));overflow:hidden;position:relative}header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-shrink:0}h1{font-size:24px;letter-spacing:-.03em;line-height:1.2;margin:0;font-weight:850}h1 span{display:block;font-size:12px;letter-spacing:0;color:var(--muted);font-weight:500;margin-top:5px}.quiet{background:transparent;border:1px solid var(--line);border-radius:24px;min-height:44px;min-width:60px;padding:0 12px;font-size:12px;font-weight:650;color:var(--ink)}.quiet:hover{background:#eee4d6}
.round-strip{display:flex;justify-content:space-between;align-items:center;padding-top:20px;flex-shrink:0}#timer{display:flex;align-items:baseline;gap:4px;font-variant-numeric:tabular-nums}#timer strong{font-size:32px;line-height:1;font-weight:800}#timer span{font-size:12px;color:var(--muted)}#timer.urgent{color:#ad321c}#nail-progress{list-style:none;display:flex;gap:8px;padding:0;margin:0}#nail-progress li{width:28px;height:28px;display:grid;place-items:center;border-bottom:2px solid #c8bba5;color:#79664d;font-size:12px;font-weight:700}#nail-progress .current{color:var(--orange);border-color:var(--orange)}#nail-progress .done{color:var(--green);border-color:var(--green)}#nail-progress .bent{color:#ad321c;border-color:#ad321c}
#stage{position:relative;flex:1;min-height:180px;margin:0 -24px;overflow:hidden}#scene{width:100%;height:100%;display:block;touch-action:pan-y}#scene-label{position:absolute;top:16px;left:24px;right:24px;text-align:center;color:var(--muted);font-size:12px;pointer-events:none}#depth{position:absolute;top:24%;right:7%;color:var(--orange);font-variant-numeric:tabular-nums;pointer-events:none}#depth strong{display:block;font-size:36px;line-height:1;font-weight:850}#depth span{display:block;font-size:11px;margin-top:6px}#boss-caption{position:absolute;bottom:8px;left:16px;right:16px;padding:9px 12px;text-align:center;background:rgba(247,242,233,.95);border-radius:12px;pointer-events:none}#boss-line{font-size:15px;display:block}#boss-tailo{font-size:10px;line-height:1.4;display:block;color:var(--muted);margin-top:3px}
#controls{flex-shrink:0;padding-top:12px;position:relative}.instruction{display:flex;justify-content:space-between;align-items:center;gap:8px}.instruction p{font-size:12px;color:var(--orange);font-weight:700;margin:0 0 5px}.instruction h2{font-size:23px;line-height:1.3;letter-spacing:-.02em;margin:0;font-weight:800}#hint{font-size:12px;line-height:1.5;color:var(--muted);margin:12px 0 16px;min-height:18px}#action,#resume{width:100%;min-height:64px;border:0;border-radius:14px;background:var(--orange);color:#fff;font-size:18px;font-weight:750;box-shadow:0 6px 16px #9a42191c;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:background 120ms,transform 120ms}#action:hover{background:#a33d0e}#action:active{transform:translateY(2px)}#action:disabled{background:#dfd3c1;color:#685439;box-shadow:none}.charging #action{background:#87360f}.instruction,#action{user-select:none}
#meter-wrap{margin-top:18px}#meter{height:20px;position:relative;background:#e4d9c6;border-radius:6px;overflow:visible}#zone{position:absolute;top:0;bottom:0;left:34%;width:32%;background:#b3d6b8;border:1px solid var(--green);border-radius:3px}#needle{position:absolute;top:-5px;width:4px;height:30px;background:var(--ink);border:1px solid var(--paper);border-radius:2px;transform:translateX(-50%)}#power-fill{position:absolute;top:5px;bottom:5px;left:0;width:0;background:var(--orange);border-radius:2px}.meter-labels{display:flex;justify-content:space-between;margin-top:8px;color:var(--muted);font-size:10px}#meter-center{color:var(--green);font-weight:700}#pause-cover{position:absolute;inset:0;z-index:3;background:rgba(247,242,233,.97);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;padding:40px}#pause-cover strong{font-size:26px}#resume{max-width:240px}
@media(max-width:360px){#game{padding-left:16px;padding-right:16px}#stage{margin-left:-16px;margin-right:-16px}h1{font-size:22px}.instruction h2{font-size:21px}#nail-progress{gap:5px}}
@media(max-height:700px){#game{padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}.round-strip{padding-top:12px}h1 span{display:none}#controls{padding-top:4px}#meter-wrap{margin-top:12px}#hint{margin:8px 0 10px}#action{min-height:58px}#boss-tailo{display:none}}
@media(min-width:700px) and (min-height:700px){body{padding:24px}#game{height:min(900px,calc(100svh - 48px));border-radius:24px;box-shadow:0 16px 48px #4837211a}}
@media(orientation:landscape) and (max-height:540px){#game{width:100%;max-width:900px;height:100svh;min-height:320px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:44px 38px 1fr;column-gap:24px;padding:12px 24px}header{grid-column:1/3}h1{font-size:20px}h1 span{display:none}.round-strip{grid-column:1;padding-top:0}#stage{grid-column:1;grid-row:3;min-height:0;margin:0 -24px}#controls{grid-column:2;grid-row:2/4;align-self:center}#scene-label{display:none}#boss-caption{bottom:0}#boss-tailo{display:none}#depth strong{font-size:26px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}

/* Keep the stage steady through impact; only the initial welcome omits the meter space. */
#meter-wrap[hidden]{display:block!important;visibility:hidden}body[data-phase="ready"] #meter-wrap[hidden]{display:none!important}#hint{min-height:36px}

/* Keep the true target interval above the charge fill, without widening its hit window. */
#power-fill{z-index:1}#zone{z-index:2;top:-3px;bottom:-3px;background:#72bd8c;border:0;border-radius:2px;box-shadow:inset 1px 0 #145c3d,inset -1px 0 #145c3d;pointer-events:none}#needle{z-index:3}
#meter[data-guide="partial"] #zone{background:#f4ce65;box-shadow:inset 1px 0 #875d0b,inset -1px 0 #875d0b}
#meter[data-guide="partial"] + .meter-labels #meter-center{color:#78500a}
#meter[data-guide="miss"]{outline:1px dashed #ad321c}
#meter[data-guide="miss"] + .meter-labels #meter-center{color:#ad321c}
