/* ══════════════════════════════════════════════════════════════
   HANGMAN — builds on atividades.css and puzzles.css
══════════════════════════════════════════════════════════════ */

/* ─── Theme card preview (navy panel) ─── */
.hm-preview rect {
  fill: rgba(238, 242, 249, 0.2);
  transition: fill .3s ease;
}

.hm-preview rect.on   { fill: var(--rose); }
.hm-preview rect.won  { fill: var(--pz-green); }
.hm-preview rect.lost { fill: rgba(209, 129, 128, 0.4); }
.pz-theme-card:hover .hm-preview rect:not([class]) { fill: rgba(238, 242, 249, 0.32); }

/* ─── Top bar (navy) ─── */
.hm-enum {
  font-size: .85em;
  font-weight: 500;
  color: var(--navy-light);
  white-space: nowrap;
}

.hm-bar-answer {
  font-weight: 800;
  letter-spacing: 1.5px;
}

.hm-bar-clue   { color: rgba(255, 255, 255, 0.78); }
.hm-bar-hidden { color: rgba(255, 255, 255, 0.6); font-style: italic; }

.hm-clue-btn {
  margin-left: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(128, 149, 182, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.hm-clue-btn:hover {
  background: var(--red);
  border-color: var(--red);
}

/* ─── Stage: drawing + word ─── */
.hm-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 0 12px;
}

.hm-figure {
  flex-shrink: 0;
  width: clamp(150px, 18vw, 230px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: pzBoardIn .6s cubic-bezier(0.22, 1, 0.36, 1) .1s both;
}

.hm-drawing {
  width: 100%;
  height: auto;
  overflow: visible;
  transition: opacity .4s ease;
}

.hm-drawing path,
.hm-drawing circle {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hm-ghost path,
.hm-ghost circle { stroke: #edf1f7; }

.hm-drawing .hm-part {
  stroke: var(--navy-light);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .5s cubic-bezier(0.65, 0, 0.35, 1), stroke .3s ease;
}

.hm-drawing .hm-part.is-figure { stroke: var(--navy); }
.hm-drawing .hm-part.is-on     { stroke-dashoffset: 0; }

/* Undrawn parts leave anti-aliased hairlines that show on a white background */
.hm-drawing .hm-part:not(.is-on) { opacity: 0; }

.hm-drawing .hm-face {
  stroke: var(--white);
  stroke-width: 4;
  opacity: 0;
  transition: opacity .3s ease .4s;
}

.hm-drawing.is-lost .hm-part.is-figure { stroke: var(--red); }
.hm-drawing.is-lost .hm-face { stroke: var(--red); opacity: 1; }
.hm-drawing.is-won { opacity: .35; }

.hm-drawing.is-shake { animation: hmShake .4s ease; }

@keyframes hmShake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.hm-lives {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.hm-heart {
  display: block;
  width: 17px;
  height: 17px;
}

.hm-heart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hm-heart path {
  fill: rgba(3, 45, 111, 0.12);
  transition: fill .3s ease;
}

.hm-heart.is-full path { fill: var(--red); }

.hm-lives-text {
  width: 100%;
  margin-top: 4px;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--mute);
}

.hm-play {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.hm-word {
  --tile: 48px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: calc(var(--tile) * 0.4) calc(var(--tile) * 0.7);
}

.hm-group {
  display: flex;
  align-items: center;
  gap: calc(var(--tile) * 0.14);
}

.hm-tile {
  width: var(--tile);
  height: calc(var(--tile) * 1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--tile) * 0.64);
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
  background: rgba(3, 45, 111, 0.04);
  border-radius: calc(var(--tile) * 0.16);
  box-shadow: inset 0 calc(var(--tile) * -0.07) 0 rgba(3, 45, 111, 0.28);
  transition: background .25s ease, box-shadow .25s ease;
}

.hm-tile.is-shown {
  background: var(--pz-paper);
  box-shadow: inset 0 0 0 1px rgba(3, 45, 111, 0.06), inset 0 -3px 0 rgba(3, 45, 111, 0.18);
}

.hm-tile.is-missed {
  color: var(--red);
  background: #f6d2d1;
  box-shadow: inset 0 -3px 0 rgba(166, 4, 4, 0.25);
}

.hm-word.is-won .hm-tile { background: var(--pz-green-soft); }

.hm-tile.is-new {
  animation: hmPop .5s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes hmPop {
  from { opacity: 0; transform: scale(0.4) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hm-punct {
  padding: 0 2px;
  font-size: calc(var(--tile) * 0.7);
  font-weight: 800;
  color: var(--navy);
}

.hm-status {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  line-height: 1.45;
  text-align: center;
  font-size: clamp(.95rem, 1.3vw, 1.15rem);
  color: var(--ink-soft);
}

.hm-status b            { color: var(--navy); }
.hm-status.ok b         { color: var(--pz-green-dark); }
.hm-status.warn b       { color: var(--red); }

.hm-next {
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 22px -8px rgba(166, 4, 4, 0.55);
  cursor: pointer;
  transition: transform .15s ease, filter .2s ease;
}

.hm-status.ok .hm-next {
  background: var(--pz-green);
  box-shadow: 0 10px 22px -8px rgba(63, 174, 122, 0.6);
}

.hm-next:hover  { filter: brightness(1.08); }
.hm-next:active { transform: scale(0.96); }

/* ─── Letter keys ─── */
.hm-keys {
  flex-shrink: 0;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 7px;
}

.hm-key {
  height: clamp(40px, 5.8vh, 54px);
  font-family: var(--font-sans);
  font-size: clamp(.95rem, 1.3vw, 1.2rem);
  font-weight: 800;
  color: var(--navy);
  background: var(--pz-paper);
  border: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(3, 45, 111, 0.06), inset 0 -3px 0 rgba(3, 45, 111, 0.2);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, color .2s ease, opacity .2s ease;
}

.hm-key:hover:not(:disabled) {
  background: #dfe7f4;
  transform: translateY(-2px);
}

.hm-key:active:not(:disabled) { transform: scale(0.94); }

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

.hm-key.is-hit {
  color: var(--white);
  background: var(--pz-green);
  box-shadow: none;
}

.hm-key.is-miss {
  color: rgba(166, 4, 4, 0.55);
  background: rgba(166, 4, 4, 0.1);
  box-shadow: none;
  text-decoration: line-through;
}

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

/* ─── Whole-word guess ─── */
.hm-guess {
  flex-shrink: 0;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

.hm-guess-input {
  flex: 1;
  min-width: 0;
  height: clamp(48px, 7vh, 60px);
  padding: 0 18px;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--off-white);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.hm-guess-input::placeholder {
  font-weight: 400;
  letter-spacing: .5px;
  text-transform: none;
  color: var(--mute);
}

.hm-guess-input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--red-55);
  box-shadow: 0 0 0 3px var(--red-08);
}

.hm-guess-submit,
.hm-guess-cancel {
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
}

.hm-guess-submit {
  color: var(--white);
  background: var(--red);
  border: 0;
  box-shadow: 0 10px 22px -8px rgba(166, 4, 4, 0.55);
}

.hm-guess-submit:hover { background: var(--red-dark); }

.hm-guess-cancel {
  color: var(--ink-soft);
  background: var(--white);
  border: 1px solid var(--line-strong);
}

.hm-guess-cancel:hover { color: var(--navy); border-color: var(--line-heavy); }

/* ─── Round panel ─── */
.hm-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 18px 12px 4px;
  color: var(--navy);
}

.hm-score-num {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}

.hm-score-of {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mute);
}

.hm-score-label {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mute);
}

.hm-round {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-round-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-sans);
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
}

.hm-round-item:hover { background: var(--hover); }

.hm-round-item.is-current {
  color: var(--navy);
  background: var(--red-08);
  box-shadow: inset 3px 0 0 var(--red);
}

.hm-round-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  color: var(--mute);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}

.hm-round-item.is-started .hm-round-num { color: var(--red); border-color: var(--red-light); }

.hm-round-item.is-won .hm-round-num {
  color: var(--white);
  background: var(--pz-green);
  border-color: var(--pz-green);
}

.hm-round-item.is-lost .hm-round-num {
  color: var(--white);
  background: var(--red-light);
  border-color: transparent;
}

.hm-round-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-round-title {
  font-size: .95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hm-round-item.is-won .hm-round-title,
.hm-round-item.is-lost .hm-round-title { letter-spacing: 1px; }

.hm-round-meta {
  font-size: .76rem;
  color: var(--mute);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hm-stage {
    flex: none;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
  }

  .hm-figure { width: 150px; }
  .hm-keys   { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
  .hm-key    { height: 44px; }
}

@media (max-width: 600px) {
  .hm-guess { flex-wrap: wrap; }
  .hm-guess-input { flex-basis: 100%; }
  .hm-guess-submit,
  .hm-guess-cancel { flex: 1; height: 44px; }
}
