*{box-sizing:border-box}html,body{margin:0;height:100%;overscroll-behavior:none}body{background:#07152f;color:white;font-family:Arial,Helvetica,sans-serif;display:grid;place-items:center}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid white;outline-offset:5px}button:disabled{opacity:.65;cursor:wait}[hidden]{display:none!important}#game{position:relative;width:min(100vw,calc(100svh * .63158));height:min(100svh,calc(100vw * 1.58333));overflow:hidden;isolation:isolate;background:#b9632b;box-shadow:0 0 100px #0008}canvas{width:100%;height:100%;display:block;touch-action:none;user-select:none}.screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:space-between;text-align:center;padding:5% 7% 10%;background:linear-gradient(#061f5960,transparent 46%,#07152fb0);overflow-y:auto}.title{width:100%;pointer-events:none}.brand{width:86%;filter:drop-shadow(0 5px 3px #0006)}h1{margin:1% 0 0;font-size:clamp(22px,5vw,33px);font-weight:1000;letter-spacing:.07em;color:#fff4c7;text-shadow:0 3px 0 #482313}h1 img{display:block;width:68%;margin:0 auto;filter:drop-shadow(0 4px 2px #0008)}.start-bottom{width:100%;text-shadow:0 2px 4px #000}p{font-size:16px;line-height:1.4;margin:14px 0 8px}.rule{font-size:14px;color:#fff0c0}small{display:block;margin-top:12px;font-size:12px;color:#d4dcec}.primary{display:block;width:100%;padding:17px 12px;background:linear-gradient(#fff071,#ffcc19);color:#0b2559;border:2px solid #fff298;border-bottom:5px solid #b77600;border-radius:12px;box-shadow:0 5px 0 #051d58,0 9px 20px #0005;font-weight:900;font-size:clamp(18px,4.8vw,24px);letter-spacing:.045em;transition:transform .1s}.primary:active{transform:translateY(3px)}.secondary{margin:16px auto 0;background:transparent;border:1px solid #ffffff70;color:white;padding:12px 20px;border-radius:8px;font-size:16px;font-weight:bold}.modal{justify-content:center;background:#07152fcc;backdrop-filter:blur(5px)}.panel{width:100%;max-width:340px}h2{font-size:clamp(28px,8vw,45px);line-height:1.02;letter-spacing:-.03em;margin:15px 0 22px;font-weight:1000}.eyebrow{font-size:14px;letter-spacing:.12em;color:#b7cffc}.result{justify-content:flex-start;padding-top:22%;background:linear-gradient(#061733eb 0%,#061733cf 62%,#06173330)}#resultLogo{width:60%;max-height:100px;object-fit:contain}.result-score{display:flex;justify-content:center;align-items:center;gap:20px;margin:22px 0;color:#ffe477}.result-score span{font-size:14px;letter-spacing:.1em}.result-score strong{font-size:36px}#hud{position:absolute;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:linear-gradient(#041536e8,#041536bc);height:72px;border-bottom:1px solid #fff3}#hud img{width:125px;height:54px;object-fit:contain}.hud-score{display:flex;flex-direction:column;text-align:center}.hud-score span{font-size:12px;letter-spacing:.08em;color:#d0dded}.hud-score strong{font-size:25px;color:#ffe155}.icon{width:40px;height:40px;border:1px solid #ffffff60;background:#ffffff14;color:white;border-radius:10px;font-size:23px;font-weight:bold}#health{position:absolute;bottom:7%;left:5%;right:5%;display:flex;align-items:center;justify-content:center;gap:10px;padding:9px;border-radius:8px;background:#05172cc7;pointer-events:none}#health span{font-size:12px;font-weight:bold;letter-spacing:.03em}#pips{display:flex;gap:5px}#pips i{width:20px;height:15px;background:#1166ff;border:2px solid #74a9ff;transform:skewX(-12deg);border-radius:3px}#pips i.infected{background:#9bed18;border-color:#d4ff8d;box-shadow:0 0 8px #8bef3290}.sound{position:absolute;right:12px;bottom:12px;background:#061a36cc;border:1px solid #ffffff40;border-radius:6px;color:#fff;padding:7px 9px;font-size:12px;letter-spacing:.05em}#announcement{position:absolute;left:10%;right:10%;top:42%;padding:12px;text-align:center;background:#061c45df;border:1px solid #ffe46a80;border-radius:9px;color:#ffe45c;font-weight:900;font-size:clamp(20px,6vw,32px);pointer-events:none;opacity:0;transition:opacity .2s}#announcement.show{opacity:1}#loadError{position:absolute;inset:auto 5% 15%;padding:20px;background:#07152f;color:white;border-radius:10px}#loadError button{padding:5px 10px;font-size:16px} @media(max-height:650px){.screen{padding-bottom:9%}.brand{width:65%}h1 img{width:50%}.start-bottom p{margin:8px 0 4px}.start-bottom small{margin-top:5px}.primary{padding:12px}.result{padding-top:12%}#hud{height:60px}#hud img{width:100px}#health{bottom:8%}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

h1 img.stop-title{width:65%;height:auto;margin:0 auto -1%;max-height:70px;object-fit:contain}@media(max-height:650px){h1 img.stop-title{width:49%;max-height:48px}}

#bossHealth{position:absolute;top:76px;left:6%;right:6%;padding:9px 12px;background:#07152fe8;border:1px solid #b5f83a;border-radius:8px;pointer-events:none}.boss-label{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px;font-size:14px;color:#dbff8c}.boss-label strong{letter-spacing:.09em}#bossMeter{display:block;width:100%;height:10px;appearance:none;border:0;border-radius:5px;overflow:hidden;background:#283524;color:#a6ed24}#bossMeter::-webkit-progress-bar{background:#283524;border-radius:5px}#bossMeter::-webkit-progress-value{background:linear-gradient(90deg,#77c918,#dcff5d);border-radius:5px}#bossMeter::-moz-progress-bar{background:#a6ed24;border-radius:5px}@media(max-height:650px){#bossHealth{top:64px;padding:7px 10px}}

/* Keep the hero's face above the touch controls, opposite the WORLD logo. */
#hud{height:76px;padding:6px 10px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px clamp(52px,15vw,62px);gap:8px}
#hud>.hud-logo{width:100%;max-width:125px;height:54px;object-fit:contain;justify-self:start}
.hud-score{min-width:0}
#hud .hero-portrait{position:relative;width:100%;aspect-ratio:1;overflow:hidden;border:2px solid #ffdc56;border-radius:13px;background:#ffb45d;box-shadow:0 0 12px #195aff66;pointer-events:none;user-select:none}
#hud .hero-portrait img{position:static;width:100%;max-width:none;height:100%;object-fit:contain;object-position:center;display:block}
#bossHealth{top:80px}
@media(max-height:650px){#hud{height:68px;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px 52px}#hud>.hud-logo{height:48px}#bossHealth{top:72px}}

/* Keep all five health slots legible on narrow phones. */
#pips{flex:1;min-width:0;max-width:120px}#pips i{flex:1;min-width:8px;width:auto}#health span{flex-shrink:0;white-space:nowrap}.rule{line-height:1.5}

/* Ending art is the whole stage; controls stay in its quiet lower band. */
.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}
.result{padding:0;justify-content:flex-end;background:#07152f;overflow:hidden}
.result-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center top}
.result-controls{position:relative;max-width:none;flex-shrink:0;padding:3% 12% 12%;background:linear-gradient(transparent,#05152fee 50%,#05152f);text-shadow:0 2px 4px #000}
.result-score{gap:12px;margin:0 0 10px}.result-score strong{font-size:clamp(23px,6vw,32px)}
.result-controls .primary{font-size:clamp(16px,4vw,22px);padding:10px 12px}
.result-controls .secondary{margin-top:10px;padding:8px 18px}
@media(max-height:650px){.result-controls{padding-bottom:11%}.result-score{margin-bottom:6px}.result-controls .primary{padding:8px}.result-controls .secondary{margin-top:8px}}

.result-controls h2:not(.sr-only){margin:0 0 8px;color:#ffdf4e;font-size:clamp(28px,7vw,40px);letter-spacing:.01em;text-shadow:0 3px 0 #704305,0 0 16px #05152f}

/* Keep victory actions above the lower battlefield's finger position. */
.result.victory .result-controls{position:absolute;left:0;right:0;bottom:32%;padding:3% 12% 4%;background:linear-gradient(transparent,#05152fd9 35%,#05152fd9 85%,transparent)}

/* Player health stays centered at the top, clear of touch controls. */
#health{top:82px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:90%;max-width:340px}
@media(max-height:650px){#health{top:74px;bottom:auto}}

.arcade-exit{position:fixed;top:8px;left:8px;z-index:30;padding:8px 12px;border-radius:7px;background:#07152fdc;border:1px solid #ffde52;color:#fff;text-decoration:none;font-size:14px;font-weight:bold}
.arcade-exit:focus-visible{outline:3px solid #fff}
body:has(#game) .arcade-exit{display:block}
@media (max-width:580px){.arcade-exit{top:auto;bottom:calc(env(safe-area-inset-bottom) + 8px);left:8px;font-size:12px;padding:6px 9px}}
