.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(30,20,60,0.92), rgba(5,6,15,0.97));
  padding: 16px;
  text-align: center;
}

.menu-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.game-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #a6f3ff, #4f8dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(126,249,255,0.35);
}
.game-tagline {
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(233,242,255,0.6);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 15px;
  transition: transform 0.12s ease, filter 0.12s ease;
  width: 100%;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(180deg, #57ffb0, #1fd18a);
  color: #06210f;
  box-shadow: 0 6px 0 #0e8a58, 0 10px 24px rgba(31,209,138,0.35);
}
.btn-play {
  font-size: 20px;
  padding: 16px 22px;
  letter-spacing: 1px;
}
.btn-ghost {
  background: rgba(126,249,255,0.08);
  border: 1px solid rgba(126,249,255,0.3);
  color: #cfefff;
  font-size: 13px;
  padding: 10px 14px;
}
.btn-sm { width: auto; padding: 10px 16px; font-size: 13px; }

.menu-best {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #ffd166;
  background: rgba(255,209,102,0.1);
  border: 1px solid rgba(255,209,102,0.35);
  padding: 4px 14px;
  border-radius: 20px;
}
.menu-row { display: flex; gap: 8px; width: 100%; }
.menu-instructions {
  font-size: 12px;
  color: rgba(233,242,255,0.5);
  line-height: 1.6;
  margin-top: 4px;
}
.mobile-only { display: none; }
@media (hover: none) and (pointer: coarse) { .mobile-only { display: inline; } }

.overlay-countdown { background: rgba(5,6,15,0.6); }
.countdown-num {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 96px;
  color: #7ef9ff;
  text-shadow: 0 0 40px rgba(126,249,255,0.7);
}
.countdown-num.pulse { animation: countPulse 0.4s ease; }
@keyframes countPulse {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.new-record {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #ffd166;
  animation: recordPulse 0.9s ease infinite;
}
@keyframes recordPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.go-reason {
  font-size: 12px;
  color: rgba(255,120,120,0.85);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: -4px;
}

.go-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin: 6px 0;
}
.go-stat {
  background: rgba(126,249,255,0.06);
  border: 1px solid rgba(126,249,255,0.18);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.go-label { font-size: 10px; letter-spacing: 1px; color: rgba(233,242,255,0.5); }
.go-value {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #7ef9ff;
}

.nickname-section { width: 100%; margin-top: 4px; }
.nickname-label { font-size: 11px; letter-spacing: 1px; color: rgba(233,242,255,0.6); display: block; margin-bottom: 6px; }
.nickname-row { display: flex; gap: 6px; }
.nickname-input {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(126,249,255,0.3);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
}
.nickname-input:focus { outline: none; border-color: #7ef9ff; }
.nickname-error { color: #ff8a8a; font-size: 11px; margin-top: 6px; }
.score-saved-msg {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #57ffb0;
  margin-top: 4px;
}

.leaderboard-list { width: 100%; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: rgba(126,249,255,0.05);
  border: 1px solid rgba(126,249,255,0.12);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}
.lb-rank { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: rgba(233,242,255,0.6); }
.lb-name { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: #ffd166; }
.lb-height { font-size: 11px; color: rgba(233,242,255,0.45); }
.lb-top1 { border-color: rgba(255,209,102,0.55); background: rgba(255,209,102,0.08); }
.lb-top2 { border-color: rgba(200,220,255,0.4); }
.lb-top3 { border-color: rgba(255,160,110,0.4); }
.lb-loading { color: rgba(233,242,255,0.5); font-size: 13px; padding: 20px 0; }

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
}
.settings-row small { color: rgba(233,242,255,0.4); font-size: 10px; }
.icon-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(126,249,255,0.1);
  border: 1px solid rgba(126,249,255,0.3);
  font-size: 15px;
}
.icon-toggle.off { opacity: 0.35; }

.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; border-radius: 20px;
  background: rgba(255,255,255,0.15);
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; transition: transform 0.15s ease;
}
.switch input:checked + .switch-slider { background: #1fd18a; }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

.toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translate(-50%, -10px);
  background: rgba(10,14,30,0.85);
  border: 1px solid rgba(126,249,255,0.35);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
