:root{--ink:#59412f;--muted:#9b8672;--paper:#faf6eb;--yellow:#f9cc5a;--mint:#d9ece2;--line:#e6dccc;--white:#fffdf7}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-width:320px;background:var(--paper);color:var(--ink);font-family:ui-rounded,"Hiragino Maru Gothic ProN","Hiragino Sans","Yu Gothic",sans-serif;-webkit-font-smoothing:antialiased}
button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default;opacity:.42}
button:focus-visible,canvas:focus-visible{outline:3px solid #8baa99;outline-offset:4px}
.game-shell{width:min(100%,1200px);margin:0 auto;padding:16px 18px 18px}
.masthead{text-align:center;margin-bottom:14px}
h1{margin:0;font-size:clamp(25px,3.2vw,35px);line-height:1.3;font-weight:900;letter-spacing:.015em}
h1 br{display:none}
.game-frame{position:relative;background:var(--white);border:1.5px solid var(--line);border-radius:26px;overflow:hidden}
.scene-wrap{position:relative;height:clamp(350px,calc(100svh - 205px),680px);touch-action:none}
canvas{display:block;width:100%;height:100%;touch-action:none;cursor:default}
.game-frame.is-home .scene-wrap{height:clamp(340px,calc(100svh - 190px),660px)}
.game-frame.is-home canvas{touch-action:auto}
.game-frame.is-result .scene-wrap{height:clamp(270px,calc(100svh - 310px),560px)}
.home-panel{padding:18px 24px 24px;border-top:1px solid var(--line)}
.primary-button,.secondary-button{display:flex;align-items:center;justify-content:center;gap:18px;min-height:52px;border:0;border-radius:16px;padding:12px 20px;font-weight:800;font-size:14px;transition:background .15s,transform .15s}
.primary-button{color:var(--ink);background:var(--yellow)}
.primary-button:hover:not(:disabled){background:#f6c141}
.primary-button:active:not(:disabled),.secondary-button:active:not(:disabled){transform:translateY(1px)}
.start-button{width:min(100%,420px);margin:0 auto;min-height:60px;font-size:18px;letter-spacing:.03em}
.primary-button>span{font-size:23px}
.secondary-button{background:#eee9de;color:var(--ink)}
.home-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 14px;min-height:44px;border:1px solid #ddd3c1;border-radius:999px;background:rgba(255,253,247,.95);color:#796650;box-shadow:0 2px 0 rgba(164,139,104,.1);font-size:12px;font-weight:700;line-height:1;transition:background .15s}
.home-button:hover{background:#f3ebd9}
.home-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#resetButton{position:absolute;z-index:3;top:16px;left:18px}
.live-score{position:absolute;z-index:2;right:22px;top:17px;text-align:right;pointer-events:none}
.live-score>span{font-size:11px;color:var(--muted);letter-spacing:.02em}
.live-score>div{display:flex;align-items:baseline;justify-content:flex-end;gap:2px}
.live-score strong{font-family:ui-rounded,"Arial Rounded MT Bold",sans-serif;font-size:44px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.percent-unit{font-size:16px;font-weight:700}
.lift-line{position:absolute;left:14px;right:14px;border-top:1.5px dashed #a0b29c;z-index:1;pointer-events:none}
.lift-line.is-counting{border-color:#789c62}
.hold-meter{position:absolute;z-index:2;top:18px;left:50%;transform:translateX(-50%);width:62px;pointer-events:none}
.hold-count{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;line-height:1;font-variant-numeric:tabular-nums;width:62px;height:62px;border-radius:50%;background:#e2edce;color:#65804b;font-size:32px;font-weight:800}
.hold-track{height:4px;border-radius:4px;background:#e3e5d9;margin-top:8px;overflow:hidden}
.hold-track>span{display:block;height:100%;width:0;background:#8ca777}
.control-area{padding:16px 24px 21px;border-top:1px solid var(--line);background:var(--white)}
.direction-controls{display:grid;grid-template-columns:1fr 1fr;gap:30px;max-width:550px;margin:0 auto}
.control-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;position:relative;padding-top:23px}
.pair-label{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;font-size:12px;font-weight:700;color:var(--muted);line-height:1}
.direction-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;line-height:1;border:1.5px solid #c3d3c3;border-radius:17px;height:62px;background:#e6edde;color:#52664c;font-size:32px;font-weight:700;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;box-shadow:0 3px 0 #d3ddca;transition:background .08s,transform .08s}
.vertical-pair .direction-button{background:#f9d66e;border-color:#ebc65d;color:#71592d;box-shadow:0 3px 0 #e9c66b}
.direction-button.is-pressed,.direction-button:active{background:#c9dbb7;transform:translateY(3px);box-shadow:none}
.vertical-pair .direction-button.is-pressed,.vertical-pair .direction-button:active{background:#edbd40}
.dessert-label{position:absolute;z-index:2;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:8px 17px;border:1px solid #d8d9c5;border-radius:999px;background:rgba(255,253,247,.95);color:#657a66;font-size:13px;font-weight:700;line-height:1;white-space:nowrap;pointer-events:none}
.dessert-label.is-ultra{background:#fff2cc;border-color:#dfb65a;color:#96651f}
.result-area{border-top:1px solid var(--line);padding:19px 30px 23px}
.result-heading{display:flex;align-items:center;justify-content:center;gap:60px}
.result-heading p,.verdict>span{display:block;margin:0 0 7px;font-size:11px;color:var(--muted)}
.result-heading h2{display:flex;align-items:baseline;justify-content:center;gap:3px;margin:0;line-height:1}
.result-heading h2>span{font-family:ui-rounded,"Arial Rounded MT Bold",sans-serif;font-size:56px;line-height:1;font-variant-numeric:tabular-nums;font-weight:900}
.result-heading small{font-size:22px}
.verdict{text-align:left}
.verdict strong{display:block;font-size:25px;line-height:1.3}
.result-comment{text-align:center;margin:12px 0;font-size:14px;font-weight:700}
.result-details{display:flex;align-items:center;justify-content:center;gap:22px;font-size:11px;color:var(--muted);margin-bottom:16px}
.result-details b{color:var(--ink);font-variant-numeric:tabular-nums}
.result-buttons{display:flex;gap:10px;justify-content:center}
.result-buttons>button{flex:1;max-width:300px;min-height:50px}
.result-home{background:#f9e6ab;border-color:#ecd393;color:#71592d;border-radius:16px;font-size:14px}
.result-home:hover{background:#f5dda0}
.save-status{font-size:11px;text-align:center;color:var(--muted);margin:8px 0 0}
.save-status:empty{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:600px){
  .game-shell{padding:10px 5px 10px}.masthead{margin-bottom:10px}h1{font-size:25px;line-height:1.28}h1 br{display:block}.game-frame{border-radius:22px}
  .scene-wrap{height:clamp(310px,calc(100svh - 205px),720px)}.game-frame.is-home .scene-wrap{height:clamp(310px,calc(100svh - 190px),720px)}.game-frame.is-result .scene-wrap{height:clamp(230px,calc(100svh - 330px),520px)}
  #resetButton{top:13px;left:12px}.home-button{padding:10px 12px;font-size:11px}.home-button svg{width:17px;height:17px}
  .live-score{top:13px;right:14px}.live-score>span{font-size:10px}.live-score strong{font-size:38px}.percent-unit{font-size:14px}
  .hold-meter{top:15px;width:50px}.hold-count{width:50px;height:50px;font-size:27px}.hold-track{margin-top:6px}
  .home-panel{padding:17px 22px 20px}.start-button{font-size:17px;min-height:56px}
  .control-area{padding:14px 16px 18px}.direction-controls{gap:22px}.control-pair{padding-top:21px;gap:9px}.pair-label{font-size:11px}.direction-button{height:58px;font-size:31px;border-radius:15px}
  .dessert-label{font-size:12px}
  .result-area{padding:16px 16px 19px}.result-heading{gap:38px}.result-heading h2>span{font-size:48px}.verdict strong{font-size:22px}.result-comment{font-size:12px}.result-details{gap:14px;font-size:10px}.result-buttons{gap:8px}.result-buttons>button{font-size:12px;min-height:46px}
}
@media(max-width:360px){h1{font-size:23px}.direction-controls{gap:16px}.control-area{padding:13px 12px 17px}.direction-button{height:54px}.live-score>span{font-size:9px}.home-button{padding:9px 10px}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
/* Only the explicit debug link shows these ordinary preview controls. */
.dessert-debug{max-width:420px;margin:17px auto 0;padding-top:14px;border-top:1px dashed var(--line)}
.debug-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;font-size:11px;color:var(--muted)}
.debug-heading>span:first-child{font-weight:800;color:var(--ink)}
.debug-choices{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}
.debug-choices [data-dessert="bucket"]{grid-column:1/-1}
.debug-choices button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0 5px;min-height:42px;line-height:1;border:1px solid #d5d8ca;border-radius:12px;background:#f5f5ed;color:#6d7664;font-size:12px;font-weight:700}
.debug-choices button[aria-pressed="true"]{background:#e4edcf;border-color:#99ac7b;color:#536842}
.debug-return{display:block;margin:8px 0 0 auto;padding:6px 0;border:0;background:transparent;font-size:11px;color:var(--muted)}
.debug-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}
.debug-actions .debug-return{margin:0}
.debug-event{padding:7px 10px;border:1px solid #e3d3c3;border-radius:9px;background:#faf2e6;color:#89614a;font-size:11px}
.game-frame.is-friend .scene-wrap{display:none}
.friend-scene{position:relative;z-index:10;min-height:clamp(470px,calc(100svh - 125px),730px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:22px;background:#fff9ec;text-align:center}
.friend-count{margin:0;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.friend-scene h2{margin:0;font-size:clamp(21px,3.5vw,30px);line-height:1.35}
.friend-art{position:relative;width:min(380px,70vw,calc(100svh - 370px));aspect-ratio:1;flex-shrink:0}
.friend-art img{display:block;width:100%;height:100%;object-fit:contain}
.friend-art.is-breaking{animation:friend-snap .32s ease-out}
.friend-line{min-height:24px;margin:0;font-size:16px;font-weight:800;line-height:1.5}
.friend-home,.friend-retry{width:min(100%,300px);flex-shrink:0}
@keyframes friend-snap{0%{transform:scale(1.03) rotate(-3deg)}35%{transform:scale(.98) rotate(2deg)}70%{transform:rotate(-1deg)}100%{transform:none}}
@media(prefers-reduced-motion:reduce){.friend-art.is-breaking{animation:none}}
.game-frame.is-home.has-debug .scene-wrap{height:clamp(185px,calc(100svh - 425px),530px)}
@media(max-width:600px){.debug-choices button{font-size:11px}.game-frame.is-home.has-debug .scene-wrap{height:clamp(160px,calc(100svh - 430px),580px)}}
