@font-face{font-family:"LH Editorial";src:url("/fonts/lh-editorial.woff2") format("woff2");font-style:normal;font-weight:400;font-display:swap}
:root{color-scheme:light;--paper:#f5f3ed;--surround:#ebe9e2;--card:#fbfaf6;--ink:#30322f;--muted:#72746b;--faint:#a3a499;--rule:#dfdbd0;--clay:#e9dfd5;--sage:#e7e9de;--accent:#926b56;--gold:#d49f3c;--button:#373c32;--button-hover:#535c49;--c0:#dc6a5c;--c1:#e0aa35;--c2:#68a35b;--c3:#5a8fc4;--c4:#8e6aa8;--anchor:#565a52;--ice:#d4e7f0;--block:#d8cebe;--fire:#e0703a;--star:#e2ad38;--loop:transparent;--serif:"LH Editorial",ui-serif,Georgia,serif;--sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif;font-synthesis:none}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--surround);color:var(--ink);font:14px/1.6 var(--sans);-webkit-font-smoothing:antialiased;overscroll-behavior:none;touch-action:manipulation}
button,input{font:inherit}
button{color:inherit;cursor:pointer;border:0;background:none;padding:0;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button,a,canvas{-webkit-user-select:none;user-select:none}
button:disabled{cursor:default}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
h1,h2,h3,p,dl,dd,ul{margin:0}
ul{padding:0;list-style:none}
[hidden]{display:none!important}
svg{width:22px;height:22px;flex-shrink:0}
svg:not(.mark){fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.knob{fill:var(--paper)}
.solid{fill:currentColor;stroke:none}
.icon-library{position:absolute;width:0;height:0;overflow:hidden}
.numeral{font-family:var(--serif);font-weight:400;font-variant-numeric:lining-nums tabular-nums}

.app-shell{position:relative;width:100%;max-width:460px;height:100%;margin:0 auto;display:flex;flex-direction:column;background:var(--paper);padding:max(10px,env(safe-area-inset-top)) 18px max(12px,env(safe-area-inset-bottom));overflow:hidden;box-shadow:inset 0 0 0 0 var(--loop);transition:box-shadow .18s}
.app-shell.looping{box-shadow:inset 0 0 0 6px var(--loop)}
.topbar{display:flex;align-items:center;justify-content:space-between;height:48px;margin:0 -8px 4px;flex-shrink:0}
.icon-button{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;transition:background .15s}
.icon-button:hover{background:#ebe8df}
.wordmark{font-family:var(--serif);font-size:27px;line-height:1;letter-spacing:-.045em}
.wordmark span{color:var(--accent)}
.game{flex:1;min-height:0;display:flex;flex-direction:column}
.game-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:0 2px 8px;flex-shrink:0}
.eyebrow{min-height:20px;color:var(--muted);font-size:12px;letter-spacing:.06em}
h1{font-size:23px;font-weight:600;letter-spacing:.03em;line-height:1.4}
h1 .numeral{font-size:1.28em;letter-spacing:-.02em;margin:0 .06em}
.moves{display:flex;align-items:baseline;gap:5px;margin-bottom:3px;line-height:1}
.moves .numeral{font-size:38px;letter-spacing:-.03em;transition:color .2s}
.moves-label{font-size:13px;color:var(--muted)}
.moves.low .numeral{color:#c0533f}
.moves.bump .numeral{animation:bump .3s}

.goals{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;flex-shrink:0;margin-bottom:6px}
.goal{display:flex;align-items:center;gap:7px;min-height:38px;padding:5px 13px 5px 7px;border-radius:19px;background:var(--card);border:1px solid var(--rule);transition:background .25s,border-color .25s}
.goal .count{font-family:var(--serif);font-size:21px;line-height:1;min-width:1.1em;text-align:left;font-variant-numeric:lining-nums tabular-nums}
.goal .token{position:relative;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;flex-shrink:0}
.goal .token svg{width:18px;height:18px}
.goal .token.dot{background:var(--dot)}
.goal .token.dot .mark{width:13px;height:13px;fill:#fff;stroke:#fff;stroke-width:2.2;opacity:.9}
.goal .token.anchor{color:var(--anchor);background:#e9e7e0}
.goal .token.ice{color:#4f8aa6;background:var(--ice)}
.goal .token.block{color:#7c705d;background:var(--block)}
.goal .token.fire{color:#fff;background:var(--fire)}
.goal .token.fire svg{fill:#fff;stroke:none}
.goal .done-mark{display:none;width:18px;height:18px;color:var(--c2);stroke-width:2.6}
.goal.done{background:#eef1e6;border-color:#d5dcc6}
.goal.done .count{display:none}
.goal.done .done-mark{display:block}
.goal.bump .token{animation:bump .3s}
.c0{--dot:var(--c0)}.c1{--dot:var(--c1)}.c2{--dot:var(--c2)}.c3{--dot:var(--c3)}.c4{--dot:var(--c4)}
.coach{flex-shrink:0;margin:0 0 4px;padding:8px 12px;border-radius:10px;background:var(--sage);color:#4f5a45;font-size:12.5px;line-height:1.65;text-align:center}

.stage{position:relative;flex:1;min-height:0}
.board{position:absolute;inset:0;width:100%;height:100%;touch-action:none;outline:none;cursor:pointer}
.board:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:14px}
.stage.aiming .board{cursor:crosshair}

.scorebar{display:flex;align-items:center;gap:12px;margin:10px 4px 0;flex-shrink:0}
#score{font-size:19px;line-height:1;min-width:3.2em;letter-spacing:-.01em}
.star-track{position:relative;flex:1;height:6px;border-radius:3px;background:#e7e0d4}
.star-track>i{position:absolute;inset:0;border-radius:3px;background:var(--star);transform-origin:0 50%;transform:scaleX(0);transition:transform .45s cubic-bezier(.3,.7,.3,1)}
.star-track .mark{position:absolute;top:50%;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;display:grid;place-items:center;background:var(--paper);color:#cfc6b6;transition:color .3s}
.star-track .mark svg{width:15px;height:15px}
.star-track .mark.on{color:var(--star)}
.star-track .mark.on svg{animation:bump .4s}
.boosters{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:12px;flex-shrink:0}
.booster{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:60px;border-radius:15px;background:var(--card);border:1px solid var(--rule);box-shadow:0 3px 0 #e2ddd1;font-size:12px;color:var(--ink);transition:background .15s,opacity .15s,transform .1s,border-color .15s}
.booster svg{width:24px;height:24px;stroke-width:1.9}
.booster.eraser svg{color:#5d7fa6}
.booster.burst svg{color:#c0533f}
.booster.cross svg{color:#8e6aa8}
.booster.shuffle svg{color:#6f8f5a}
@media(hover:hover){.booster:hover:not(:disabled){background:#f3efe6}}
.booster:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #e2ddd1}
.booster[aria-pressed="true"]{background:var(--button);border-color:var(--button);color:#f8f7f2;box-shadow:0 3px 0 #22261f}
.booster[aria-pressed="true"] svg{color:#f3e2c7}
.booster:disabled{opacity:.42}
.badge{position:absolute;top:-7px;right:calc(50% - 32px);min-width:21px;height:21px;padding:0 6px;border-radius:11px;background:var(--accent);color:#fff;font-size:13px;line-height:21px;text-align:center}
.badge.empty{background:#aaa699}
/* Messages float over the bottom of the board, so showing one never resizes it. */
.notice{position:absolute;left:50%;bottom:6px;z-index:2;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);padding:6px 14px;border-radius:16px;background:rgba(48,50,47,.86);color:#f8f7f2;font-size:12.5px;line-height:1.6;text-align:center;pointer-events:none;animation:toast .2s ease-out}
.notice:empty{display:none}

dialog{color:var(--ink);background:var(--paper);border:0;padding:24px;box-shadow:0 24px 80px rgba(40,36,30,.24);overscroll-behavior:contain}
dialog::backdrop{background:rgba(48,50,47,.34);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.sheet{width:min(440px,calc(100% - 24px));max-height:86dvh;border-radius:22px;margin:auto}
.sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.sheet-heading h2{font-size:21px;font-weight:600}
.sheet-heading .eyebrow{margin-bottom:2px}
.sheet-heading .icon-button{margin-right:-10px;flex-shrink:0}
.level-list{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}
.level-list button{position:relative;aspect-ratio:1;min-width:0;border-radius:12px;background:#ece8df;display:grid;place-items:center}
.level-list .numeral{font-size:19px;line-height:1.2}
.level-list .mini{position:absolute;bottom:5px;left:0;right:0;display:flex;justify-content:center;gap:1px;color:#d7cdbd}
.level-list .mini svg{width:10px;height:10px}
.level-list .mini svg.on{color:var(--star)}
.level-list button.current .mini svg:not(.on){color:#5c6155}
.level-list button.done{background:var(--clay)}
.level-list button.current{background:var(--button);color:#f8f7f2}
.level-list button:disabled{background:#f0ede6;color:#bab7ad}
.level-list button:disabled svg{width:15px;height:15px}
.setting{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:15px 0;border-bottom:1px solid var(--rule);font-size:14px}
.setting small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.setting input{appearance:none;-webkit-appearance:none;flex:0 0 auto;width:42px;height:25px;border-radius:20px;background:#d9d6cc;position:relative;cursor:pointer;margin:0;transition:background .15s}
.setting input:checked{background:var(--button)}
.setting input::before{content:"";position:absolute;top:3px;left:3px;width:19px;height:19px;border-radius:50%;background:#fff;transition:transform .15s}
.setting input:checked::before{transform:translateX(17px)}
.how-to{margin:22px 0}
.how-to h3{font-size:13px;font-weight:600;margin-bottom:8px}
.how-to p{font-size:12.5px;color:var(--muted);line-height:1.85;margin-top:6px}
.secondary-button{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 12px;border:1px solid var(--rule);border-radius:12px;background:var(--card);font-size:14px}
.secondary-button svg{width:18px;height:18px}
.secondary-button+.secondary-button{margin-top:8px}
.primary-button{width:100%;display:flex;align-items:center;justify-content:center;gap:12px;min-height:50px;border-radius:12px;background:var(--button);color:#f8f7f2;font-size:15px;margin:22px 0 10px;transition:background .2s}
.primary-button svg{width:18px;height:18px}
.primary-button:hover{background:var(--button-hover)}
.text-button{width:100%;min-height:40px;color:var(--accent);font-size:13px}
.home-link{display:block;text-align:center;color:var(--muted);text-decoration:none;font-size:13px;padding:18px 0 4px}
.home-link:hover{text-decoration:underline;text-underline-offset:4px}
.device-note{text-align:center;font-size:11px;color:var(--faint);margin-top:6px}
.result-dialog{width:min(360px,calc(100% - 36px));border-radius:24px;text-align:center;padding:28px 24px 18px}
.result-dialog h2{font-size:26px;font-weight:600;margin:4px 0 10px;letter-spacing:.04em}
.stars{display:flex;justify-content:center;gap:6px;margin-bottom:14px;color:#ddd5c6}
.stars svg{width:34px;height:34px}
.stars svg.on{color:var(--star)}
.stars svg.on:nth-child(2){animation-delay:.12s}
.stars svg.on:nth-child(3){animation-delay:.24s}
.stars.show svg.on{animation:pop .45s both}
.result-stats{display:grid;grid-template-columns:repeat(3,1fr);border-block:1px solid var(--rule);padding:12px 0;margin-bottom:12px}
.result-stats div+div{border-left:1px solid var(--rule)}
.result-stats dt{font-size:11px;color:var(--muted);letter-spacing:.08em}
.result-stats dd{font-size:24px;line-height:1.35;margin-top:2px}
.result-copy{font-size:13px;color:var(--muted);line-height:1.8}
.result-copy .record{color:var(--accent)}
.lose-goals{margin:0 0 12px}
.chest{display:flex;align-items:center;gap:10px;margin-top:16px;padding:11px 14px;border-radius:14px;background:#efe9df}
.chest>svg{color:var(--accent)}
.pips{display:flex;gap:6px;flex:1}
.pips i{flex:1;height:7px;border-radius:4px;background:#e0d6c7;transition:background .3s}
.pips i.on{background:var(--gold)}
.chest-label{font-size:12px;color:var(--muted);white-space:nowrap}
.chest-reward{margin-top:8px;font-size:12.5px;color:var(--accent)}
.chest.open>svg{animation:bump .5s 2}
.result-dialog .actions{display:flex;flex-direction:column;gap:8px;margin-top:20px}
.result-dialog .actions .primary-button{margin:0}
.result-dialog .actions .secondary-button+.secondary-button{margin-top:0}

@keyframes bump{50%{transform:scale(1.14)}}
@keyframes pop{from{transform:scale(.3);opacity:0}60%{transform:scale(1.2)}to{transform:none;opacity:1}}
@keyframes toast{from{opacity:0;transform:translate(-50%,6px)}}

@media(min-width:640px){
  body{padding:24px 0}
  .app-shell{height:min(940px,calc(100dvh - 48px));border:1px solid #dcd8cd;border-radius:28px;padding:18px 26px 22px}
}
@media(max-height:700px){
  .topbar{height:40px;margin-bottom:0}
  h1{font-size:20px}
  .moves .numeral{font-size:32px}
  .game-heading{margin-bottom:5px}
  .goal{min-height:32px;padding:3px 11px 3px 5px}
  .goal .token{width:22px;height:22px}
  .goal .count{font-size:18px}
  .scorebar{margin-top:6px}
  .boosters{margin-top:8px}
  .booster{min-height:50px}
  .booster svg{width:21px;height:21px}
}
@media(max-width:359px){
  .app-shell{padding-left:12px;padding-right:12px}
  .boosters{gap:6px}
  .booster{font-size:11px}
  .goals{gap:6px}
  .goal{padding-right:10px}
}
@media(prefers-reduced-motion:reduce){
  .app-shell{transition:none}
  .moves.bump .numeral,.goal.bump .token,.chest.open>svg,.notice,.stars.show svg.on,.star-track .mark.on svg{animation:none}
  .star-track>i{transition:none}
}
