* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

h1 {
    color: #4a4a4a;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.hangman-drawing {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.game-info {
    margin: 2rem 0;
}

.word-display {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    direction: ltr;
    unicode-bidi: embed;
}

.wrong-letters {
    margin: 1rem 0;
    color: #e74c3c;
    font-size: 1rem;
}

.wrong-letters strong {
    color: #333;
}

.remaining-guesses {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1rem;
}

.input-section {
    margin: 2rem 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

#letter-input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.2rem;
    width: 60px;
    text-align: center;
    direction: ltr;
}

#letter-input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 10px 20px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #5a6fd8;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.game-controls {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#hint-button {
    background-color: #f39c12;
}

#hint-button:hover {
    background-color: #e67e22;
}

#hint-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#new-game-button {
    background-color: #27ae60;
}

#new-game-button:hover {
    background-color: #219a52;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin: 1.5rem 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.key {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.key:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.key.disabled {
    background-color: #6c757d;
    color: white;
    cursor: not-allowed;
}

.key.correct {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.key.wrong {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.game-message {
    margin-top: 1rem;
    font-size: 1.3rem;
    font-weight: bold;
    min-height: 30px;
}

.hangman-drawing svg {
    border: 2px solid #eee;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.modal-button {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-button:hover {
    background-color: #5a6fd8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        margin: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .word-display {
        font-size: 1.5rem;
    }
    
    .hangman-drawing svg {
        width: 150px;
        height: 180px;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
}