:root { --bg: #6ec6ff; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px; pointer-events: none; z-index: 2;
}
.panel {
  background: rgba(20,30,50,.55); backdrop-filter: blur(6px);
  color: #fff; border-radius: 14px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
  font-family: system-ui; font-size: 15px; font-weight: 700;
}
.panel .right { }
#val { font-size: 26px; }
#grow { color: #ffe08a; font-size: 14px; }
#score, #best { letter-spacing: 1px; }
#ammo { color: #9fe3ff; font-size: 13px; text-align: left; margin-right: 10px; }
#mult {
  color: #0e6; font-size: 18px; font-weight: 900; padding: 2px 8px;
  background: rgba(0,255,140,.16); border-radius: 8px;
  animation: pump .8s ease-in-out infinite;
}
@keyframes pump { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18)} }
#best { color: #ffe08a; font-size: 12px; text-align: right; }

#msg {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  color: #fff; font-family: system-ui; z-index: 3;
  text-shadow: 0 2px 12px rgba(0,0,40,.6);
  pointer-events: none;
}
#msg-text { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
#retry {
  pointer-events: auto; background: rgba(255,255,255,.92); color: #123;
  border: none; border-radius: 30px; padding: 12px 28px;
  font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,40,.4);
}
#retry:active { transform: scale(.94); }
#tip {
  position: fixed; bottom: 14px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.8); font-family: system-ui; font-size: 13px;
  text-shadow: 0 1px 8px rgba(0,0,40,.5); pointer-events: none; z-index: 2;
}
#board {
  position: fixed; left: 16px; top: 78px; z-index: 2; pointer-events: none;
  font-family: system-ui; color: #cfe4ff; background: rgba(20,30,50,.5);
  backdrop-filter: blur(6px); border-radius: 12px; padding: 10px 14px;
  min-width: 128px; text-shadow: 0 1px 6px rgba(0,0,40,.5);
}
#board h2 { font-size: 11px; letter-spacing: 2px; margin-bottom: 6px; color: #7fb2ff; }
#board ol { list-style: none; font-size: 14px; line-height: 1.7; }
#board li { display: flex; justify-content: space-between; gap: 10px; }
#board li b { color: #ffe08a; }
#save { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
#save input {
  background: rgba(255,255,255,.92); color: #123; border: none; border-radius: 20px;
  padding: 10px 16px; font-size: 15px; font-weight: 700; outline: none; width: 170px;
}
#save button {
  background: rgba(255,255,255,.92); color: #123; border: none; border-radius: 20px;
  padding: 10px 18px; font-size: 15px; font-weight: 800; cursor: pointer;
}
#save button:active { transform: scale(.94); }
#jumpbtn {
  position: fixed; right: 16px; bottom: 16px; z-index: 3;
  background: rgba(255,255,255,.9); color: #123; border: none; border-radius: 40px;
  width: 96px; height: 96px; font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,40,.35); touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#jumpbtn:active { transform: scale(.92); }
@media (max-width: 640px) { #jumpbtn, #firebtn { width: 84px; height: 84px; font-size: 15px; } }
#firebtn {
  position: fixed; left: 16px; bottom: 16px; z-index: 3;
  background: rgba(255,120,80,.92); color: #1a0a05; border: none; border-radius: 40px;
  width: 96px; height: 96px; font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 24px rgba(120,30,0,.4); touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#firebtn:active { transform: scale(.92); }