@font-face {
  font-family: 'CustomFont';
  src: url('../assets/font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom left, #FCAD72, #736FA3);
  color: white;
  font-family: 'CustomFont', Arial, sans-serif;
  text-align: center;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* Splash Screen */
#splash-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
}

.logo, .animated-text {
  opacity: 0;
  animation: fadeIn 15s ease forwards;
}

.logo {
  width: 450px;
  height: auto;
  margin-bottom: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.animated-text {
  margin-top: 0;
  font-size: 8em;
}

/* General screen styling */
#menu-screen,
#name-input-screen,
#multiplayer-screen,
#leaderboard-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  opacity: 0;
}

#menu-screen.fade-in,
#name-input-screen.fade-in,
#multiplayer-screen.fade-in,
#leaderboard-screen.fade-in {
  opacity: 1;
  display: flex;
}

.snake-logo {
  width: 300px;
  height: auto;
  margin-bottom: 40px;
  animation: fadeIn 0.8s ease forwards;
}

/* Leaderboard Styles */
#leaderboard-list {
  width: 400px;
  margin: 0 auto;
  padding: 20px 0 40px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 16px;
  min-height: 120px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.08);
}

.leaderboard-entry {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2em;
  padding: 12px 20px;
  margin: 5px 10px;
  border-radius: 8px;
  font-family: 'CustomFont', Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
  color: white !important; /* Stellt sicher, dass der Text weiß und sichtbar ist */
}

.leaderboard-entry:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

/* Fügt Text-Schatten hinzu für bessere Lesbarkeit */
.leaderboard-entry div {
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.leaderboard-rank {
  width: 40px;
  text-align: left;
}
.leaderboard-name {
  flex: 1;
  text-align: left;
  padding-left: 10px;
}
.leaderboard-score {
  width: 60px;
  text-align: right;
}
.leaderboard-date {
  width: 120px;
  text-align: right;
  font-size: 0.9em;
  opacity: 0.7;
}

/* Leaderboard Container Styles */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  width: 80%;
  max-width: 600px;
  margin: 0 auto;
}

/* Multiplayer Styles */
.input-section {
  margin-bottom: 20px;
  width: 100%;
  max-width: 300px;
}

.input-section input[type="text"] {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  text-align: center;
  transition: all 0.3s;
}

.input-section input[type="text"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
}
