.hm-gallows {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

#gallows {
  width: min(160px, 40vw, 22vh);
  height: auto;
}

.hm-gallows .part { opacity: 0; transition: opacity 0.3s ease-out; }
.hm-gallows .part.on { opacity: 1; }

.hm-category {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.hm-category-label {
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hm-word {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: 2px;
}

.hm-letter {
  min-width: 1.2em;
  padding: 2px 4px;
  border-bottom: 3px solid var(--text);
  text-align: center;
  color: var(--text);
}

.hm-letter.blank { color: transparent; }

/* On-screen keyboard — 26 letters in a responsive grid. Each key carries its
   hit / miss / untried state so the "tried letters" strip isn't needed. */
.hm-keyboard {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 14px auto 0;
  max-width: 560px;
}

.hm-key {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 0;
  font-family: "SF Mono", "Menlo", monospace;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
}

.hm-key:hover:not(:disabled) { border-color: var(--primary); }
.hm-key:active:not(:disabled) { transform: translateY(1px); }

.hm-key.hit {
  background: linear-gradient(135deg, #bbf7d0, #6ee7b7);
  color: var(--text);
  border-color: transparent;
}

.hm-key.miss {
  background: #fee2e2;
  color: var(--danger);
  border-color: transparent;
}

.hm-key:disabled {
  cursor: default;
  opacity: 0.85;
}

.hm-key:disabled:not(.hit):not(.miss) { opacity: 0.55; }

@media (max-width: 480px) {
  #gallows { width: min(110px, 16vh); }
  .hm-gallows { padding: 2px 0; }
  .hm-word { margin: 8px 0 4px; font-size: clamp(22px, 6vw, 30px); gap: 4px; }
  .hm-letter { padding: 0 3px; border-bottom-width: 2px; }
  .hm-category { margin: 2px 0; font-size: 13px; }
  .hm-category-label { font-size: 12px; }
  .hm-keyboard {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 10px;
  }
  .hm-key { padding: 10px 0; font-size: 15px; }
}
