:root {
  --bg: #07152d;
  --panel: rgba(8, 20, 44, 0.86);
  --panel-strong: rgba(6, 14, 34, 0.94);
  --line: rgba(140, 217, 255, 0.22);
  --text: #eef6ff;
  --muted: #98b2d8;
  --accent: #6be7ff;
  --warm: #ffcc4d;
  --danger: #ff6b5c;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(65, 127, 255, 0.34), transparent 42%),
    linear-gradient(180deg, #061024 0%, #091837 44%, #040912 100%);
  color: var(--text);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  padding: 18px;
}

.app-shell {
  width: min(100%, 1380px);
  display: grid;
  gap: 14px;
}

.hud,
.footer,
.overlay__card {
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px var(--shadow);
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(18, 39, 74, 0.96), rgba(8, 19, 39, 0.92));
  border-radius: 22px;
}

.hud__cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hud__cluster--center {
  justify-content: center;
}

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

.hud__title {
  font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  letter-spacing: 0.12em;
  color: var(--warm);
  text-shadow: 0 3px 0 rgba(83, 38, 0, 0.6);
}

.hud__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.98rem;
  white-space: nowrap;
}

.hud__pill strong {
  font-size: 1.08rem;
  color: #fffdf1;
}

.hud__pill--health {
  gap: 12px;
}

.health {
  width: 180px;
  height: 16px;
  border-radius: 999px;
  background: rgba(9, 14, 22, 0.9);
  overflow: hidden;
  border: 1px solid rgba(255, 204, 77, 0.35);
}

.health__bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b5c 0%, #ffb347 46%, #ffe46b 100%);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.26);
}

.hud__button,
.overlay__button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(180deg, #21477f, #11274d);
  padding: 10px 16px;
  font: inherit;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.hud__button:hover,
.overlay__button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.hud__button:disabled,
.overlay__button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  filter: none;
}

.overlay__button--primary {
  background: linear-gradient(180deg, #ffb347, #db6e1b);
  color: #1c1000;
  font-weight: 700;
}

.stage-shell {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(120, 210, 255, 0.24);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.44);
  background: linear-gradient(180deg, #020915 0%, #050d1e 100%);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #020915;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(2, 10, 24, 0.24), rgba(2, 9, 19, 0.68));
  transition: opacity 180ms ease;
}

.overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay__card {
  width: min(100%, 720px);
  padding: 28px 30px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(82, 206, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(10, 20, 46, 0.96), rgba(6, 13, 31, 0.98));
  text-align: center;
}

.overlay__eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.overlay__title {
  margin: 0 0 14px;
  font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
  letter-spacing: 0.08em;
  font-size: clamp(2rem, 4vw, 3.8rem);
  color: #fff8dc;
  text-shadow: 0 4px 0 rgba(74, 35, 2, 0.6);
}

.overlay__text,
.overlay__hint,
.footer__line {
  margin: 0;
  line-height: 1.55;
}

.overlay__text {
  color: #edf5ff;
  font-size: 1rem;
}

.overlay__hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.overlay__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.footer {
  padding: 14px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 25, 52, 0.9), rgba(7, 14, 29, 0.92));
}

.footer__line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.footer__line--small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .hud {
    flex-direction: column;
    align-items: stretch;
  }

  .hud__cluster,
  .hud__cluster--center,
  .hud__cluster--end,
  .footer__line {
    justify-content: center;
  }

  .health {
    width: min(48vw, 180px);
  }

  .overlay__card {
    padding: 22px 18px;
  }
}
