@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800;900&display=swap');
:root{color-scheme:light;--cream:#f9f5eb;--red:#c84840;--ink:#4a3b34;--muted:#948477;--line:#e5ddd0;--display:'Noto Sans SC',sans-serif;font-family:var(--display);color:var(--ink);background:var(--cream)}
*{box-sizing:border-box}body{margin:0;background-image:linear-gradient(90deg,#e4dcca26 1px,transparent 1px),linear-gradient(#e4dcca26 1px,transparent 1px);background-size:25px 25px}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #506f92;outline-offset:5px}button:disabled{cursor:wait}a{color:inherit;text-decoration:none}.app{max-width:990px;margin:auto;padding:30px 38px 20px}.topbar{display:flex;justify-content:space-between;align-items:center;padding-bottom:23px;border-bottom:1px solid var(--line)}.brand{font-size:16px;font-weight:800;display:flex;align-items:center;gap:9px}.brand-icon{background:var(--red);color:#fff5df;border-radius:50%;width:29px;height:29px;display:grid;place-content:center;font-size:23px}.brand-en{font-size:10px;letter-spacing:1px;margin-left:7px;color:var(--muted)}.menu-button{border:1px solid #d6ccbd;background:#fffcf5;border-radius:30px;padding:10px 17px;font-size:14px;font-weight:600;box-shadow:0 3px 0 #e8dfcf}.menu-button span{color:var(--red);margin-right:5px}.intro{text-align:center;padding:28px 0 4px}.eyebrow{font-family:Arial,sans-serif;font-size:11px;font-weight:700;letter-spacing:2.3px;color:var(--muted)}h1{font-size:43px;margin:8px 0 8px;line-height:1.3;font-weight:900;letter-spacing:1px;color:var(--red)}h1 span{display:inline-block;transform:rotate(10deg)}.intro p{font-size:14px;color:var(--muted);margin:0}.play-layout{display:grid;grid-template-columns:minmax(0,560px) minmax(0,280px);gap:47px;align-items:center}.game{position:relative;min-width:0}.machine-area{width:100%;position:relative}#machine{width:100%;display:block;aspect-ratio:520/590}.console{display:flex;align-items:center;justify-content:space-evenly;position:relative;margin:-8px 34px 0;background:#ebe2d3;border:1px solid #dcd0be;border-radius:14px 14px 26px 26px;padding:13px 7px 12px;box-shadow:0 6px 0 #d9cbb7,0 12px 22px #5a352012}.stick-group,.grab-group{display:flex;flex-direction:column;align-items:center;gap:9px}.control-caption{font-size:11px;font-weight:500;color:#86725e}.joystick{--stick-pivot:34px;--shaft-length:27px;width:124px;height:94px;position:relative;touch-action:none;user-select:none}.stick-well{position:absolute;width:76px;height:42px;left:calc(50% - 38px);bottom:calc(var(--stick-pivot) - 21px);background:radial-gradient(ellipse at center,#7f6c58 0%,#9e8a73 30%,#bfae94 32%,#d6c8b4 54%,#e7dcc9 55%);border-radius:50%;box-shadow:0 3px 0 #b8a58c}.stick-stem{position:absolute;left:calc(50% - 6px);bottom:var(--stick-pivot);height:var(--shaft-length);width:12px;background:linear-gradient(90deg,#bbb2a7,#fffcf3 40%,#ad9f92);border-radius:5px;transform-origin:50% 100%;z-index:1;pointer-events:none}.stick-knob{position:absolute;left:calc(50% - 21.5px);bottom:calc(var(--stick-pivot) + 5.5px);width:43px;height:43px;border-radius:50%;background:radial-gradient(circle at 32% 23%,#fff4eb 0%,#ec8c77 17%,#d85147 48%,#a53030 100%);box-shadow:inset -3px -4px 4px #8e2a3440,0 3px 3px #5f392630;pointer-events:none;z-index:2}.direction{position:absolute;color:#ad9b83;font-size:10px;line-height:1}.up{top:0;left:57px}.down{bottom:0;left:57px}.left{left:0;top:44px}.right{right:0;top:44px}.key-zone{position:absolute;border:0;background:transparent;z-index:3}.north{top:0;left:34px;width:57px;height:18px}.south{bottom:0;left:34px;width:57px;height:15px}.west{left:0;top:16px;width:22px;height:67px}.east{right:0;top:16px;width:22px;height:67px}.grab-button{width:107px;height:79px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50%;border:4px solid #e2b186;background:radial-gradient(ellipse at 35% 17%,#fae5ad,#edcd82 60%,#d3a655);color:#745134;box-shadow:0 6px 0 #b88853,0 9px 0 #d1bd9f,0 13px 12px #89715433;transform:translateY(-3px);transition:transform .12s,box-shadow .12s}.grab-button span{font-size:20px;font-weight:900}.grab-button small{font-size:9px;font-family:Arial;letter-spacing:1.5px;margin-top:3px}.grab-button:active{transform:translateY(2px);box-shadow:0 2px 0 #b88853,0 5px 0 #d1bd9f}.grab-button:disabled{filter:saturate(.6);opacity:.8}.game-status{display:flex;justify-content:center;gap:7px;align-items:center;margin-top:22px;min-height:24px;font-size:13px;color:#8d7a69}.status-star{color:var(--red)}.menu-panel{padding-top:25px}.mascot-wrap{height:112px;position:relative;display:flex;align-items:center;gap:8px;margin-bottom:22px}.mascot-wrap img{width:125px;height:125px;object-fit:contain;filter:drop-shadow(0 7px 5px #8d684718)}.mascot-wrap img[hidden]{display:none}.little-label{font-family:Arial;font-weight:900;font-size:17px;line-height:1.3;color:#b89a75;transform:rotate(-6deg);letter-spacing:1px}.menu-heading{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:23px}.menu-heading .eyebrow{font-size:10px;letter-spacing:1.7px}h2{font-size:19px;margin:7px 0 16px;font-weight:800}.count{white-space:nowrap;font-size:12px;padding:5px 9px;border-radius:20px;border:1px solid #d8cebf;color:#a58b72}.menu-chips{display:flex;gap:8px;flex-wrap:wrap;max-height:245px;overflow:auto}.food-chip{font-size:13px;padding:8px 12px;border:1px solid #dfd4c4;border-radius:9px;background:#fffcf6;max-width:100%;overflow-wrap:anywhere}.food-chip:nth-child(3n+1){background:#f5e8df;border-color:#ebd5c6}.food-chip:nth-child(3n+2){background:#e7eddf;border-color:#d9e1cd}.text-button{margin:17px 0 20px;padding:0;background:none;border:0;color:var(--red);font-size:13px;font-weight:600}.text-button span{margin-left:8px}.tiny-note{display:flex;gap:12px;border-top:1px dashed #d8cbb9;padding-top:18px;align-items:center}.tiny-note>span{font-size:30px;color:#c4aa83}.tiny-note p{font-size:12px;color:#9b8875;line-height:1.8;margin:0}footer{display:flex;justify-content:space-between;border-top:1px solid var(--line);margin-top:34px;padding-top:18px;font-size:10px;letter-spacing:1.5px;color:#ae9c89}footer span:last-child{letter-spacing:1px}footer i{font-size:15px;color:var(--red);font-style:normal}dialog{color:var(--ink);border:1px solid #eee1cf;border-radius:24px;background:#fffcf5;box-shadow:0 25px 90px #50332740;width:min(430px,calc(100% - 28px));padding:27px}dialog::backdrop{background:#4f392e80;backdrop-filter:blur(5px)}.dialog-top{display:flex;justify-content:space-between;align-items:flex-start}.dialog-top h2{font-size:25px;margin-bottom:10px}.close-button{display:grid;place-items:center;padding:0;border:0;background:#efe7dc;color:#8c7766;border-radius:50%;width:32px;height:32px;flex-shrink:0}.close-button svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}.dialog-description{color:#96816d;font-size:14px;line-height:1.8;margin:0 0 21px}label{font-size:14px;font-weight:600;display:block;margin-bottom:9px}textarea{width:100%;resize:vertical;border:1px solid #ddd0bd;border-radius:12px;background:#f8f2e7;font:16px/1.8 var(--display);padding:12px 15px;outline-color:var(--red);color:var(--ink)}.input-note{display:flex;justify-content:space-between;font-size:11px;color:#9b8875;margin-top:8px;gap:8px}.form-error{color:#b63930;font-size:13px;min-height:18px;margin:12px 0}.save-button{width:100%;background:var(--red);color:#fff8ed;padding:14px;border:0;border-radius:13px;font-size:15px;font-weight:700;box-shadow:0 4px 0 #a93433}.result-dialog{text-align:center;overflow-x:hidden}.result-close{position:absolute;top:16px;right:16px}.result-inner{padding-top:26px}.result-inner h2{font-size:25px;margin:13px 0 0}.capsule-button{border:0;background:transparent;width:100%;padding:0;color:#99826b;font-size:14px}.capsule-button canvas{width:min(100%,300px);display:block;margin:0 auto}.capsule-button span{display:block;margin-bottom:8px}.food-note{background:#fff4d6;border-radius:3px;box-shadow:0 4px 15px #634a2614;padding:26px 20px;margin:20px 0 27px;transform:rotate(-3deg);position:relative;border-top:3px dotted #e9d9b6;animation:unfold .55s ease both}.food-note>span{font-size:12px;color:#a38c67;letter-spacing:2px}.food-note h3{font-size:30px;color:var(--red);overflow-wrap:anywhere;margin:18px 0 13px}.food-note p{font-size:12px;color:#a18c70}.note-stamp{font-size:11px;border:1px solid #c8484066;border-radius:50%;width:46px;height:46px;display:grid;place-content:center;color:#c8484099;transform:rotate(15deg);margin:22px auto 0}.result-inner .eyebrow{font-size:10px}@keyframes unfold{from{opacity:0;transform:translateY(20px) rotate(-7deg) scale(.8)}to{opacity:1;transform:rotate(-3deg)}}[hidden]{display:none!important}
@media(min-width:800px){.machine-area{margin-top:-7px}.app{padding-top:28px}}
@media(max-width:760px){.app{max-width:490px;padding:18px 18px 24px}.topbar{padding-bottom:15px}.brand{font-size:14px;gap:7px}.brand-en{display:none}.brand-icon{width:26px;height:26px;font-size:20px}.menu-button{font-size:12px;padding:8px 12px}.intro{padding:22px 0 0}.eyebrow{font-size:9px;letter-spacing:2px}h1{font-size:34px;margin:5px 0 7px}.intro p{font-size:12px}.play-layout{display:block}.machine-area{margin-top:0}#machine{aspect-ratio:520/590}.console{margin:-7px 15px 0;padding:10px 2px;border-radius:13px 13px 22px 22px}.joystick{--stick-pivot:30px;height:87px;width:114px}.up,.down{left:52px}.left,.right{top:41px}.control-caption{font-size:10px}.grab-button{height:74px;width:101px}.grab-button span{font-size:19px}.stick-group,.grab-group{gap:8px}.game-status{font-size:12px;margin-top:19px}.menu-panel{margin:26px 8px 0;padding:0}.mascot-wrap{display:none}.menu-heading{padding-top:20px}h2{font-size:17px;margin-bottom:14px}.menu-heading .eyebrow{font-size:9px}.menu-chips{gap:7px;max-height:150px}.food-chip{font-size:12px;padding:7px 11px}.text-button{font-size:12px;margin-bottom:18px}.tiny-note{display:none}footer{margin-top:10px;font-size:8px;letter-spacing:1px}.input-note{font-size:10px}}
@media(max-width:360px){.app{padding-left:10px;padding-right:10px}.control-caption{font-size:9px}h1{font-size:30px}.intro{padding-top:16px}.console{margin-left:12px;margin-right:12px}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;scroll-behavior:auto!important}}

.game-status{flex-wrap:wrap;line-height:1.8}.game-status .text-button{margin:0 0 0 5px;white-space:nowrap}#save-menu:disabled{opacity:.65}#menu-input:disabled{opacity:.8}

@media(max-width:760px) and (max-height:750px){.intro{padding-top:14px}.machine-area{max-width:310px;margin-inline:auto}.game-status{margin-top:14px}}

/* The paper rises between the back lid and the front half of the capsule. */
.capsule-reveal{position:relative;isolation:isolate;width:100%;height:300px;margin:10px 0 13px}
.capsule-reveal .capsule-button{position:relative;z-index:1;width:300px;max-width:100%;display:block;margin:auto}
.capsule-reveal .capsule-button:disabled{cursor:default}
.capsule-front{position:absolute;z-index:3;top:0;left:50%;transform:translateX(-50%);width:min(100%,300px);pointer-events:none}
.paper-slot{position:absolute;inset:0;z-index:2;overflow:hidden;pointer-events:none;padding:14px 9px 24px}
.capsule-reveal .food-note{width:100%;margin:0;padding:22px 17px;animation:none;transform:rotate(-3deg);transform-origin:50% 50%;background:linear-gradient(180deg,#fff8e5,#fff2d2 48%,#fff6df 49%,#fff2d2 51%,#fff5dc);border-bottom:1px solid #ddc69e}
.capsule-reveal .food-note h3{font-size:clamp(23px,7vw,30px);margin:14px 0 10px}
.capsule-reveal .note-stamp{margin-top:18px}
.capsule-reveal.opening .food-note{will-change:transform,opacity}
.capsule-reveal.opening #open-caption{animation:caption-away .2s both}
.capsule-reveal.revealed{height:auto;min-height:280px}
.capsule-reveal.revealed .paper-slot{position:relative;overflow:visible}
@keyframes caption-away{to{opacity:0}}

.menu-dialog{padding:0;max-height:calc(100dvh - 24px);width:min(450px,calc(100% - 24px));overflow:hidden}
#menu-form{display:flex;flex-direction:column;max-height:calc(100dvh - 26px);height:min(760px,calc(100dvh - 26px))}
.menu-dialog .dialog-top{padding:24px 22px 16px;gap:14px;flex-shrink:0}
.menu-dialog .dialog-top h2{margin:5px 0 5px}
.menu-dialog .dialog-top p{font-size:12px;color:var(--muted);margin:0;line-height:1.6}
.menu-fields{border:0;padding:0;margin:0;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.menu-add{padding:0 22px 14px;flex-shrink:0}
.menu-add label{font-size:12px;margin-bottom:8px;color:#8e7761}
.menu-add-controls{display:flex;gap:8px}
.menu-add-controls input,.menu-list-toolbar input{min-width:0;font:16px var(--display);border:1px solid #ddd0bd;border-radius:11px;background:#fffaf0;color:var(--ink);outline-color:var(--red)}
.menu-add-controls input{flex:1;padding:12px}
.menu-add-controls button{border:0;background:var(--red);color:#fff8ed;border-radius:11px;padding:0 14px;font-size:13px;font-weight:700;white-space:nowrap;min-height:46px}
.menu-list-toolbar{display:flex;gap:12px;align-items:center;padding:12px 22px;background:#f5efe4;border-top:1px solid #e8ddcc;flex-shrink:0}
.menu-list-toolbar input{flex:1;padding:9px 12px;background:#fffcf5;font-size:16px}
#draft-count{font-size:12px;color:#947d67;white-space:nowrap}
.menu-draft-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:12px 22px 16px;background:#f5efe4;scrollbar-width:thin}
.menu-draft-list{display:flex;flex-direction:column;gap:8px}
.menu-draft-row{display:flex;gap:8px;align-items:center;padding:5px 7px 5px 10px;background:#fffcf5;border:1px solid #e6dac9;border-radius:12px}
.menu-row-number{font:11px Arial,sans-serif;color:#baa48b;flex-shrink:0;width:20px}
.menu-draft-row input{font:16px/1.5 var(--display);color:var(--ink);min-width:0;width:100%;padding:8px 4px;border:0;border-radius:6px;background:transparent;outline-color:var(--red)}
.menu-row-delete{flex-shrink:0;border:0;background:#f7e9e0;color:#b65c47;font-size:12px;border-radius:8px;min-width:44px;min-height:44px;padding:0 7px}
.draft-empty{font-size:13px;line-height:1.8;color:#9b8875;text-align:center;margin:30px 5px}
.menu-editor-footer{padding:13px 22px 16px;border-top:1px solid #e6dac9;background:#fffcf5;flex-shrink:0}
.menu-edit-feedback{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;min-height:23px;color:#9b8875}
#menu-editor-status{overflow-wrap:anywhere}
#undo-delete{border:0;background:transparent;color:var(--red);padding:3px 0;font-size:12px;white-space:nowrap;flex-shrink:0}
.menu-editor-footer .form-error{min-height:0;margin:4px 0 8px;font-size:12px}
.menu-editor-footer .form-error:empty{display:none}
.menu-save-hint{font-size:10px;text-align:center;color:#b29b84;margin:10px 0 0}
@media(max-height:650px){.menu-dialog .dialog-top{padding:15px 18px 10px}.menu-dialog .dialog-top .eyebrow{display:none}.menu-add{padding:0 18px 10px}.menu-list-toolbar{padding:8px 18px}.menu-draft-scroll{padding:8px 18px}.menu-editor-footer{padding:9px 18px 12px}.menu-save-hint{display:none}}

/* Tactile feedback for touch, mouse and keyboard presses. */
button{touch-action:manipulation}
:is(.menu-button,.save-button,.menu-add-controls button,.menu-row-delete,.close-button,.text-button,#undo-delete,.capsule-button){transition:transform 100ms ease-out,box-shadow 100ms ease-out,filter 100ms ease-out}
.menu-add-controls button{box-shadow:0 3px 0 #a93433}
.menu-row-delete{box-shadow:0 2px 0 #e4cabc}
.close-button{box-shadow:0 2px 0 #d7c9b8}
.menu-button:active:not(:disabled){transform:translateY(3px);box-shadow:0 0 0 #e8dfcf;filter:brightness(.96)}
.save-button:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #a93433;filter:brightness(.94)}
.menu-add-controls button:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #a93433;filter:brightness(.94)}
.menu-row-delete:active:not(:disabled){transform:translateY(2px) scale(.97);box-shadow:0 0 0 #e4cabc;filter:brightness(.95)}
.close-button:active:not(:disabled){transform:translateY(2px) scale(.94);box-shadow:0 0 0 #d7c9b8;filter:brightness(.95)}
:is(.text-button,#undo-delete):active:not(:disabled){transform:translateY(2px) scale(.96);filter:brightness(.8)}
.capsule-button:active:not(:disabled){transform:scale(.97)}
@media(prefers-reduced-motion:reduce){:is(.menu-button,.save-button,.menu-add-controls button,.menu-row-delete,.close-button,.text-button,#undo-delete,.capsule-button){transition:none}}

@media(max-width:760px){
 .grab-button{--grab-width:clamp(76px,24vw,101px);width:var(--grab-width);height:calc(var(--grab-width)*.733);padding:0;border-width:clamp(3px,.9vw,4px)}
 .grab-button span{font-size:clamp(14px,calc(var(--grab-width)*.18),18px);line-height:1.15;white-space:nowrap}
 .grab-button small{font-size:clamp(7px,calc(var(--grab-width)*.085),8.5px);line-height:1;letter-spacing:1px;margin-top:3px}
}

:root{--topbar-height:78px}
html{scroll-padding-top:calc(var(--topbar-height) + env(safe-area-inset-top,0px) + 12px)}
.app{padding-top:calc(var(--topbar-height) + env(safe-area-inset-top,0px) + 8px)}
.topbar{position:fixed;inset:0 0 auto;z-index:20;height:calc(var(--topbar-height) + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 0 0;border-bottom:1px solid #e5ddd0cc;background:#f9f5ebf2;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 4px 18px #71503808}
.topbar-inner{width:100%;max-width:990px;height:100%;margin:auto;padding:0 38px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.brand{gap:10px;min-width:0}
.brand-logo{display:block;width:42px;height:42px;flex-shrink:0;filter:drop-shadow(0 3px 3px #a74b3220)}
.brand-wordmark{display:flex;flex-direction:column;gap:4px}
.brand-name{font-size:17px;font-weight:900;letter-spacing:.6px;color:#9e4238;white-space:nowrap;line-height:1.2}
.brand-en{display:block;margin:0;font:700 8px/1.1 Arial,sans-serif;letter-spacing:1.65px;color:#af8b6c}
.topbar .menu-button{flex-shrink:0;min-height:40px;white-space:nowrap}
@media(max-width:760px){:root{--topbar-height:68px}.topbar-inner{padding:0 18px}.brand{gap:9px}.brand-logo{width:38px;height:38px}.brand-name{font-size:15px;letter-spacing:.2px}.brand-en{font-size:7px;letter-spacing:1.35px}.topbar .menu-button{padding:8px 12px;min-height:38px}}
@media(max-width:360px){.topbar-inner{padding:0 12px}.brand-logo{width:34px;height:34px}.brand-name{font-size:14px}.brand{gap:7px}.topbar .menu-button{padding:8px 10px}}

.topbar .menu-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;color:#a3483c;border-color:#e5cfb5;background:#fff9ec;font-weight:700;line-height:1.2}
.topbar .menu-button .menu-label{color:inherit;margin:0}
.menu-button-icon{width:16px;height:16px;display:block;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){
 .topbar .menu-button{min-height:44px;padding:0 12px;border-radius:14px;border-color:#ba4a3f;background:linear-gradient(160deg,#d76754,#bd493e);color:#fff7e7;font-size:12px;letter-spacing:.2px;box-shadow:0 3px 0 #9f3d36,inset 0 1px 0 #ffffff40}
 .topbar .menu-button:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #9f3d36,inset 0 1px 0 #ffffff25;filter:brightness(.96)}
 .topbar .menu-button:focus-visible{outline-color:#8f4136;outline-offset:4px}
 .menu-button-icon{width:15px;height:15px}
}

/* Keep touch scrolling vertical; the joystick retains its own touch-action:none. */
html,body{width:100%;min-width:0;overflow-x:hidden;overflow-x:clip;overscroll-behavior:none;touch-action:pan-y}
body{min-height:100vh;min-height:100svh}
