/* Title screen styling */
@font-face {
  font-family: 'NiseSegaSonic';
  src: url('/NiseSegaSonic.TTF') format('truetype');
}

#title-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #01579b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.title-container {
  text-align: center;
  padding: 2rem;
  position: relative;
  width: 100%;
  max-width: 800px;
}

.game-title {
  font-family: 'NiseSegaSonic', sans-serif;
  font-size: 4rem;
  color: #FFD54F;
  text-shadow: 
    0 0 10px rgba(255, 213, 79, 0.8),
    4px 4px 0 #1565c0;
  margin-bottom: 2rem;
  animation: title-bounce 3s ease-in-out infinite;
  letter-spacing: 2px;
  transform-origin: center;
}

@keyframes title-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.title-characters {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.title-sonic {
  height: 100px;
  animation: character-move 3s ease-in-out infinite;
  filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.3));
}

.title-tails {
  height: 80px;
  animation: character-move 3s ease-in-out infinite 0.5s;
  filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.3));
}

.title-knuckles {
  height: 90px;
  animation: character-move 3s ease-in-out infinite 1s;
  filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.3));
}

@keyframes character-move {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

#start-button {
  font-family: 'NiseSegaSonic', sans-serif;
  font-size: 1.5rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(to bottom, #f44336 0%, #d32f2f 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 
    0 6px 0 #b71c1c,
    0 8px 20px rgba(0,0,0,0.3);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
}

#start-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 9px 0 #b71c1c,
    0 12px 25px rgba(0,0,0,0.4);
}

#start-button:active {
  transform: translateY(3px);
  box-shadow: 
    0 3px 0 #b71c1c,
    0 5px 10px rgba(0,0,0,0.3);
}

#start-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center, 
    rgba(255,255,255,0.3) 0%, 
    transparent 70%
  );
  transform: rotate(45deg);
  animation: button-shine 5s infinite;
}

@keyframes button-shine {
  0% { transform: scale(0.5) rotate(0deg); opacity: 0; }
  25% { opacity: 1; }
  50% { transform: scale(1) rotate(360deg); opacity: 0; }
  100% { opacity: 0; }
}

.title-footer {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.title-rings {
  display: flex;
  gap: 1.5rem;
}

.title-ring {
  width: 40px;
  height: 40px;
  animation: ring-spin 3s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.title-ring:nth-child(2) {
  animation-delay: 0.5s;
}

.title-ring:nth-child(3) {
  animation-delay: 1s;
}

@keyframes ring-spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@media (max-width: 768px) {
  .game-title {
    font-size: 3rem;
  }
  
  .title-characters {
    gap: 1rem;
  }
  
  .title-sonic, .title-knuckles {
    height: 80px;
  }
  
  .title-tails {
    height: 60px;
  }
  
  #start-button {
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 2rem;
  }
  
  .title-characters {
    gap: 0.5rem;
  }
  
  .title-sonic, .title-knuckles {
    height: 60px;
  }
  
  .title-tails {
    height: 50px;
  }
  
  #start-button {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
  }
}

.title-credits {
  position: fixed;
  bottom: 0;
  left: 0;
  width: auto;
  max-width: 250px;
  transform: none;
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem;
  border-radius: 0 12px 0 0;
  text-align: left;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  margin: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.title-credits h3 {
  margin: 0 0 0.5rem 0;
  color: #FFD54F;
  font-size: 0.9rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.title-credits .credits-list {
  font-size: 0.8rem;
}

.title-credits .credits-list p {
  margin: 0.25rem 0;
  color: #ccc;
}

.title-credits .credits-list ul {
  list-style-type: none;
  padding: 0;
  margin: 0.25rem 0;
}

.title-credits .credits-list li {
  margin: 0.25rem 0;
  color: #aaa;
  font-size: 0.75rem;
}

@media (max-width: 480px) {
  .title-credits {
    display: none;
  }
}