body {
  background-color: #0f0f10;
  color: #fff;
  font-family: monospace;
  margin: 0;
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.2) blur(2px);
}

.hidden {
  display: none;
}

input {
  opacity: 0;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  font-size: 1px;
  z-index: -1;
}

.navbar {
  background-color: #1c1c1e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #333;
  gap: 20px;
  flex-wrap: wrap;
}

.navbar button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1rem;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.navbar button:hover,
.navbar button.active {
  color: #ffa726;
  transform: translateY(-2px);
}

.navbar button:active {
  transform: translateY(1px);
  color: #ffb74d;
}

.navbar-logo {
  color: #ffa726;
  text-decoration: none;
  font-size: 24px;
  font-weight: bold;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 20px;
}

#word-container {
  font-size: 2rem;
  line-height: 2.5rem;
  max-width: 800px;
  width: 100%;
  height: 14.5rem;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 20px;
  box-sizing: border-box;
  animation: fadeIn 0.6s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: justify;
  word-break: break-word;
  hyphens: auto;
}

#word-container:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 30px rgba(255, 167, 38, 0.2);
}

#word-inner {
  transition: transform 0.2s ease;
  white-space: normal;
  word-break: break-word;
  line-height: 2.5rem;
  text-align: justify;
  width: 100%;
  hyphens: auto;
}

#word-inner span {
  display: inline;
  transition: all 0.1s ease;
  word-break: break-word;
}

#word-inner .line {
  display: block;
  height: 2.5rem;
  text-align: justify;
}

.correct {
  color: #4caf50;
  transform: scale(1.1);
}

.incorrect {
  color: #f44336;
  transform: scale(1.1);
}

.active {
  border-bottom: 2px solid #ffa726;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% {
    border-color: transparent;
  }
  50% {
    border-color: #ffa726;
  }
}

#wpm-display {
  margin-top: 20px;
  font-size: 1.5rem;
  color: #ffa726;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.card {
  background-color: #1e1e22;
  border-radius: 12px;
  padding: 30px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

#retryBtn {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #ffa726;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: #000;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.2s;
}

#retryBtn:hover {
  background-color: #000000;
  color: white;
  transform: translateY(-2px);
}

#retryBtn:active {
  background-color: #e68a00;
  transform: translateY(1px);
}

#leaderboard-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#leaderboard-modal.show {
  display: flex;
}

#leaderboard-modal .modal-content {
  background-color: #1e1e22;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  animation: fadeIn 0.6s ease-out;
}

#leaderboard-modal table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

#leaderboard-modal th, #leaderboard-modal td {
  padding: 10px;
  border-bottom: 1px solid #444;
}

#leaderboard-modal th {
  background-color: #222;
  color: #ffa726;
}

#leaderboard-modal button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #ffa726;
  border: none;
  color: #000;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.2s;
}

#leaderboard-modal button:hover {
  background-color: #ff9800;
  transform: scale(1.05);
}

#leaderboard-modal tbody tr:nth-child(1) td:first-child::before {
  content: "🥇 ";
}

#leaderboard-modal tbody tr:nth-child(2) td:first-child::before {
  content: "🥈 ";
}

#leaderboard-modal tbody tr:nth-child(3) td:first-child::before {
  content: "🥉 ";
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-switcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: 800px;
  margin-bottom: 10px;
  padding: 0 10px;
  color: #ffa726;
  font-weight: bold;
}

.language-switcher select {
  background-color: #1e1e22;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: monospace;
  font-size: 1rem;
  margin-left: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-switcher select:hover {
  background-color: #2c2c2e;
}
