/* Hangman game specific styles */

#hm-hangman-graphic {
    font-weight: bold;
    font-size: 1rem;
    min-height: 12rem;
    color: #dc3545; /* Bootstrap danger color */
    text-align: center;
    user-select: none;
}

.hangman-ascii-art {
    font-family: monospace, monospace;
    line-height: 1.2;
    white-space: pre;
    margin: 0 auto;
    display: inline-block;
    text-align: left;
}

#hm-current-word {
    letter-spacing: 0.3em;
    font-family: monospace, monospace;
    font-weight: bold;
    min-height: 3rem;
}

#hm-keyboard {
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    text-align: center;
}

.keyboard-inner-container {
    display: inline-block;
    margin: 0 auto;
    text-align: center;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    margin-bottom: 0.5rem;
}

.keyboard-row.long-row button {
    /* Smaller buttons for languages with long rows */
    transform: scale(0.9);
    margin: 0.1rem !important;
}

#hm-keyboard button {
    width: 2.4rem;
    height: 2.4rem;
    font-weight: bold;
    font-size: 0.95rem;
    user-select: none;
    padding: 0;
    overflow: hidden;
    text-overflow: clip;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    margin: 0.15rem !important;
}

#hm-keyboard button:hover:not(:disabled),
#hm-keyboard button:focus:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 2;
}

#hm-keyboard button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

#hm-keyboard button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

#hm-keyboard button.key-pressed {
    transform: scale(0.9);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    transition: transform 0.1s ease-in-out;
}

#hm-keyboard button.btn-success:disabled {
    background-color: #198754;
    color: white;
}

#hm-keyboard button.btn-danger:disabled {
    background-color: #dc3545;
    color: white;
}

/* Keyboard overlay for game over state */
.keyboard-inner-container {
    position: relative;
}

.keyboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
    backdrop-filter: blur(1px);
}

.game-over-message {
    display: none; /* Hide the message completely */
}

#hm-incorrect-guesses,
#hm-guessed-letters,
#hm-score-display,
#hm-timer-display {
    font-weight: 600;
}

#hm-guessed-letters {
    min-height: 1.5rem;
}

#hm-message-area {
    min-height: 2rem;
    font-weight: bold;
}

#hm-message-area .alert {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hm-setup-dropdown-col {
    max-width: 200px;
    margin: 0 auto;
}

#hm-final-word {
    font-family: monospace, monospace;
    letter-spacing: 0.1em;
    font-weight: bold;
}

#hm-hangman-svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
    margin-bottom: 0.5rem;
}

#hm-hangman-svg-container svg {
    /* Default color for light mode */
    stroke: #444;
}

.dark-mode #hm-hangman-svg-container svg {
    /* Adjust color for dark mode */
    stroke: #e0e0e0; /* Light grey */
}

.high-contrast-mode #hm-hangman-svg-container svg {
    /* Adjust color for high-contrast mode */
    stroke: #ffffff; /* White */
}

/* Responsive adjustments */
@media (max-width: 992px) {
    #hm-keyboard button {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.9rem;
        margin: 0.15rem !important;
    }
}

@media (max-width: 768px) {
    #hm-keyboard button {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
        margin: 0.12rem !important;
    }
    
    #hm-current-word {
        font-size: 1.8rem !important;
    }
    
    .hangman-ascii-art {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    #hm-keyboard button {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.75rem;
        margin: 0.1rem !important;
    }
    
    #hm-current-word {
        font-size: 1.5rem !important;
    }
    
    .hangman-ascii-art {
        font-size: 0.7rem;
    }

    #hm-hangman-svg-container svg {
        width: 80px;
        height: 110px;
    }
}

@media (max-width: 400px) {
    #hm-keyboard button {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
        margin: 0.08rem !important;
    }
}
