.hangman { max-width: 860px; margin: 0 auto; }
.hangman [hidden] { display: none !important; }
.hangman-heading { margin-bottom: 28px; }
.hangman-eyebrow { font-size: 12px; line-height: 20px; text-transform: uppercase; letter-spacing: 1.8px; }
.hangman-heading .hangman-eyebrow { color: #e7ddfc; margin-bottom: 10px; }
.hangman-heading h1 { font-size: 72px; font-weight: 500; line-height: 1; }
.hangman-heading h1 > span { color: #ff8b47; }
.hangman-heading > p:last-child { max-width: 650px; margin-top: 16px; font-family: 'Futura PT Book', sans-serif; font-size: 22px; line-height: 1.4; color: #ffffffe0; }
.hangman-author { margin-bottom: 28px; padding: 24px 28px; border: 1px solid #ffdcc0; border-left: 4px solid #ff8d48; border-radius: 18px; background: #fff6eb; color: #594838; }
.hangman-author h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 20px; line-height: 1.3; font-weight: 500; }
.hangman-author h2 > span { color: #c3540e; }
.hangman-author p { font-family: 'Futura PT Book', sans-serif; font-size: 20px; line-height: 1.45; }
.hangman-author p + p { margin-top: 10px; }
.hangman-author a { display: inline; color: #ac4204; font-family: 'Futura PT', sans-serif; font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hangman-author a:hover { color: #713000; }
.hangman-author a:focus-visible { outline: 3px solid #c3540e; outline-offset: 4px; border-radius: 3px; }
.hangman-frame { border: 1px solid #ffffff70; border-radius: 28px; overflow: hidden; background: #faf8ff; color: #332945; box-shadow: 0 20px 60px #25174730; }
.hangman-frame { scroll-margin-top: 20px; }
.hangman-hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 18px; background: #fffdf8; }
.hangman-hud > div > span { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #74657f; }
.hangman-hud strong { display: flex; align-items: baseline; gap: 4px; font-size: 42px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hangman-clock strong > span:last-child { font-size: 19px; color: #8c7b9c; }
.hangman-score { text-align: right; }
.hangman-score strong { justify-content: end; }
.hangman-score small { font-size: 18px; color: #8c7b9c; }
.hangman-hud-mark { padding: 8px 13px; border: 1px solid #ddd0e9; border-radius: 50px; font-size: 10px; letter-spacing: 2px; color: #8c72b0; }
.hangman-timer-track { height: 4px; background: #e7e0ee; }
.hangman-timer-track > div { width: 100%; height: 100%; background: #9a82bd; transition: width .1s linear; }
.hangman-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 20px 16px; overflow: hidden; border-bottom: 1px solid #e4dcec; background-color: #f0eaf7; background-image: radial-gradient(#d5c8e6 1px, transparent 1px); background-size: 20px 20px; }
.hangman-stage-decor { position: absolute; top: 46px; left: 11%; color: #d6c8e5; font-size: 62px; transform: rotate(-12deg); }
.hangman-drawing { position: relative; width: 430px; max-width: 100%; height: 250px; }
.hangman-stage-message { color: #8c72b0; font-size: 12px; letter-spacing: 1px; line-height: 20px; text-align: center; }
.hangman-person { transform-origin: 270px 89px; }
.hangman-face-lost, .hangman-sparkles { opacity: 0; }
.hangman-setup, .hangman-play { padding: 28px 32px; }
.hangman-setup legend { margin-bottom: 16px; font-size: 25px; line-height: 1.25; font-weight: 500; }
.hangman-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hangman-level { position: relative; cursor: pointer; min-width: 0; }
.hangman-level input { position: absolute; top: 15px; right: 12px; accent-color: #7856a8; width: 15px; height: 15px; cursor: pointer; }
.hangman-level > span { display: flex; flex-direction: column; min-height: 114px; padding: 13px; border: 1px solid #ded5e9; border-radius: 14px; background: #fff; transition: background .15s, border-color .15s; }
.hangman-level strong { font-size: 27px; color: #6f548d; }
.hangman-level small { margin-top: 5px; font-family: 'Futura PT Book', sans-serif; font-size: 15px; line-height: 1.3; color: #766584; }
.hangman-level input:checked + span { border-color: #9876b9; background: #eee5f8; box-shadow: inset 0 0 0 1px #9876b9; }
.hangman-level input:focus-visible + span { outline: 3px solid #ef914e; outline-offset: 3px; }
.hangman-rules { margin: 18px 0 20px; font-family: 'Futura PT Book', sans-serif; font-size: 18px; line-height: 1.4; color: #766584; }
.hangman-primary, .hangman-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 48px; border-radius: 12px; padding: 12px 24px; font-size: 18px; cursor: pointer; }
.hangman-primary { background: #ff8d48; color: #442a20; border: 1px solid #ff8d48; }
.hangman-primary:hover { background: #ffa46a; }
.hangman-secondary { border: 1px solid #b4a1c8; color: #6c5289; background: #fff; }
.hangman button:focus-visible, .hangman-back:focus-visible { outline: 3px solid #ea9656; outline-offset: 4px; }
.hangman button:disabled { cursor: default; }
.hangman-primary:disabled { opacity: .55; }
.hangman-play > .hangman-eyebrow { color: #9a82b4; margin-bottom: 5px; }
.hangman-play h2 { font-size: 25px; line-height: 1.3; margin-bottom: 18px; }
.hangman-options { display: grid; gap: 10px; }
.hangman-answer { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 18px; border: 1px solid #ded5e9; border-radius: 14px; background: #fff; text-align: left; font-size: 20px; line-height: 1.35; cursor: pointer; color: #493859; }
.hangman-answer > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.hangman-answer-number { display: flex; align-items: center; justify-content: center; flex: 0 0 34px; height: 34px; border-radius: 8px; background: #f2edf8; color: #9a82b4; font-size: 14px; }
.hangman-answer:hover:not(:disabled) { border-color: #9876b9; background: #f6f0fd; }
.hangman-answer.is-correct { border-color: #71a77b; background: #eaf6e9; color: #3a663e; }
.hangman-answer.is-correct .hangman-answer-number { background: #cee6cd; color: #3a663e; }
.hangman-answer.is-wrong { border-color: #ce8284; background: #fbe8e8; color: #974345; }
.hangman-answer.is-wrong .hangman-answer-number { background: #f4cacc; color: #974345; }
.hangman-keyboard { margin-top: 14px; font-family: 'Futura PT Book', sans-serif; font-size: 15px; color: #8b779c; }
.hangman-result { padding: 28px 32px 32px; border-top: 1px solid #e4dcec; background: #fffdf8; }
.hangman-result > h2 { font-size: 32px; line-height: 1.2; color: #784950; }
.hangman-summary { margin-top: 10px; font-size: 18px; color: #766584; }
.hangman-review { margin: 22px 0; border: 1px solid #e3d9ea; padding: 20px; border-radius: 14px; background: #faf7fc; }
.hangman-review h3 { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #8b779c; margin-bottom: 6px; }
.hangman-review > p { font-family: 'Futura PT Book', sans-serif; font-size: 19px; line-height: 1.4; }
.hangman-review .hangman-correct-sentence { font-family: inherit; color: #3a663e; font-size: 22px; margin-bottom: 18px; }
.hangman-result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hangman-status { margin-top: 16px; min-height: 24px; font-family: 'Futura PT Book', sans-serif; font-size: 18px; color: #ffffffe0; }
.hangman-back { display: inline-flex; gap: 10px; margin-top: 18px; font-size: 17px; color: #fff; }
.hangman.is-urgent .hangman-clock strong { color: #b9545f; }
.hangman.is-urgent .hangman-timer-track > div { background: #d2797f; }
.hangman.is-lost .hangman-person { animation: hangman-drop .65s ease-out forwards, hangman-swing 2.5s .65s ease-in-out infinite alternate; }
.hangman.is-lost .hangman-platform { animation: hangman-platform-drop .5s forwards; }
.hangman.is-lost .hangman-rope { stroke-dasharray: 90; animation: hangman-rope-drop .5s forwards; }
.hangman.is-lost .hangman-face-safe { opacity: 0; }
.hangman.is-lost .hangman-face-lost { opacity: 1; }
.hangman.is-won .hangman-sparkles { opacity: 1; }
.hangman.is-won .hangman-person { animation: hangman-celebrate .55s ease-in-out 3; }
.hangman.is-won .hangman-result > h2 { color: #3a663e; }
@keyframes hangman-drop { from { transform: translateY(0); } to { transform: translateY(14px) rotate(4deg); } }
@keyframes hangman-swing { from { transform: translateY(14px) rotate(4deg); } to { transform: translateY(14px) rotate(-4deg); } }
@keyframes hangman-platform-drop { to { transform: translateY(25px); opacity: 0; } }
@keyframes hangman-rope-drop { to { transform: scaleY(1.26); transform-origin: 270px 34px; } }
@keyframes hangman-celebrate { 50% { transform: translateY(-10px) rotate(-4deg); } }
@media (max-width: 600px) {
  .hangman-author { padding: 20px 18px; }
  .hangman-author p { font-size: 18px; }
  .hangman-heading h1 { font-size: 48px; }
  .hangman-heading > p:last-child { font-size: 19px; }
  .hangman-frame { border-radius: 20px; }
  .hangman-hud { padding: 16px 20px; }
  .hangman-hud strong { font-size: 34px; }
  .hangman-hud-mark { font-size: 8px; letter-spacing: 1px; padding: 7px 9px; }
  .hangman-hud > div > span { font-size: 10px; letter-spacing: .5px; }
  .hangman-drawing { height: 195px; }
  .hangman:has(.hangman-play:not([hidden])) .hangman-drawing { height: 135px; }
  .hangman-stage-decor { font-size: 40px; left: 5%; }
  .hangman-setup, .hangman-play, .hangman-result { padding: 22px 18px; }
  .hangman-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hangman-level > span { min-height: 100px; }
  .hangman-play h2, .hangman-setup legend { font-size: 22px; }
  .hangman-answer { font-size: 18px; padding: 12px; gap: 12px; }
  .hangman-answer-number { flex-basis: 28px; height: 28px; font-size: 12px; }
  .hangman-result > h2 { font-size: 27px; }
  .hangman-review { padding: 16px; }
  .hangman-result-actions { flex-direction: column; }
  .hangman-setup .hangman-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hangman *, .hangman *::before, .hangman *::after { animation: none !important; transition: none !important; }
  .hangman.is-lost .hangman-person { transform: translateY(14px); }
  .hangman.is-lost .hangman-platform { opacity: 0; }
  .hangman.is-lost .hangman-rope { transform: scaleY(1.26); transform-origin: 270px 34px; }
}
