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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #101827 0%, #020617 60%, #000 100%);
  color: #e5e7eb;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD */

#hud {
  position: fixed;
  top: 10px;
  left: 0;
  width: 100%;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 16px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

.hud-item {
  pointer-events: none;
}

/* Overlay */

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
  backdrop-filter: blur(4px);
}

#overlay.hidden {
  display: none;
}

#overlay-content {
  text-align: center;
  padding: 24px 32px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#overlay-content h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

#overlay-content p {
  font-size: 14px;
  margin-bottom: 16px;
  color: #9ca3af;
}

button#startButton {
  cursor: pointer;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #22c55e;
  color: #022c22;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
}

button#startButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.4);
  background: #4ade80;
}

button#startButton:active {
  transform: translateY(1px);
  box-shadow: 0 6px 15px rgba(22, 163, 74, 0.4);
}

/* Tips section (inside overlay) */

#overlay-content .tips {
  margin: 12px 0 18px;
  text-align: left;
  font-size: 14px;
  color: #cbd5e1;
}

#overlay-content .tips-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
  color: #e2e8f0;
}

#overlay-content .tips ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#overlay-content .tips li {
  margin-bottom: 4px;
  line-height: 1.3;
}

.tip-golden {
  color: #facc15; /* golden yellow */
}

.tip-life {
  color: #14b8a6; /* teal / life bubble color */
}

.leaderboard-section {
  margin: 16px 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  text-align: left;
}

.leaderboard-section h2 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.leaderboard-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.leaderboard-form label {
  font-size: 13px;
  color: #cbd5e1;
}

.leaderboard-form input {
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 13px;
}

.leaderboard-form button {
  cursor: pointer;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #38bdf8;
  color: #02131f;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.35);
}

.leaderboard-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(56, 189, 248, 0.4);
  background: #0ea5e9;
}

.leaderboard-form button:active {
  transform: translateY(1px);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.5);
}

#leaderboardList {
  font-size: 13px;
  padding-left: 0;
  list-style: none;
  color: #e5e7eb;
}

#leaderboardList li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.lb-rank {
  width: 26px;
  opacity: 0.8;
}

.lb-avatar,
.lb-avatar-text {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.lb-avatar {
  object-fit: cover;
}

.lb-name {
  flex: 1;
}

.lb-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}


/* Mode buttons */
.mode-row{
  display:flex;
  gap:10px;
  justify-content:center;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.mode-btn{
  cursor:pointer;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, border-color 0.2s ease;
}

.mode-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0,0,0,0.35);
  border-color: rgba(148, 163, 184, 0.8);
}

.mode-btn.active{
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.22);
}

/* Zen HUD: hide lives */
#hud.zen-no-lives .hud-item:last-child{
  display:none;
}

.tip-bad{ color:#fb7185; }     /* rose */
.tip-rescue{ color:#a78bfa; }  /* purple-ish */
