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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

header {
    text-align: center;
    width: 100%;
}

h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.wrong-count {
    color: #666;
    font-size: 1.1rem;
}

#wrong-count {
    font-weight: bold;
    color: #e74c3c;
}

#hangman-canvas {
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    background: #000000;
}

.word-display {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    letter-spacing: 10px;
    font-weight: bold;
    color: #333;
    min-height: 60px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

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

.keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.keyboard button {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.keyboard button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.keyboard button:active:not(:disabled) {
    transform: translateY(0);
}

.keyboard button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

.keyboard button.correct {
    background: #2ecc71;
    border-color: #2ecc71;
    color: white;
}

.keyboard button.wrong {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.message {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.win {
    color: #2ecc71;
}

.message.lose {
    color: #e74c3c;
}

.reset-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reset-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .game-container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .word-display {
        font-size: 2rem;
        letter-spacing: 5px;
    }

    #hangman-canvas {
        width: 250px;
        height: 250px;
    }

    .keyboard {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 6px;
    }

    .keyboard button {
        padding: 12px;
        font-size: 1rem;
    }
}
