* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05030f;
  color: #e9f4ff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

body { display: flex; align-items: center; justify-content: center; }

#stage { position: relative; }

canvas {
  display: block;
  touch-action: none;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(120, 80, 255, 0.25);
}

#buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

#buttons button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 6, 30, 0.6);
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

#buttons button.off { opacity: 0.45; text-decoration: line-through; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(25, 10, 60, 0.82), rgba(5, 3, 15, 0.92));
  border-radius: 8px;
}

.hidden { display: none; }

h1 {
  margin: 0 0 8px;
  font-size: clamp(40px, 11vmin, 76px);
  line-height: 0.95;
  letter-spacing: 4px;
  color: #3ee6ff;
  text-shadow: 0 0 18px #3ee6ff, 0 0 40px #1a7dff;
}

h1 span { color: #ff4fd8; text-shadow: 0 0 18px #ff4fd8, 0 0 40px #a020ff; }

h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 8vmin, 54px);
  letter-spacing: 3px;
  color: #ff4fd8;
  text-shadow: 0 0 18px #ff4fd8;
}

.tag { margin: 4px 0 18px; color: #c9b8ff; font-size: 16px; }

.controls {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #b9d7ee;
}

.controls b { color: #ffd166; margin-right: 6px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 13px;
  margin-bottom: 14px;
}

.legend span { display: flex; align-items: center; gap: 6px; }

.legend i {
  font-style: normal;
  font-weight: bold;
  width: 22px;
  height: 22px;
  line-height: 20px;
  border-radius: 50%;
  border: 2px solid var(--c);
  color: var(--c);
  box-shadow: 0 0 8px var(--c);
  font-size: 12px;
}

.best { margin: 4px 0 14px; color: #ffd166; }

button.big {
  font: inherit;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 12px 42px;
  border-radius: 40px;
  border: none;
  color: #12002a;
  background: linear-gradient(90deg, #3ee6ff, #ff4fd8);
  box-shadow: 0 0 24px rgba(255, 79, 216, 0.6);
  cursor: pointer;
  transition: transform 0.1s;
}

button.big:hover { transform: scale(1.06); }

.hint { margin: 10px 0 0; font-size: 13px; color: #8a7fb3; }

.stats { display: flex; gap: 28px; margin: 8px 0 22px; }

.stats div { display: flex; flex-direction: column; }

.stats small { color: #8a7fb3; letter-spacing: 2px; }

.stats b { font-size: 30px; color: #fff; }

.new-best {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: bold;
  color: #ffd166;
  text-shadow: 0 0 14px #ffd166;
  animation: pulse 0.7s ease-in-out infinite alternate;
}

@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
