:root {
  --bg: #0b1020;
  --panel: #121a2e;
  --accent: #3ddc84;
  --accent-2: #ffd166;
  --text: #f4f7fb;
  --muted: #8b9bb4;
  --danger: #ef476f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background:
    radial-gradient(ellipse at 20% 0%, #1a2744 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, #132a1f 0%, transparent 45%),
    var(--bg);
}

#hud {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  width: min(960px, 100%);
  padding: 0.35rem 0.75rem;
  background: rgba(18, 26, 46, 0.85);
  border: 1px solid rgba(61, 220, 132, 0.25);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

.hud-item {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
}

.hud-item .label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#game {
  width: min(960px, 100%);
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 2px solid rgba(61, 220, 132, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: #5c94fc;
  display: block;
  touch-action: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 11, 20, 0.72);
  z-index: 10;
  padding: 1rem;
}

.overlay.hidden {
  display: none;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(61, 220, 132, 0.35);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.panel.hidden {
  display: none;
}

.panel h1 {
  font-size: 2.2rem;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.panel h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  color: var(--accent-2);
}

.tagline {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.howto {
  list-style: none;
  text-align: left;
  margin: 0 auto 1.5rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.howto kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.35em;
  margin: 0 0.1em;
  border-radius: 4px;
  background: #1e2a44;
  border: 1px solid #3a4a6a;
  font-size: 0.85em;
  text-align: center;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #4aef96, #2bb86a);
  color: #062214;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.touch {
  display: none;
  width: min(960px, 100%);
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

.touch button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(61, 220, 132, 0.5);
  background: rgba(18, 26, 46, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  touch-action: none;
}

.touch-left, .touch-right {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 800px), (pointer: coarse) {
  .touch {
    display: flex;
  }
}
