body {
  margin: 0;
  padding: 0;
  /* Mix of classic 90s fonts */
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  background-color: silver;
  overflow: hidden;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  /* Retro repeating orthogonal brick background using SVG */
  background-color: #bd3314;
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="50" fill="%23bd3314"/><path d="M0 0 H 100 M0 25 H 100 M 50 0 V 25 M 0 25 V 50" stroke="rgba(0,0,0,0.4)" stroke-width="4" fill="none"/></svg>');
  background-size: 100px 50px;
}

#track {
  position: absolute;
  bottom: 0;
  width: 200vw;
  height: 150px;
  background-color: green;
  /* Clunky repeating lines to simulate a primitive track */
  background-image: repeating-linear-gradient(
    90deg,
    green,
    green 40px,
    #003300 40px,
    #003300 80px
  );
  border-top: 5px ridge #00FF00;
}

#score-board, #high-score-board {
  position: absolute;
  top: 20px;
  font-family: "Times New Roman", Times, serif;
  font-size: 2rem;
  color: #FFFF00;
  background-color: #0000FF;
  border: 4px outset silver;
  padding: 5px;
  z-index: 100;
}

#score-board {
  left: 20px;
}

#high-score-board {
  right: 20px;
}

#ui-overlay, #game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: silver;
  padding: 20px;
  /* Chunky 90s window border */
  border: 10px outset white;
  text-align: center;
  z-index: 200;
}

#ui-overlay {
  width: 600px;
}

#game-over {
  width: 400px;
  z-index: 300;
}

h1 {
  font-family: "Times New Roman", Times, serif;
  font-size: 3rem;
  margin: 0 0 10px 0;
  color: red;
  /* Underline link aesthetic for titles to look extra 90s */
  text-decoration: underline;
}

#game-over h1 {
  text-decoration: blink; /* Classic! */
}

marquee {
  font-family: "Comic Sans MS", cursive;
  font-size: 1.5rem;
  background-color: yellow;
  color: blue;
  padding: 5px;
  margin-bottom: 20px;
  border: 2px inset grey;
}

button {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.5rem;
  font-weight: bold;
  padding: 5px 15px;
  background-color: silver;
  color: black;
  /* Very chunky default HTML button look */
  border: 6px outset white;
  cursor: pointer;
  text-decoration: underline;
  color: blue;
}

button:active {
  border: 6px inset white;
  background-color: #dddddd;
}

/* --- THE PLAYER --- */
#player {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  height: 150px;
  z-index: 50;
  /* Pixelated retro scaling */
  image-rendering: pixelated;
}

.player-run {
  /* Jerky 90s movement */
  animation: run-bob 0.1s steps(2, end) infinite alternate;
}

@keyframes run-bob {
  from { transform: translateX(-50%) translateY(0); }
  to { transform: translateX(-50%) translateY(-20px); }
}

/* --- THE PREDATOR (JOB) --- */
#predator {
  position: absolute;
  bottom: 150px;
  /* Will be positioned dynamically via JS */
  font-size: 8rem;
  font-weight: 900;
  color: #ff0000;
  text-shadow:
    -3px -3px 0 #fff,
    3px -3px 0 #fff,
    -3px 3px 0 #fff,
    3px 3px 0 #fff,
    8px 8px 0 black;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cartoon Legs */
.legs {
  display: flex;
  gap: 15px;
  margin-top: -10px;
  width: 100%;
  justify-content: center;
}

.leg {
  width: 12px;
  height: 40px;
  background: black;
  border-radius: 6px;
  position: relative;
  transform-origin: top center;
}

.leg::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -5px;
  width: 30px;
  height: 15px;
  background: black;
  border-radius: 10px 10px 0 0;
}

.running-legs .left-leg {
  animation: kick 0.3s infinite alternate;
}

.running-legs .right-leg {
  animation: kick 0.3s infinite alternate-reverse;
}

@keyframes kick {
  0% {
    transform: rotate(-30deg) translateY(-5px);
  }

  100% {
    transform: rotate(30deg) translateY(5px);
  }
}

/* Webcam feed */
#tracker-container {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 320px;
  height: 240px;
  border: 10px ridge grey;
  background: silver;
  z-index: 100;
  overflow: hidden;
}

#output_canvas {
  /* Mirror the webcam feed visually */
  transform: scaleX(-1);
}

#debug-info {
  background: blue;
  color: yellow;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 5px;
  position: absolute;
  bottom: 0;
  width: 100%;
  border-top: 3px ridge white;
}

.hidden {
  display: none !important;
}