* {
  border: 0;
  margin: 0;
  overflow-y: hidden;
}
html,
body {
  height: 100%;
  width: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
#webgl {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  outline: none;
}
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.95) 100%
  );
  z-index: 10000;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fc9;
  font-family: halloween_spooky, sans-serif;
}
.spinner {
  width: 56px;
  height: 56px;
  border: 6px solid rgba(255, 102, 0, 0.2);
  border-top-color: #f60;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 10px #ff6600);
}
.loading-text {
  font-size: 20px;
  text-shadow: 0 0 8px #ff6600;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#instructions-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 250px;
  padding: 15px;
  background-color: #00000080;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 0 0 10px #000000b3;
  z-index: 1000;
}
#instructions-menu h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
  text-align: center;
  text-decoration: underline;
}
#instructions-menu ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
#instructions-menu ul li {
  margin-bottom: 6px;
}
#hud {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%);
  width: 600px;
  display: flex;
  justify-content: space-between;
  z-index: 1000;
  pointer-events: none;
  font-family: Arial Black, sans-serif;
}
.health-bar {
  width: 280px;
  height: 30px;
  background-color: #222;
  border: 3px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 10px #fff3;
}
.health-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #00ff00, #00aa00);
  transition: width 0.2s ease, background 0.2s ease;
  border-radius: 5px 0 0 5px;
  box-shadow: inset 0 0 5px #0000004d;
}
.health-bar:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: inset 0 0 10px #fff3;
  pointer-events: none;
}
.health-bar .label {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 0 5px #000;
  pointer-events: none;
}
#start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
.start-content {
  text-align: center;
  background-image: url(https://cdn.pixelsurf.ai/templates_asset_configurations/fighting_game_3d/images/startscreen_bg_startscreen.png);
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  width: 90%;
  height: 100%;
}
#start-button {
  font-family: Orbitron, sans-serif;
  font-size: 22px;
  padding: 14px 40px;
  color: #fff;
  background: linear-gradient(90deg, #ff7b00, #ff4b1f);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 20px #ff500099;
  transition: all 0.3s ease;
  position: relative;
  top: 75%;
}
#start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px #ff7800e6;
}
#start-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.move-btn,
.action-btn {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12px;
  text-align: center;
  line-height: 56px;
  margin: 5px;
  z-index: 1000;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.2s ease;
}
.move-btn:active,
.action-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}
#movement-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: grid;
  z-index: 1;
  grid-template-areas: ". up ." "left . right" ". down .";
  grid-gap: 10px;
  width: 220px;
  height: 220px;
}
#move-up {
  grid-area: up;
}
#move-left {
  grid-area: left;
}
#move-down {
  grid-area: down;
}
#move-right {
  grid-area: right;
}
#action-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1;
  display: grid;
  font-size: 15px;
  grid-template-columns: repeat(2, 70px);
  grid-template-rows: repeat(2, 70px);
  grid-gap: 10px;
}
#punch1 {
  grid-column: 1;
  grid-row: 1;
}
#punch2 {
  grid-column: 2;
  grid-row: 1;
}
#kick1 {
  grid-column: 1;
  grid-row: 2;
}
#kick2 {
  grid-column: 2;
  grid-row: 2;
}
#game-over-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#game-over-screen.active {
  opacity: 1;
  pointer-events: auto;
}
.game-over-content {
  background: rgba(20, 20, 20, 0.9);
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 40px #ff320099;
}
.game-over-content h1 {
  font-family: Orbitron, sans-serif;
  font-size: 48px;
  color: #ff4b1f;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255, 100, 0, 0.7);
}
.game-over-content p {
  font-size: 20px;
  color: #fff;
  margin-bottom: 30px;
}
#restart-button {
  font-family: Orbitron, sans-serif;
  font-size: 22px;
  padding: 12px 40px;
  color: #fff;
  background: linear-gradient(90deg, #ff7b00, #ff4b1f);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 20px #ff500099;
  transition: all 0.3s ease;
}
#restart-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px #ff7800e6;
}
