body {
    margin: 0;
    padding: 0;
    background-color: #171717;
    color: #9b9b35;
    font-family: 'Courier New', monospace;
    overflow: auto;
    -webkit-font-smoothing: antialiased;
}

#terminal {
    width: 100%;
    min-height: 100vh;
    padding: clamp(12px, 3vw, 20px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    align-items: center;
}

#output {
    width: 100%;
    max-width: 800px;
    font-size: clamp(14px, 2.5vw, 18px);
    white-space: pre-wrap;
    margin-bottom: 20px;
    padding: 4px 8px;
    box-sizing: border-box;
}

#input-line {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px;
    gap: 8px;
}

#prompt {
    margin-right: 6px;
    color: #9b9b35;
    flex: 0 0 auto;
}

#command-input {
    background-color: transparent;
    border: none;
    color: #9b9b35;
    font-family: 'Courier New', monospace;
    font-size: clamp(14px, 2.5vw, 18px);
    padding: 6px 8px;
    outline: none;
    flex: 1 1 auto;
    min-width: 0;
    /* allow shrinking on small screens */
}

#command-input::placeholder {
    color: #006600;
}

/* Piano keyboard styling */
#piano-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #0a0a0a;
    border-top: 2px solid #9b9b35;
    padding: 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    z-index: 1000;
    max-height: 40vh;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    align-items: flex-end;
}

.piano-key {
    flex: 0 0 auto;
    width: 45px;
    min-width: 45px;
    height: 150px;
    padding: 8px 4px;
    background-color: #1a1a1a;
    border: 2px solid #9b9b35;
    color: #9b9b35;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    text-align: center;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
}

.piano-key:active {
    background-color: #9b9b35;
    color: #000;
    transform: translateY(2px);
}

.piano-key:hover {
    background-color: #2a2a2a;
    border-color: #d4d46f;
}

.piano-exit {
    flex: 0 0 auto;
    width: auto;
    min-width: 80px;
    height: auto;
    padding: 12px 20px;
    background-color: #4a0000;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.piano-exit:active {
    background-color: #ff6b6b;
    color: #4a0000;
    transform: none;
}

.piano-exit:hover {
    border-color: #ff8c8c;
}

/* Small-screen tweaks */
@media (max-width: 600px) {
    #terminal {
        padding: 12px;
    }

    #output {
        font-size: clamp(13px, 3.5vw, 16px);
    }

    #prompt {
        margin-right: 6px;
        font-size: 16px;
    }

    #command-input {
        font-size: 16px;
    }
}

@media (orientation: landscape) and (max-height: 450px) {
    #output {
        font-size: 13px;
    }

    #command-input {
        font-size: 14px;
    }
}