/* Estilos específicos para Piano Pillo */

#piano-keyboard {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Alinea las teclas al inicio */
    position: relative;
    /* Necesario para posicionar teclas negras */
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    min-height: 180px;
    /* Altura mínima para el teclado */
    width: fit-content;
    /* Ajustar ancho al contenido */
    margin-left: auto;
    margin-right: auto;
}

.piano-key {
    border: 1px solid #555;
    cursor: pointer;
    transition: background-color 0.1s ease;
    position: relative;
    /* Para el texto de la nota */
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Alinea el texto abajo */
    align-items: center;
    padding-bottom: 10px;
}

.white-key {
    width: 60px;
    height: 180px;
    background-color: white;
    color: #333;
    margin: 0 1px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.15);
}

.black-key {
    width: 38px;
    height: 110px;
    background-color: #222;
    color: white;
    position: absolute;
    z-index: 1;
    margin-left: -20px;
    /* Superponer sobre la blanca */
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.5);
}

/* Posicionamiento específico de las teclas negras */
.black-key[data-note="C#4"] {
    left: calc(50% - 3 * 60px - 3*2px + 41px);
}

.black-key[data-note="D#4"] {
    left: calc(50% - 2 * 60px - 2*2px + 41px);
}

.black-key[data-note="F#4"] {
    left: calc(50% - 0 * 60px - 0*2px + 41px);
}

.black-key[data-note="G#4"] {
    left: calc(50% + 1 * 60px + 1*2px + 41px);
}

.black-key[data-note="A#4"] {
    left: calc(50% + 2 * 60px + 2*2px + 41px);
}


.piano-key .note-name {
    font-size: 10px;
    user-select: none;
    /* Evitar selección de texto */
}

/* Estilos de resaltado */
.piano-key.highlight-playback {
    background-color: var(--corcholis-blue) !important;
    /* Azul para reproducción */
    box-shadow: inset 0 0 10px var(--corcholis-blue);
}

.piano-key.highlight-correct {
    background-color: var(--corcholis-orange) !important;
    /* Naranja para acierto jugador */
    box-shadow: inset 0 0 10px var(--corcholis-orange);
}

.piano-key.highlight-error {
    background-color: var(--corcholis-red) !important;
    /* Rojo para error jugador */
    box-shadow: inset 0 0 10px var(--corcholis-red);
}

#progress-bar-area {
    width: 80%;
    max-width: 600px;
    margin: 15px auto;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--corcholis-green);
    border-radius: 15px 0 0 15px;
    transition: width 0.3s ease-in-out;
    text-align: center;
    line-height: 25px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
}

#controls-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.control-group label {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--corcholis-dark);
}

/* Estilo para el slider de velocidad */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 10px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 5px;
    cursor: pointer;
}

input[type=range]:hover {
    opacity: 1;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--corcholis-blue);
    cursor: pointer;
    border-radius: 50%;
}

input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--corcholis-blue);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

#message-area {
    margin: 15px 0;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    color: var(--corcholis-dark);
    min-height: 30px;
    /* Espacio para el mensaje */
}

#song-name-area {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    color: var(--corcholis-purple);
    margin-top: 10px;
    min-height: 30px;
    /* Espacio para el nombre */
}

/* Ajustes específicos para la modal */
.corcholis-modal {
    display: none;
    /* Oculto por defecto */
    align-items: center;
    /* Centrado vertical */
    justify-content: center;
    /* Centrado horizontal */
}

.corcholis-modal.active {
    display: flex;
    /* Mostrar cuando tenga la clase active */
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Iconos (usando texto por simplicidad, se pueden reemplazar con SVGs o FontAwesome) */
.icon-sound-on::before {
    content: '🔊';
}

.icon-sound-off::before {
    content: '🔇';
}

.icon-instructions::before {
    content: '❓';
}