@font-face {
  font-family: 'Nordic Light';
  src: url(./fonts/NORDIC_LIGHT.ttf) format('truetype'); 
}

body {
    margin: 0;
    background: radial-gradient(circle at center, #1a1a1a, #000);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100svh;
    touch-action: none;
}

canvas {
    width: 100vw;
    height: 100vh;
    display: block;
    background: transparent;
    margin-top: 70px;
}

.header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    pointer-events: none;
    z-index: 3;
}

.heading {
    font-family: 'Nordic Light', cursive;
    color: grey;
    font-size: 3rem;
    margin-bottom: 24px;
    letter-spacing: 0.2em;
    width: 100%;
    position: absolute;
    top: 1%;
    left: 50%;
    transform: translateX(-50%);    
    text-align: center;
    z-index: 2;
    pointer-events: none;
    color: #fff;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #222;
    border: 3px solid #00ff99;
    border-radius: 16px;
    padding: 40px 32px;
    color: #fff;
    font-family: 'Nordic Light', 'Press Start 2P', cursive;
    font-size: 2rem;
    text-align: center;
    z-index: 10;
    box-shadow: 0 0 32px #00ff99;
}

.popup button {
    margin-top: 24px;
    font-size: 1.2rem;
    padding: 10px 32px;
    border-radius: 8px;
    border: none;
    background: #00ff99;
    color: #222;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.popup button:hover {
    background: #00cc77;
}

.hidden {
    display: none;
}

#start-popup {
    z-index: 20;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}
#start-popup ul {
    font-size: 1.2rem;
    text-align: left;
    font-family: "Orbitron", sans-serif;
}

#joystick-zone {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 40vh;
  touch-action: none;
  background: transparent;
}

#direction-timer {
  position: fixed;
  top: 0.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 10px;
  margin-top: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  z-index: 5;
}

#timer-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00ff99, #00cc77);
  transition: width 0.5s linear;
  border-radius: 5px;
}

footer {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #666;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  z-index: 1;
  pointer-events: none;
}

footer a {
  color: #00ff99;
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.3s;
}

footer a:hover {
  color: #00cc77;
  text-decoration: underline;
}

.tie-counter {
  position: fixed;
  top: 15%;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  z-index: 5;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 15px;
  border-radius: 20px;
  border: 2px solid;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#player-ties {
  left: 20px;
  color:lime;
  border-color: lime;
}

#ai-ties {
  right: 20px;
  color: red;
  border-color: red;
}

@media (max-width: 768px) {
  #joystick-zone {
    height: 50vh;
  }

  #start-popup {
    width: 80vw;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
  }

  #start-popup ul {
    font-size: 1.2rem;
  }

  .popup {
    width: 50vw;
    font-size: 1.5rem;
    padding: 20px;
  }

  .heading {
    font-size: 2.5rem;
    top: 3%;
  }

  footer {
    font-size: 0.8rem;
    bottom: 5px;
  }

  .tie-counter {
    font-size: 1rem;
    top: 16%;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  #player-ties {
    right: 80%;
    left: 14px;
    margin-bottom: 20px;
  }

  #ai-ties {
    right: 80%;
    left: 14px;
    margin-top: 40px;
  }
}