.game-root { min-height: 40rem; }

.hangman-wrong,
.hangman-streak,
.hangman-solved {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.hangman-wrong { min-width: 6ch; }
.hangman-streak,
.hangman-solved { min-width: 3ch; }

.hangman-stage {
  display: flex;
  justify-content: center;
}

.hangman-card {
  width: min(100%, 36rem);
  padding: 0.85rem 1.15rem 1.05rem;
  border: 2px solid #b8923a;
  border-radius: 16px;
  background: #fffdf7;
  color: #1d2433;
}

.hangman-figure {
  height: 11.5rem;
  margin: 0 auto 0.35rem;
  color: #1d2433;
}

.hangman-figure svg {
  display: block;
  height: 100%;
  width: auto;
  margin: 0 auto;
}

.hangman-wood {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hangman-part {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.hangman-part.is-on { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .hangman-part { transition: opacity 0.12s linear; }
}

.hangman-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 0.35rem 0.4rem;
  height: calc(2.7rem * 2 + 0.35rem);
  margin: 0;
}

.hangman-slot {
  box-sizing: border-box;
  width: 1.55rem;
  height: 2.5rem;
  border-bottom: 2px solid #8a6230;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  color: #1d2433;
  user-select: none;
}

.hangman-word.is-solved .hangman-slot {
  color: #2e6b4e;
  border-bottom-color: #2e6b4e;
}

.hangman-slot.is-reveal { color: #8a6230; }

.hangman-note {
  height: 2.8em;
  margin: 0.35rem 0 0.65rem;
  overflow: hidden;
  text-align: center;
  line-height: 1.4;
  font-size: 0.98rem;
  color: #6d6456;
}

.hangman-note.is-good { color: #8a6230; }

.hangman-keys {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: calc(4 * var(--tap-min) + 3 * 0.35rem);
}

.hangman-keyrow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  height: var(--tap-min);
}

.hangman-keyrow.is-last {
  display: flex;
  justify-content: center;
}

.hangman-key {
  box-sizing: border-box;
  width: auto;
  height: var(--tap-min);
  margin: 0;
  padding: 0;
  border: 2px solid #b8923a;
  border-radius: 8px;
  background: #fffdf7;
  color: #1d2433;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.2vw, 1.15rem);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.hangman-keyrow.is-last .hangman-key {
  width: calc((100% - 6 * 0.35rem) / 7);
}

.hangman-key:hover:not(:disabled) { background: #fff6e0; }

.hangman-key:focus-visible {
  outline: 2px solid #8a6230;
  outline-offset: 2px;
}

.hangman-key:disabled { cursor: default; }

.hangman-key.is-hit {
  border-color: #2e6b4e;
  background: #f4f8f4;
  color: #2e6b4e;
}

.hangman-key.is-miss {
  border-color: #d9d0c0;
  background: #f6f3ec;
  color: #a09888;
}

.hangman-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
}

.hangman-actions .btn {
  min-width: 8.5rem;
  white-space: nowrap;
}

@container (max-width: 36rem) {
  .hangman-card { padding: 0.75rem 0.7rem 0.85rem; }
}
