body {
  font-family: Arial, sans-serif;
  background: #f7f7f7;
  text-align: center;
  padding: 20px;
  line-height: 1.6;
}

h1 {
  margin-bottom: 20px;
}

section.controls {
  margin: 20px auto;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  max-width: 700px;
}

section.controls h2 {
  margin-top: 0;
  font-size: 1.1em;
  color: #444;
}

textarea {
  font-size: 16px;
  padding: 8px;
  margin: 10px auto;
  display: block;
  width: 100%;
  max-width: 600px;
}

button {
  padding: 10px 20px;
  font-size: 16px;
  margin: 6px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: #4caf50;
  color: white;
  transition: background 0.2s;
}

button:hover {
  background: #45a049;
}

button.back-btn {
  background: #2196f3;   /* blue instead of green */
  margin-bottom: 15px;
}

button.back-btn:hover {
  background: #1976d2;
}

.note {
  display: inline-block;
  margin: 3px;
  padding: 3px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.hole {
  width: 14px;
  height: 14px;
  border: 2px solid black;
  border-radius: 50%;
  margin: 2px auto;
  background-color: white; /* always visible as open */
}

.hole.covered-low {
  background-color: black !important;
}

.hole.covered-high {
  background-color: red !important;
}

#output,
#tabsOutput {
  display: grid;
  grid-template-columns: repeat(8, 1fr); /* exactly 8 notes per row */
  gap: 4px;
  justify-items: center;
  margin: 10px auto;
  width: 100%;
  max-width: 1000px;
}

.barline {
  width: 2px;
  height: 80px; /* shorter for compact look */
  background: black;
  margin: auto;
}

#timeline {
  width: 100%;
  height: 8px;
  background: #ddd;
  margin-top: 20px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

#progress {
  width: 0%;
  height: 100%;
  background: #4caf50;
  transition: width 0.2s linear;
}

/* Progress slider */
#progressBar {
  width: 100%;
  height: 12px;
  margin-top: 10px;
  cursor: pointer;
}

#progressBar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4caf50;
  cursor: pointer;
}

#progressBar::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4caf50;
  cursor: pointer;
}

@media (max-width: 600px) {
  #output,
  #tabsOutput {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 4px;
  }

  .note {
    display: flex;              /* use flexbox */
    flex-direction: column;     /* stack children vertically */
    justify-content: space-between; /* push input to bottom */
    align-items: center;
    width: 54px;
    height: 160px;              /* tall enough for all elements */
    margin: 0 auto;
    text-align: center;
    font-size: 12px;
    box-sizing: border-box;
    padding: 4px;
  }

  .fingering-box {
    width: 44px;
    margin: 4px auto;
    flex-grow: 1;               /* take up middle space */
    display: flex;
    flex-direction: column;
    justify-content: center;    /* center holes vertically */
  }

  .duration-box {
    width: 44px;
    margin: 0 auto;
  }

  .duration-input {
    width: 100%;
    height: 22px;
    font-size: 0.75em;
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
  }

  .hole {
    width: 11px;
    height: 11px;
    margin: 2px auto;
  }
}

  .barline {
    height: 60px;
  }
}

.duration-label {
  font-size: 0.8em;
  margin-top: 4px;
  color: #444;
}

.duration-label.long-note {
  color: #00ff00; /* bright green */
  font-weight: bold;
}

.duration-label.short-note {
  color: #0066ff; /* bright blue */
  font-style: italic;
  font-weight: bold;
}
/* Highlight current note */
.note.active {
  background-color: yellow;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

/* Hide scrollbar in note area */
#tabsOutput {
  overflow: hidden;  /* no scrollbars */
}
.fingering-box,
.duration-box {
  width: 50px;       /* lock width */
  margin: 0 auto;    /* center inside note */
}

.duration-input {
  width: 100%;       /* fills duration-box */
  font-size: 0.8em;
  text-align: center;
  padding: 2px;
  box-sizing: border-box;
}
