#hangman-game {
  width: 100%;
  touch-action: manipulation;
}

.hangman-box {
  text-align: center;
  padding: 0 !important;
  overflow: hidden;
}

#language-picker {
  padding: 40px;
}

.hangman-subtitle {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-l);
  color: var(--text-wrappers);
  margin-bottom: 20px;
}

.language-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.language-card {
  background: var(--bg-secondary);
  color: var(--text-accent);
}

.language-card i {
  display: none;
  font-size: 12px;
  margin-right: 10px;
}

.language-card.active i {
  display: inline-block;
  vertical-align: middle;
}

.language-card.active {
  background: var(--bg-primary);
  color: var(--text-accent);
  text-shadow: -1px -1px 0px var(--text-shadow-02);
}

#language-picker #start-button {
  margin: 0 auto;
}

#hangman-game .hidden {
  display: none;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px;
  text-align: left;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.game-bar-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-bar-message {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-m);
  color: var(--text-wrappers);
}

.game-bar-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 5px 12px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-s);
  text-transform: lowercase;
  white-space: nowrap;
}

.stat-label {
  font-weight: bold;
  opacity: 0.8;
}

.game-bar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-bar-actions .icon-button-bar {
  width: auto;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-s);
  text-transform: lowercase;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  touch-action: manipulation;
}

.icon-button-bar:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hangman-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 30px 10px;
}

.hangman-drawing {
  width: 130px;
  height: auto;
}

.gallows-line {
  fill: none;
  stroke: var(--text-wrappers);
  stroke-width: 4;
  stroke-linecap: round;
}

.hangman-part {
  fill: none;
  stroke: var(--bg-accent-alt);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.25s ease;
}

circle.hangman-part {
  fill: none;
}

.hangman-part.visible {
  opacity: 1;
}

#hangman-game .word {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  padding: 0 30px;
  pointer-events: none;
}

.letter-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 42px;
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-l);
  color: var(--text-wrappers);
  border-bottom: 3px solid var(--bg-secondary);
  border-radius: 6px 6px 0 0;
  text-transform: uppercase;
}

.letter-box.space-box {
  border-bottom: none;
  width: 16px;
}

.wrong-letters-row {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-s);
  color: var(--text-wrappers);
  margin-bottom: 20px;
  padding: 0 30px;
}

.wrong-letters {
  display: inline-block;
  color: var(--text-form-fields);
  background: var(--bg-form-fields);
  border-radius: 8px;
  padding: 3px 10px;
  margin-left: 8px;
}

.input-section {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 460px;
  margin: 0 auto;
}

.input-section input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 15px;
  touch-action: manipulation;
}

.icon-button {
  width: 45px;
  height: 35px;
  flex-shrink: 0;
  -webkit-mask-image: url('../../images/shape-box-square.svg');
  mask-image: url('../../images/shape-box-square.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  z-index: 1;
  touch-action: manipulation;
}

#remaining-tries.green {
  color: #8de0a4;
}

#remaining-tries.orange {
  color: #f0c477;
}

#remaining-tries.red {
  color: #ec8b8b;
}

@media (max-width: 600px) {
  #language-picker {
    padding: 20px 16px;
  }

  .hangman-subtitle {
    font-size: var(--font-size-m);
    margin-bottom: 14px;
  }

  .language-options {
    gap: 10px;
    margin-bottom: 18px;
  }

  .game-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .game-bar-left {
    flex: 1;
    min-width: 0;
  }

  .game-bar-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }

  .game-bar-stats::-webkit-scrollbar {
    display: none;
  }

  .stat-pill {
    padding: 4px 9px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .game-bar-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 6px;
  }

  .game-bar-actions .icon-button-bar {
    height: 34px;
    padding: 0;
    width: 34px;
    justify-content: center;
    border-radius: 50%;
  }

  .game-bar-actions .icon-button-bar span {
    display: none;
  }

  .game-bar-actions .icon-button-bar i {
    font-size: 16px;
  }

  .hangman-stage {
    padding: 60px 20px 4px;
  }

  .hangman-drawing {
    width: 90px;
  }

  .game-bar-message {
    font-size: var(--font-size-s);
  }

  #hangman-game .word {
    gap: 4px;
    margin-bottom: 14px;
    padding: 0 16px;
  }

  .letter-box {
    width: 26px;
    height: 34px;
    font-size: var(--font-size-m);
  }

  .letter-box.space-box {
    width: 10px;
  }

  .wrong-letters-row,
  .input-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wrong-letters-row {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .input-section {
    gap: 8px;
  }

  .input-section input[type="text"] {
    font-size: 16px;
    padding: 12px 14px;
    transform: scale(0.875);
    transform-origin: left center;
    width: 114.3%;
    margin-right: -14.3%;
  }

  .icon-button {
    width: 40px;
    height: 32px;
  }
}