:root {
  color-scheme: dark;
  --bg-0: #f0d7aa;
  --bg-1: #9ec4f0;
  --panel: rgba(49, 31, 19, 0.74);
  --frame: rgba(255, 210, 139, 0.34);
  --text: #fff7eb;
  --muted: #e7cfa9;
  --accent: #ffcf7a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 246, 210, 0.5), transparent 32%),
    radial-gradient(circle at 18% 18%, rgba(255, 169, 91, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  font-family: Bahnschrift, "Trebuchet MS", sans-serif;
  color: var(--text);
}

body {
  display: grid;
  place-items: center;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
}

.hud-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hud-stats,
.hud-message {
  max-width: 34rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 229, 183, 0.14);
  background: linear-gradient(135deg, rgba(42, 27, 16, 0.76), rgba(74, 42, 22, 0.34));
  backdrop-filter: blur(8px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hud-stats {
  font-size: 0.95rem;
  font-weight: 700;
}

.hud-badge {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 207, 122, 0.26);
  background: linear-gradient(135deg, rgba(73, 38, 23, 0.84), rgba(116, 59, 31, 0.44));
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-message {
  margin-top: auto;
  margin-bottom: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 16px rgba(255, 204, 118, 0.34));
}

.crosshair-line {
  position: absolute;
  background: rgba(255, 244, 226, 0.94);
  box-shadow: 0 0 12px rgba(255, 188, 98, 0.38);
  border-radius: 999px;
}

.crosshair-line.top,
.crosshair-line.bottom {
  width: 2px;
  height: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.crosshair-line.left,
.crosshair-line.right {
  width: 14px;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.crosshair-line.top {
  top: 8px;
}

.crosshair-line.right {
  right: 8px;
}

.crosshair-line.bottom {
  bottom: 8px;
}

.crosshair-line.left {
  left: 8px;
}

.hit-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.hit-marker span {
  position: absolute;
  width: 12px;
  height: 2px;
  background: rgba(255, 232, 188, 0.92);
  box-shadow: 0 0 12px rgba(255, 176, 85, 0.4);
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.hit-marker span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.hit-marker span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.hit-marker span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(135deg);
}

.hit-marker span:nth-child(4) {
  transform: translate(-50%, -50%) rotate(-135deg);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 210, 149, 0.14), rgba(21, 12, 7, 0.74)),
    linear-gradient(180deg, rgba(53, 33, 18, 0.28), rgba(24, 14, 8, 0.84));
  transition: opacity 180ms ease;
}

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

.overlay-panel {
  width: min(92vw, 38rem);
  padding: 1.8rem;
  border: 1px solid var(--frame);
  background: var(--panel);
  border-radius: 18px;
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-family: "Palatino Linotype", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-family: "Palatino Linotype", Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#overlay-body {
  margin: 0.95rem 0 1.4rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 32rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.controls span {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  color: var(--text);
}

button {
  border: 0;
  padding: 0.9rem 1.25rem;
  font: inherit;
  font-family: "Palatino Linotype", Georgia, serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2d170a;
  background: linear-gradient(135deg, #ffd889, #f0a35b);
  cursor: pointer;
  box-shadow: 0 0.8rem 2.4rem rgba(214, 132, 67, 0.34);
}

button:hover {
  filter: brightness(1.05);
}

@media (max-width: 720px) {
  .hud {
    padding: 0.85rem;
  }

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

  .hud-stats,
  .hud-message {
    max-width: none;
    font-size: 0.78rem;
  }

  .hud-badge {
    align-self: flex-start;
  }

  .overlay-panel {
    padding: 1.2rem;
  }
}
