/* Ensure full viewport height and width */
html,
body {
  /* height: 100%;
  margin: 0;
  overflow: hidden; */
  font-family: "poppins";
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f9fafb;
  font-size: 14px;
  /* Even larger base font */
  transform: scale(1);
  /* No scale, use natural size */
  transform-origin: center;
}

.key {
  flex: 1 1 0;
  min-width: 36px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  text-align: center;
  line-height: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
  margin: 1px;
  transition: all 0.15s ease;
  user-select: none;
  padding: 0 4px;
  box-sizing: border-box;
}

.key-space {
  flex: 3 1 0;
}


.key-pressed {
  background-color: #e9f5ff;
  transform: translateY(2px);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.key-next {
  background-color: #f0f9ff;
  border-color: #93c5fd;
}

.key-wrong {
  background-color: rgba(231, 76, 60, 0.1);
  border-color: #E74C3C;
}

.key-correct {
  background-color: rgba(46, 204, 113, 0.1);
  border-color: #2ECC71;
}

.key-suggest {
  background-color: #e0f7fa !important;
  border-color: #00bcd4 !important;
  color: #00bcd4 !important;
}

.progress-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #e5e7eb;
}

.progress-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.word {
  font-size: 14px;
  font-family: "Poppins";
  display: inline-block;
  margin-right: 4px;
  transition: color 0.2s ease;
  line-height: 1.5;
  padding: 2px 5px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.8);
}

.word.current {
  border-bottom: 2px solid #3b82f6;
}

.word.correct {
  color: #2ECC71;
}

.word.incorrect {
  color: #E74C3C;
}

.word span.text-green-600 {
  color: #2ecc71 !important;
  font-weight: bold;
}

.word span.text-red-600 {
  color: #E74C3C !important;
  font-weight: bold;
}

.word[style*="line-through"] {
  text-decoration-thickness: 3px;
  text-decoration-style: solid;
}

.avatar {
  background-color: #e5e7eb;
  overflow: hidden;
}

.modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse-animation {
  animation: pulse 1.5s infinite;
}

#text-display {
  overflow: hidden;
  position: relative; 
  width: 100%;
}

@keyframes scrollText {
  0% {
    transform: translateX(60%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.scroll-text {
  display: inline-block;
  white-space: nowrap;
  position: absolute;
  animation: scrollText linear infinite;
  will-change: transform;
}

.scroll-text-vertical {
  position: absolute;
  bottom: 0;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollTextVertical 35s linear forwards;
  white-space: nowrap;
}

@keyframes scrollTextVertical {
  0% {
    top: 100%;
  }
  100% {
    top: -100%;
  }
}

.fade-in {
  animation: fadeIn 0.5s forwards;
}

.fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Style for each falling word */
.falling-word {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Animation for falling effect */
@keyframes fall {
  from { top: 0; opacity: 1; }
  to { top: 90%;  opacity: 0;}
}

.moving-up-word {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  animation: moveUp 5s linear forwards;
}

@keyframes moveUp {
  0% {
    top: 100%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: -20%;
    opacity: 0;
  }
}

@keyframes bounce-vertical-loop {
  0%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-12px); /* go up */
  }
  60% {
    transform: translateY(4px); /* small drop */
  }
}

.char-active {
  animation: bounce-vertical-loop 0.8s ease-in-out infinite;
  color: #3498db;
  font-weight: bold;
}

span.word {
  display: inline-block;
  transition: color 0.2s, background 0.2s;
}

span.word.correct {
  color: green;
  font-weight: bold;
}

span.word.incorrect {
  color: red;
  font-weight: bold;
}


/* Reduce the size of game stats */
#typing-speed,
#accuracy,
#score {
  font-size: 1.35rem;
  font-weight: 500;
}

.text-sm {
  font-size: 1.18rem;
}

.flex.gap-8>div {
  gap: 4px;
}

.flex.justify-between.mb-6.px-4 {
  margin-bottom: 1rem;
  /* Reduce bottom margin */
}

/* Adjust text for levels */
.flex.justify-between.mt-2.text-xs.text-gray-500 span {
  font-size: 0.8rem;
  /* Slightly increase font size for readability */
}

.leaderboard-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
}

.leaderboard-icon.first {
  background-color: gold;
}

.leaderboard-icon.second {
  background-color: silver;
}

.leaderboard-icon.third {
  background-color: #cd7f32;
}

/* Leaderboard table */
.leaderboard-table {
  max-width: 98%;
  margin: 0 auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td,
.leaderboard-table-modern th,
.leaderboard-table-modern td {
  padding: 4px 6px;
  text-align: center;
  font-size: 1.25rem;
}

.leaderboard-table-modern {
  width: 100%;
  max-width: 98%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-collapse: separate;
  border-spacing: 0;
}

.leaderboard-table-modern th,
.leaderboard-table-modern td {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  border-right: 1px solid #e5e7eb;
  vertical-align: middle;
}

.leaderboard-table-modern th:last-child,
.leaderboard-table-modern td:last-child {
  border-right: none;
}

.leaderboard-table-modern th {
  background: #f3f4f6;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.leaderboard-table-modern tr:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
}

.leaderboard-table-modern td {
  background: #fff;
}

.leaderboard-table-modern .avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #2ecc71;
  background: #f3f4f6;
  margin: 0 auto;
}

.leaderboard-table-modern .rank-badge {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.15em 0.7em;
  background: #e5e7eb;
  color: #2ecc71;
  display: inline-block;
}

.leaderboard-table-modern .rank-badge.gold {
  background: #fffbe6;
  color: #FFD700;
}

.leaderboard-table-modern .rank-badge.silver {
  background: #f8fafc;
  color: #C0C0C0;
}

.leaderboard-table-modern .rank-badge.bronze {
  background: #fff5e6;
  color: #cd7f32;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.modal-content {
  scrollbar-width: thin;
  /* For Firefox */
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

#completion-modal .text-2xl,
#level-completion-modal .text-2xl,
#registration-modal .text-2xl {
  font-size: 1.15rem !important;
}

#completion-modal .text-xl,
#level-completion-modal .text-xl {
  font-size: 1rem !important;
}

/*hello*/
#completion-modal .p-6,
#level-completion-modal .p-6,
#registration-modal .p-6 {
  padding: 1rem !important;
}