@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;800&display=swap');

.hidden { display: none !important; }

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(60,20,90,0.55), rgba(5,3,10,0.92) 70%);
  z-index: 10;
}

.title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 9vw, 62px);
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 18px rgba(255,45,90,0.75), 0 0 40px rgba(120,40,255,0.5);
  line-height: 1;
}
.title span {
  display: block;
  color: #ff2d5a;
  text-shadow: 0 0 18px rgba(255,45,90,0.9), 0 0 46px rgba(255,45,90,0.6);
}

.subtitle {
  color: #b9aee0;
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.loading-text {
  color: #8f7fc4;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.howto-hint {
  color: #8f7fc4;
  font-size: 12.5px;
  max-width: 320px;
  margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  padding: 14px 46px;
  border-radius: 50px;
  min-width: 220px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #ff2d5a, #ff6a3d);
  color: #fff;
  box-shadow: 0 0 24px rgba(255,45,90,0.55), 0 6px 0 #a11636;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 0 18px rgba(255,45,90,0.5), 0 3px 0 #a11636; }
.btn-primary.btn-big { font-size: 24px; padding: 18px 54px; }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #e6defc;
  border: 1px solid rgba(180,150,255,0.35);
  font-size: 15px;
  min-width: 180px;
  padding: 11px 28px;
}
.btn-secondary:active { transform: translateY(2px); }

.best-score {
  margin-top: 8px;
  color: #ffd27a;
  font-size: 12px;
  letter-spacing: 2px;
}
.best-score span {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  color: #ffe6a8;
  display: block;
  text-shadow: 0 0 10px rgba(255,210,120,0.6);
}

.menu-toggles { display: flex; gap: 10px; margin-top: 4px; }
.icon-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(180,150,255,0.3);
  font-size: 18px;
  color: #e6defc;
}
.icon-toggle.off { opacity: 0.35; }

/* ---------- Countdown ---------- */
#countdown-num {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 120px;
  color: #fff;
  text-shadow: 0 0 40px #ff2d5a;
  animation: pop 0.7s ease;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  40% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  z-index: 5;
  pointer-events: none;
}
#hud-left, #hud-right { pointer-events: auto; }
.hud-label { font-size: 10px; letter-spacing: 2px; color: #a89ad6; }
.hud-value {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 5vw, 30px);
  color: #fff;
  text-shadow: 0 0 12px rgba(120,40,255,0.6);
}
.combo-value {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(16px, 4vw, 22px);
  color: #2ee6ff;
  text-shadow: 0 0 14px rgba(46,230,255,0.7);
  opacity: 0.35;
  transition: opacity 0.15s, transform 0.15s;
}
.combo-value.active { opacity: 1; transform: scale(1.08); }
.lives-value { font-size: clamp(16px, 4vw, 22px); letter-spacing: 3px; text-align: right; }
.hud-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #e6defc;
  font-size: 15px;
  pointer-events: auto;
}

#boss-hud {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(76%, 380px);
  text-align: center;
  z-index: 6;
  background: rgba(8,4,16,0.55);
  border: 1px solid rgba(255,60,100,0.3);
  border-radius: 12px;
  padding: 8px 14px 10px;
  backdrop-filter: blur(2px);
}
#boss-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #ff2d5a;
  text-shadow: 0 0 12px rgba(255,45,90,0.8);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.boss-hp-track {
  height: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,80,110,0.4);
  overflow: hidden;
}
#boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2d5a, #ff8a3d);
  transition: width 0.25s ease;
}

/* ---------- Pause / Game Over ---------- */
#screen-pause h2, #screen-gameover h2 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 34px;
  color: #fff;
  text-shadow: 0 0 16px rgba(255,45,90,0.7);
}
.go-score {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 46px;
  color: #ffe6a8;
  text-shadow: 0 0 18px rgba(255,210,120,0.7);
}
.go-record {
  color: #ff6a3d;
  font-weight: 800;
  letter-spacing: 1px;
  animation: pop 0.6s ease;
}
.go-away { color: #a89ad6; font-size: 13px; max-width: 300px; }
#go-best { color: #8f7fc4; font-size: 13px; margin-bottom: 4px; }
.go-row { display: flex; gap: 10px; }
.save-status { font-size: 12px; color: #8f7fc4; min-height: 16px; }

/* ---------- Modals ---------- */
.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,2,10,0.78);
  padding: 16px;
}
.modal-card {
  background: linear-gradient(160deg, #180b2a, #0c0616);
  border: 1px solid rgba(180,150,255,0.25);
  border-radius: 18px;
  padding: 24px 22px;
  width: min(100%, 360px);
  text-align: center;
  box-shadow: 0 0 50px rgba(120,40,255,0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-card h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
}
#nickname-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(180,150,255,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  color: #fff;
  text-align: center;
}
#nickname-input::placeholder { color: #6b5f92; }
.error { color: #ff5d7a; font-size: 12.5px; min-height: 16px; }

.leaderboard-status { color: #8f7fc4; font-size: 12.5px; min-height: 16px; }
.leaderboard-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  font-size: 14px;
}
.lb-row.self { background: rgba(255,45,90,0.18); border: 1px solid rgba(255,45,90,0.4); }
.lb-rank { color: #ffd27a; font-weight: 800; text-align: center; }
.lb-name { color: #f2eefc; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: #2ee6ff; font-weight: 700; }
.lb-empty { color: #6b5f92; font-size: 13px; padding: 20px 0; }

@media (max-width: 420px) {
  .btn-primary, .btn-secondary { min-width: 0; width: 100%; }
  .go-row { flex-direction: column; }
}
