:root {
  --primary-color: #1eb53a; /* Burundi Green - main actions */
  --secondary-color: #ce1126; /* Burundi Red - secondary actions */
  --background-color: #f8f8f8; /* Light gray background */
  --card-background: #ffffff; /* White from flag */
  --text-primary: #111827; /* Near black for text */
  --text-secondary: #374151; /* Dark gray for secondary text */
  --border-color: #e5e7eb; /* Light gray borders */
  --success-color: #1eb53a; /* Burundi Green for success */
  --error-color: #ce1126; /* Burundi Red for errors */
  --timer-warning: #f59e0b; /* Amber for warning - less aggressive */
  --button-hover: #198b2e; /* Darker green for hover */
  --secondary-button-hover: #b31022; /* Darker red for secondary hover */
  --word-display-bg: #ffffff; /* White background for word display */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Game Container Styles */
#game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

#logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

#logo {
  max-width: 150px;
  height: auto;
}

.game-header {
  text-align: center;
  margin-bottom: 1rem;
}

.today-counter {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.countdown-container {
  text-align: center;
  margin: 1rem 0;
  font-weight: 500;
  color: var(--text-secondary);
}

.word-display {
  background-color: var(--word-display-bg);
  padding: 1.5rem;
  border-radius: 1.5rem;
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(30, 181, 58, 0.1);
  letter-spacing: 0.25rem;
  color: var(--primary-color);
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.word-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  transition: all 0.3s ease;
  background-color: var(--word-display-bg);
  color: var(--text-primary);
}

.word-input:focus {
  outline: none;
  border-color: var(--border-color);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

.word-input.success {
  border-color: var(--success-color);
  box-shadow: 0 0 0 4px rgba(30, 181, 58, 0.1);
}

.word-input.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 4px rgba(206, 17, 38, 0.1);
}

.button-group {
  display: flex;
  gap: 1rem;
}

.game-button {
  flex: 1;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.game-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(30, 181, 58, 0.2);
}

.game-button.primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 6px rgba(30, 181, 58, 0.2);
}

.game-button.secondary {
  background-color: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 6px rgba(206, 17, 38, 0.2);
}

.game-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(206, 17, 38, 0.2);
}

.game-button.secondary:hover {
  background-color: var(--secondary-button-hover);
}

.results-container {
  margin: 2rem 0;
  text-align: center;
  font-weight: 500;
}

.correct-words {
  background-color: var(--card-background);
  border-radius: 1rem;
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-height: 30vh;
  overflow-y: auto;
}

#correct-words-list {
  list-style: decimal;
  padding-left: 2rem;
}

#correct-words-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

#correct-words-list li:last-child {
  border-bottom: none;
}

/* Leaderboard Styles */
.leaderboard-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.leaderboard-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-size: 1.8rem;
}

.leaderboard-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--card-background);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
  background: var(--primary-color);
  color: white;
}

.leaderboard-content {
  margin-bottom: 3rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-background);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.top-1 {
  background: linear-gradient(45deg, #ffd700, #ffc107);
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.top-2 {
  background: linear-gradient(45deg, #c0c0c0, #e0e0e0);
  box-shadow: 0 4px 8px rgba(192, 192, 192, 0.3);
}

.top-3 {
  background: linear-gradient(45deg, #cd7f32, #d4a676);
  box-shadow: 0 4px 8px rgba(205, 127, 50, 0.3);
}

.top-1 .rank,
.top-1 .location,
.top-1 .stats {
  color: #000;
}

.top-2 .rank,
.top-2 .location,
.top-2 .stats,
.top-3 .rank,
.top-3 .location,
.top-3 .stats {
  color: #000;
}

.top-1 .stats span,
.top-2 .stats span,
.top-3 .stats span {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.leaderboard-item:hover {
  transform: translateY(-2px);
}

.player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rank {
  font-size: 1.5rem;
  font-weight: 600;
  margin-right: 0.75rem;
  min-width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.location img {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  margin-right: 0.3rem;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  align-items: center;
}

.stats span {
  background: var(--background-color);
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stats .streak i {
  margin-right: 0.2rem;
}

.stats .streak {
  color: inherit;
}

/* Personal Stats Section */
.personal-stats {
  background: var(--card-background);
  border-radius: 1rem;
  padding: 1rem;
  margin-top: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.personal-stats h2 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
}

.day-stats {
  background: var(--card-background);
  border-radius: 0.8rem;
  padding: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stats-date {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  text-align: center;
}

.stats-numbers {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  padding: 0.5rem;
  background: var(--background-color);
  border-radius: 0.5rem;
}

.stats-words {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
  padding: 0.5rem;
  background: var(--background-color);
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.stats-numbers div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-numbers i {
  font-size: 1rem;
}

.error-message {
  text-align: center;
  padding: 2rem;
  color: var(--error-color);
  background: var(--card-background);
  border-radius: 0.8rem;
  margin: 2rem 0;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1rem;
}

.back-button:hover {
  color: var(--button-hover);
}

#footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary);
}

#footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .word-display {
    font-size: 1.5rem;
    padding: 1.5rem;
  }

  .game-button {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .leaderboard-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .table-container {
    padding: 1rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .day-stats {
    padding: 1.5rem;
  }

  .stats-date {
    font-size: 1.2rem;
  }

  .stats-numbers {
    font-size: 1rem;
    gap: 2rem;
  }
}

/* Add these new animation-related styles to your existing CSS file */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes wordAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

.word-fade-in {
  animation: fadeIn 0.3s ease-in;
}

.word-fade-out {
  animation: fadeOut 0.3s ease-out;
}

.error-shake {
  animation: shake 0.3s ease-in-out;
  border-color: var(--error-color) !important;
}

.correct-answer {
  color: var(--success-color);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.word-item-appear {
  animation: wordAppear 0.3s ease-out;
}

.game-end-reveal {
  animation: fadeIn 0.5s ease-in;
  color: var(--primary-color);
}

.results-appear {
  animation: wordAppear 0.5s ease-out;
}

.timer-normal {
  color: var(--success-color);
  font-size: 1.75rem;
  transition: color 0.3s ease;
}

.timer-warning {
  color: var(--timer-warning);
  font-size: 1.75rem;
}

.timer-danger {
  color: var(--error-color);
  font-size: 1.75rem;
}

@keyframes blink {
  50% {
    opacity: 0.5;
  }
}

.blink {
  animation: blink 1s ease-in-out infinite;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--card-background);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.end-game-buttons {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin: 2rem auto;
  max-width: 400px;
}

.end-game-button {
  flex: 1;
  margin: 2rem auto;
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
  animation-delay: 0.3s;
  padding: 1rem;
  font-size: 0.9rem;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(206, 17, 38, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

#share-button {
  background-color: var(--secondary-color);
  color: white;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(206, 17, 38, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

#share-button:hover {
  background-color: var(--secondary-button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(206, 17, 38, 0.3);
}

#share-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(206, 17, 38, 0.2);
}

#leaderboard-button {
  background-color: var(--primary-color);
  color: white;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(30, 181, 58, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

#leaderboard-button:hover {
  background-color: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(30, 181, 58, 0.3);
}

#leaderboard-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(30, 181, 58, 0.2);
}

.streak-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.streak-flame {
  color: #f97316; /* Orange color for the flame */
  animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.word-score {
  color: var(--success-color);
  font-weight: 600;
  margin-left: 1rem;
  font-size: 0.9rem;
}
