canvas {
    border: 3px solid #4A8AAA;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    background: #B8D8EA;
    gap: 12px;
}

@media (max-width: 840px) {
    body {
        margin: 10px;
        gap: 8px;
    }
    #hint {
        font-size: 11px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

#hud {
    display: flex;
    gap: 16px;
}

#score,
#best {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 8px 24px;
    backdrop-filter: blur(4px);
}

#score-label,
#best-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #4A7A9B;
    letter-spacing: 2px;
}

#score-value,
#best-value {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    color: #1E4D6B;
    min-width: 4ch;
    text-align: right;
}

#best-value {
    color: #B8860B;
}

#hint {
    font-family: 'Arial', sans-serif;
    font-size: 13px;
    color: #3A6A88;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

#canvas-wrap {
    position: relative;
    display: block;
    line-height: 0;
}

#difficulty-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(8, 22, 40, 0.62);
    border-radius: 4px;
}

#game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    color: #1E4D6B;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
    letter-spacing: 2px;
}

#diff-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: 2px;
}

#diff-buttons {
    display: flex;
    gap: 10px;
}

.diff-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 10px 18px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 8px;
    background: rgba(255,255,255,0.35);
    color: #1E4D6B;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.1s;
}

.diff-btn:hover {
    background: rgba(255,255,255,0.6);
    transform: translateY(-2px);
}

.diff-btn[data-mode="easy"]   { color: #2A7A2A; }
.diff-btn[data-mode="normal"] { color: #1E4D6B; }
.diff-btn[data-mode="hard"]   { color: #A02020; }

#volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.5);
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2A6A8A;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2A6A8A;
    cursor: pointer;
    border: none;
}

kbd {
    display: inline-block;
    background: #fff;
    border: 1px solid #6AA8CC;
    border-bottom-width: 3px;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 12px;
    color: #2A5070;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
