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

body {
    background: #1a1a2e;
    color: #eee;
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow-x: hidden;
}

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

#hud {
    display: flex;
    gap: 0;
    font-size: 18px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}

#hud > div {
    padding: 10px 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

#hud > div:last-child {
    border-right: none;
}

#hud span {
    font-weight: bold;
    color: #4fc3f7;
}

#fretboard {
    background: #2d1810;
    border-radius: 4px;
    cursor: pointer;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

#message {
    font-size: 24px;
    font-weight: bold;
    height: 40px;
    color: #4fc3f7;
}

#active-notes {
    background: rgba(255,255,255,0.05);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 16px;
}

#active-notes .label {
    color: #888;
    margin-right: 10px;
}

#active-notes .notes {
    font-weight: bold;
    font-size: 18px;
}

#active-notes .note-item {
    display: inline-block;
    margin: 0 8px;
}

#active-notes .note-name {
    color: #e74c3c;
    font-size: 20px;
}

#active-notes .note-acc {
    color: #888;
    font-size: 14px;
    margin-left: 4px;
}

#active-notes .note-acc.good {
    color: #4fc3f7;
}

#active-notes .note-acc.great {
    color: #4caf50;
}

#active-notes .fret-range {
    color: #666;
    font-size: 14px;
    margin-left: 15px;
}

#hud button {
    background: transparent;
    border: none;
    color: #eee;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 16px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

#hud button:hover {
    background: rgba(255,255,255,0.1);
}

#hud button:last-child {
    border-right: none;
}

#hint-btn.used {
    opacity: 0.4;
    cursor: not-allowed;
}

#version {
    position: fixed;
    bottom: 5px;
    right: 10px;
    font-size: 11px;
    color: #555;
}

.hidden {
    display: none !important;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

#overlay-content {
    pointer-events: auto;
    background: rgba(26, 26, 46, 0.95);
    padding: 20px 40px;
    border-radius: 12px;
}

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#overlay-content, #game-over {
    text-align: center;
}

#overlay-content h2, #game-over h2 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #4fc3f7;
}

#overlay-content p {
    font-size: 20px;
    margin-bottom: 20px;
    color: #aaa;
}

#start-btn, #restart-btn {
    background: #4fc3f7;
    border: none;
    color: #1a1a2e;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}

#start-btn:hover, #restart-btn:hover {
    background: #81d4fa;
}

#game-over p {
    font-size: 24px;
    margin: 20px 0;
}

#final-score {
    color: #4fc3f7;
    font-weight: bold;
}

#new-high-score {
    color: #4caf50;
    font-size: 20px;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.high-score-line {
    color: #888;
    font-size: 18px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    #game-container {
        gap: 10px;
        width: 100%;
    }

    #overlay {
        align-items: flex-end;
        padding-bottom: 20px;
    }

    #overlay-content {
        padding: 10px 20px;
        background: rgba(26, 26, 46, 0.85);
    }

    #overlay-content h2,
    #overlay-content p {
        display: none;
    }

    #hud {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 14px;
        border-radius: 6px;
    }

    #hud > div {
        padding: 6px 12px;
    }

    #hud button {
        padding: 6px 12px;
    }

    #active-notes {
        font-size: 14px;
        padding: 6px 12px;
    }

    #active-notes .note-name {
        font-size: 16px;
    }

    #active-notes .note-item {
        margin: 0 4px;
    }

    #message {
        font-size: 18px;
        height: 30px;
    }

    #overlay-content h2, #game-over h2 {
        font-size: 28px;
    }

    #overlay-content p {
        font-size: 16px;
    }

    #start-btn, #restart-btn {
        padding: 12px 30px;
        font-size: 18px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 5px;
    }

    #start-btn {
        padding: 10px 25px;
        font-size: 16px;
    }

    #hud {
        font-size: 12px;
        gap: 5px;
    }

    #hud > div {
        padding: 4px 8px;
    }

    #hud button {
        padding: 4px 8px;
        font-size: 14px;
    }

    #active-notes {
        font-size: 12px;
    }

    #active-notes .note-name {
        font-size: 14px;
    }

    #active-notes .fret-range {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
}
