@theme-color: #4a7fd3;
@theme-color-highlighted: #5f93f1;
@theme-color-selected: #86b1ea;
@background-color: #222629;
@empty-color: #151716;
@dark-accent-color: #2e353b;
@warning-red: #9b5c5c;
@correct-green: #2baf6a;

@import "core.less";

#game-over-modal {
  --victory-winning-cell-color: @theme-color-highlighted;
}

body {
    color: white;
}

// players row
// ===========

#hangman-others {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    margin-bottom: 10px;
}

// current player (you), shown below the play area
#hangman-me {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 6px;
}

.hangman-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: @dark-accent-color;
    border: 2px solid transparent;
    min-width: 120px;
}

.hangman-player.hangman-active {
    border-color: @theme-color-highlighted;
    box-shadow: 0 0 10px fade(@theme-color-highlighted, 50%);
}

.hangman-player.is-me {
    background: lighten(@dark-accent-color, 5%);
}

// picker mode: the current wordmaster's seat
.hangman-player.is-picker {
    border-color: @theme-color-selected;
    box-shadow: 0 0 10px fade(@theme-color-selected, 45%);
}

.hangman-player.is-picker .hangman-player-score {
    color: #f0c674;
    font-weight: 700;
}

.hangman-player-avatar {
    flex: 0 0 auto;
}

.hangman-player-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.hangman-player-name {
    font-weight: 700;
    font-size: 14px;
}

.hangman-player-score {
    font-size: 12px;
    color: @theme-color-selected;
}

// play area
// =========

.hangman-play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.hangman-figure-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.hangman-figure {
    width: 180px;
    height: 210px;
}

.hangman-figure .gallows {
    stroke: #c8a060;
    stroke-width: 4;
    stroke-linecap: round;
}

.hangman-figure .part {
    stroke: #ededed;
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hangman-figure circle.part {
    fill: none;
}

.hangman-figure .part.show {
    opacity: 1;
}

.hangman-misses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.hangman-category {
    font-weight: 700;
    color: @theme-color-selected;
}

.hangman-wrong-count {
    font-size: 14px;
    color: #d0d0d0;
}

.hangman-wrong-letters {
    font-size: 15px;
}

.hangman-wrong-title {
    color: @warning-red;
    font-weight: 700;
}

.hangman-wrong-letter {
    display: inline-block;
    margin: 0 2px;
    color: @warning-red;
    text-decoration: line-through;
    font-weight: 700;
}

.hangman-wrong-words {
    font-size: 15px;
    margin-top: 4px;
}

.hangman-wrong-word {
    display: inline-block;
    margin: 2px 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: @dark-accent-color;
    color: @warning-red;
    font-weight: 700;
    text-decoration: line-through;
}

// the word
// ========

.hangman-word {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.hangman-letter {
    width: 34px;
    height: 44px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    border-bottom: 4px solid @theme-color;
}

.hangman-letter.filled {
    border-bottom-color: @correct-green;
}

.hangman-letter-char {
    line-height: 1;
}

.hangman-turn {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    min-height: 24px;
}

.hangman-round-recap {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: @theme-color-selected;
    margin-bottom: 6px;
}

// keyboard
// ========

.hangman-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 520px;
}

.hangman-key {
    width: 38px;
    height: 44px;
    border-radius: 8px;
    border: none;
    background: @dark-accent-color;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}

.hangman-key:hover:not([disabled]) {
    background: @theme-color;
    transform: translateY(-2px);
}

.hangman-key[disabled] {
    cursor: default;
    opacity: 0.85;
}

.hangman-key.used.correct {
    background: @correct-green;
    color: white;
}

.hangman-key.used.wrong {
    background: @warning-red;
    color: white;
}

// word chooser (picker mode)
// ===========================

.hangman-word-chooser {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-radius: 14px;
    background: @dark-accent-color;
    border: 2px solid fade(@theme-color-selected, 60%);
    max-width: 460px;
    width: 100%;
    text-align: center;
}

.hangman-chooser-label {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 0;
}

.hangman-chooser-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

#hangman-secret-input {
    max-width: 240px;
    text-transform: uppercase;
}

#hangman-secret-submit {
    white-space: nowrap;
}

.hangman-chooser-hint {
    font-size: 13px;
    color: #b9c0c7;
}

// word guess
// ==========

.hangman-word-guess {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

#hangman-word-input {
    max-width: 220px;
    text-transform: uppercase;
}

#hangman-word-submit {
    white-space: nowrap;
}

// lobby options
// =============

#hangman-lobby-options-row {
    justify-content: center;
    gap: 24px;
    margin-top: 14px;
}

.hangman-lobby-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hangman-options-label {
    font-weight: 700;
    margin-bottom: 0;
}

#hangman-category-select,
#hangman-mode-select {
    max-width: 240px;
}

.hangman-spectators {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
}

@media (max-width: 575px) {
    .hangman-figure {
        width: 140px;
        height: 165px;
    }
    .hangman-letter {
        width: 26px;
        height: 36px;
        font-size: 22px;
    }
    .hangman-key {
        width: 30px;
        height: 38px;
        font-size: 15px;
    }
}
