/**
 * Hangman Styles
 *
 * Game-specific styles for the Hangman word guessing game.
 *
 * @package AIML_Games_Hangman
 * @since 1.0.0
 */

/* =============================================================================
   HANGMAN GAME AREA
   ============================================================================= */

/* Game container - full width */
.aiml-games-game-content {
    width: 100%;
    text-align: center;
}

/* Wrong Guesses Counter */
.aiml-hangman-wrong-guesses {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.aiml-hangman-wrong-label {
    color: #666;
    margin-right: 8px;
}

.aiml-hangman-wrong-count {
    font-weight: bold;
    color: #333;
}

.aiml-hangman-wrong-count.aiml-hangman-danger {
    color: #dc3545;
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Category Display */
.aiml-hangman-category {
    font-size: 16px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

/* Words Progress Counter */
.aiml-hangman-words-progress {
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    color: #666;
}

.aiml-hangman-progress-label {
    margin-right: 8px;
}

.aiml-hangman-progress-count {
    font-weight: bold;
    color: #333;
}

/* Definition Hint */
.aiml-hangman-definition.aiml-hangman-hint {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px auto;
    max-width: 400px;
    text-align: center;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

.aiml-hangman-definition.aiml-hangman-hint strong {
    color: #0066cc;
}

/* Hangman Figure */
.aiml-hangman-figure {
    font-family: 'Courier New', Courier, monospace;
    font-size: 5rem;
    line-height: 1.3;
    text-align: center;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    width: fit-content;
    max-width: 100%;
    white-space: pre;
    color: #333;
    border: 2px solid #dee2e6;
}

.aiml-hangman-figure.aiml-hangman-danger {
    border-color: #dc3545;
    color: #dc3545;
}

/* Word Display */
.aiml-hangman-word {
    font-family: 'Courier New', Courier, monospace;
    font-size: 32px;
    letter-spacing: 8px;
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    word-break: break-all;
}

.aiml-hangman-word span {
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

.aiml-hangman-letter-hidden {
    color: #333;
    border-bottom: 3px solid #333;
    margin: 0 2px;
}

.aiml-hangman-letter-revealed {
    color: #28a745;
    font-weight: bold;
    margin: 0 2px;
}

.aiml-hangman-letter-missed {
    color: #dc3545;
    font-weight: bold;
    text-decoration: line-through;
    margin: 0 2px;
}

.aiml-hangman-letter-space {
    color: #6c757d;
    margin: 0 4px;
}

.aiml-hangman-word.aiml-hangman-word-complete {
    animation: celebrate 0.5s ease-in-out;
}

.aiml-hangman-word.aiml-hangman-word-failed {
    animation: shake 0.5s ease-in-out;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Definition Display */
.aiml-hangman-definition {
    font-size: 16px;
    color: #495057;
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 8px;
    font-style: italic;
}

/* =============================================================================
   ON-SCREEN KEYBOARD
   ============================================================================= */

.aiml-hangman-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 25px 0;
}

.aiml-hangman-keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.aiml-hangman-letter {
    width: 40px;
    height: 45px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #007bff;
    background-color: #fff;
    color: #007bff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiml-hangman-letter:hover:not(:disabled) {
    background-color: #007bff;
    color: #fff;
    transform: scale(1.1);
}

.aiml-hangman-letter:active:not(:disabled) {
    transform: scale(0.95);
}

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

.aiml-hangman-letter.aiml-hangman-used {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.aiml-hangman-letter.aiml-hangman-correct {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.aiml-hangman-letter.aiml-hangman-wrong {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* =============================================================================
   RESPONSIVE STYLES
   ============================================================================= */

@media (max-width: 600px) {
    .aiml-hangman-word {
        font-size: 24px;
        letter-spacing: 5px;
    }

    .aiml-hangman-figure {
        font-size: 12px;
        padding: 15px;
    }

    .aiml-hangman-letter {
        width: 32px;
        height: 38px;
        font-size: 14px;
    }

    .aiml-hangman-keyboard-row {
        gap: 4px;
    }

    .aiml-hangman-wrong-guesses {
        font-size: 16px;
    }

    .aiml-hangman-category {
        font-size: 14px;
    }

    .aiml-hangman-definition {
        font-size: 14px;
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .aiml-hangman-word {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .aiml-hangman-letter {
        width: 28px;
        height: 34px;
        font-size: 12px;
    }

    .aiml-hangman-keyboard-row {
        gap: 3px;
    }
}
