/* suling sunda by the orangz -*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body {
  background: radial-gradient(ellipse at top, #c87941 0%, #87431d 50%),
    linear-gradient(135deg, #c87941 0%, #87431d 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Georgia", serif;
  overflow: hidden;
  position: relative;
}

/* pattern bambu background */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="bamboo" patternUnits="userSpaceOnUse" width="100" height="100"><rect width="100" height="100" fill="none"/><path d="M0,20 Q50,15 100,20 M0,40 Q50,35 100,40 M0,60 Q50,55 100,60 M0,80 Q50,75 100,80" stroke="%23DBCBBD" stroke-width="0.5" opacity="0.1" fill="none"/></pattern></defs><rect width="100%" height="100%" fill="url(%23bamboo)"/></svg>')
    repeat;
  opacity: 0.3;
  pointer-events: none;
}

.title {
  color: #dbcbbd;
  font-size: 3rem;
  font-weight: bold;
  text-shadow: 3px 3px 6px rgba(41, 0, 1, 0.8), 0 0 20px rgba(255, 217, 61, 0.3);
  margin-bottom: 25px;
  text-align: center;
  letter-spacing: 2px;
}

.instructions {
  color: #ffd93d;
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 40px;
  text-shadow: 2px 2px 4px rgba(41, 0, 1, 0.7);
  max-width: 700px;
  padding: 15px 25px;
  background: rgba(41, 0, 1, 0.2);
  border-radius: 15px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 217, 61, 0.3);
}

/* container suling */
.flute-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 50px 0;
  perspective: 1000px;
}

/* body suling utama */
.flute {
  width: 700px;
  height: 80px;
  background: linear-gradient(
    180deg,
    #dbcbbd 0%,
    #c87941 25%,
    #87431d 50%,
    #c87941 75%,
    #dbcbbd 100%
  );
  border-radius: 40px;
  position: relative;
  box-shadow: 0 15px 30px rgba(41, 0, 1, 0.5),
    inset 0 5px 10px rgba(255, 255, 255, 0.4),
    inset 0 -5px 10px rgba(41, 0, 1, 0.3), 0 0 50px rgba(255, 217, 61, 0.1);
  border: 3px solid #87431d;
  transform-style: preserve-3d;
}

/* ujung suling kiri */
.flute::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 30px;
  width: 40px;
  height: 96px;
  background: linear-gradient(135deg, #dbcbbd 0%, #c87941 50%, #87431d 100%);
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(41, 0, 1, 0.4),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3);
  border: 2px solid #87431d;
}

/* efek highlight */
.flute::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 60px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(135, 67, 29, 0.1) 50px,
    transparent 100px
  );
  border-radius: 30px;
  pointer-events: none;
}

/* garis2 bambu */
.bamboo-rings {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 40px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(135, 67, 29, 0.2) 1px,
    transparent 2px,
    transparent 80px
  );
  pointer-events: none;
}

/* lubang2 suling */
.hole {
  position: absolute;
  width: 45px;
  height: 45px;
  background: radial-gradient(
    circle at 30% 30%,
    #87431d 0%,
    #290001 50%,
    #000000 100%
  );
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: all 0.15s ease-out;
  box-shadow: inset 0 8px 16px rgba(41, 0, 1, 0.9),
    inset 0 -4px 8px rgba(135, 67, 29, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
  border: 2px solid #290001;
  z-index: 10;
}

/* highlight di lubang */
.hole::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 20% 20%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.hole:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: inset 0 10px 20px rgba(41, 0, 1, 0.95),
    inset 0 -6px 12px rgba(135, 67, 29, 0.4), 0 8px 16px rgba(255, 217, 61, 0.3);
}

/* pas lubang di klik */
.hole.active {
  background: radial-gradient(
    circle at 30% 30%,
    #ffd93d 0%,
    #c87941 40%,
    #87431d 80%,
    #290001 100%
  );
  transform: translateY(-50%) scale(0.9);
  box-shadow: inset 0 4px 12px rgba(41, 0, 1, 0.7),
    0 0 25px rgba(255, 217, 61, 0.6);
  border-color: #ffd93d;
}

/* pas ditahan */
.hole.pressed {
  background: radial-gradient(
    circle at 30% 30%,
    #ffd93d 0%,
    #c87941 30%,
    #87431d 60%,
    #290001 100%
  );
  transform: translateY(-50%) scale(0.85);
  box-shadow: inset 0 6px 16px rgba(41, 0, 1, 0.8),
    0 0 30px rgba(255, 217, 61, 0.8);
}

/* posisi masing2 lubang */
.hole:nth-child(2) { left: 130px; }
.hole:nth-child(3) { left: 200px; }
.hole:nth-child(4) { left: 270px; }
.hole:nth-child(5) { left: 340px; }
.hole:nth-child(6) { left: 410px; }
.hole:nth-child(7) { left: 480px; }
.hole:nth-child(8) { left: 550px; }

/* label tombol keyboard */
.key-labels {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 55px;
}

.key-label {
  color: #ffd93d;
  font-weight: bold;
  font-size: 1.4rem;
  text-shadow: 2px 2px 4px rgba(41, 0, 1, 0.8);
  padding: 8px 12px;
  background: rgba(41, 0, 1, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 217, 61, 0.3);
  transition: all 0.2s ease;
}

