/* Hangman-specific styles. The panels, buttons, top bar and toasts come from
   ../shared/arcade.css, linked first in index.html. */

.answer { margin: 6px 0 22px; font-size: 1.05rem; color: #cbbfe0; }
.answer b { color: #ffd076; letter-spacing: 0.08em; }

#secret { font-size: 1.15rem; letter-spacing: 0.12em; text-transform: uppercase; }
#secret-hint { font-size: 0.95rem; }

/* ───────── board ───────── */
#board {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 40px);
  flex-wrap: wrap;
}

#gallows {
  width: min(260px, 46vw);
  max-height: 42vh;
  flex-shrink: 0;
}

#gallows .frame path {
  fill: none;
  stroke: #6b5a80;
  stroke-width: 7;
  stroke-linecap: round;
}
#gallows .frame .rope { stroke: #a08ebb; stroke-width: 5; }

#gallows .body circle, #gallows .body path {
  fill: none;
  stroke: #ffd076;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#gallows .body .on { opacity: 1; animation: draw-in 0.35s ease; }
@keyframes draw-in { from { opacity: 0; transform: scale(0.9); transform-origin: 140px 110px; } }

#gallows.dead .body circle, #gallows.dead .body path { stroke: #ff7f6e; }

#gallows .cat path, #gallows .cat circle { fill: #5c4d72; stroke: none; }
#gallows .cat .tail { fill: none; stroke: #5c4d72; stroke-width: 4; stroke-linecap: round; }

.right { flex: 1 1 300px; min-width: 0; text-align: center; }

.hint {
  color: #b9a8cf;
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 14px;
}

.word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-bottom: 16px;
}

.word-group { display: flex; gap: 8px; }

.slot {
  width: clamp(24px, 7vw, 34px);
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: 3px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 4px;
  min-height: 2.1em;
}
.slot.filled { border-bottom-color: #ffd076; }
.slot.reveal { color: #ff9d8a; }
.slot span { display: inline-block; animation: pop 0.25s ease; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

.turn-note { min-height: 1.4em; font-size: 0.92rem; color: #b9a8cf; margin-bottom: 10px; }
.wrong { min-height: 1.6em; font-size: 1.05rem; letter-spacing: 0.16em; color: #ff9d8a; font-weight: 600; }
.lives { margin-top: 8px; font-size: 0.85rem; color: #9d8bb5; }

/* ───────── keyboard ───────── */
.keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 6px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.key {
  font: inherit;
  font-size: clamp(0.95rem, 3.4vw, 1.15rem);
  font-weight: 700;
  aspect-ratio: 1 / 1;
  max-height: 52px;
  border-radius: 10px;
  cursor: pointer;
  color: #f3ecdf;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.15s ease, transform 0.1s ease;
}
.key:active { transform: scale(0.94); }
.key.hit { background: rgba(120, 200, 140, 0.35); border-color: rgba(140, 230, 160, 0.5); color: #d6ffe0; }
.key.miss { background: rgba(255, 110, 90, 0.22); border-color: rgba(255, 130, 110, 0.35); color: #ffb4a6; }
.key:disabled { cursor: default; opacity: 0.75; }
.keyboard.locked .key { opacity: 0.4; pointer-events: none; }

@media (max-width: 560px) {
  .stage { flex-direction: column; gap: 12px; }
  #gallows { width: min(200px, 52vw); max-height: 30vh; }
}
