/* ===============================
   Asteikon muodostaminen – tyyli (SCOPED)
   =============================== */

#asteikko-app {
  width: 100%;
  max-width: 1100px; /* leveämpi mutta ei täysin reunaan */
  margin: 0 auto;
  text-align: center;
  background: #fff;
  padding: 20px;
  box-sizing: border-box;
  font-family: "Marker Felt", sans-serif;
}
  margin: 0 auto;
  text-align: center;
  background: #fafafa;
  padding: 20px;
  box-sizing: border-box;
  font-family: "Marker Felt", sans-serif;
}

/* fontti vain plugarissa */
#asteikko-app button,
#asteikko-app input,
#asteikko-app select,
#asteikko-app label,
#asteikko-app #abcName,
#asteikko-app #status,
#asteikko-app #stars {
  font-family: "Marker Felt", sans-serif;
}

/* ---------------------------------
   TEHTÄVÄNAPIT
--------------------------------- */
#asteikko-app #task-buttons {
  margin: 20px 0;
}

#asteikko-app .task-btn {
  background: #ccc;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  margin: 4px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}

#asteikko-app .task-btn:hover {
  background: #bbb;
}

#asteikko-app .task-btn.active {
  background: #7ba8c5;
  color: white;
}

/* ---------------------------------
   PLAYER-NAPIT
--------------------------------- */
#asteikko-app #player-controls {
  margin: 15px 0;
}

#asteikko-app #player-controls button {
  background: #e0e0e0;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin: 3px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: none;
  transition: background 0.2s;
}

#asteikko-app #player-controls button:hover {
  background: #ccc;
}

#asteikko-app #player-controls button:active {
  background: #2196F3;
  color: white;
}

#asteikko-app #progress {
  vertical-align: middle;
  margin-left: 10px;
}

/* ---------------------------------
   NUOTTINAPIT
--------------------------------- */
#asteikko-app #note-buttons {
  margin-top: 20px;
}

#asteikko-app #note-buttons button {
  background: #ddd;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

#asteikko-app #note-buttons button:hover {
  background: #ccc;
}

#asteikko-app #note-buttons button.active {
  background: #85bb1a;
  color: white;
}

/* ---------------------------------
   ETUMERKKINAPIT AKTIVOITUINA
--------------------------------- */
#asteikko-app #note-buttons button[data-sign='sharp'].active {
  background: #f44336 !important;
  color: white !important;
}

#asteikko-app #note-buttons button[data-sign='flat'].active {
  background: #ffeb3b !important;
  color: black !important;
}

/* ---------------------------------
   ETUMERKKINAPIT (♯ ja ♭)
--------------------------------- */
#asteikko-app #note-buttons button[data-accidental="^"],
#asteikko-app #note-buttons button[data-accidental="_"] {
  background: #ddd;
  color: black;
}

#asteikko-app #note-buttons button[data-accidental="^"].flash {
  background: #f44336;
  color: white;
}

#asteikko-app #note-buttons button[data-accidental="_"].flash {
  background: #ffeb3b;
  color: black;
}

/* ---------------------------------
   ABC-NOTAATIO JA STATUS
--------------------------------- */
#asteikko-app #abcName {
  font-size: 20px;
  color: #1976d2;
  margin-top: 15px;
  font-weight: bold;
}

#asteikko-app #paperUser {
  margin: 20px auto;
  display: inline-block;
  background: white;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);

  /* 🔥 TÄRKEÄ MUUTOS */
  transform: none;

  transform-origin: top center;
}

#asteikko-app #status {
  margin-top: 20px;
  font-size: 18px;
  color: #333;
}

/* ---------------------------------
   NUOTTIEN OIKEIN / VÄÄRIN
--------------------------------- */
#asteikko-app .abcjs-note.correct {
  fill: #4CAF50 !important;
  stroke: #4CAF50 !important;
}

#asteikko-app .abcjs-note.wrong {
  fill: #f44336 !important;
  stroke: #f44336 !important;
}

/* Klikkaa-muokkaa: valittu nuotti korostuu ennen korvaamista */
#asteikko-app .abcjs-note.editing {
  fill: #2196F3 !important;
  stroke: #2196F3 !important;
}

/* Lisäystila (Lisää ennen/jälkeen) – eri väri kuin korvaustila, ettei sekoitu */
#asteikko-app .abcjs-note.inserting {
  fill: #ff9800 !important;
  stroke: #ff9800 !important;
}

#asteikko-app .abcjs-note {
  cursor: pointer;
}

/* ---------------------------------
   TÄHTIARVIOINTI
--------------------------------- */
#asteikko-app #stars {
  margin-top: 12px;
  font-size: 36px;
  color: gold;
  letter-spacing: 4px;
}

/* ---------------------------------
   MISC
--------------------------------- */
#asteikko-app button:focus {
  outline: none;
}
/* =================================
   ACTION-NAPPIEN SININEN ACTIVE
   (override vihreän nuottinapin yli)
================================= */

#asteikko-app #note-buttons button[onclick*="asteikko_check"].active,
#asteikko-app #note-buttons button[onclick*="asteikko_removeLast"].active,
#asteikko-app #note-buttons button[onclick*="asteikko_reset"].active {
  background: #7ba8c5 !important;
  color: white !important;
}

/* hover myös sinisenä */
#asteikko-app #note-buttons button[onclick*="asteikko_check"].active:hover,
#asteikko-app #note-buttons button[onclick*="asteikko_removeLast"].active:hover,
#asteikko-app #note-buttons button[onclick*="asteikko_reset"].active:hover {
  background: #6a97b3 !important;
}

/* =========================================
   ASTEIKON MUODOSTAMINEN – ETENEMISEN SEURANTA
========================================= */

#asteikko-app .task-btn.task-done {
  border: 2px solid #4CAF50 !important;
  position: relative !important;
  padding-right: 26px !important;
}

#asteikko-app .task-btn.task-done::after {
  content: "✓" !important;
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #4CAF50 !important;
  font-weight: bold !important;
}

#asteikko-app .task-btn.task-done.active::after {
  color: #fff !important;
}

#asteikko-app #asteikko-progress-summary {
  font-size: 15px;
  color: #555;
  margin: 8px 0 4px;
}

#asteikko-app #asteikko-login-prompt {
  background: #fff8e1;
  border-left: 5px solid #ffc107;
  padding: 12px 16px;
  margin: 0 0 15px;
  font-size: 15px;
  color: #333;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#asteikko-app .asteikko-login-btn {
  background: #4f8cc4 !important;
  color: #fff !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-size: 14px !important;
  display: inline-block !important;
}

#asteikko-app .asteikko-login-btn:hover {
  background: #3d729e !important;
}