body {
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: sans-serif;
}

.piano-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #222;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    width: 90vw; /* Skaalautuu näytön leveyden mukaan */
    max-width: 600px;
}

.piano-keys-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative; /* Lisätty mustille näppäimille */
}

.piano-key {
    float: inline-start;
    width: 3.33vw;
    height: 10vw;
    max-width: 40px;
    max-height: 160px;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 0 0 5px 5px; /* Pyöristys vain alareunassa */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
    margin: 0 2px;
    transition: background-color 0.1s ease;
    box-sizing: border-box; /* Sisällytä reuna kokoon */
    z-index: 1; /* Valkoiset näppäimet ovat mustien alla */
}

.black-key-placeholder {
    width: 0; /* Aseta leveydeksi 0, jotta ei vie tilaa */
    height: 0;
    margin: 0 2px;
}

.black-key {
    position: absolute;
    width: 2.3vw;
    height: 6vw;
    max-width: 25px;
    max-height: 100px;
    background-color: #000;
    border: 1px solid #000;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
    z-index: 2; /* Mustat näppäimet ovat valkoisten päällä */
    transform: translateX(-50%);
}

/* Sijoita mustat näppäimet oikeisiin paikkoihin */
.black-key:nth-child(1) { left: calc(3.33vw * 1.5); }
.black-key:nth-child(2) { left: calc(3.33vw * 2.5); }
.black-key:nth-child(3) { left: calc(3.33vw * 4.5); }
.black-key:nth-child(4) { left: calc(3.33vw * 5.5); }
.black-key:nth-child(5) { left: calc(3.33vw * 6.5); }
.black-key:nth-child(6) { left: calc(3.33vw * 8.5); }
.black-key:nth-child(7) { left: calc(3.33vw * 9.5); }
.black-key:nth-child(8) { left: calc(3.33vw * 11.5); }
.black-key:nth-child(9) { left: calc(3.33vw * 12.5); }
.black-key:nth-child(10) { left: calc(3.33vw * 13.5); }
.black-key:nth-child(11) { left: calc(3.33vw * 15.5); }
.black-key:nth-child(12) { left: calc(3.33vw * 16.5); }
.black-key:nth-child(13) { left: calc(3.33vw * 17.5); }

.piano-key-label {
    background-color: #000;
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.piano-key.active {
    background-color: #00ff00;
}

.black-key.active {
    background-color: #00ff00;
}

.bass-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.bass-indicators {
    display: flex;
    justify-content: center;
}

.bass-indicator {
    font-size: 5vw;
    color: #ccc;
    margin: 0 1vw;
    transition: color 0.1s ease;
    cursor: pointer;
    width: 40px;
    text-align: center;
}

.bass-indicator.active {
    color: #ffff00;
}

.bass-labels {
    display: flex;
    justify-content: center;
}

.bass-label {
    font-size: 2vw;
    color: #fff;
    margin: 0 1vw;
    font-weight: bold;
    text-align: center;
    width: 40px;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}


















































@media (max-width: 700px) {

.piano-container {
    rotate: 90deg;
    transform: scale(2);
}


.piano-key {
    float: inline-start;
    width: 3.5vw;
    height: 20vw;
    max-width: 50px;
    max-height: 160px;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 0 0 5px 5px; /* Pyöristys vain alareunassa */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
    margin: 0 0px;
    transition: background-color 0.1s ease;
    box-sizing: border-box; /* Sisällytä reuna kokoon */
    z-index: 1; /* Valkoiset näppäimet ovat mustien alla */
}


.piano-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #222;
    padding: 7px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    width: 85vw; /* Skaalautuu näytön leveyden mukaan */
    max-width: 600px;
}

.piano-key-label {
    background-color: #000;
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.5em;
    font-weight: bold;
    margin-bottom: 5px;
}



}