*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: system-ui, -apple-system, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#gameCanvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
}

/* Overlay panels */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 10;
  padding: 24px;
  text-align: center;
}

.overlay h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.overlay h2 {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 700;
  color: #fff;
}

.overlay p {
  font-size: clamp(0.9rem, 3.5vw, 1.1rem);
  color: #ccc;
  max-width: 320px;
  line-height: 1.5;
}

.overlay .subtitle {
  font-size: clamp(0.85rem, 3vw, 1rem);
  color: #aaa;
}

.btn {
  padding: 14px 36px;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: #1565c0;
  color: #fff;
  transition: background 0.15s, transform 0.1s;
  min-width: 180px;
}

.btn:active {
  transform: scale(0.96);
  background: #0d47a1;
}

.btn.secondary {
  background: transparent;
  border: 2px solid #555;
  color: #ccc;
}

.btn.secondary:active {
  background: rgba(255,255,255,0.08);
}

.stars {
  font-size: 2.5rem;
  letter-spacing: 4px;
}

/* In-game settings button */
#settingsBtn {
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  transition: color 0.15s;
}

#settingsBtn:active {
  color: #fff;
}

/* Speed picker */
.speed-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.speed-label {
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.speed-picker {
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid #888;
}

.speed-btn {
  padding: 10px 22px;
  font-size: clamp(0.9rem, 3.5vw, 1.05rem);
  font-weight: 600;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-width: 0;
}

.speed-btn + .speed-btn {
  border-left: 1px solid #888;
}

.speed-btn.active {
  background: #1565c0;
  color: #fff;
}

.speed-btn:not(.active):hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.speed-btn:not(.active):active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Rage Bait */
.rage-label {
  color: #ff5722;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.rage-desc {
  font-size: clamp(0.75rem, 2.8vw, 0.88rem) !important;
  color: #888 !important;
  margin-top: -4px;
}

.rage-toggle {
  padding: 10px 40px;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  font-weight: 800;
  border: 2px solid #555;
  border-radius: 50px;
  background: rgba(255,255,255,0.06);
  color: #888;
  cursor: pointer;
  letter-spacing: 0.12em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* Credit link */
.credit {
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  color: #555;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.credit:hover {
  color: #aaa;
}

.rage-toggle.on {
  background: #b71c1c;
  border-color: #ff5722;
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 87, 34, 0.5);
}
