
/****************************************/
/* common styles used for v1 through v4 */
/****************************************/

body {
     font-family: Arial, Helvetica, sans-serif; 
     background: black;
     height: 100%;
     width: 100%;
     margin: 0;
     padding: 0;
     overflow: hidden;
     color: white;
}
/* canvas {
    display: block;
    width: 100%;
    height: 100%;
  } */

#stats { 
    border: 2px solid black; 
}
#controls { 
    width: 28em; float: left; padding: 1em; font-size: 0.7em; 
}
#controls th { 
    text-align: right; vertical-align: middle; }
#instructions { 
    clear: left; float: left; width: 17em; padding: 1em; border: 1px solid black; box-shadow: 0 0 5px black; 
}
#racer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border: none;
    z-index: 0;
}
#canvas {
  position: relative;
    display: block;
    width: 100%;
    height: 100%;
    /* background-color: #72D7EE; */
}

/* #racer {
    position: relative; z-index: 0; width: 640px; height: 480px; margin-left: 20em; border: 2px solid black; 
} */
/* #canvas { 
    position: absolute; z-index: 0; width: 100%; height: 100%; z-index: 0; background-color: #72D7EE; 
} */
#mute { 
    background-position:   0px 0px; width: 32px; height: 32px; background: url(images/mute.png); display: inline-block; cursor: pointer; position: absolute; margin-left: 20em; 
}
#mute.on { 
    background-position: -32px 0px; 
}

/**************************************************/
/* rudimentary heads up display (only used in v4) */
/**************************************************/

#hud {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: rgba(255, 0, 0, 0.4);
    padding: 10px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 1.2em;
    box-sizing: border-box;
  }
  
#hud .hud {
background-color: rgba(255, 255, 255, 0.6);
padding: 8px 16px;
border-radius: 8px;
font-weight: bold;
color: black;
min-width: 120px;
text-align: center;
transition: background-color 1s;
}
  
#hud #speed { 
    float: right; 
}
#hud #current_lap_time { 
    float: left;  
}
#hud #last_lap_time { 
    float: left; display: none;  
}
#hud #fast_lap_time { 
    display: block; width: 12em;  margin: 0 auto; text-align: center; transition-property: background-color; transition-duration: 2s; -webkit-transition-property: background-color; -webkit-transition-duration: 2s; 
}
#hud .value { 
    color: black; font-weight: bold; 
}
#hud .fastest { 
    background-color: rgba(255,215,0,0.5); 
}

/* #menu {
    background-image: url('images/MenuBG.png');
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
   
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    color: white;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    z-index: 10;
    padding-top: 100px !important;
  }
  
  #menu h1 {
    font-size: 64px;
    margin-bottom: 100px; 
    text-shadow: 2px 2px 5px #00ffff;
  }
  
  #menu button {
    font-size: 24px;
    padding: 12px 24px;
    margin: 10px;
    border: none;
    border-radius: 8px;
    background-color: #00ffff;
    color: black;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s;
  }
  
  #menu button:hover {
    transform: scale(1.05);
    background-color: #00ccdd;
  } */
  

  #menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/menu-bg.png'); /* Replace with your path */
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns content to bottom */
    align-items: center;
    gap: 20px;
    text-align: center;
    z-index: 999;
  }
  
  
  #menu h1 {
    font-size: 60px;
    color: white;
    text-shadow: 2px 2px 10px black;
    margin-bottom: 40px;
  }
  
  #menu button {
    margin-bottom: 100px;
    font-size: 24px;
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  #menu button:hover {
    background-color: rgba(54, 181, 245, 0.543);
  }
  

  #menu::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    /* background: radial-gradient(circle at center, #1a1a1a, #000); */
    animation: pulse 8s infinite alternate;
    z-index: -1;
  }
  
  @keyframes pulse {
    0% {
      transform: scale(1);
      opacity: 0.6;
    }
    100% {
      transform: scale(1.1);
      opacity: 0.3;
    }
  }

  
  #backToMenu {
    position: relative;
    top: 20px;
    background-color: #00ffff;
    color: black;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s, transform 0.2s ease;
  }
  #backToMenu:hover {
    background-color: #00ccdd;
    transform: scale(1.05);
  }
 
  #tutorialOverlay {
    z-index: 100; /* ensure it's on top of everything */
  }


  #fadeOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
  }
  





/* CSS */
.button-49,
.button-49:after {
  width: auto;
  height: auto;
  line-height: auto;
  font-size: 20px;
  font-family: 'Bebas Neue', sans-serif;
  background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
  border: 0;
  color: #fff;
  letter-spacing: 3px;
  box-shadow: 6px 0px 0px #00E6F6;
  outline: transparent;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button-49:after {
  --slice-0: inset(50% 50% 50% 50%);
  --slice-1: inset(80% -6px 0 0);
  --slice-2: inset(50% -6px 30% 0);
  --slice-3: inset(10% -6px 85% 0);
  --slice-4: inset(40% -6px 43% 0);
  --slice-5: inset(80% -6px 5% 0);
  
  content: 'Get Ready';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 3%, #00E6F6 3%, #00E6F6 5%, #FF013C 5%);
  text-shadow: -3px -3px 0px #F8F005, 3px 3px 0px #00E6F6;
  clip-path: var(--slice-0);
}

.button-49:hover:after {
  animation: 1s glitch;
  animation-timing-function: steps(2, end);
}

@keyframes glitch {
  0% {
    clip-path: var(--slice-1);
    transform: translate(-20px, -10px);
  }
  10% {
    clip-path: var(--slice-3);
    transform: translate(10px, 10px);
  }
  20% {
    clip-path: var(--slice-1);
    transform: translate(-10px, 10px);
  }
  30% {
    clip-path: var(--slice-3);
    transform: translate(0px, 5px);
  }
  40% {
    clip-path: var(--slice-2);
    transform: translate(-5px, 0px);
  }
  50% {
    clip-path: var(--slice-3);
    transform: translate(5px, 0px);
  }
  60% {
    clip-path: var(--slice-4);
    transform: translate(5px, 10px);
  }
  70% {
    clip-path: var(--slice-2);
    transform: translate(-10px, 10px);
  }
  80% {
    clip-path: var(--slice-5);
    transform: translate(20px, -10px);
  }
  90% {
    clip-path: var(--slice-1);
    transform: translate(-10px, 0px);
  }
  100% {
    clip-path: var(--slice-1);
    transform: translate(0);
  }
}

@media (min-width: 768px) {
  .button-49,
  .button-49:after {
    width: auto;
    height: auto;
    line-height: 88px;
  }
}