/* Define CSS variables for easier theming */
:root {
  --bg-color: #000;
  --scoreboard-border: #000;
  --scoreboard-font: "Courier New", Courier, monospace;
  --life-icon-color: #ffff00;
}

/* ==========================================================================
   Global Reset & Base Styles
   ========================================================================== */
html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  overflow: hidden;
  height: 100vh;
  font-family: var(--scoreboard-font);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ==========================================================================
   Scoreboard Styles
   ========================================================================== */
#scoreBoard {
  width: 100%;
  max-width: 256px;
  background-color: var(--bg-color);
  border: 1px solid var(--scoreboard-border);
  display: flex;
  justify-content: space-between;
  padding: 4px;
  font-size: 14px;
  margin-bottom: 4px;
}

#scoreText,
#highScoreText,
#livesContainer {
  font-weight: bold;
}

#scoreText {
  text-align: left;
  flex: 1;
}
#highScoreText {
  text-align: center;
  flex: 1;
}
#livesContainer {
  text-align: right;
  flex: 1;
}

/* ==========================================================================
   Life Icon Styles
   ========================================================================== */
.life-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--life-icon-color);
  clip-path: polygon(50% 0%, 91.67% 41.67%, 75% 100%, 25% 100%, 8.33% 41.67%);
  margin-left: 2px;
}

/* ==========================================================================
   Game Container & Canvas Styles
   ========================================================================== */
#gameContainer {
  position: relative;
  width: 100%;
  max-width: 256px;
  margin: 0 auto;
}

canvas {
  border: 2px solid var(--scoreboard-border);
  -webkit-optimize-contrast: pixelated;
  -moz-crisp-edges: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  -ms-touch-action: none;
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Enemy Overlay Styles
   ========================================================================== */
#enemyOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 320px) {
  #scoreBoard,
  #gameContainer {
    width: 100%;
    padding: 0 5px;
  }
  canvas,
  #enemyOverlay {
    width: 100%;
  }
}
