/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700&display=swap');

/* Reset / Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Root Variables */
:root {
  --bg-color: #0a0a0a;
  --text-color: #eaeaea;
  --accent-color: #00ff9f;
}

/* Body Setup */
body {
  align-items: center;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  font-family: 'Orbitron', sans-serif;
  height: 100vh;
  height: 100dvh;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

main {
  height: 100%;
  position: relative;
  width: 100%;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Game Container */
#game-container {
  height: 100%;
  position: relative;
  touch-action: none;
  width: 100%;
}

/* Canvas (Phaser will inject this) */
canvas {
  display: block;
  touch-action: none;
}

.leaderboard-overlay {
  align-items: center;
  background: rgba(10, 10, 10, 0.82);
  color: var(--text-color);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.leaderboard-overlay[hidden] {
  display: none;
}

.leaderboard-panel {
  background: #111318;
  border: 1px solid rgba(168, 255, 219, 0.38);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.46);
  max-width: 520px;
  padding: 20px;
  width: min(100%, 520px);
}

.leaderboard-title {
  color: #a8ffdb;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.run-summary {
  background: rgba(168, 255, 219, 0.08);
  border: 1px solid rgba(168, 255, 219, 0.24);
  border-radius: 6px;
  margin-bottom: 14px;
  padding: 12px 13px;
}

.run-summary-text {
  color: #f2fff9;
  font-size: 14px;
  line-height: 1.45;
}

.leaderboard-message {
  color: #eaeaea;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.leaderboard-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: grid;
  font-size: 13px;
  gap: 10px;
  grid-template-columns: 36px 1fr auto;
  padding: 9px 10px;
}

.leaderboard-rank,
.leaderboard-score {
  color: #ffd966;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.leaderboard-input {
  background: #0a0a0a;
  border: 1px solid rgba(168, 255, 219, 0.48);
  border-radius: 6px;
  color: var(--text-color);
  font: inherit;
  font-size: 16px;
  min-height: 42px;
  padding: 8px 10px;
}

.leaderboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.leaderboard-button {
  background: #a8ffdb;
  border: 0;
  border-radius: 6px;
  color: #111318;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  padding: 9px 13px;
}

.leaderboard-button.secondary {
  background: transparent;
  border: 1px solid rgba(168, 255, 219, 0.5);
  color: #a8ffdb;
}

.leaderboard-panel.victory-panel {
  border: 1px solid rgba(255, 217, 102, 0.48);
  max-width: 540px;
  text-align: center;
  width: min(100%, 540px);
}

.victory-social-link {
  align-items: center;
  border: 1px solid rgba(168, 255, 219, 0.5);
  border-radius: 999px;
  color: #a8ffdb;
  display: inline-flex;
  font-size: 16px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  text-decoration: none;
  width: 38px;
}

.victory-social-link i {
  line-height: 1;
}

.start-social-link {
  align-items: center;
  background: rgba(17, 19, 24, 0.78);
  border: 1px solid rgba(168, 255, 219, 0.46);
  border-radius: 999px;
  bottom: 22px;
  color: #a8ffdb;
  display: inline-flex;
  font-size: 18px;
  height: 42px;
  justify-content: center;
  left: 50%;
  position: fixed;
  text-decoration: none;
  transform: translateX(-50%);
  width: 42px;
  z-index: 12;
}

.start-social-link i {
  line-height: 1;
}
