/* === BASE: Reset e Fonte Principal === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #000000;
  color: #CCCCCC;
  font-family: monospace;
  padding: 20px;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

/* === TERMINAL (PORTFÓLIO) === */
#terminal {
  width: 500px;
  display: none;
}

.output {
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.command {
  color: #00FF00;
}

.prompt {
  display: flex;
}

input {
  background: none;
  border: none;
  color: #fff;
  font-family: monospace;
  outline: none;
  flex: 1;
}

.btn {
  display: inline-block;
  margin: 2px;
  padding: 3px 6px;
  background-color: #000000;
  border: 1px solid #00FF00;
  cursor: pointer;
}

.typing {
  display: inline;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { border-right-color: transparent; }
  50% { border-right-color: #FFFFFF; }
}

/* === CANVAS MATRIX === */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
}

/* === HACKING SCENE (Overlay de Texto Binário Aleatório) === */
#hacking-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  z-index: 1;
  pointer-events: none;
}

/* === ACCESS GRANTED SCREEN === */
#access-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  color: #0f0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 2;
  font-size: 1.5rem;
  cursor: pointer;
  transition: opacity 1s ease-in-out;
}

/* === JOGO DO DINOSSAURO === */
#container {
  display: none;
  width: 700px;
  height: 400px;
  position: relative;
  overflow: hidden;
  font-family: monospace;
  margin-top: -520px;
  margin-left: 800px;
}

#container #dino {
  width: 70px;
  height: 70px;
  position: absolute;
  bottom: 28px;
  left: 20px;
}

#container #dino img {
  width: 70px;
  height: 70px;
}

.dinoActive {
  animation: animateDino 0.5s linear infinite;
}

@keyframes animateDino {
  0%, 100% { bottom: 28px; }
  45%, 55% { bottom: 160px; }
}

#container #block {
  width: 125px;
  height: 80px;
  position: absolute;
  bottom: 20px;
  right: -20px;
}

#container #block img {
  width: 125px;
  height: 80px;
}

.blockActive {
  animation: animateBlock 1s linear infinite;
}

@keyframes animateBlock {
  0% { right: -125px; }
  100% { right: 100%; }
}

#container #road {
  width: 1200px;
  height: 30px;
  position: absolute;
  bottom: 0;
}

#container #road img {
  width: 2000px;
  height: 30px;
  position: absolute;
  left: 0;
  animation: none;
}

@keyframes animateRoad {
  0% { left: 0; }
  100% { left: -800px; }
}

#container #cloud {
  width: 1200px;
  height: 80px;
  border-radius: 40px;
  position: absolute;
  top: 30px;
}

#container #cloud img {
  width: 2000px;
  height: 80px;
  position: absolute;
  left: -2000px;
  animation: none;
}

@keyframes animateCloud {
  0% { left: -1800px; }
  100% { left: 100%; }
}

#score {
  position: absolute;
  top: 20px;
  right: 0;
  color: #fff;
  font-family: monospace;
  font-weight: bold;
}

#controls {
  display: flex;
  flex-direction: column;
}

#controls p {
  display: flex;
  align-items: center;
  gap: 10px;
}

#gameOver {
  display: none;
  width: 462px;
  height: 90px;
  position: absolute;
  font-size: 70px;
  left: calc(50% - 231px);
  top: 10%;
  text-align: center;
  color: #fff;
}

#gameOver p {
  font-size: 20px;
  text-align: center;
}

/* === RESPONSIVIDADE === */
@media screen and (max-width: 1220px) {
  body {
    flex-direction: column;
    align-items: center;
  }

  #container {
    width: 90%;
    margin-left: 0;
  }

  #terminal {
    width: 100%;
    max-width: 900px;
  }
}

@media screen and (max-width: 820px) {
  #container {
    width: 100%;
  }

  #terminal {
    max-width: 100%;
  }
}
