/*Import font*/
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
	background-color: #1C0221;
	font-family: 'Press Start 2P', monospace;
	text-align: center;
	color: white;
	display: flex;
  	justify-content: center;
  	align-items: center;
}

/* .topnav {
  background-color:#E1DBFB; 
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.topnav .links {
	text-align: center;
}
.topnav .links a {
	padding: 7px;
	color: white;
} */

.gameWindow {
	animation-play-state: paused;
	position: relative;
	width: 90vw;
	height: 60vh;
	max-width: 900px;
	max-height: 450px;
	background-image: url('assets/image.png');
	margin: auto;
	margin-top: 50px;
	overflow: hidden;
	border-radius: 10px;
	box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
	animation: glow 2s infinite alternate;
	z-index: 10;
}



.arcadeFrame .arcadeTitle {
	padding-top: 20px;
	color: white;
  	font-size: 20px;
  	text-shadow: 2px 2px #ff0077;
  	margin-bottom: 20px;
  	text-align: center;
  	animation: flicker 1s infinite;
}

.startOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.startText {
  color: #ffdd00;
  font-size: 12px;
  text-shadow: 2px 2px #ff0000;
  animation: flicker 1s infinite;
  margin-bottom: 20px;
}

#startButton {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 10px 20px;
  background: gold;
  border: 2px solid #ffaa00;
  color: #000;
  cursor: pointer;
  box-shadow: 3px 3px 0 #ff8800;
  transition: all 0.1s steps(2, end);
  z-index: 20; /* Ensure it is above other elements */
  pointer-events: auto; /* Ensure it can be clicked */
}
.meteor {
  position: absolute;
  bottom: 50px; /* Right above the ground */
  width: 30px;
  height: 30px;
  z-index: 6;
  image-rendering: pixelated;
}

#startButton:hover {
  background: #ffaa00;
  box-shadow: 4px 4px 0 #ff7700;
}

.lightSpeedEffect {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(circle at center, #000 30%, #02030f 100%);
}

.star {
  position: absolute;
  width: 2px;
  height: 25px;
  background: white;
  opacity: 0;
  transform-origin: top center;
  filter: drop-shadow(0 0 6px #00ffff);
  animation: starBurst 0.7s linear forwards;
}

@keyframes starBurst {
  0% {
    opacity: 0.2;
    transform: translate(0, 0) scaleY(0.3);
  }
  30% {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scaleY(1.3);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx) * 8), calc(var(--ty) * 8)) scaleY(2.5);
  }
}

.flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  z-index: 15;
  animation: flashWhite 0.4s ease-out forwards;
}

@keyframes flashWhite {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes flicker {
  0%   { opacity: 1; }
  5%   { opacity: 0.85; }
  10%  { opacity: 0.9; }
  15%  { opacity: 0.95; }
  20%  { opacity: 0.8; }
  25%  { opacity: 0.9; }
  30%  { opacity: 0.88; }
  35%  { opacity: 0.92; }
  40%  { opacity: 0.86; }
  45%  { opacity: 0.94; }
  50%  { opacity: 1; }
  55%  { opacity: 0.87; }
  60%  { opacity: 0.93; }
  65%  { opacity: 0.9; }
  70%  { opacity: 0.95; }
  75%  { opacity: 0.85; }
  80%  { opacity: 0.92; }
  85%  { opacity: 0.9; }
  90%  { opacity: 0.88; }
  95%  { opacity: 0.93; }
  100% { opacity: 1; }
}

@keyframes glow {
   0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% {
    box-shadow: 0 0 calc(30px + var(--rand1,0px)) #00ffea;
  }
}

.gameWindow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: 
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 1px,
      rgba(0, 0, 0, 0.05) 2px,
      rgba(0, 0, 0, 0.05) 3px
    );
  mix-blend-mode: overlay;
  opacity: 0.3;
}

