/* Hangman styles */
.hangman-container,
.hangman-container * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.hangman-container {
    width: min(100%, 760px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.hangman-controls {
    justify-content: center;
    gap: 8px;
}

.hangman-layout {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 1fr;
    gap: 20px;
    align-items: start;
}

.hangman-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #b7d7ea;
}

.hangman-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 4 / 5;
}

.hangman-mistakes {
    font-size: 20px;
    font-weight: bold;
    color: #d32f2f;
    text-align: center;
}

.hangman-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hangman-word {
    background: #ffffff;
    border: 2px solid #5f8ea8;
    border-radius: 8px;
    padding: 20px;
    font-size: clamp(24px, 5vw, 48px);
    font-weight: 900;
    text-align: center;
    letter-spacing: 8px;
    color: #24343c;
    font-family: monospace;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hangman-clue {
    background: #fff8cf;
    border: 2px solid #f4b942;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: #6d5c00;
    line-height: 1.5;
}

.hangman-clue strong {
    color: #b8960d;
}

.hangman-wrong-label {
    font-weight: bold;
    color: #304c5b;
    font-size: 14px;
}

.hangman-alphabet {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
    gap: 6px;
}

.hangman-letter {
    aspect-ratio: 1;
    border: 2px solid #5f8ea8;
    background: #ffffff;
    color: #24343c;
    border-radius: 6px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.hangman-letter:hover:not(:disabled) {
    background: #fff8cf;
    border-color: #f4b942;
    transform: scale(1.05);
}

.hangman-letter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hangman-letter.guessed {
    background: #e8f5e9;
    border-color: #61a96b;
    color: #2e7d32;
}

.hangman-letter.guessed.wrong {
    background: #ffebee;
    border-color: #d32f2f;
    color: #c62828;
}

.hangman-feedback {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    padding: 10px;
    border-radius: 8px;
}

.hangman-feedback.success {
    color: #2e7d32;
    background: #c8efcc;
    border: 2px solid #61a96b;
}

.hangman-feedback.error {
    color: #c62828;
    background: #ffcdd2;
    border: 2px solid #d32f2f;
}

/* Common styles for game buttons */
.game-controls {
    display: flex;
    gap: 8px;
}

.button {
    border: 2px solid;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button.yellow {
    background: #fff8cf;
    border-color: #f4b942;
    color: #b8960d;
}

.button.yellow:hover:not(:disabled) {
    background: #f4b942;
    color: #ffffff;
}

.button.orange {
    background: #ffe0b2;
    border-color: #ff9800;
    color: #e65100;
}

.button.orange:hover:not(:disabled) {
    background: #ff9800;
    color: #ffffff;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-instructions {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

@media (max-width: 680px) {
    .hangman-layout {
        grid-template-columns: 1fr;
    }

    .hangman-figure {
        padding: 15px;
    }

    .hangman-word {
        font-size: clamp(20px, 4vw, 36px);
        padding: 15px;
        min-height: 60px;
    }

    .hangman-alphabet {
        grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
        gap: 5px;
    }

    .hangman-letter {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .hangman-layout {
        gap: 15px;
    }

    .hangman-word {
        font-size: 18px;
        letter-spacing: 5px;
        padding: 12px;
    }

    .hangman-alphabet {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .hangman-letter {
        font-size: 11px;
        border-width: 1px;
    }

    .hangman-figure {
        padding: 10px;
    }
}
