﻿body {
    margin: 0;
    overflow: hidden;
    background: #333; /* Dark background to make the piano pop */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* Piano backdrop - elegant stage design */
#piano-container {
    position: fixed;
    bottom: 25px; /* Gap for key press animation visibility */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 850px;
    height: 210px;
    background: linear-gradient(180deg,
        #2a2a3d 0%,
        #1f1f2e 15%,
        #18182a 100%);
    pointer-events: auto;
    touch-action: none;
    overflow: visible;
    border-radius: 16px;
    padding: 16px 15px 10px 15px;
    box-sizing: border-box;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Top glossy edge strip */
#piano-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(139, 92, 246, 0.25) 25%,
        rgba(167, 139, 250, 0.35) 50%,
        rgba(139, 92, 246, 0.25) 75%,
        rgba(99, 102, 241, 0.1) 100%);
    border-radius: 16px 16px 0 0;
}

/* Decorative inner border */
#piano-container::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    pointer-events: none;
}

.key {
    position: absolute;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: 12px;
    border: 1px solid rgba(32,32,32,0.2);
    border-radius: 0px 0px 5px 5px;
    cursor: pointer;
    box-shadow: 0px 5px 1px rgba(32,32,32,0.2);
    transition: transform 0.05s ease, background-color 0.05s ease, box-shadow 0.05s ease;
    box-sizing: border-box;
}

/* White Key Styling */
.white-key {
    background-color: #F2F2DE;
    color: #3008F5;
    z-index: 1;
    height: 100%;
    text-shadow: 0px 1px 1px rgba(255,255,255,0.5);
}

    .white-key:hover {
        background-color: #ffffff;
    }

    .white-key.active {
        background-color: #1BC0EA; /* The Blue from your code */
        transform: translateY(5px); /* Physical press effect - moves entire key including label */
        box-shadow: none;
    }

/* Black Key Styling */
.black-key {
    background-color: rgb(32,32,32);
    color: #ffffff;
    z-index: 10; /* Must be above white keys */
    height: 60%;
    text-shadow: 0px -1px 1px #000;
}

    .black-key:hover {
        background-color: #444;
    }

    .black-key.active {
        background-color: #1BC0EA; /* Blue when pressed */
        transform: translateY(5px); /* Physical press effect - moves entire key including label */
        box-shadow: none;
    }

/* Labels */
.piano-label {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none; /* Let clicks pass through text */
}

    .piano-label span {
        display: block;
    }

.note-name {
    font-weight: bold;
    font-size: 14px;
}

.midi-number {
    font-size: 10px;
    opacity: 0.5;
}

/* Mobile responsive adjustments */
@media (max-height: 600px) {
    #piano-container {
        height: 175px;
        bottom: 20px;
        padding: 12px 10px 8px 10px;
        border-radius: 14px;
    }

    .note-name {
        font-size: 12px;
    }

    .midi-number {
        font-size: 8px;
    }
}

@media (max-height: 500px) {
    #piano-container {
        height: 150px;
        bottom: 15px;
        padding: 10px 8px 6px 8px;
        border-radius: 12px;
    }

    .piano-label {
        bottom: 5px;
    }

    .note-name {
        font-size: 10px;
    }

    .midi-number {
        display: none;
    }
}

@media (max-width: 600px) {
    #piano-container {
        max-width: 100%;
    }

    .note-name {
        font-size: 11px;
    }
}
