@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@700;900&display=swap');

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

:root {
  --red: #c0392b;
  --orange: #e67e22;
  --dark: #050000;
  --green: #00ff41;
  --gold: #ffd700
}

body {
  background: var(--dark);
  color: #ddd;
  font-family: 'Share Tech Mono', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden
}

header {
  width: 100%;
  padding: 16px 24px 10px;
  text-align: center;
  border-bottom: 2px solid #2a0000;
  background: linear-gradient(180deg, #1a0000, #050000)
}

header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 4vw, 2.2rem);
  letter-spacing: 4px;
  color: var(--red);
  text-shadow: 0 0 20px #ff000088;
  animation: glow 2s ease-in-out infinite
}

header p {
  font-size: .65rem;
  color: #555;
  margin-top: 5px;
  letter-spacing: 2px
}

@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 20px #ff000088
  }

  50% {
    text-shadow: 0 0 35px #ff0000cc
  }
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 14px 40px;
  width: 100%;
  max-width: 680px
}

.game-wrap {
  position: relative;
  width: 100%;
  max-width: 640px
}

#gameCanvas {
  width: 100%;
  aspect-ratio: 16/10;
  display: block;
  border: 3px solid #2a0000;
  box-shadow: 0 0 40px #ff000033;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none; /* Prevents mobile browser gesture interference */
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, .12) 3px, rgba(0, 0, 0, .12) 4px);
  pointer-events: none;
  z-index: 5
}

.overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, .88);
  z-index: 20;
  text-align: center
}

.overlay.show {
  display: flex
}

.hud {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: .7rem
}

.hud-box {
  background: #0d0000 url('assets/hud_background.png') center/cover no-repeat;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 12px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-face {
  height: 40px;
  width: 40px;
  object-fit: contain;
  padding: 1px;
}

.hud-lbl {
  color: #aaa;
  font-size: .58rem;
  font-weight: bold;
  margin-bottom: 3px;
  letter-spacing: 1px;
}

.hud-val {
  color: var(--green);
  font-size: 1.1rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.hud-val.r {
  color: var(--red);
  text-shadow: 0 0 5px rgba(192, 57, 43, 0.5);
}

.hud-val.g {
  color: var(--gold);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center
}

.btn {
  background: #1a0000;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: 'Share Tech Mono', monospace;
  font-size: .72rem;
  letter-spacing: 2px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  transition: all .15s;
  user-select: none
}

.btn:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 12px var(--red)
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.25rem;
    letter-spacing: 2px;
  }
  
  main {
    padding: 10px 8px 30px;
    gap: 10px;
  }
  
  .hud {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  .hud-box {
    padding: 4px 6px;
  }
  
  .hud-lbl {
    font-size: 0.5rem;
    letter-spacing: 0.5px;
  }
  
  .hud-val {
    font-size: 0.95rem;
  }
  
  .hud-face {
    height: 30px;
    width: 30px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 0.8rem;
    width: 45%; /* Symmetrical buttons on mobile */
    text-align: center;
  }
  
  .btns {
    width: 100%;
    justify-content: space-between;
  }
}

