:root {
  color-scheme: dark;
  --panel-bg: rgba(16, 14, 14, 0.58);
  --panel-border: rgba(255, 199, 93, 0.34);
  --text-main: #f7efe4;
  --text-dim: rgba(247, 239, 228, 0.8);
  --accent: #ffc75a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #110d0d;
  cursor: crosshair;
}

body {
  font-family: "Space Grotesk", sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

body.is-running .hud {
  opacity: 0;
  transform: translateY(-12px);
}

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

body.is-start .hud,
body.is-ended .hud {
  opacity: 1;
}

.hud {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  width: min(28rem, calc(100vw - 2.5rem));
  padding: 1rem 1.1rem 1.15rem;
  color: var(--text-main);
  background:
    linear-gradient(135deg, rgba(255, 125, 54, 0.22), rgba(12, 12, 14, 0.72)),
    var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font-family: "Rubik Mono One", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.96;
  text-shadow: 0.18rem 0.18rem 0 rgba(16, 9, 9, 0.5);
}

.instructions {
  margin: 0.9rem 0 0;
  max-width: 34ch;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.45;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(6, 5, 7, 0.34), rgba(8, 7, 10, 0.7));
  transition: opacity 180ms ease;
}

.overlay-panel {
  width: min(36rem, 100%);
  padding: 1.5rem;
  color: var(--text-main);
  background:
    linear-gradient(135deg, rgba(255, 125, 54, 0.2), rgba(12, 12, 14, 0.84)),
    var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1.2rem;
  box-shadow: 0 1.8rem 3.2rem rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
}

.overlay-panel h2 {
  margin: 0;
  font-family: "Rubik Mono One", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1;
}

.overlay-copy {
  margin: 0.95rem 0 0;
  max-width: 38ch;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.5;
}

.overlay-stats {
  min-height: 1.5rem;
  margin-top: 0.8rem;
  color: #ffdca0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.overlay-button {
  margin-top: 1.1rem;
  padding: 0.95rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd36d, #ff8f4b);
  color: #1a1311;
  font: 700 0.95rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.overlay-button:hover {
  filter: brightness(1.04);
}

@media (max-width: 640px) {
  .hud {
    top: 0.85rem;
    left: 0.85rem;
    width: calc(100vw - 1.7rem);
    padding: 0.9rem 0.95rem 1rem;
  }

  .instructions {
    font-size: 0.88rem;
  }

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