.hangman-page {
  position: relative;
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 2rem);
  box-sizing: border-box;
}

.hangman-page *,
.hangman-page *::before,
.hangman-page *::after {
  box-sizing: border-box;
}

.hangman-hero,
.hangman-board,
.hangman-side,
.hangman-entry {
  border: 1px solid var(--product-line);
  border-radius: var(--product-radius-lg);
  background: var(--product-panel);
  box-shadow: var(--product-shadow-sm);
}

.hangman-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(0.8rem, 2vw, 1.35rem);
  align-items: end;
  min-height: clamp(180px, 20vw, 280px);
  padding: clamp(0.95rem, 2.1vw, 1.55rem);
  overflow: hidden;
}

.hangman-hero h1 {
  margin: 0;
  color: var(--product-ink);
  font-family: "Tradutur Serif", Georgia, serif;
  font-size: clamp(1.9rem, 4.8vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hangman-hero p:not(.tool-eyebrow) {
  max-width: 760px;
  margin: 0.62rem 0 0;
  color: var(--product-muted);
  font-size: clamp(0.94rem, 1.15vw, 1.04rem);
  line-height: 1.5;
}

.hangman-language-card {
  display: grid;
  gap: 0.7rem;
  padding: clamp(0.9rem, 2vw, 1.15rem);
  border: 1px solid var(--product-line);
  border-radius: var(--product-radius-md);
  background: var(--product-bg-2);
  box-shadow: var(--product-shadow-sm);
}

.hangman-language-card label {
  color: var(--product-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hangman-language-card select,
.hangman-language-card button,
.hangman-entry-link {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 750;
}

.hangman-language-card select {
  width: 100%;
  border: 1px solid var(--product-line);
  background: var(--product-panel);
  color: var(--product-ink);
  padding: 0.65rem 0.85rem;
  transition: all 0.2s ease;
}

.hangman-language-card button,
.hangman-entry-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--product-accent);
  color: #fff !important;
  padding: 0.7rem 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hangman-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: clamp(1rem, 2vw, 1.4rem);
  align-items: stretch;
}

.hangman-board,
.hangman-side,
.hangman-entry {
  padding: clamp(1.15rem, 2.5vw, 1.85rem);
}

.hangman-board-head,
.hangman-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.hangman-board h2,
.hangman-side h2,
.hangman-entry h2 {
  margin: 0;
  color: var(--product-ink);
  font-size: clamp(1.3rem, 2.8vw, 2.2rem);
  letter-spacing: 0;
}

.hangman-hearts {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.32rem;
  min-width: 130px;
  color: #cf3f38;
  font-size: 1.35rem;
}

.hangman-heart.is-lost {
  color: var(--product-line-strong);
}

.hangman-status {
  margin: 1.15rem 0 1rem;
  min-height: 1.6rem;
  color: var(--product-muted);
  font-weight: 700;
}

.hangman-status.is-win { color: var(--product-success); }
.hangman-status.is-loss { color: var(--product-danger); }

.hangman-word {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 1vw, 0.65rem);
  align-items: center;
  min-height: clamp(86px, 10vw, 140px);
  margin: clamp(1rem, 2vw, 1.5rem) 0;
  padding: clamp(0.6rem, 1.6vw, 1rem);
  border: 1px dashed rgba(20, 108, 95, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
}

.hangman-letter {
  display: grid;
  place-items: center;
  min-width: clamp(2.2rem, 5vw, 3.8rem);
  height: clamp(3rem, 7vw, 5rem);
  border: 1px solid rgba(20, 108, 95, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--product-ink);
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 900;
  text-transform: lowercase;
  box-shadow: 0 10px 24px rgba(43, 53, 35, 0.06);
}

.hangman-letter.is-hidden {
  color: transparent;
  background:
    linear-gradient(135deg, rgba(20, 108, 95, 0.13), rgba(255, 255, 255, 0.62));
}

.hangman-progress {
  min-height: 1.3rem;
  color: var(--product-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.hangman-keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 0.45rem;
  margin-top: clamp(1rem, 2vw, 1.4rem);
  padding: clamp(0.55rem, 1.4vw, 0.85rem);
  border: 1px solid rgba(43, 53, 35, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
}

.hangman-key {
  min-height: clamp(44px, 4.8vw, 54px);
  border: 1px solid rgba(43, 53, 35, 0.13);
  border-radius: 14px;
  background: #fff;
  color: var(--product-ink);
  font-size: 1.05rem;
  font-weight: 850;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.hangman-key:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(20, 108, 95, 0.28);
  background: rgba(20, 108, 95, 0.08);
}

.hangman-key:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.hangman-key.is-correct {
  border-color: rgba(45, 125, 87, 0.35);
  background: rgba(45, 125, 87, 0.12);
  color: var(--product-success);
}

.hangman-key.is-wrong {
  border-color: rgba(163, 60, 50, 0.26);
  background: rgba(163, 60, 50, 0.1);
  color: var(--product-danger);
}

.hangman-side {
  align-self: stretch;
}

.hangman-side p:not(.tool-eyebrow) {
  margin: 0.85rem 0 0;
  color: var(--product-muted);
}

.hangman-rule-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.hangman-rule-list > span {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--product-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 750;
}

.hangman-rule-list i {
  color: var(--product-amber);
}

.hangman-entry[hidden] {
  display: none !important;
}

.hangman-entry-content {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.hangman-entry-card {
  padding: 1rem;
  border: 1px solid var(--product-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.hangman-entry-card h3 {
  margin: 0;
  color: var(--product-ink);
  font-size: 1.4rem;
  letter-spacing: 0;
}

.hangman-entry-meta {
  color: var(--product-muted);
  font-weight: 750;
}

.hangman-entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.hangman-entry-list li {
  border-radius: 999px;
  background: rgba(20, 108, 95, 0.1);
  color: var(--product-accent);
  padding: 0.35rem 0.65rem;
  font-weight: 750;
}

.hangman-example {
  margin: 0.75rem 0 0;
  color: var(--product-muted);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-hero,
body.product-shell[data-accessibility-theme="dark"] .hangman-board,
body.product-shell[data-accessibility-theme="dark"] .hangman-side,
body.product-shell[data-accessibility-theme="dark"] .hangman-entry,
html[data-accessibility-theme="dark"] body.product-shell .hangman-hero,
html[data-accessibility-theme="dark"] body.product-shell .hangman-board,
html[data-accessibility-theme="dark"] body.product-shell .hangman-side,
html[data-accessibility-theme="dark"] body.product-shell .hangman-entry {
  color: var(--product-ink);
  border-color: var(--product-line);
  background: var(--product-panel);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-hero h1,
body.product-shell[data-accessibility-theme="dark"] .hangman-board h2,
body.product-shell[data-accessibility-theme="dark"] .hangman-side h2,
body.product-shell[data-accessibility-theme="dark"] .hangman-entry h2,
body.product-shell[data-accessibility-theme="dark"] .hangman-entry-card h3,
body.product-shell[data-accessibility-theme="dark"] .hangman-entry-card h4,
html[data-accessibility-theme="dark"] body.product-shell .hangman-hero h1,
html[data-accessibility-theme="dark"] body.product-shell .hangman-board h2,
html[data-accessibility-theme="dark"] body.product-shell .hangman-side h2,
html[data-accessibility-theme="dark"] body.product-shell .hangman-entry h2,
html[data-accessibility-theme="dark"] body.product-shell .hangman-entry-card h3,
html[data-accessibility-theme="dark"] body.product-shell .hangman-entry-card h4 {
  color: var(--product-ink);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-language-card,
body.product-shell[data-accessibility-theme="dark"] .hangman-word,
body.product-shell[data-accessibility-theme="dark"] .hangman-keyboard,
body.product-shell[data-accessibility-theme="dark"] .hangman-rule-list > span,
body.product-shell[data-accessibility-theme="dark"] .hangman-entry-card,
html[data-accessibility-theme="dark"] body.product-shell .hangman-language-card,
html[data-accessibility-theme="dark"] body.product-shell .hangman-word,
html[data-accessibility-theme="dark"] body.product-shell .hangman-keyboard,
html[data-accessibility-theme="dark"] body.product-shell .hangman-rule-list > span,
html[data-accessibility-theme="dark"] body.product-shell .hangman-entry-card {
  color: var(--product-ink);
  border-color: var(--product-line);
  background: var(--product-panel-2);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-language-card select,
body.product-shell[data-accessibility-theme="dark"] .hangman-letter,
body.product-shell[data-accessibility-theme="dark"] .hangman-key,
html[data-accessibility-theme="dark"] body.product-shell .hangman-language-card select,
html[data-accessibility-theme="dark"] body.product-shell .hangman-letter,
html[data-accessibility-theme="dark"] body.product-shell .hangman-key {
  color: var(--product-ink);
  border-color: var(--product-line);
  background: #0f172a;
}

body.product-shell[data-accessibility-theme="dark"] .hangman-letter.is-hidden,
html[data-accessibility-theme="dark"] body.product-shell .hangman-letter.is-hidden {
  color: transparent;
  border-color: var(--product-line);
  background: rgba(103, 232, 249, 0.14);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-key:hover:not(:disabled),
html[data-accessibility-theme="dark"] body.product-shell .hangman-key:hover:not(:disabled) {
  border-color: rgba(103, 232, 249, 0.42);
  background: rgba(103, 232, 249, 0.12);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-key.is-correct,
html[data-accessibility-theme="dark"] body.product-shell .hangman-key.is-correct {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.42);
  background: rgba(34, 197, 94, 0.16);
}

body.product-shell[data-accessibility-theme="dark"] .hangman-key.is-wrong,
html[data-accessibility-theme="dark"] body.product-shell .hangman-key.is-wrong {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.42);
  background: rgba(239, 68, 68, 0.16);
}

@media (max-width: 980px) {
  .hangman-page {
    padding: clamp(0.85rem, 3vw, 1.25rem);
  }

  .hangman-hero,
  .hangman-layout {
    grid-template-columns: 1fr;
  }

  .hangman-hero {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .hangman-page {
    padding: 0.75rem;
  }

  .hangman-hero,
  .hangman-board,
  .hangman-side,
  .hangman-entry {
    border-radius: 24px;
  }

  .hangman-board-head,
  .hangman-entry-head {
    flex-direction: column;
  }
  .hangman-hearts {
    justify-content: start;
  }
  .hangman-keyboard {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  }
}
