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

body {
    background: linear-gradient(180deg, #001220 0%, #002840 50%, #001830 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#gameCanvas {
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 150, 255, 0.3);
    display: block;
    max-width: 100%;
}

#word-display {
    font-size: 48px;
    letter-spacing: 15px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
    font-family: 'Courier New', monospace;
    min-height: 60px;
}

#keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 600px;
}

.key {
    width: 40px;
    height: 45px;
    background: linear-gradient(180deg, #1a4a6e 0%, #0d2840 100%);
    border: 2px solid #2a6a9e;
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.key:hover:not(.used):not(.correct):not(.wrong) {
    background: linear-gradient(180deg, #2a6a9e 0%, #1a4a6e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 255, 0.3);
}

.key.correct {
    background: linear-gradient(180deg, #2ecc71 0%, #1a8a4c 100%);
    border-color: #2ecc71;
    cursor: default;
}

.key.wrong {
    background: linear-gradient(180deg, #c0392b 0%, #7a1f1f 100%);
    border-color: #c0392b;
    cursor: default;
    opacity: 0.6;
}

.key.used {
    cursor: default;
}

#message {
    font-size: 28px;
    color: #fff;
    text-align: center;
    min-height: 40px;
    text-shadow: 0 0 15px rgba(255, 100, 100, 0.8);
}

#message.win {
    color: #2ecc71;
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
}

#message.lose {
    color: #e74c3c;
    text-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
}

#stats {
    display: flex;
    gap: 30px;
    color: #6aa;
    font-size: 14px;
}

#stats span {
    background: rgba(0, 50, 80, 0.5);
    padding: 5px 15px;
    border-radius: 15px;
}

#wins {
    color: #2ecc71;
}

#losses {
    color: #e74c3c;
}

.play-again {
    margin-top: 10px;
    padding: 12px 30px;
    font-size: 18px;
    background: linear-gradient(90deg, #00b894, #00cec9);
    border: none;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-again:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 206, 201, 0.4);
}
