/* Import cyberpunk fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

/* Reset and base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #001f4d; /* dark blue */
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  color: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align:center;
}

/* Container for whole game */
#game-container {
  max-width: 480px;
  margin: 20px auto;
  padding: 15px;
}

/* Header styles */
header {
  text-align: center;
  margin-bottom: 20px;
}
#cat-image {
  display: block;
  margin: 0 auto 15px auto;
  width: 250px;
  position: relative;
  left: -9px; /* moves image 20px to the left */
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,255,255,0.4);
}


#player-name {
  font-weight: 900;
  font-size: 1.6rem;
  color: #8e00ff; /* bright purple */
  margin-right: 12px;
}

#high-score {
  font-weight: 900;
  font-size: 1.6rem;
  color: #00c8ff; /* neon blue */
  display: inline-block;
}

#name-input { 
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid #8e00ff;
  border-radius: 6px;
  background-color: #00001a;
  color: #8ef;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  outline: none;
  box-shadow: 0 0 8px #8e00ff;
  width: 100%;
  max-width: 300px;
  margin: 10px auto;
  display: block;
  text-align: center;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

#name-input:focus {
  background-color: #150033;
  box-shadow: 0 0 12px #b366ff, 0 0 20px #8e00ff;
}

#startButton {
  display: block;
  text-align: center;
  margin: 20px auto 0 auto; /* top auto bottom auto = centered horizontally */
  background-color: #3a0ca3;
  color: #8ef;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: bold;
  border: 2px solid #8ef;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 10px #8ef;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
}

#startButton:hover {
  background-color: #5f3dc4;
  box-shadow: 0 0 15px #aef;
}

#startButton:active {
  background-color: #2a0688;
  box-shadow: 0 0 5px #6ef inset;
}

/* Password banner container */
#password-banner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 20px 0 30px 0;
  padding: 5px 10px;
  max-width: 110vw;
  overflow-x: hidden;
}

/* Password character cubes */
.password-char,
.password-wrong {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 23px;
  font-weight: 900;
  font-family: 'Share Tech Mono', monospace;
  user-select: none;
  min-width: 20px;
  text-transform: uppercase;
}

/* Correct guess cube */
.password-char {
  background: #2a005d;
  box-shadow: 0 0 6px #8e00ff, 0 0 12px #b366ff;
  color: #00c8ff;
  border: 1.5px solid #b366ff;
}

/* Wrong guess cube (X) */
.password-wrong {
  background: #330000;
  box-shadow: 0 0 6px #ff0000, 0 0 12px #ff4d4d;
  color: #ff0000;
  border: 1.5px solid #ff4d4d;
}

/* Question container */
#question {
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
}

/* Choices container: vertical list with boxes */
.choice-btn {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  background-color: #150033;
  border: 2px solid #8e00ff;
  border-radius: 6px;
  color: #8e00ff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
}

.choice-btn:hover:not(:disabled) {
  background-color: #8e00ff;
  color: #001f4d;
}

.choice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Start screen and game container toggling */
#start-screen, #game-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

/* Timer */
#timer {
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 10px;
  color: #00c8ff;
  text-align: center;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
}

/* Animations for feedback */
body.correct {
  animation: correctFlash 0.5s ease;
}

body.wrong {
  animation: wrongFlash 0.5s ease;
}

@keyframes correctFlash {
  0%, 100% { background-color: #001f4d; }
  50% { background-color: #0033ff; }
}

@keyframes wrongFlash {
  0%, 100% { background-color: #001f4d; }
  50% { background-color: #990000; }
}

/* Game over screen */
#end-screen {
  text-align: center;
  color: #00c8ff;
  font-size: 1.5rem;
  font-weight: 900;
  margin-top: 50px;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
}


/* Responsive tweaks */
@media (max-width: 500px) {
  #game-container, #start-screen {
    padding: 11px;
    max-width: 100vw;
  }

  .choice-btn {
    font-size: 1rem;
    padding: 9px;
  }

  #player-name, #high-score {
    font-size: 1.2rem;
  }

  #password-banner {
    gap: 5px;
  }

  .password-char, .password-wrong {
    width: 24px;
    height: 24px;
    font-size: 21px;
    min-width: 20px;
  }
}


/* Fix for full password reveal on end screen */
#full-password-display .password-char {
  width: 30px;
  height: 30px;
  font-size: 20px;
  margin: 8px 4px 0 4px; /* 8px space at top of each square */
  line-height: 32px;
  border-radius: 4px;
  border: 1px solid #ccc;
  display: inline-block;
  text-align: center;
  user-select: none;
  background-color: black;
  color: #7FFF00;
  font-family: 'Share Tech Mono', monospace;
}

#full-password-display .password-char,
#full-password-display .password-wrong {
  width: 30px;
  height: 40px;
  min-width: 30px;
  font-size: 24px;
  margin: 8px 4px 0 4px; /* 8px space at top of each square */

}