#playerImg {
	position: absolute;
	bottom: 0;
	width: 25vw;
	height: 50vh;
	max-width: 50px;
	max-height: 100px;
	left:80px;
	image-rendering: pixelated;
	visibility: hidden;
	z-index: 7;
}

.startOverlay {
  pointer-events: auto;
}

#startButton {
  pointer-events: auto;
}

#deathOverlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  color: red;
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 999;
  animation: fadeIn 0.5s ease forwards;
}

#deathOverlay h1 {
  font-size: 36px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px red;
}

#deathOverlay button {
  background: none;
  border: 2px solid red;
  color: red;
  font-family: 'Press Start 2P', monospace;
  padding: 10px 20px;
  cursor: pointer;
  transition: 0.3s;
}

#deathOverlay button:hover {
  background: red;
  color: black;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


#bootScreenOverlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #000 10%, #050a1f 100%);
  opacity: 1;
  z-index: 50;
  pointer-events: none;
  animation: crtBoot 3s ease-out forwards;
}

@keyframes crtBoot {
  0% {
    opacity: 1;
    filter: brightness(0.1) contrast(1.2) saturate(0.8);
  }
  10% {
    opacity: 0.9;
    filter: brightness(0.2);
  }
  25% {
    opacity: 0.7;
    filter: brightness(0.4);
  }
  40% {
    opacity: 0.3;
    filter: brightness(0.8);
  }
  50% {
    opacity: 0.8;
    filter: brightness(0.5);
  }
  60% {
    opacity: 0.4;
    filter: brightness(0.9);
  }
  70% {
    opacity: 0.2;
  }
  80% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    opacity: 0;
    filter: brightness(1);
    visibility: hidden;
  }
}

.crtScanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0px,
    rgba(0,0,0,0.03) 2px
  );
  mix-blend-mode: overlay;
  animation: scanlineFlicker 2.5s linear forwards;
}

@keyframes scanlineFlicker {
  0%, 30%, 60%, 90%, 100% { opacity: 0.3; }
  20%, 50%, 80% { opacity: 0.6; }
}

#kittyImg {
  position: absolute;
  right: 10%; /* Position the kitty on the right */
  bottom: 0; /* Match the vertical position of the player */
  width: 50px; /* Adjust size */
  height: 70px;
  z-index: 6;
}

.kitty {
  position: absolute;
  bottom: 0;
  width: 50px;
  height: 70px;
  z-index: 6;
}

.ground {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50px;
  background: url('assets/grounds.png') repeat-x;
  background-size: cover;
  z-index: 5;
}

.skyback {
  position: absolute;
  top: 0;
  width: 100%;
  height: 50px;
  background: url('assets/SKY_BACK.png') repeat-x;
  background-size: cover;
  z-index: 6;
}

.startOverlay {
  display: none;         
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;         
  transition: opacity 2s ease;
}

.fade-out {
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.gameWindow video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

#soundOverlay {
    display: flex;
    position: absolute;
    inset: 0;
    background: black;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    pointer-events: auto;
}
#enableSoundButton {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    padding: 15px 30px;
    background: gold;
    border: 2px solid #ffaa00;
    color: #000;
    cursor: pointer;
    box-shadow: 3px 3px 0 #ff8800;
    transition: all 0.1s steps(2, end);
}

#enableSoundButton:hover {
    background: #ffaa00;
    box-shadow: 4px 4px 0 #ff7700;
}

#blackOverlay {
    display: block; 
    position: absolute;
    inset: 0;
    opacity: 1;
    background: black;
    z-index: 1;
    transition: opacity 1s ease;
}


#soundOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#blackOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}


#introVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 9999;         
    pointer-events: none;   
    opacity: 1;
    transition: opacity 2s ease;
}

/* Fade out video */
#introVideo.fade-out {
    opacity: 0;
}

/* Start overlay */
#startOverlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 1s ease;
}
#introVideo.fade-out {
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
}

#startOverlay.visible {
    opacity: 1;
}


@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}
