:root {
  --bg: #0a0f1a;
  --ui: #e7f1ff;
  --accent: #78dce8;
  --good: #a6e22e;
  --warn: #ffb86b;
  --danger: #ff5555;
}

html,
body {
  height: 100%;
  margin: 0;
  background: linear-gradient(180deg, #070b13, #0a0f1a 45%, #0b1424);
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ui);
  user-select: none;
  -webkit-user-select: none;
}

header {
  margin-top: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  opacity: .9;
}

#wrap {
  position: relative;
  max-width: min(95vw, 1100px);
  width: 100%;
  touch-action: none;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  background: #03060e;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.align-end {
  justify-content: flex-end;
}

.pill {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(2px);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

#lives span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--good);
  margin-left: 6px;
  box-shadow: 0 0 6px rgba(166, 226, 46, .6);
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .75));
  text-align: center;
  gap: 14px;
}

#overlay h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 38px);
}

#overlay p {
  margin: 0;
  opacity: .9;
}

button {
  all: unset;
  background: linear-gradient(180deg, var(--accent), #4bb4c3);
  color: #00313a;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(72, 200, 214, .35);
}

button:hover {
  transform: translateY(-1px);
}

.tip {
  font-size: .9rem;
  opacity: .8;
}

footer {
  opacity: .6;
  font-size: .9rem;
  margin-bottom: 8px;
}
