/* Akasztófa (hangman) — prefix hm- */
.hm-frame {
  width: min(520px, 100cqw);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  container-type: inline-size;
}

/* The gallows: a light line drawing, one step per wrong guess; the newest step in the game colour. */
.hm-gallows { width: min(150px, 34cqw); height: auto; overflow: visible; }
.hm-gallows g { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.hm-gallows g.on { opacity: 1; }
.hm-gallows g:not(.on) { opacity: .05; }
.hm-gallows g.hm-new { stroke: var(--game); animation: hm-draw .6s var(--ease-out); }
@keyframes hm-draw { from { opacity: 0; transform: translateY(-3px); } }
.hm-lives { font-size: .86rem; color: var(--muted); font-weight: 500; }
.hm-lives.hm-low { color: var(--danger); }

/* The word: one tile per letter; the words of an expression wrap as a whole. */
.hm-word {
  --hm-tile: min(42px, calc((100cqw - (var(--hm-cols) - 1) * 5px) / var(--hm-cols)));
  width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px;
}
.hm-w { display: flex; gap: 5px; align-items: center; }
.hm-tile {
  width: var(--hm-tile); height: calc(var(--hm-tile) * 1.18); display: grid; place-items: center;
  border-bottom: 3px solid rgba(255, 255, 255, .5); color: #fff;
  font-family: var(--font); font-weight: 650; font-size: calc(var(--hm-tile) * .62); line-height: 1;
}
.hm-tile.on { border-bottom-color: var(--game); }
.hm-tile.hm-hinted { color: var(--accent, #fff); border-bottom-color: #8e8e93; }
.hm-tile.hm-missed { color: var(--danger); border-bottom-color: var(--danger); }
.hm-tile.hm-pop { animation: hm-pop .3s var(--ease-spring); }
@keyframes hm-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } }
.hm-dash { color: #fff; font-weight: 650; font-size: calc(var(--hm-tile) * .6); }

/* Keyboard */
.hm-kb { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; user-select: none; -webkit-user-select: none; }
.hm-row { width: 100%; display: flex; justify-content: center; gap: 4px; }
.hm-key {
  flex: 0 1 44px; min-width: 0; height: 44px; border: 0; border-radius: 9px; cursor: pointer;
  background: #3a3a3c; color: #fff; font: 600 1rem var(--font); touch-action: manipulation;
  transition: background-color .15s, opacity .15s, transform .2s var(--ease-spring);
}
.hm-key:active { transform: scale(.92); }
.hm-key.hm-hit { background: #22b05f; }
.hm-key.hm-miss { background: #1c1c1e; color: #636366; }
.hm-key.hm-hint { background: #48484a; }
.hm-key.hm-hint-key { box-shadow: 0 0 0 2px var(--gold); }
.hm-key:disabled { cursor: default; }
.hm-solve-btn { margin-top: 4px; padding: 9px 18px; background: rgba(255, 255, 255, .1); color: #fff; touch-action: manipulation; }
.hm-solve { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.hm-solve input {
  flex: 1 1 220px; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2);
  background: #1c1c1e; color: #fff; font: 600 1.05rem var(--font); text-transform: uppercase; user-select: text; -webkit-user-select: text;
}
.hm-solving .hm-kb { display: none; }
.hm-okb { display: none; }
.hm-solving .hm-okb { display: flex; }
.hm-locked .hm-okb { display: none; }
.hm-locked .hm-kb, .hm-locked .hm-solve { display: none; }

@media (max-height: 640px) {
  .hm-gallows { width: min(110px, 28cqw); }
  .hm-key { height: 38px; font-size: .92rem; }
  .hm-frame { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-gallows g.hm-new, .hm-tile.hm-pop { animation: none; }
}
