@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* ------------------ BASE ------------------ */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  background: black;
  box-sizing: border-box;
}

/* ------------------ CANVAS : Fond Matrix ------------------ */
canvas#matrix {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

/* ------------------ CONTENU ------------------ */
.content {
  position: relative;
  z-index: 1;
  color: #00ff41;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  gap: 20px;
}

/* ------------------ TITRE ------------------ */
h1 {
  font-family: 'VT323', monospace;
  font-size: 3rem;
  color: #00ff41;
  text-shadow: 0 0 4px #00ff41;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #00ff41;
  width: 0;
  margin: 0 auto;
  text-align: center;
  animation:
    typing 3s steps(60, end) forwards,
    blink-caret 0.75s step-end infinite;
}

/* Animation typing */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #00ff41; }
}

/* ------------------ CHAMP INPUT ------------------ */
input[type="text"] {
  background-color: #000;
  color: #00ff41;
  border: 1px solid #00ff41;
  padding: 12px;
  font-size: 1.1rem;
  width: 90%;
  max-width: 350px;
  border-radius: 5px;
  outline: none;
  caret-color: #00ff41;
  box-shadow: 0 0 15px #00ff41;
  transition: box-shadow 0.3s ease-in-out;
}

input[type="text"]:focus {
  background-color: #010;
  animation: pulse 1s infinite alternate;
  box-shadow: 0 0 25px #00ff41, inset 0 0 5px #00ff41;
}

@keyframes pulse {
  from { box-shadow: 0 0 10px #00ff41, inset 0 0 2px #00ff41; }
  to   { box-shadow: 0 0 25px #00ff41, inset 0 0 8px #00ff41; }
}

input[type="text"]::placeholder {
  color: #00ff41a0;
}

/* ------------------ BOUTON ------------------ */
button {
  margin-top: 15px;
  padding: 14px 28px;
  background-color: #000;
  border: 1px solid #00ff41;
  color: #00ff41;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 0 15px #00ff41;
  animation: bounce 2s infinite;
  transition: all 0.3s ease-in-out;
}

button:hover {
  background-color: #002d00;
  box-shadow: 0 0 25px #00ff41;
  transform: scale(1.05);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ------------------ MESSAGE D’ERREUR ------------------ */
#message {
  margin-top: 15px;
  font-size: 1rem;
  color: red;
  text-shadow: 0 0 5px red;
}

/* ------------------ TRANSITION ------------------ */
#transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #00ff41;
  font-family: 'Courier New', Courier, monospace;
}

#hackText {
  font-size: 2.5rem;
  text-align: center;
  text-shadow: 0 0 15px #00ff41;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ------------------ UTILITAIRES ------------------ */
.hidden {
  display: none !important;
}

.blink {
  animation: blink 0.4s step-start 5;
}

/* ------------------ RESPONSIVE MOBILE ------------------ */
@media screen and (max-width: 500px) {
  h1 {
    font-size: 2rem;
    white-space: normal;
    width: auto;
    animation: none;
    border-right: none;
    text-shadow: 0 0 4px #00ff41;
  }

  #hackText {
    font-size: 1.8rem;
  }

  button {
    width: 90%;
    max-width: 300px;
  }
}
