@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');

#credits-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #050505; 
  color: #ccc;
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#credits-screen.hidden {
  display: none;
}

.credits-container {
  width: 90%;
  height: 70%;
  max-width: 700px;
  overflow: hidden;
  position: relative;
  border: 1px solid #333;
  background: #111;
  box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.8);
}

.credits-container::before,
.credits-container::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to bottom, #111, transparent);
  pointer-events: none;
  z-index: 2;
}

.credits-container::before {
  top: 0;
}

.credits-container::after {
  bottom: 0;
  background: linear-gradient(to top, #111, transparent);
}

.credits-scroller {
  position: absolute;
  /* top: 100%; <-- This was removed */
  left: 50%;
  /* NEW: Start the scroller at the bottom of the 70vh container */
  transform: translateX(-50%) translateY(70vh); 
  width: 100%;
  text-align: center;
  /* UPDATED: Increased duration to 60s. Adjust this to change speed. */
  animation: scroll 60s linear infinite; 
}

.credits-title {
  font-family: 'Creepster', cursive;
  font-size: 4em;
  color: #900;
  text-shadow: 2px 2px 5px #000;
  margin-bottom: 50px;
}

.credits-section {
  margin-bottom: 45px;
}

.credits-section h2 {
  color: #888;
  font-size: 1.5em;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.credits-section p {
  margin: 8px 0;
  font-size: 1.1em;
  line-height: 1.6;
}

.credits-section .role {
  display: block;
  font-size: 0.9em;
  color: #666;
  font-weight: bold;
}

.credits-section a {
  color: #a04040;
  text-decoration: none;
  transition: all 0.2s ease;
}

.credits-section a:hover {
  color: #ff6666;
  text-shadow: 0 0 5px #ff0000;
}

.asset-links {
  font-size: 0.9em;
  color: #777;
}

.sound-list {
  list-style: none;
  padding: 0;
  margin: 15px auto 0 auto;
  max-width: 80%;
  text-align: left;
}

.sound-list li {
  margin-bottom: 10px;
  font-size: 1em;
  color: #999;
}

.sound-list li span {
  font-weight: bold;
  color: #ccc;
}

.powered-by {
  font-size: 1.5em !important;
  font-weight: bold;
  color: #777;
}

/* UPDATED KEYFRAMES */
@keyframes scroll {
  0% {
    /* Start at the bottom of the container */
    transform: translateX(-50%) translateY(70vh);
  }
  100% {
    /* End after moving up by 100% OF ITS OWN HEIGHT */
    transform: translateX(-50%) translateY(-100%);
  }
}

#close-credits-btn {
  margin-top: 25px;
  border-color: #555;
}

#close-credits-btn:hover {
    border-color: #900;
    background: #900;
    box-shadow: 0 0 15px #ff0000;
}