html, body {
  margin: 0;
  height: 100%;
  background: #111;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

#stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#frame {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
}

#game,
#hud-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#game {
  object-fit: fill;
  image-rendering: pixelated;
}

#hud-art {
  object-fit: fill;
  pointer-events: none;
  z-index: 2;
}

#move,
#status,
#hud,
#banner,
.skill {
  z-index: 3;
}

#move {
  position: absolute;
  left: 4.65%;
  top: 57.29%;
  width: 18.24%;
  height: 32.55%;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: none;
}

#nub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  margin: -19% 0 0 -19%;
  border-radius: 50%;
  background: rgba(230, 226, 214, 0.55);
  box-shadow: inset 0 0 0 3px rgba(40, 48, 56, 0.35);
  pointer-events: none;
  will-change: transform;
}

#status {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hp {
  position: absolute;
  left: 4.03%;
  top: 4.62%;
  width: 17.73%;
  height: 4.82%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#hp i {
  width: 14%;
  height: 86%;
  border-radius: 50%;
  background: #e24b4b;
  box-shadow: 0 0 0 2px #3a1010;
}

#hp i.gone {
  background: #4a3a32;
  box-shadow: 0 0 0 2px #2a2018;
  opacity: 0.45;
}

#wave {
  position: absolute;
  left: 4.03%;
  top: 10.22%;
  width: 16.42%;
  height: 8.79%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a2a18;
  font: 700 clamp(12px, 1.8vw, 22px) / 1 "Microsoft YaHei", sans-serif;
}

#banner {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(42%, 420px);
  transform: translate(-50%, -50%);
  padding: 22px 24px 18px;
  border: 3px solid #c9a66a;
  border-radius: 12px;
  background: rgba(244, 236, 214, 0.94);
  color: #2a2018;
  text-align: center;
  font: 700 clamp(16px, 2.1vw, 26px) / 1.35 "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#banner[hidden] {
  display: none !important;
}

#banner-text {
  margin: 0;
}

#btn-retry {
  min-width: 44%;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid #2a2018;
  border-radius: 8px;
  background: #c9a66a;
  color: #2a2018;
  font: 700 16px "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.skill {
  position: absolute;
  pointer-events: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.skill-shock { left: 56.29%; top: 79.62%; width: 10.54%; height: 18.23%; }
.skill-x1 { left: 66.24%; top: 79.62%; width: 10.65%; height: 18.23%; }
.skill-file { left: 73.44%; top: 67.71%; width: 10.65%; height: 18.36%; }
.skill-coffee { left: 80.96%; top: 79.62%; width: 10.61%; height: 18.23%; }
.skill-wang { left: 88.44%; top: 64%; width: 11.56%; height: 24.61%; }

.skill:active,
.skill.is-on,
.skill.is-charge {
  filter: brightness(1.12);
}

.skill.is-cool {
  opacity: 0.42;
}

.skill .cd {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(18, 12, 8, 0.55);
  color: #f4e4b0;
  font: 700 clamp(16px, 2.2vw, 28px) / 1 "Microsoft YaHei", sans-serif;
  pointer-events: none;
}

.skill .cd[hidden] {
  display: none;
}

#pips {
  position: absolute;
  left: 50%;
  bottom: 8%;
  display: flex;
  gap: 3px;
  transform: translateX(-50%);
}

#pips i {
  width: 7px;
  height: 5px;
  border-radius: 2px;
  background: rgba(42, 32, 24, 0.28);
}

#pips.s1 i:nth-child(1),
#pips.s2 i:nth-child(-n+2),
#pips.s3 i {
  background: #e8ff4a;
}

#pips.s3 i {
  background: #ff7a1a;
}
