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 {
  background-color: black !important;
}


.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: space-evenly;
  }

  .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 */
}
/* ✅ Allow tune.html to control width on small screens */
.fingering-box,
.duration-box {
  width: auto;
  margin: 0 auto;
  max-width: 50px; /* keeps same desktop look, but not locked */
}

.duration-input {
  width: 100%;       /* fills duration-box */
  font-size: 0.8em;
  text-align: center;
  padding: 2px;
  box-sizing: border-box;
}
/* ===== Login Modal (updated for mobile visibility) ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;                         /* shorthand for left/top/width/height */
  z-index: 9999 !important;         /* raise above everything */
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  overflow: visible !important;     /* prevent clipping */
}

.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  max-width: 350px;
  width: 90%;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  position: relative;
  z-index: 10000;                   /* sit on top of overlay */
}

.modal-content h2 {
  margin-bottom: 10px;
}

.modal-content input {
  width: 90%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.modal-buttons {
  margin-top: 15px;
}

.modal-buttons button {
  background: #24a629;
  color: #fff;
  border: none;
  padding: 10px 18px;
  margin: 5px;
  border-radius: 6px;
  cursor: pointer;
}

.modal-buttons button:hover {
  background: #1e8f23;
}
/* ===== Floating Logout Button (top-right) ===== */
#logoutBtn {
  position: fixed;
  top: 12px;
  right: 12px;
  background: #f44336;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 99999;
}

#logoutBtn:hover {
  background: #d32f2f;
}

/* Slightly smaller and tighter for mobile */
@media (max-width: 600px) {
  #logoutBtn {
    padding: 8px 10px;
    font-size: 12px;
    top: 8px;
    right: 8px;
  }
}
/* ===================== LOGIN MODAL ===================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.modal-content {
  background: #fff;
  padding: 30px 25px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content h2 {
  margin-top: 0;
  color: #222;
  font-size: 1.4em;
}

.modal-content p {
  color: #444;
  font-size: 0.95em;
  margin-bottom: 15px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95em;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

.modal-buttons button,
#logoutBtn {
  background: #24a629;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-weight: 600;
}

.modal-buttons button:hover,
#logoutBtn:hover {
  background: #1d8b22;
}

#authMessage {
  font-size: 0.95em;
  font-weight: 600;
  margin-top: 8px;
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile adjustments */
@media (max-width: 500px) {
  .modal-content {
    width: 92%;
    padding: 20px;
  }
  .modal-content h2 {
    font-size: 1.2em;
  }
}
/* ✅ FINAL AUTHORITATIVE MOBILE FIX — WHISTLETABS (Oct 15 2025) */
@media (max-width: 600px) {
  body .tabs-output .note,
  body .note {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
    min-height: auto !important;
    height: auto !important;
    margin: 4px 2px !important;
    padding: 4px 2px !important;
    box-sizing: border-box !important;
  }

  body .fingering-box {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    flex-grow: 0 !important;
    height: auto !important;
  }

  body .hole {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    margin: 3px auto !important;
    border: 2px solid #333 !important;
    border-radius: 50% !important;
    background: white;
    flex-shrink: 0 !important;
    line-height: normal !important;
  }

body .hole.covered,
body .hole.covered-low {
  background-color: black !important;
}

body .hole.covered-high {
  background-color: red !important;
}
  html, body {
    -webkit-text-size-adjust: 100% !important;
  }
}
