body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: #f9fafb;
  color: #111827;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.letter-anim {
  animation: letterPop 0.25s ease-out;
}
@keyframes letterPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#hmKeyboard {
  /* Use fractional columns so 6 columns always fit the container responsively */
  display: grid !important;
  grid-template-columns: repeat(6, minmax(44px, 1fr)) !important;
  gap: 10px !important;
  justify-items: center !important;
  align-items: center !important;
}

/* key style */
.hm-key {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important; /* fill the grid cell */
  max-width: 56px !important; /* keep keys reasonably sized on wide screens */
  height: 48px !important;
  padding: 0 6px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.04) !important;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease !important;
  cursor: pointer;
  text-align: center;
  user-select: none;
}
.hm-key:active {
  transform: translateY(1px) scale(0.98) !important;
}

/* states */
.hm-key.used {
  opacity: 0.45 !important;
  pointer-events: none !important;
}
.hm-key.correct {
  background: #4ade80 !important;
  border-color: #16a34a !important;
  color: #fff !important;
}
.hm-key.wrong {
  background: #f87171 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

/* make hint, mistake and used letters bolder (requested) */
#hmHint,
#hmMistakeInfo,
#hmUsedLetters {
  color: #374151; /* stronger gray */
  font-weight: 600;
}

/* Ensure the keyboard container is above site floats when necessary */
#hmKeyboard {
  z-index: 5;
  position: relative;
}

/* When floating buttons exist, we will hide them via JS on keyboard interaction; this prevents accidental overlap */
/* Fallback: if site has backToTopBtn/moreToolsBtn as id or backtotop/moretools, move them down so they don't cover game */
#backToTopBtn,
#backtotop,
#moreToolsBtn,
#moretools {
  z-index: 40;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

/* add a little spacing at bottom to avoid overlap with global fixed elements */
main {
  padding-bottom: 90px;
} /* safe space so New Word is reachable on small screens */
