*{box-sizing:border-box}html,body{margin:0;width:100%;min-height:100%;background:#e6f9e5;color:#202020;font-family:'DotGothic16',monospace}button{font:inherit;cursor:pointer;touch-action:manipulation}#app{width:min(100%,460px);min-height:100dvh;margin:auto;position:relative;overflow:hidden;background:#fff6d9}.screen{min-height:100dvh;display:flex;flex-direction:column}.hidden{display:none!important}.pixel,canvas{image-rendering:pixelated;image-rendering:crisp-edges}.title-screen{justify-content:flex-start;background:#9cf4c4}.title-art{width:100%;height:auto;display:block}.title-bottom{text-align:center;padding:18px 20px 34px}.title-bottom p{font-weight:800}.primary{width:82%;padding:16px;background:#ff8c19;color:#181818;border:4px solid #171717;border-radius:9px;box-shadow:4px 5px 0 #171717;font-size:24px;font-weight:900}.hint{font-size:13px}.game-screen{background:#fff7df url('bg.png') center center/100% 100% no-repeat;padding:env(safe-area-inset-top) 12px max(12px,env(safe-area-inset-bottom));height:100dvh;min-height:580px}.hud{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding-top:9px}.hud>div{background:#fffbe9;border:3px solid #202020;text-align:center;padding:5px 2px;box-shadow:2px 3px 0 #202020}.hud small{display:block;font-size:11px;font-weight:900}.hud strong{display:block;font-size:22px;font-weight:900;font-variant-numeric:tabular-nums}.meter{height:10px;border:2px solid #202020;background:white;margin-top:9px}.meter>div{height:100%;width:100%;background:#48b36b;transition:width .1s linear}#gameArea{flex:1;min-height:0;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.hippo-box{height:clamp(85px,17vh,140px);width:clamp(85px,17vh,140px);margin-bottom:2px}.hippo-box canvas{width:100%;height:100%}#feedback{height:26px;text-align:center;font-size:19px;font-weight:900;color:#e26d00;text-shadow:1px 1px white}.question-panel{width:100%;max-width:340px;background:#fff9e9ed;border:4px solid #171717;border-radius:13px;padding:8px 12px 12px;text-align:center;box-shadow:4px 5px 0 #171717}.item-frame{height:clamp(110px,22vh,190px);display:flex;align-items:center;justify-content:center}.item-frame canvas{height:100%;width:auto;max-width:100%;object-fit:contain}#questionText{font-weight:900;font-size:clamp(16px,4vw,20px);line-height:1.45;min-height:2.9em;margin:8px 0}.answer-meter{height:8px;background:#ddd;border:2px solid #222}.answer-meter>div{width:100%;height:100%;background:#f5b433}.choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding-top:12px}.choices button{min-width:0;border:3px solid #202020;border-radius:9px;background:#a6e6ff;padding:12px 1px 10px;box-shadow:2px 3px 0 #202020}.choices button:nth-child(2){background:#ffdc7b}.choices button:nth-child(3){background:#b5f0a3}.choices button:active{transform:translate(2px,3px);box-shadow:none}.choices span{display:block;font-size:clamp(13px,3.5vw,17px);font-weight:900;white-space:nowrap}.choices small{display:block;font-size:10px;margin-top:4px}.result-screen{align-items:center;text-align:center;background:#fff4ba;padding:18px 16px 25px;justify-content:center}.result-screen h1{margin:0 0 8px;font-size:25px}.result-art{width:min(64%,240px);aspect-ratio:1;object-fit:contain}.result-content{width:100%}.result-label{margin:5px 0 0;font-weight:900;font-size:13px}.final-score{font-size:clamp(38px,10vw,54px);font-weight:900;margin:0}.rank{font-size:19px;font-weight:900;margin:4px 0 12px}.result-stats{display:flex;justify-content:space-around;background:#fff;border:3px solid #222;border-radius:8px;padding:11px 2px;font-size:13px;font-weight:800}.result-stats b{display:block;font-size:19px}.result-buttons{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:18px}.result-buttons button{border:3px solid #222;border-radius:8px;background:#a4e9e4;font-weight:900;padding:12px 3px;box-shadow:2px 3px 0 #222}.record-text{font-size:13px;font-weight:800;margin-top:14px}@media(max-height:690px){.game-screen{min-height:0}.hippo-box{height:85px;width:85px}.item-frame{height:110px}.question-panel{padding:6px 10px}.choices button{padding:8px 1px}.result-art{width:min(43%,180px)}}

/* v2: no per-item deadline; retro arcade feedback */
.game-top{display:flex;justify-content:flex-end;padding-top:5px}.game-top button{border:2px solid #1e2520;background:#fff8dd;padding:5px 9px;font-size:12px;box-shadow:2px 2px 0 #1e2520}.hud{padding-top:7px}.answer-meter{display:none}#feedback{height:16px;font-size:12px}.question-panel{position:relative;z-index:1}.impact{position:absolute;inset:0;z-index:10;pointer-events:none;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;isolation:isolate}.impact::before{content:'';position:absolute;inset:0;background:rgba(255,248,211,.56);animation:impactFlash .55s steps(2,end) both}.impact-symbol,.impact-message,.impact-points,.impact-combo{position:relative;z-index:2;font-weight:900;text-align:center;text-shadow:4px 4px 0 #1b1b1b,-2px -2px 0 #1b1b1b,2px -2px 0 #1b1b1b,-2px 2px 0 #1b1b1b}.impact-symbol{font-family:'DotGothic16',monospace;font-size:clamp(100px,34vw,170px);line-height:1;color:#56ed77;animation:impactPop .65s steps(6,end) both}.impact.bad .impact-symbol{color:#ff5573}.impact-message{font-size:clamp(23px,7vw,35px);color:white;animation:impactPop .6s steps(5,end) both}.impact-points{font-size:clamp(25px,8vw,40px);color:#ffe04a;animation:impactPop .65s steps(5,end) both}.impact-combo{font-size:clamp(17px,5vw,27px);color:#7cf6ff;animation:impactPop .7s steps(5,end) both}.particles{position:absolute;inset:0;z-index:1}.particle{position:absolute;left:50%;top:48%;width:var(--sz);height:var(--sz);background:var(--pc);border:2px solid #222;animation:burst .7s steps(7,end) both;transform:translate(-50%,-50%)}.impact.big::after{content:'';position:absolute;z-index:0;left:50%;top:50%;width:70vmin;height:70vmin;border:12px solid #fff05b;transform:translate(-50%,-50%);animation:shock .6s steps(6,end) both}.game-screen.shake #gameArea{animation:shake .24s steps(4,end)}@keyframes impactFlash{0%{background:rgba(255,255,255,.9)}25%{background:rgba(255,225,70,.6)}100%{background:rgba(255,248,211,.1)}}@keyframes impactPop{0%{transform:scale(.15) rotate(-12deg);opacity:0}35%{transform:scale(1.25) rotate(5deg);opacity:1}60%{transform:scale(.95)}100%{transform:scale(1);opacity:1}}@keyframes burst{to{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(90deg);opacity:0}}@keyframes shock{from{transform:translate(-50%,-50%) scale(.1);opacity:1}to{transform:translate(-50%,-50%) scale(1.2);opacity:0}}@keyframes shake{0%,100%{transform:translate(0,0)}25%{transform:translate(-6px,3px)}50%{transform:translate(6px,-3px)}75%{transform:translate(-4px,-2px)}}@media(prefers-reduced-motion:reduce){.impact *, .impact::before,.impact::after,.game-screen.shake #gameArea{animation-duration:.01ms!important}}

/* v3: smooth feedback symbols, top-aligned compact results */
.result-screen{justify-content:flex-start;padding-top:max(12px,env(safe-area-inset-top));gap:0}
.result-screen h1{margin:0 0 5px}
.result-art{width:min(58%,210px)}
.rank{margin:4px 0 8px}
.result-buttons{margin-top:12px}
.impact-symbol{font-family:Arial,"Helvetica Neue",sans-serif;font-weight:900;text-shadow:0 5px 0 #18231e,0 0 16px rgba(255,255,255,.9);animation:impactPopSmooth .55s cubic-bezier(.18,1.6,.35,1) both}
@keyframes impactPopSmooth{0%{transform:scale(.15) rotate(-15deg);opacity:0}55%{transform:scale(1.25) rotate(5deg);opacity:1}100%{transform:scale(1);opacity:1}}
@media(max-height:690px){.result-art{width:min(43%,170px)}}

/* v4: warm caramel title and smaller top-aligned illustration */
.title-screen{background:#fff4ba;align-items:center;justify-content:flex-start}
.title-art{width:85%;max-width:390px;height:auto;margin:12px auto 0}
.title-bottom{width:100%;padding-top:16px}
/* keep results aligned to top */
.result-screen{justify-content:flex-start}
/* feedback remains visible long enough to read */
.impact-symbol{animation-duration:.55s}
.impact::before{animation-duration:.7s}

/* game76: common arcade result controls */
.result-buttons{width:min(92%,360px);margin:8px auto 0;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;opacity:1;transition:opacity .35s ease}
.result-buttons button{min-height:56px;min-width:0;font-size:clamp(13px,3.8vw,17px);padding:8px 3px;overflow-wrap:anywhere}
.result-buttons.buttons-waiting{opacity:0;pointer-events:none}
.result-buttons.buttons-fading{opacity:1;pointer-events:none}
.result-buttons button:disabled{cursor:default}
