*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
html,body{width:100%;height:100%;overflow:hidden;background:#efe6d2;font-family:'Klee One',serif;color:#3a2e22;touch-action:none}
#app{position:fixed;inset:0}
#app canvas{display:block;width:100%;height:100%}
.hide{display:none!important}

/* 和紙のきりぬき */
.strip,#title .press,#pause button,#card .sheet{
  background:#fbf6ea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow:0 3px 0 rgba(60,40,20,.18),0 6px 14px rgba(60,40,20,.18);
}
#hud{position:fixed;inset:0;pointer-events:none;z-index:5}
.strip{position:absolute;left:calc(14px + env(safe-area-inset-left));display:flex;align-items:center;gap:8px;height:40px;padding:0 16px 0 10px;font-size:24px;
  clip-path:polygon(0 6%,97% 0,100% 52%,98% 100%,2% 94%);transform:rotate(-1.2deg)}
.strip b{font-weight:600;min-width:1.4em;letter-spacing:.02em}
#hCranes{top:calc(12px + env(safe-area-inset-top))}
#hFans{top:calc(58px + env(safe-area-inset-top));transform:rotate(.8deg)}
#hLives{top:calc(104px + env(safe-area-inset-top));transform:rotate(-.5deg)}
.ico{display:inline-block;width:30px;height:30px;background-size:contain;background-repeat:no-repeat;background-position:center}
.ico.crane{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M3 24 L17 20 L20 6 L24 21 L37 15 L27 26 L20 30 Z' fill='%23e8534a'/%3E%3Cpath d='M17 20 L20 6 L22 22 Z' fill='%23c43a33'/%3E%3Cpath d='M24 21 L37 15 L27 26Z' fill='%23f07a6c'/%3E%3Cpath d='M3 24 L9 13 L12 23Z' fill='%23c43a33'/%3E%3C/svg%3E")}
.ico.fan{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 34 L2 18 A20 20 0 0 1 38 18 Z' fill='%23e0a92c'/%3E%3Cpath d='M20 34 L6 11 L13 6Z M20 34 L20 4 L27 6Z M20 34 L34 11 L38 18Z' fill='%23f5cf5c'/%3E%3Cpath d='M20 34 L13 6 L20 4Z M20 34 L27 6 L34 11Z' fill='%23c98d1c'/%3E%3Ccircle cx='20' cy='33' r='2.6' fill='%23a3362e'/%3E%3C/svg%3E")}
.ico.frog{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M4 26 L12 12 L20 16 L28 12 L36 26 L20 34Z' fill='%234aa35a'/%3E%3Cpath d='M4 26 L20 34 L20 24Z' fill='%23388a49'/%3E%3Cpath d='M9 15 L13 6 L18 15Z M22 15 L27 6 L31 15Z' fill='%23fff'/%3E%3Ccircle cx='13.5' cy='12' r='2' fill='%23222'/%3E%3Ccircle cx='26.5' cy='12' r='2' fill='%23222'/%3E%3C/svg%3E")}
#hearts{position:absolute;top:calc(14px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;gap:6px}
#hearts i{width:34px;height:32px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 38'%3E%3Cpath d='M20 36 L3 17 L6 6 L14 3 L20 9 L26 3 L34 6 L37 17Z' fill='%23e04a5f'/%3E%3Cpath d='M20 36 L3 17 L20 9Z' fill='%23b8344a'/%3E%3Cpath d='M20 9 L26 3 L34 6Z' fill='%23f27c8c'/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 2px 0 rgba(0,0,0,.2));transition:transform .2s}
#hearts i.off{filter:grayscale(1) opacity(.35);transform:scale(.8) rotate(-10deg)}
#reds{position:absolute;top:calc(56px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;gap:4px}
#reds i{width:20px;height:20px;opacity:.25;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M3 24 L17 20 L20 6 L24 21 L37 15 L27 26 L20 30 Z' fill='%23d42c3c'/%3E%3C/svg%3E") center/contain no-repeat}
#reds i.on{opacity:1;animation:pp .35s}
#reds.hide2{display:none}
@keyframes pp{0%{transform:scale(2)}100%{transform:scale(1)}}
.bump{animation:bump .3s}
@keyframes bump{0%{transform:scale(1.35) rotate(-3deg)}100%{transform:scale(1)}}
#bPause{position:absolute;top:calc(12px + env(safe-area-inset-top));right:calc(14px + env(safe-area-inset-right));width:46px;height:46px;border:none;border-radius:6px;background:rgba(251,246,234,.85);pointer-events:auto;display:flex;gap:7px;align-items:center;justify-content:center;box-shadow:0 3px 0 rgba(60,40,20,.2)}
#bPause span{width:7px;height:20px;background:#5b4632;border-radius:1px}

#pop{position:fixed;inset:0;pointer-events:none;z-index:6}
.popt{position:absolute;font-family:'Yuji Syuku',serif;font-size:34px;color:#fff;text-shadow:0 0 0 #000,2px 2px 0 #b23a2e,-2px 2px 0 #b23a2e,2px -2px 0 #b23a2e,-2px -2px 0 #b23a2e,0 4px 0 #6d1f18;transform:translate(-50%,-50%);animation:popup 1.2s ease-out forwards;white-space:nowrap}
@keyframes popup{0%{transform:translate(-50%,-30%) scale(.4);opacity:0}15%{transform:translate(-50%,-50%) scale(1.2);opacity:1}30%{transform:translate(-50%,-55%) scale(1)}100%{transform:translate(-50%,-140%) scale(1);opacity:0}}

#card{position:fixed;left:0;right:0;top:22%;display:flex;justify-content:center;pointer-events:none;z-index:7;opacity:0}
#card .sheet{padding:16px 60px 18px;font-family:'Yuji Syuku',serif;font-size:min(9vw,58px);color:#2f2418;clip-path:polygon(0 10%,4% 0,96% 6%,100% 0,99% 90%,95% 100%,3% 92%,0 100%);letter-spacing:.12em}
#card.show{animation:card 2.6s ease forwards}
#card.big .sheet{font-size:min(14vw,96px);color:#b23a2e;padding:18px 70px 24px}
@keyframes card{0%{opacity:0;transform:translateX(-60px) rotate(-3deg)}12%{opacity:1;transform:translateX(0) rotate(-1deg)}80%{opacity:1;transform:translateX(0) rotate(-1deg)}100%{opacity:0;transform:translateX(60px) rotate(1deg)}}
#card.stay{animation:cardin .5s ease forwards}
@keyframes cardin{0%{opacity:0;transform:scale(1.6) rotate(-6deg)}100%{opacity:1;transform:scale(1) rotate(-2deg)}}

#curtain{position:fixed;inset:0;pointer-events:none;z-index:20}
#curtain div{position:absolute;top:-5%;bottom:-5%;width:56%;transition:transform .55s cubic-bezier(.7,0,.3,1);
  background:#c8473c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='46'%3E%3Cg fill='none' stroke='%23e9a08f' stroke-width='2' opacity='.55'%3E%3Ccircle cx='0' cy='46' r='38'/%3E%3Ccircle cx='0' cy='46' r='26'/%3E%3Ccircle cx='0' cy='46' r='14'/%3E%3Ccircle cx='80' cy='46' r='38'/%3E%3Ccircle cx='80' cy='46' r='26'/%3E%3Ccircle cx='80' cy='46' r='14'/%3E%3Ccircle cx='40' cy='23' r='38'/%3E%3Ccircle cx='40' cy='23' r='26'/%3E%3Ccircle cx='40' cy='23' r='14'/%3E%3C/g%3E%3C/svg%3E")}
#curtain .l{left:0;transform:translateX(-102%);clip-path:polygon(0 0,100% 0,94% 50%,100% 100%,0 100%)}
#curtain .r{right:0;transform:translateX(102%);clip-path:polygon(6% 0,100% 0,100% 100%,6% 100%,0 50%)}
#curtain.close .l,#curtain.close .r{transform:translateX(0)}

#title{position:fixed;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6vh;cursor:pointer}
#title .logo{font-family:'Yuji Syuku',serif;font-size:min(15vw,120px);line-height:1;display:flex;align-items:baseline;filter:drop-shadow(0 6px 0 rgba(80,40,20,.25));margin-top:-18vh}
#title .logo span{display:inline-block;padding:.08em .18em .12em;background:#fbf6ea;clip-path:polygon(0 8%,95% 0,100% 90%,4% 100%)}
#title .logo .a{color:#3e8a4e;transform:rotate(-4deg)}
#title .logo .b{color:#c8473c;transform:rotate(3deg) translateY(.1em);background:#fff3df}
#title .logo .dot{background:none;color:#3a2e22;padding:0 .05em}
#title .press{font-size:28px;padding:10px 40px 12px;clip-path:polygon(0 0,100% 8%,97% 100%,3% 92%);animation:bob 1.6s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-6px) rotate(1deg)}}

#pause{position:fixed;inset:0;z-index:15;background:rgba(40,30,20,.42);display:flex;align-items:center;justify-content:center}
#pause .panel{display:flex;flex-direction:column;gap:14px;align-items:stretch;min-width:280px;max-width:92vw}
#pause button{font-family:'Klee One',serif;font-weight:600;font-size:24px;color:#3a2e22;border:none;padding:12px 24px;cursor:pointer;clip-path:polygon(0 4%,98% 0,100% 96%,2% 100%)}
#pause button:hover,#pause button.sel{background-color:#ffe9b8}
#keys{background:#fbf6ea;padding:16px 20px;font-size:16px;line-height:1.75;clip-path:polygon(0 1%,99% 0,100% 99%,1% 100%)}
#keys b{display:inline-block;min-width:6.5em;color:#b23a2e}

#touch{position:fixed;inset:0;z-index:4;pointer-events:none}
#stick{position:absolute;width:150px;height:150px;border-radius:50%;background:rgba(251,246,234,.28);border:3px solid rgba(251,246,234,.6);left:calc(40px + env(safe-area-inset-left));bottom:calc(40px + env(safe-area-inset-bottom));opacity:.9}
#knob{position:absolute;left:50%;top:50%;width:66px;height:66px;margin:-33px 0 0 -33px;border-radius:50%;background:rgba(251,246,234,.85);box-shadow:0 3px 0 rgba(60,40,20,.25)}
.tbtn{position:absolute;border-radius:50%;background:rgba(251,246,234,.8);box-shadow:0 4px 0 rgba(60,40,20,.25);display:flex;align-items:center;justify-content:center}
.tbtn.on{transform:scale(.92);background:rgba(255,233,184,.95)}
#tJump{width:104px;height:104px;right:calc(34px + env(safe-area-inset-right));bottom:calc(46px + env(safe-area-inset-bottom))}
#tCrouch{width:76px;height:76px;right:calc(172px + env(safe-area-inset-right));bottom:calc(30px + env(safe-area-inset-bottom))}
.tj{width:0;height:0;border-left:22px solid transparent;border-right:22px solid transparent;border-bottom:30px solid #3e8a4e;margin-top:-6px}
.tc{width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:22px solid #c8473c;margin-top:4px}
@media (max-width:700px){.strip{height:34px;font-size:20px}.ico{width:24px;height:24px}#hFans{top:calc(50px + env(safe-area-inset-top))}#hLives{top:calc(88px + env(safe-area-inset-top))}#hearts i{width:28px;height:26px}}
#bossHp{position:absolute;top:calc(60px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;gap:10px}
#bossHp i{width:26px;height:42px;background:#f7f0d8;box-shadow:0 3px 0 rgba(0,0,0,.25);position:relative;transform:rotate(-4deg);transition:all .3s}
#bossHp i:nth-child(2){transform:rotate(3deg)}
#bossHp i::after{content:'';position:absolute;left:10px;top:6px;width:6px;height:30px;background:#c8352d}
#bossHp i.off{opacity:.15;transform:translateY(8px) rotate(20deg)}
