:root {
  --bg-color: #0f172a;
  --surface: #1e293b;
  --text: #f8fafc;
  --accent: #22c55e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--text);
}

h1 {
  font-size: 1.5rem;
  color: var(--accent);
}

.scores {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.scores strong {
  color: #fff;
  font-size: 1rem;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  background-color: #000;
  border: 3px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

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

.overlay p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.btn {
  background-color: var(--accent);
  color: #052e16;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.1s, filter 0.2s;
}

.btn:active {
  transform: scale(0.95);
}

/* D-Pad */
.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.dpad-row {
  display: flex;
  gap: 6px;
}

.dpad-btn {
  width: 58px;
  height: 52px;
  background-color: var(--surface);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.1s;
}

.dpad-btn:active {
  background-color: #334155;
}
