:root{font-family:system-ui,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;background:#f7f5ef;color:#25342f;color-scheme:light}
*{box-sizing:border-box}body{margin:0}button,a{color:inherit;font:inherit;-webkit-tap-highlight-color:transparent}button{cursor:pointer}
button{border:1px solid #b4c0b7;background:#fffefa;border-radius:14px;padding:7px 13px;min-height:44px;font-weight:650;touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid #1980a0;outline-offset:2px}
[hidden]{display:none!important}.back{font-size:.86rem;text-decoration:none;display:inline-flex;align-items:center;min-height:44px;color:#435951}
.game{--accent:#296959;margin:auto;width:min(100%,520px);height:100vh;height:100svh;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:4px;padding:max(2px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
body[data-game="paper-fold"] .game{--accent:#80522f}body[data-game="folding-fan"] .game{--accent:#813c3f}body[data-game="candy-floss"] .game{--accent:#9b4a60}body[data-game="train-stop"] .game{--accent:#476d2c}
header{display:flex;align-items:center;justify-content:space-between}#sound{background:transparent;border:0;min-width:68px;color:#47554c}
h1{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(18px,5vw,25px);font-weight:750;line-height:1.3;letter-spacing:.015em;margin:0 0 4px;text-align:center}
.stage{display:grid;place-items:center;position:relative;min-height:0;min-width:0;overflow:hidden;border-radius:17px}
#board{display:block;touch-action:none;width:100%;height:100%;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:crosshair}
footer{display:grid;gap:3px;justify-items:center;align-content:center;min-height:100px}#before,#after{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:2px 10px}
#hint{font-size:clamp(12px,3.5vw,15px);margin:2px 0;font-weight:550;text-align:center;color:#35443c}
#record{color:var(--accent);font-size:clamp(20px,5.8vw,29px);font-variant-numeric:tabular-nums;line-height:1.2}#detail,#best{font-size:12px}#after{text-align:center}#best{color:#526054}
.actions{display:flex;justify-content:center;gap:6px}.actions button{font-size:clamp(12px,3.6vw,14px)}#retry,#act,#restart{background:var(--accent);color:#fff;border-color:transparent}#act{width:min(260px,72vw);height:50px;font-size:20px}
#like{font-family:system-ui;min-width:44px;font-size:22px;line-height:1}#like[aria-pressed="true"]{color:#ab3458}#replay{padding-inline:8px}
#act[aria-disabled="true"]{background:#788577;cursor:default}
#pause:not([hidden]){position:absolute;inset:0;background:#f8f5eee6;display:grid;place-content:center;gap:14px;justify-items:center}
dialog{border:0;border-radius:18px;padding:16px;width:min(90%,420px)}textarea{width:100%;min-height:82px;font:inherit}#notice{position:fixed;bottom:calc(84px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);pointer-events:none;white-space:nowrap;background:#25342f;color:white;border-radius:12px;font-size:13px}#notice:not(:empty){padding:8px 12px}
@media(max-height:650px){.game{gap:1px}h1{margin-bottom:1px}.stage{border-radius:10px}footer{min-height:84px}header{height:41px}#act{height:44px}}
@media(max-height:450px){.game{grid-template-rows:auto minmax(0,1fr) auto}.game h1{display:none}footer{min-height:48px;display:flex;justify-content:center;flex-wrap:wrap}}
.shelf{max-width:880px;margin:auto;padding:18px clamp(12px,4vw,34px)}.shelf h1{text-align:left;margin:16px 0}.shelf ul{padding:0;margin:0;list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.shelf li a{display:block;background:#fffdfa;border-radius:14px;overflow:hidden;text-decoration:none;border:1px solid #deddd4}.shelf img{width:100%;height:auto;display:block;aspect-ratio:320/198;object-fit:cover}.shelf span{font-size:16px;display:block;padding:12px;font-weight:650}
.shelf li{background:#fffdfa;border:1px solid #deddd4;border-radius:14px;overflow:hidden}.shelf li a{border:0;border-radius:0}.card-actions{display:flex;gap:5px;margin:0 12px 8px}.card-actions button{font-size:14px;border:0;background:transparent;padding:5px 10px}.card-heart[aria-pressed="true"]{color:#ab3458}
#live{z-index:1;position:absolute;top:6px;left:50%;transform:translateX(-50%);margin:0;border-radius:999px;padding:3px 12px;white-space:nowrap;background:#fffdf2ee;color:#263930;font-size:14px;font-weight:750;font-variant-numeric:tabular-nums;pointer-events:none}
#celebration{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2}
#celebration i{position:absolute;top:50%;left:50%;width:7px;height:11px;border-radius:45% 6%;background:hsl(var(--tone) 76% 58%);opacity:0;animation:bloom .88s ease-out both}
@keyframes bloom{0%{opacity:1;transform:translate(0,0)}55%{opacity:1;transform:translate(var(--x),var(--y)) rotate(var(--rot))}100%{opacity:0;transform:translate(var(--x),60px) rotate(var(--rot))}}
body[data-game="glass-clean"]{background:#eaf4f2;color:#174247}body[data-game="glass-clean"] h1{font-family:system-ui,sans-serif;font-weight:850}body[data-game="glass-clean"] .stage{border:1px solid #75a4a1}
body[data-game="paper-fold"]{background:#f2eadb;color:#4f3826}body[data-game="paper-fold"] .stage{border-radius:5px}body[data-game="paper-fold"] .actions button{border-radius:5px}
body[data-game="folding-fan"]{background:#f8efd9;color:#5e362a}body[data-game="folding-fan"] h1{font-weight:600;letter-spacing:.09em}body[data-game="folding-fan"] .stage{border-radius:3px;border-top:3px double #a9684e;border-bottom:3px double #a9684e}
body[data-game="candy-floss"]{background:#fcecf4;color:#6a3357}body[data-game="candy-floss"] h1{font-family:system-ui,sans-serif;font-weight:900}body[data-game="candy-floss"] .actions button{border-radius:999px}body[data-game="candy-floss"] .stage{border-radius:25px}body[data-game="candy-floss"] #live{background:#fff0fa;color:#813d64}
body[data-game="train-stop"]{background:#e9eee0;color:#27382c}body[data-game="train-stop"] .stage{border:2px solid #74895e;border-radius:4px}body[data-game="train-stop"] #act{border-radius:5px}body[data-game="train-stop"] h1{font-family:system-ui,sans-serif;letter-spacing:.08em}
