:root {
  color-scheme: dark;
  font-family: Avenir Next, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #050713;
  color: #f8fbff;
  touch-action: manipulation;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 70% 10%, rgba(135, 85, 255, 0.28), transparent 28rem),
    radial-gradient(circle at 14% 74%, rgba(45, 238, 222, 0.18), transparent 24rem),
    #050713;
}

button {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  border: 2px solid rgba(130, 239, 255, 0.92);
  border-radius: 8px;
  background: rgba(6, 11, 28, 0.9);
  color: white;
  cursor: pointer;
  font: inherit;
  min-height: 64px;
  padding: 10px 8px;
  text-align: center;
}

button:active {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.25);
}

button strong,
button span {
  display: block;
}

button strong {
  font-size: clamp(0.88rem, 4.3vw, 1.18rem);
  font-weight: 900;
  letter-spacing: 0;
}

button span {
  color: rgba(226, 241, 255, 0.78);
  font-size: clamp(0.72rem, 3.3vw, 0.92rem);
  font-weight: 700;
  margin-top: 4px;
}

.shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100svh;
  margin: 0 auto;
  max-width: 480px;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  position: relative;
}

.hud {
  background: rgba(6, 9, 24, 0.76);
  border: 2px solid rgba(255, 208, 88, 0.88);
  border-radius: 8px;
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.28);
  padding: 12px;
  position: relative;
  z-index: 3;
}

.hud h1,
.hud p {
  margin: 0;
}

.hud h1 {
  color: #ffe777;
  font-size: clamp(1.08rem, 5.5vw, 1.52rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: uppercase;
}

.kicker {
  color: #9ff7ff;
  font-size: clamp(0.72rem, 3.3vw, 0.86rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stats {
  color: rgba(240, 248, 255, 0.92);
  display: flex;
  font-size: clamp(0.72rem, 3.2vw, 0.84rem);
  font-weight: 900;
  gap: 10px;
  justify-content: space-between;
  margin-top: 9px;
}

.feedback {
  color: white;
  font-size: clamp(0.82rem, 3.9vw, 0.98rem);
  font-weight: 800;
  line-height: 1.22;
  margin-top: 8px;
  min-height: 2.35em;
  text-transform: uppercase;
}

.bars {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.bars label,
.danger {
  display: grid;
  gap: 4px;
}

.bars span,
.danger span {
  color: white;
  font-size: clamp(0.68rem, 3vw, 0.78rem);
  font-weight: 900;
}

.bars i,
.danger i {
  background: rgba(23, 29, 52, 0.95);
  border: 1px solid rgba(140, 168, 194, 0.72);
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.bars b,
.danger b {
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 140ms ease-out, background 140ms ease-out;
  width: 100%;
}

#playerBar {
  background: #38f49a;
}

#enemyBar {
  background: #ff4848;
}

.danger {
  margin-top: 8px;
}

.danger i {
  height: 6px;
}

#dangerBar {
  background: #f5bb3d;
  width: 0%;
}

.stageWrap {
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#game {
  display: block;
  height: 100%;
  max-height: 100%;
  width: 100%;
}

.controls {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 10px;
  position: relative;
  z-index: 4;
}

.controls .wide {
  background: rgba(21, 74, 92, 0.96);
  grid-column: 1 / -1;
  min-height: 58px;
}

.controls button:nth-child(3) {
  border-color: #ffd052;
}

.controls button:nth-child(4) {
  border-color: #65ddff;
}

.controls button:nth-child(5) {
  border-color: #d48aff;
}

dialog {
  background: rgba(7, 10, 25, 0.96);
  border: 2px solid #ffd456;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  color: white;
  max-width: min(330px, calc(100vw - 36px));
  padding: 24px;
  text-align: center;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

dialog h2 {
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 12px;
  text-transform: uppercase;
}

dialog p {
  color: #e9fbff;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 18px;
  white-space: pre-line;
}

dialog button {
  background: rgba(189, 76, 32, 0.96);
  border-color: #ffe16a;
  min-width: 190px;
}
