:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #f8fafc;
}

.game-shell {
  text-align: center;
  padding: 24px;
}

.subtitle {
  margin-top: -8px;
  color: #cbd5e1;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px auto 16px;
  max-width: 560px;
}

.score-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 0.95rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.controls label {
  font-size: 0.95rem;
  color: #cbd5e1;
}

input[type="text"] {
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 10px;
  background: #0f172a;
  color: white;
  min-width: 110px;
}

input[type="color"] {
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #22c55e;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #16a34a;
}

.canvas-wrapper {
  position: relative;
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
}

canvas {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 3px solid #334155;
  background: #020617;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.78);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.overlay-card {
  max-width: 280px;
}

.overlay h2 {
  margin-bottom: 8px;
}

.overlay-actions {
  margin-top: 12px;
}

.touch-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.touch-row {
  display: flex;
  gap: 8px;
}

.dir-btn {
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  background: #334155;
  font-size: 1rem;
}

.dir-btn:hover {
  background: #475569;
}
