@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;--tile-face:#fbf8f1;--tile-line:#c9bba3;--tile-edge:#d6c8b0;--tile-edge-dark:#c2b398;--covered:#cfc7b9;--covered-edge:#b3a996;--mystery:#8d7aa6;--mystery-edge:#6f5f88;--tray:#cdb698;--tray-slot:#e2d3bf;--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{-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{margin:0}
[hidden]{display:none!important}
svg{width:22px;height:22px;flex-shrink:0}
svg:not(.glyph){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}
.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 6px;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}
.score{display:flex;flex-direction:column;align-items:flex-end;gap:5px;min-width:112px;margin-bottom:5px}
.score-line{display:flex;align-items:baseline;gap:8px;line-height:1}
#score{font-size:30px;letter-spacing:-.02em}
.multiplier{font-size:15px;color:var(--faint);transition:color .2s}
.multiplier.on{color:var(--accent)}
.score.bump #score{animation:bump .3s}
.combo-track{width:100%;height:4px;border-radius:2px;background:#e7e0d4;overflow:hidden}
.combo-track i{display:block;height:100%;background:var(--accent);transform-origin:0 50%;transform:scaleX(0)}
.coach{flex-shrink:0;margin:2px 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;display:flex;flex-direction:column}
.board-area{position:relative;flex:1;min-height:0}
.tray-row{position:relative;flex-shrink:0;display:flex;align-items:center;gap:8px;margin-top:10px}
.tray{flex:1;min-width:0;display:grid;grid-template-columns:repeat(var(--slots,7),1fr);gap:4px;padding:7px;border-radius:15px;background:var(--tray);box-shadow:0 0 0 4px #ede4d6,inset 0 2px 4px rgba(96,70,40,.2);transition:background-color .25s,box-shadow .25s}
.slot{aspect-ratio:1;border-radius:18%;background:var(--tray-slot);box-shadow:inset 0 2px 3px rgba(96,70,40,.16);transition:background-color .25s}
.tray.warn{background:#d8ab95;box-shadow:0 0 0 4px #f0d9cd,inset 0 2px 4px rgba(120,60,40,.22)}
.tray.warn .slot{background:#ebd2c4}
.tray.shake{animation:shake .45s}
.extra{position:relative;flex:0 0 auto;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--gold);color:#fff;box-shadow:0 3px 0 #b3802a;transition:transform .1s,opacity .2s}
.extra svg{width:20px;height:20px;stroke-width:2.4}
.extra .badge{top:-8px;right:-9px;min-width:19px;height:19px;line-height:19px;font-size:12px}
.extra:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #b3802a}
.extra:disabled{opacity:.4}

.tile{position:absolute;left:0;top:0;width:var(--ts,48px);height:var(--ts,48px);transform-origin:0 0;transition:transform .24s cubic-bezier(.3,.75,.25,1);will-change:transform;z-index:10}
.stage.instant .tile{transition:none}
.face{position:absolute;inset:0;display:grid;place-items:center;border-radius:18%;background:var(--tile-face);border:1px solid var(--tile-line);box-shadow:calc(var(--ts,48px)*.045) calc(var(--ts,48px)*.075) 0 var(--tile-edge),calc(var(--ts,48px)*.06) calc(var(--ts,48px)*.11) calc(var(--ts,48px)*.14) rgba(60,48,34,.16);transition:transform .12s,background-color .2s,box-shadow .2s}
.glyph{width:78%;height:78%;pointer-events:none;transition:filter .2s,opacity .2s}
.mark{font-family:var(--serif);font-size:calc(var(--ts,48px)*.62);line-height:1;color:#fbf8f1;pointer-events:none}
.tile.mystery .face{background:var(--mystery);border-color:var(--mystery-edge)}
.tile.blocked{cursor:default}
.tile.blocked .face{background:var(--covered);border-color:var(--covered-edge);box-shadow:calc(var(--ts,48px)*.045) calc(var(--ts,48px)*.075) 0 var(--covered-edge),calc(var(--ts,48px)*.06) calc(var(--ts,48px)*.11) calc(var(--ts,48px)*.14) rgba(60,48,34,.12)}
.tile.blocked .glyph{filter:brightness(0);opacity:.34}
.tile.blocked .mark{color:#8e8577}
.tile.in-tray{pointer-events:none}
.tile.flying .face{box-shadow:0 0 0 2px rgba(236,196,104,.75),0 0 18px 4px rgba(236,196,104,.55)}
.tile.hinted .face{animation:nudge 1.1s ease-in-out infinite}
@media(hover:hover){.tile:not(.blocked):not(.in-tray):hover .face{transform:translateY(-2px)}}
.tile:not(.blocked):not(.in-tray):active .face{transform:translateY(1px) scale(.97)}

.boosters{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px;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}
.booster svg{width:24px;height:24px;stroke-width:1.9}
.booster.undo svg{color:#6f8f5a}
.booster.hint svg{color:#c9922e}
.booster.shuffle svg{color:#5d7fa6}
@media(hover:hover){.booster:hover:not(:disabled){background:#f3efe6}}
.booster:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #e2ddd1}
.booster:disabled{opacity:.42}
.badge{position:absolute;top:-7px;right:calc(50% - 34px);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}
.notice{margin-top:8px;text-align:center;font-size:12px;color:var(--accent);flex-shrink:0}
.notice:empty{display:none}

.fx{position:absolute;left:0;top:0;pointer-events:none;z-index:900}
.spark{width:8px;height:8px;border-radius:2px}
.points{font-family:var(--serif);font-size:20px;color:var(--accent);white-space:nowrap}

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}
.level-list button.done{background:var(--clay)}
.level-list button.done svg{position:absolute;right:5px;bottom:5px;width:12px;height:12px;color:var(--accent);stroke-width:2.4}
.level-list button.current{background:var(--button);color:#f8f7f2}
.level-list button.current svg{color:#e6d6c6}
.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 16px;letter-spacing:.04em}
.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)}
.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 shake{0%,100%{transform:none}20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
@keyframes bump{50%{transform:scale(1.14)}}
@keyframes nudge{0%,100%{transform:none}50%{transform:translateY(-4px)}}

@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;box-shadow:0 0 90px rgba(50,45,35,.05)}
}
@media(max-height:700px){
  .topbar{height:40px;margin-bottom:0}
  h1{font-size:20px}
  #score{font-size:26px}
  .tray-row{margin-top:8px}
  .tray{padding:5px}
  .boosters{margin-top:10px}
  .booster{min-height:50px;flex-direction:row;gap:6px}
}
@media(max-width:359px){
  .app-shell{padding-left:12px;padding-right:12px}
  .boosters{gap:8px}
  .tray{gap:3px;padding:5px}
  .extra{width:34px;height:34px}
}
@media(prefers-reduced-motion:reduce){
  .tile{transition-duration:.12s}
  .tray.shake,.score.bump #score,.tile.hinted .face,.chest.open>svg{animation:none}
}
