/* Neon Harbor Runner — styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #04021a;
  color: #e8f6ff;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0 calc(14px + env(safe-area-inset-left));
  pointer-events: none;
  z-index: 5;
}
.hud-block {
  background: rgba(6, 10, 40, 0.45);
  border: 1px solid rgba(77, 250, 255, 0.25);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: center;
  min-width: 84px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hud-mid { min-width: 0; padding: 8px 14px; }
.hud-label {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(140, 220, 255, 0.75);
}
#score, #best, #speed {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #4dfaff;
  text-shadow: 0 0 10px rgba(77, 250, 255, 0.8);
  line-height: 1.1;
}
#speed { font-size: 16px; color: #ff50dc; text-shadow: 0 0 10px rgba(255, 80, 220, 0.8); }

/* ---------- buttons ---------- */
.round-btn {
  position: fixed;
  z-index: 6;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(77, 250, 255, 0.4);
  background: rgba(6, 10, 40, 0.55);
  color: #4dfaff;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.1s, box-shadow 0.15s;
}
#muteBtn { bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); }
#pauseBtn { bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(64px + env(safe-area-inset-right)); }
.round-btn:active { transform: scale(0.92); }
.round-btn:hover { box-shadow: 0 0 14px rgba(77, 250, 255, 0.5); }

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.screen-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.screen-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4,2,26,0.55) 0%, rgba(4,2,26,0.35) 40%, rgba(4,2,26,0.92) 100%);
}
.screen-shade.heavy { background: rgba(4, 2, 26, 0.88); }
.screen-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  max-width: 560px;
  width: 100%;
}

.game-title {
  font-size: clamp(34px, 9vw, 64px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.05;
  color: #fff;
  text-shadow:
    0 0 8px #4dfaff,
    0 0 24px rgba(77, 250, 255, 0.9),
    0 0 60px rgba(77, 250, 255, 0.5);
}
.game-title span {
  display: block;
  font-size: clamp(24px, 6vw, 44px);
  letter-spacing: 14px;
  color: #ff50dc;
  text-shadow:
    0 0 8px #ff50dc,
    0 0 24px rgba(255, 80, 220, 0.9),
    0 0 60px rgba(255, 80, 220, 0.5);
}

.tagline {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(190, 235, 255, 0.85);
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 22px;
}
.hint {
  font-size: 11.5px;
  letter-spacing: 1px;
  color: rgba(160, 210, 255, 0.75);
  border: 1px solid rgba(120, 180, 255, 0.22);
  background: rgba(10, 16, 52, 0.5);
  border-radius: 999px;
  padding: 6px 12px;
}
.hint b { color: #4dfaff; font-weight: 700; }

.neon-btn {
  appearance: none;
  border: 2px solid #4dfaff;
  background: linear-gradient(180deg, rgba(77,250,255,0.16), rgba(77,250,255,0.04));
  color: #dffcff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 14px 42px;
  border-radius: 14px;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(77,250,255,0.9);
  box-shadow: 0 0 18px rgba(77, 250, 255, 0.45), inset 0 0 12px rgba(77, 250, 255, 0.18);
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.neon-btn:hover {
  box-shadow: 0 0 30px rgba(77, 250, 255, 0.8), inset 0 0 16px rgba(77, 250, 255, 0.3);
  background: linear-gradient(180deg, rgba(77,250,255,0.28), rgba(77,250,255,0.08));
}
.neon-btn:active { transform: scale(0.95); }

.tiny-hint {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(160, 210, 255, 0.6);
}
.tiny-hint b { color: #4dfaff; }

.over-title {
  font-size: clamp(38px, 10vw, 64px);
  font-weight: 900;
  letter-spacing: 8px;
  color: #ff3b6b;
  text-shadow: 0 0 10px rgba(255, 59, 107, 0.9), 0 0 40px rgba(255, 59, 107, 0.5);
}
.over-title.small {
  font-size: clamp(30px, 8vw, 48px);
  color: #4dfaff;
  text-shadow: 0 0 10px rgba(77,250,255,0.9), 0 0 40px rgba(77,250,255,0.5);
}

.new-best {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 16px;
  border: 1px solid #ffd24d;
  border-radius: 999px;
  color: #ffd24d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 210, 77, 0.8);
  box-shadow: 0 0 16px rgba(255, 210, 77, 0.35);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.score-card {
  margin: 20px auto 24px;
  display: inline-block;
  min-width: 220px;
  border: 1px solid rgba(77, 250, 255, 0.3);
  border-radius: 14px;
  background: rgba(6, 10, 40, 0.6);
  padding: 12px 26px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
}
.score-row span:last-child { color: #4dfaff; text-shadow: 0 0 10px rgba(77,250,255,0.8); }

.screen.mini .screen-content { pointer-events: none; }
#pauseScreen { cursor: pointer; }