.key-label.active {
  background: rgba(255, 217, 61, 0.3);
  color: #290001;
  transform: scale(1.1);
}

/* tampilan nada */
.notes-display {
  margin-top: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.current-note {
  color: #ffd93d;
  font-size: 2.5rem;
  font-weight: bold;
  text-shadow: 3px 3px 6px rgba(41, 0, 1, 0.8);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.current-note.playing {
  transform: scale(1.1);
  text-shadow: 3px 3px 6px rgba(41, 0, 1, 0.8), 0 0 20px rgba(255, 217, 61, 0.6);
}

/* efek gelombang suara */
.sound-wave {
  position: absolute;
  border: 2px solid #ffd93d;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  animation: gelombangMelebar 0.6s ease-out forwards;
}

/* footer buat tombol */
.footer {
  position: absolute;
  bottom: 525px;
  right: 1100px;
}

.footer button {
  height: 40px;
  width: 100px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 18px;
  background-color: transparent;
  border: none;
  color: #3a0001;
  border: #3a0001 2px solid;
  transition: 0.5s ease-in-out;
}

.footer button:hover {
  height: 40px;
  width: 100px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  background-color: #3a0001;
  border: none;
  box-shadow: 0 0px 20px 2px rgba(0, 0, 0, 0.5);
  color: #dbcbbd;
}

/* animasi gelombang */
@keyframes gelombangMelebar {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 70px;
    height: 70px;
    opacity: 0;
  }
}

/* responsive tablet */
@media (max-width: 768px) {
  .title {
    font-size: 2.2rem;
    margin-bottom: 20px;
  }

  .instructions {
    font-size: 1rem;
    margin-bottom: 30px;
    padding: 12px 20px;
  }

  .flute {
    width: 400px;
    height: 60px;
  }

  .flute::before {
    width: 30px;
    height: 76px;
    left: 20px;
    top: -8px;
  }

  .hole {
    width: 35px;
    height: 35px;
  }

  /* posisi lubang tablet */
  .hole:nth-child(2) { left: 80px; }
  .hole:nth-child(3) { left: 115px; }
  .hole:nth-child(4) { left: 150px; }
  .hole:nth-child(5) { left: 185px; }
  .hole:nth-child(6) { left: 220px; }
  .hole:nth-child(7) { left: 255px; }
  .hole:nth-child(8) { left: 290px; }

  .key-labels {
    gap: 20px;
    margin-left: 80px;
    font-size: 1rem;
  }

  .key-label {
    font-size: 1rem;
    padding: 6px 8px;
  }

  .current-note {
    font-size: 2rem;
  }

  .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 0;
    background: rgba(41, 0, 1, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 217, 61, 0.2);
    z-index: 1000;
  }

  .footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .footer-text {
    color: #ffd93d;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(41, 0, 1, 0.8);
    letter-spacing: 1px;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
  }

  .footer-text:hover {
    opacity: 1;
    text-shadow: 2px 2px 4px rgba(41, 0, 1, 0.8),
      0 0 15px rgba(255, 217, 61, 0.5);
  }

  .footer {
    padding: 10px 0;
  }

  .footer-text {
    font-size: 0.9rem;
  }
}

/* responsive hp */
@media (min-width: 320px) and (max-width: 767px) {
  body {
    background: radial-gradient(ellipse at top, #c87941 0%, #87431d 100%),
      linear-gradient(135deg, #c87941 0%, #87431d 100%);
    font-family: "Poppins", sans-serif;
    overflow: auto;
    padding-bottom: 96px;
  }

  .title {
    font-size: clamp(1.4rem, 6vw, 2.2rem);
    margin-bottom: 14px;
  }

  .instructions {
    font-size: clamp(0.9rem, 3.6vw, 1.1rem);
    margin-bottom: 18px;
    padding: 10px 14px;
    max-width: 92vw;
  }

  .flute-container {
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
  }

  /* suling mobile */
  .flute {
    width: 450px;
    height: 65px;
    border-radius: 28px;
  }

  .flute::before {
    left: 4%;
    width: 30px;
    height: 80px;
    top: -8px;
  }

  .flute::after {
    height: 48px;
    border-radius: 22px;
  }

  .hole {
    position: absolute;
    left: 10px;
    width: 30px;
    height: 30px;
  }

  .hole:nth-child(1) { left: 2%; }
  .hole:nth-child(2) { left: 18.5%; }
  .hole:nth-child(3) { left: 28.6%; }
  .hole:nth-child(4) { left: 38.6%; }
  .hole:nth-child(5) { left: 48.6%; }
  .hole:nth-child(6) { left: 58.6%; }
  .hole:nth-child(7) { left: 68.6%; }
  .hole:nth-child(8) { left: 78.6%; }

  .key-labels {
    gap: 14px;
    margin-left: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .key-label {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    padding: 6px 8px;
  }

  .current-note {
    font-size: clamp(1.4rem, 8vw, 2rem);
    min-height: 44px;
  }

  .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 8px;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 217, 61, 0.12);
  }

  .footer button {
    height: 40px;
    width: 86px;
    font-size: 16px;
  }

  /* matiin gelombang di mobile agar tidak lag*/
  .sound-wave {
    display: none;
  }
}