:root {
  --ink: #0f1419;
  --mint: #9ed9c8;
  --cream: #f5efe6;
  --gold: #e8c547;
  --glass: rgba(20, 28, 36, 0.72);
  --glass-border: rgba(158, 217, 200, 0.35);
  --text: #e8f0ec;
  --muted: #8aa99a;
  --font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1a2830 0%, var(--ink) 55%);
  color: var(--text);
  font-family: var(--font);
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  width: min(100vw, 640px);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.6rem 1rem;
  width: 100%;
  justify-content: center;
}

.hud-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hud-stat span:last-child {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hud-lives {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.hud-lives canvas {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.hud-power {
  flex: 1;
  min-width: 120px;
  max-width: 180px;
}

.power-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #f5d76e);
  border-radius: 4px;
  transition: width 0.05s linear;
}

.hud-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
}

#game {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 16, 0.65);
  z-index: 10;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  padding: 2rem 2.5rem;
  max-width: 22rem;
  text-align: center;
}

.overlay-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  margin-bottom: 0.75rem;
}

.overlay-card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  color: var(--mint);
}

.overlay-card p {
  margin: 0.5rem 0;
  color: var(--cream);
  line-height: 1.45;
}

.overlay-hint {
  font-size: 0.85rem;
  color: var(--muted) !important;
}

.btn {
  margin-top: 1.25rem;
  padding: 0.65rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  background: var(--mint);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.98);
}