:root {
  --bg: #0e1014;
  --road: #1b1f2a;
  --lane: #2a3142;
  --text: #e8ecf1;
  --accent: #00d1b2;
  --danger: #ff4d4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(1200px 800px at 50% 0%, #141824 0%, var(--bg) 70%);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* The game occupies the full screen. The playable area (9:16) is computed in JS like shoot-runner */
#game-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background: linear-gradient(#111521, #0c0e14);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(#101420, #0b0d13);
  image-rendering: pixelated;
  outline: none;
}

/* HUD */
#hud {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Jersey 20', sans-serif;
  padding: .6rem .9rem;
  pointer-events: none;
}

#hud .hud-left,
#hud .hud-right {
  display: flex;
  gap: .6rem;
}

/* Overlay */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  place-content: center;
  place-items: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .0), rgba(0, 0, 0, .65) 60%, rgba(0, 0, 0, .85));
  backdrop-filter: blur(2px);
}

#overlay.hidden {
  display: none;
}


#overlay h1 {
  margin: .2rem 0 .4rem;
  font-size: clamp(1.3rem, 2vw + 3rem, 4rem);
}

#overlay p {
  margin: 0;
  opacity: .85;
  font-size: clamp(1.3rem, 2vw + 1rem, 2rem);
}

/* Help hint */
#help {
  position: absolute;
  inset: auto 0 .4rem 0;
  text-align: center;
  font-size: .9rem;
  opacity: .85;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

.fade {
  animation: fadeInOut 3.6s ease-in-out infinite;
}

@keyframes fadeInOut {

  0%,
  100% {
    opacity: .0;
  }

  15%,
  60% {
    opacity: .9;
  }
}

/* Utility badges (unused but handy) */
.badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: .8rem;
}

.invulnerable {
  filter: drop-shadow(0 0 6px rgba(0, 209, 178, .9));
}

/* Loading screen (modeled after shoot-runner) */
#loadingScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  z-index: 9999;
}

#loadingProgress {
  width: min(60vw, 420px);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

#loadingProgressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4da0ff, #1d77ff);
  transition: width .2s ease;
}

#loadingText {
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  letter-spacing: .4px;
}

/* Utilitários de texto estilo tower-defense */
.text-stroke {
  -webkit-text-stroke: var(--stroke-width, 6px) #000;
  paint-order: stroke fill;
}

.text-stroke-xl {
  --stroke-width: 6px;
}

.title-text {
  color: #FFF;
  text-align: center;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  -webkit-text-stroke: var(--stroke-width, 6px) #000;
  -webkit-text-stroke-width: 8px;
  -webkit-text-stroke-color: #000;
  font-family: 'Jersey 20', sans-serif;
  font-size: 40px;
  font-style: normal;
  line-height: normal;
  margin-bottom: 2rem;
  font-weight: 700;
}

.title-text.huge {
  font-size: 90px;
}

/* Backdrop bars behind "RACING" on start screen */
#start-screen .title-wrap .title-text {
  position: relative;
  z-index: 1;
}

#start-screen .title-wrap .title-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: rgba(0, 0, 0, 0.33);
  pointer-events: none;
}

#start-screen .title-wrap .title-bar-top {
  top: 0;
  height: 70px;
}

#start-screen .title-wrap .title-bar-bottom {
  bottom: 0;
  height: 70px;
}

.button {
  width: 256px;
  height: 65px;
  flex-shrink: 0;
  padding: 16px 40px;
  border-radius: 8px;
  border: 3px solid #000;
  background: #FFB450;
  color: #593817;
  font-family: 'Jersey 20', sans-serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  cursor: pointer;
  transition: all 0.1s ease;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25), 5px 0 0 #FFCA84 inset, 0 -6px 0 #C26314 inset, 0 5px 0 #FFCA84 inset, -4px 0 0 #C26314 inset;
}

.button:hover,
.button:active {
  transform: translateY(-2px);
}

/* Tela de início e fim do jogo - car-runner */
.start-screen-text,
.end-game-text {
  color: #FFF;
  text-align: center;
  text-shadow: 0 3.728px 0 #000;
  -webkit-text-stroke-width: 2.8px;
  -webkit-text-stroke-color: #000;
  font-family: "Jersey 20";
  font-size: 37.278px;
  font-style: normal;
  font-weight: 400;
  line-height: 100%;
  /* 37.278px */
}
