.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --accent: #22c55e;
  --text: #e8e8f0;
  --muted: #8888a0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid #1e1e2e;
  position: relative;
  z-index: 10;
}

.btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn:hover { background: rgba(255,255,255,0.12); }

.game-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

canvas {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid #1e1e2e;
  display: block;
  max-width: 100%;
  height: auto;
}

.score {
  font-size: 1rem;
  color: var(--muted);
}

.score span {
  color: var(--accent);
  font-weight: 700;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: 1rem;
}

.overlay h2 {
  font-size: 2rem;
  color: var(--accent);
}

.overlay p {
  color: var(--muted);
  font-size: 1rem;
}

.overlay.hidden { display: none; }

.btn-accent {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--accent);
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-accent:hover { background: rgba(34,197,94,0.25); }

/* Mobile D-pad */
.touch-controls {
  display: none;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.touch-controls .row {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.touch-btn {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid #1e1e2e;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.touch-btn:active { background: rgba(34,197,94,0.2); }

@media (pointer: coarse) {
  .touch-controls { display: grid; }
}

@media (max-width: 500px) {
  canvas { border-radius: 6px; }
}
