*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#0b3a66;font-family:"Trebuchet MS",system-ui,sans-serif;color:#123;touch-action:none;user-select:none;-webkit-user-select:none}
canvas{display:block;width:100vw;height:100vh;height:100dvh}
.hide{display:none!important}
#hud{position:fixed;top:max(8px,env(safe-area-inset-top));left:8px;right:8px;display:flex;gap:8px;justify-content:space-between;pointer-events:none}
.pill{background:rgba(255,255,255,.9);border-radius:999px;padding:6px 14px;font-weight:900;font-size:22px;box-shadow:0 3px 0 rgba(0,0,0,.2)}
#hTime.low{background:#ff5d5d;color:#fff}
.btn{pointer-events:auto;border:0;cursor:pointer}
.ov{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(5,30,60,.45);padding:12px;overflow:auto}
.card{background:#fffdf3;border-radius:22px;padding:18px 20px;max-width:560px;width:100%;text-align:center;box-shadow:0 8px 0 rgba(0,0,0,.25);max-height:100%;overflow:auto}
h1{margin:0;font-size:42px;color:#ff6b2c;text-shadow:3px 3px 0 #ffd23f;letter-spacing:1px}
h2{margin:0;color:#ff6b2c;font-size:34px}
.by{font-weight:800;color:#2a7bd4;margin-bottom:6px}
.how{margin:8px 0;font-size:15px}
.heart{color:#1db954;font-weight:900}
.stages{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:10px 0}
.stg{border:3px solid transparent;border-radius:14px;padding:8px 2px;font-weight:900;cursor:pointer;background:#d8f0ff;font-size:14px}
.stg .e{font-size:26px;display:block}
.stg.sel{border-color:#ff6b2c;background:#fff1c9}
.stg.lock{opacity:.45;cursor:default}
.stg small{display:block;font-size:10px}
.modes{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.big{border:0;border-radius:14px;padding:12px 18px;font-size:18px;font-weight:900;background:#ff6b2c;color:#fff;cursor:pointer;box-shadow:0 4px 0 #b84413;font-family:inherit}
.big.alt{background:#2a7bd4;box-shadow:0 4px 0 #1a4f8a}
.big.off{background:#bbb;box-shadow:0 4px 0 #888;cursor:not-allowed;font-size:15px}
.link{background:none;border:0;color:#2a7bd4;font-weight:800;margin-top:10px;font-size:15px;cursor:pointer;text-decoration:underline}
.final{font-size:54px;font-weight:900;color:#123}
.stats{font-size:14px;margin-bottom:8px}
#submitRow{display:flex;gap:8px;justify-content:center}
#ini{width:90px;font-size:24px;text-align:center;text-transform:uppercase;font-weight:900;border:3px solid #2a7bd4;border-radius:12px;font-family:inherit}
.msg{min-height:20px;font-size:14px;font-weight:700;color:#2a7bd4;margin:6px 0}
.tabs{display:flex;gap:4px;justify-content:center;margin:6px 0}
.tab{border:0;border-radius:10px;padding:6px 10px;font-weight:900;background:#d8f0ff;cursor:pointer;font-family:inherit}
.tab.on{background:#2a7bd4;color:#fff}
table{width:100%;border-collapse:collapse;font-size:15px}
td{padding:3px 6px;border-bottom:1px solid #eee}
td.r{text-align:right;font-weight:900}
tr.me td{background:#fff1c9}
.note{font-size:12px;color:#777}
@media (max-height:500px){h1{font-size:30px}.how{font-size:13px}.stg{padding:4px 2px}.stg .e{font-size:20px}.final{font-size:36px}.card{padding:10px 14px}}
.runmap{display:flex;flex-wrap:wrap;gap:3px;justify-content:center;align-items:center;margin:10px 0}
.chip{background:#d8f0ff;border-radius:10px;padding:3px 7px;font-weight:800;font-size:12px}
.chip.lock{opacity:.45}
.arr{color:#999;font-weight:900}
#hLevel{font-size:16px;align-self:center}
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0}
.acard{border:3px solid #2a7bd4;border-radius:16px;background:#eef7ff;padding:10px 6px;cursor:pointer;font-family:inherit;display:flex;flex-direction:column;gap:3px;align-items:center;font-size:12px;box-shadow:0 4px 0 #1a4f8a}
.acard.perk{border-color:#ff6b2c;background:#fff3e6;box-shadow:0 4px 0 #b84413}
.acard .ai{font-size:30px}.acard b{font-size:15px}.acard small{color:#777;font-weight:800}
@media (max-width:420px){.cards{grid-template-columns:1fr}.acard{flex-direction:row;flex-wrap:wrap;justify-content:center}#hLevel{font-size:13px}.pill{font-size:18px;padding:5px 10px}}
@media (max-height:500px){.cards{gap:4px}.acard{padding:4px}.acard .ai{font-size:20px}}
.species{font-size:14px;margin:4px 0 8px;background:#eafbe6;border-radius:12px;padding:6px}
.spgrid{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-top:4px}
.sp{background:#fff;border-radius:8px;border:2px solid #1db954;display:inline-flex}
.sp-ic{width:44px;height:44px}

.stampbox{margin-top:8px;padding:6px;background:#fff8e6;border-radius:12px;font-size:13px}
.sp.stamp{border-color:#ff9f1c}
h1{font-size:36px}
.by{font-size:16px}

.story{margin:6px 0 4px;padding:8px 10px;background:#ffe8f0;border-radius:12px;font-size:14px;font-weight:700;color:#a01848;line-height:1.35}
.chip{font-size:11px}
