:root {
  color-scheme: dark;
  --bg: #0a0f1f;
  --panel: #11182d;
  --line: #f4f7fb;
  --accent: #5eead4;
  --text: #e5eefc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #16213f, var(--bg) 60%);
  color: var(--text);
}

.app {
  width: min(95vw, 960px);
  text-align: center;
}

h1 {
  margin-bottom: 0.4rem;
}

.help,
#status {
  margin: 0.35rem 0 1rem;
  color: #b7c7e6;
}

.stage {
  position: relative;
}

canvas {
  width: 100%;
  max-width: 900px;
  border: 3px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #0b1223, #0a1020);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.menu {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 20, 0.72);
  border-radius: 12px;
}

.menu.hidden {
  display: none;
}

.menu-card {
  width: min(90%, 380px);
  padding: 1.4rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  background: rgba(17, 24, 45, 0.96);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.menu-card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.menu-card p {
  margin: 0 0 1rem;
  color: #b7c7e6;
}

.menu-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #08111f;
}

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

.action-btn {
  min-width: 92px;
  min-height: 48px;
}

.hud {
  margin-top: 1rem;
  font-size: 2rem;
  font-weight: 700;
}

.divider {
  color: var(--accent);
  margin: 0 0.4rem;
}

.mobile-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-group {
  min-width: 160px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background: rgba(17, 24, 45, 0.7);
}

.control-group-wide {
  min-width: 220px;
}

.control-label {
  display: block;
  margin-bottom: 0.6rem;
  color: #b7c7e6;
  font-size: 0.95rem;
}

.control-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.touch-btn {
  min-width: 64px;
  min-height: 64px;
  border-radius: 18px;
  font-size: 1.4rem;
  touch-action: manipulation;
  user-select: none;
}

.touch-btn:active,
.touch-btn.active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

@media (min-width: 900px) {
  .mobile-controls {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}
