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

body {
    font-family: 'Minecraft', 'Courier New', monospace;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.container {
    background: rgba(60, 60, 60, 0.85);
    border: 4px solid #3e3e3e;
    border-radius: 0;
    padding: 30px;
    box-shadow:
        0 0 0 2px #1a1a1a,
        0 0 0 4px #525252,
        8px 8px 0 rgba(0, 0, 0, 0.4);
    max-width: 800px;
    width: 90%;
    text-align: center;
    image-rendering: pixelated;
}

h1 {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #ffff55;
    text-shadow: 3px 3px 0px #555500;
    letter-spacing: 2px;
}

.piano-icon {
    font-size: 4em;
    margin-bottom: 15px;
    filter: drop-shadow(3px 3px 0px rgba(0, 0, 0, 0.5));
}

.profile-card {
    background: rgba(40, 40, 40, 0.9);
    border: 3px solid #2a2a2a;
    padding: 15px 20px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.5),
        4px 4px 0 rgba(0, 0, 0, 0.3);
}

.player-head {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    border: 2px solid #555;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.profile-info {
    text-align: left;
    flex: 1;
}

.player-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #55ff55;
    text-shadow: 2px 2px 0px #005500;
    margin-bottom: 4px;
}

.profile-subtitle {
    font-size: 0.9em;
    color: #aaaaaa;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
}

button, .minecraft-btn {
    background: linear-gradient(180deg, #7a7a7a 0%, #5a5a5a 100%);
    color: #ffffff;
    border: 2px solid #000;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow:
        inset -2px -4px 0 rgba(0, 0, 0, 0.3),
        inset 2px 2px 0 rgba(255, 255, 255, 0.2),
        3px 3px 0 rgba(0, 0, 0, 0.4);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    font-family: 'Minecraft', 'Courier New', monospace;
    image-rendering: pixelated;
    margin: 10px 5px;
}

button:hover, .minecraft-btn:hover {
    background: linear-gradient(180deg, #8a8a8a 0%, #6a6a6a 100%);
    transform: translateY(-1px);
}

button:active, .minecraft-btn:active {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 100%);
    box-shadow:
        inset 2px 2px 4px rgba(0, 0, 0, 0.5),
        1px 1px 0 rgba(0, 0, 0, 0.4);
    transform: translateY(1px);
}

button:disabled, .minecraft-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info {
    margin-top: 25px;
    font-size: 0.95em;
    color: #cccccc;
    line-height: 1.6;
}

.note-display {
    margin: 25px 0;
    font-size: 2.2em;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #2a2a2a;
    padding: 15px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

/* Modal styles with Minecraft theme */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #3c3c3c;
    color: #fff;
    width: min(92vw, 520px);
    border: 4px solid #000;
    box-shadow:
        0 0 0 2px #1a1a1a,
        0 0 0 4px #525252,
        8px 8px 0 rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
    border-bottom: 3px solid #000;
}

.modal-header h2 {
    color: #ffffff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    font-size: 1.5em;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow: auto;
    background: rgba(60, 60, 60, 0.95);
}

.modal-actions {
    padding: 14px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(40, 40, 40, 0.9);
    border-top: 2px solid #000;
}

.modal .device-item {
    background: rgba(70, 70, 70, 0.8);
    border: 2px solid #4a4a4a;
    padding: 12px 14px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.modal .device-item:hover {
    background: rgba(90, 90, 90, 0.9);
    transform: translateX(2px);
}

.modal .device-item.selected {
    background: rgba(85, 255, 85, 0.2);
    border-color: #55ff55;
    box-shadow:
        0 0 10px rgba(85, 255, 85, 0.3),
        2px 2px 0 rgba(0, 0, 0, 0.4);
}

.modal button {
    background: linear-gradient(180deg, #7a7a7a 0%, #5a5a5a 100%);
    color: #fff;
}

.modal button.secondary {
    background: linear-gradient(180deg, #999 0%, #777 100%);
}

/* Scrollbar styling for modal */
.modal-body::-webkit-scrollbar {
    width: 12px;
}

.modal-body::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #555;
    border: 2px solid #2a2a2a;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.instrument-container {
    margin: 10px auto 5px auto;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.instrument-container label {
    font-weight: bold;
    color: #ffff55;
}
.minecraft-select {
    background: #3c3c3c;
    color: #fff;
    border: 2px solid #000;
    padding: 8px 12px;
    font-family: 'Minecraft', 'Courier New', monospace;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
    box-shadow: inset -2px -2px 0 rgba(255,255,255,0.1), inset 2px 2px 0 rgba(0,0,0,0.4);
}
.minecraft-select:focus {
    outline: none;
    border-color: #55ff55;
    box-shadow: inset -2px -2px 0 rgba(255,255,255,0.2), inset 2px 2px 0 rgba(0,0,0,0.5);
}

/* Virtual Piano Keyboard */
.virtual-piano-container {
    margin: 20px auto;
    padding: 20px;
    background: rgba(40, 40, 40, 0.9);
    border: 3px solid #2a2a2a;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.5),
        4px 4px 0 rgba(0, 0, 0, 0.3);
    max-width: 100%;
    overflow: hidden;
}

.virtual-piano {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.piano-keys-container {
    position: relative;
    width: 100%;
    height: 160px;
}

.white-keys-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    gap: 0;
}

.black-keys-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.piano-key {
    cursor: pointer;
    user-select: none;
    transition: all 0.05s ease;
    border: 1px solid #000;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-weight: bold;
    padding-bottom: 8px;
    box-sizing: border-box;
}

.piano-key.white {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 80%, #d0d0d0 100%);
    flex: 1;
    min-width: 0;
    height: 100%;
    position: relative;
    color: #333;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

.piano-key.white:hover {
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 80%, #e0e0e0 100%);
}

.piano-key.white:active, .piano-key.white.active {
    background: linear-gradient(180deg, #d0d0d0 0%, #c0c0c0 80%, #b0b0b0 100%);
    transform: translateY(2px);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.piano-key.black {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 80%, #000 100%);
    position: absolute;
    width: 3.5%;
    height: 60%;
    top: 0;
    pointer-events: auto;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
    border-color: #000;
    z-index: 10;
}

.piano-key.black:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 80%, #111 100%);
}

.piano-key.black:active, .piano-key.black.active {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 80%, #000 100%);
    transform: translateY(2px);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.piano-key-label {
    pointer-events: none;
    font-size: 0.65em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Disabled piano keys (grayed out) */
.piano-key.disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    filter: grayscale(0.7);
}

.piano-key.white.disabled {
    background: linear-gradient(180deg, #b0b0b0 0%, #a0a0a0 80%, #909090 100%);
}

.piano-key.black.disabled {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 80%, #1a1a1a 100%);
}

.piano-key.disabled:hover {
    transform: none !important;
    background: inherit !important;
}

.piano-key.disabled:active {
    transform: none !important;
    background: inherit !important;
    box-shadow: inherit !important;
}