/* =========================
   RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   PAGE
========================= */
html,
body {
  min-height: 100%;
}

body {
  background: #000;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.home-link {
  margin-right: 30px;
  margin-bottom: 50px;
  margin-top: -20px;
  min-width: 180px;
  text-align: center;
  color: #ffe600;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-link a {
  color: inherit;
  text-decoration: none;
}

/* =========================
   GAME WRAPPER
========================= */
.game-wrap {
  position: relative;
  display: inline-block;
  padding: 1rem;
  background: #000;
  border: 4px solid #1a1a1a;
  border-radius: 14px;
  box-shadow:
    0 0 0 3px #0a0a0a,
    0 0 20px rgba(0, 80, 255, 0.18),
    0 0 40px rgba(0, 80, 255, 0.08);
}

/* =========================
   CANVAS
========================= */
#game {
  display: block;
  background: #000;
  border: 3px solid #1f38ff;
  border-radius: 8px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  -ms-touch-action: none;
  max-width: 100%;
  height: auto;
}

/* =========================
   SCORE + LIVES
========================= */
#score,
#lives {
  position: absolute;
  top: -2.25rem;
  min-width: 140px;
  text-align: center;
  color: #ffe600;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#score {
  left: 30%;
  transform: translateX(-50%);
}

#lives {
  left: 70%;
  transform: translateX(-50%);
}

/* score acts like pause button */
.pause-trigger {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.pause-trigger:hover {
  background: rgba(255, 230, 0, 0.12);
}

.pause-trigger:active {
  transform: translateX(-50%) scale(0.97);
}

.pause-trigger:focus {
  outline: 2px solid #ffe600;
  outline-offset: 2px;
}

.pause-trigger.is-paused {
  background: rgba(255, 230, 0, 0.18);
  color: #ffffff;
}

/* =========================
   MESSAGE
========================= */
#message {
  margin-top: 1rem;
  text-align: center;
  color: #d6d6d6;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  max-width: 700px;
}

/* =========================
   HIGH SCORES
========================= */
.high-scores-wrap {
  width: min(100%, 520px);
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 3px solid #1f38ff;
  border-radius: 12px;
  background: #050505;
  box-shadow:
    0 0 0 2px #0a0a0a,
    0 0 18px rgba(0, 80, 255, 0.15);
}

.high-scores-wrap h2 {
  text-align: center;
  color: #ffe600;
  margin-bottom: 0.9rem;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#high-scores-list {
  list-style-position: inside;
  padding-left: 0;
}

#high-scores-list li {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #f5f5f5;
  font-size: 1rem;
}

#high-scores-list li:last-child {
  border-bottom: none;
}

.empty-score {
  list-style: none;
  color: #bdbdbd;
}

/* =========================
   SMALL SCREEN
========================= */
@media (max-width: 600px) {
  body {
    padding: 1.5rem 0.75rem 2rem;
  }

  .game-wrap {
    padding: 0.65rem;
    width: min(100%, 470px);
  }

  #game {
    width: 100%;
    height: auto;
  }

  #score,
  #lives {
    top: -2rem;
    font-size: 0.85rem;
    min-width: 100px;
  }

  #score {
    left: 28%;
  }

  #lives {
    left: 72%;
  }

  .pause-trigger {
    padding: 0.2rem 0.35rem;
    border: 1px solid rgba(255, 230, 0, 0.25);
    background: rgba(255, 230, 0, 0.06);
  }

  #message {
    font-size: 0.85rem;
    margin-top: 0.85rem;
    line-height: 1.4;
  }

  .high-scores-wrap {
    margin-top: 1.1rem;
    padding: 0.85rem 1rem;
  }

  .high-scores-wrap h2 {
    font-size: 1rem;
  }

  #high-scores-list li {
    font-size: 0.95rem;
  }
}
