* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #19303d 0%, #070a10 46%, #030408 100%);
  color: #e8fff3;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.game-shell {
  width: min(1080px, 100%);
}

.top-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: #78ffc9;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  text-shadow: 0 0 18px rgba(103, 255, 193, 0.45);
}

.primary-button {
  border: 2px solid #86ffd6;
  border-radius: 12px;
  padding: 12px 18px;
  background: #12242e;
  color: #eafff5;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(92, 255, 191, 0.25), inset 0 0 12px rgba(92, 255, 191, 0.12);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #183240;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 3px solid #6affcb;
  border-radius: 18px;
  background: #05070a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45), 0 0 30px rgba(92, 255, 191, 0.18);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.help-panel {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(134, 255, 214, 0.35);
  border-radius: 14px;
  background: rgba(6, 13, 19, 0.72);
  color: #cceee0;
  line-height: 1.45;
}

.help-panel p {
  margin: 0;
}

.mobile-controls {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mobile-controls button {
  min-height: 58px;
  border: 2px solid rgba(134, 255, 214, 0.7);
  border-radius: 14px;
  background: rgba(18, 36, 46, 0.88);
  color: #eafff5;
  font-size: 1.5rem;
  font-weight: 900;
  touch-action: none;
}

.mobile-controls button:active,
.mobile-controls button.is-down {
  background: #28586b;
  transform: translateY(1px);
}

@media (hover: none), (max-width: 820px) {
  body {
    padding: 10px;
  }

  .top-bar {
    align-items: flex-start;
  }

  .mobile-controls {
    display: grid;
  }

  .help-panel {
    font-size: 0.9rem;
  }
}
