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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #141519;
  color: #f2f3f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  overflow-x: hidden;
}

#app { width: 100%; max-width: 820px; }

#topbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tag {
  background: #232428;
  border: 1px solid #2f3136;
  color: #b5bac1;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  white-space: nowrap;
}
#scoreTag { color: #ffd700; border-color: rgba(255, 215, 0, 0.35); background: rgba(255, 215, 0, 0.08); }

#stageWrap { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; background: #1b1d22; }

/* burst attribution floats above canvas */
#burstLayer {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.pop-txt {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  animation: popUp 1.4s ease-out forwards;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
.pop-txt .who { color: #ffd700; }
.pop-txt .pts { color: #57f287; }
@keyframes popUp {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  20%  { transform: translate(-50%, -70%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

#leaderboard {
  margin-top: 12px;
  background: #1e1f22;
  border-radius: 12px;
  padding: 12px 14px;
}
.lb-title { font-size: 14px; font-weight: 700; color: #b5bac1; margin-bottom: 8px; }
.lb-sub { font-size: 11px; font-weight: 400; color: #80848e; }
#lbList { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  background: #232428; border-radius: 8px; padding: 6px 12px; font-size: 14px;
}
.lb-row.me { outline: 1px solid #5865f2; }
.lb-rank { width: 22px; color: #80848e; font-weight: 700; text-align: center; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: #ffd700; font-weight: 800; }
.lb-empty { color: #80848e; font-size: 13px; padding: 6px 2px; }

#whoami { margin-top: 10px; font-size: 13px; color: #949ba4; }
#help { margin-top: 4px; font-size: 12px; color: #5d626b; }

#splashOverlay {
  position: fixed; inset: 0; background: rgba(20, 21, 25, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  z-index: 50; text-align: center; padding: 20px;
}
#splashOverlay.hidden { display: none; }
#splashStatus { font-size: 15px; color: #b5bac1; }
.btn-discord {
  background: #5865f2; color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-discord:hover { background: #4752c4; }
