/* =========================================
   Grundlayout Wrapper
   ========================================= */

.pkv-wrapper {
  width: 100%;          /* immer volle Breite der Content-Spalte */
  max-width: 1600px;    /* aber nicht breiter als 1600px */
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-sizing: border-box;

  padding-top: 30px;
  padding-bottom: 30px;

  min-height: 410px; /* 210 */
}



/* In TT4 steckt das Ganze in einer wp-block-group – zur Sicherheit zentrieren */
.wp-block-group .pkv-wrapper {
  margin-left: auto;
  margin-right: auto;
}


/* =========================================
   Controls & Buttons
   ========================================= */

.pkv-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pkv-status {
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: #444;
}

.pkv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* alle Buttons gleich hoch */
  height: 34px;
  padding: 0 1rem;

  border-radius: 999px;
  border: 1px solid #888;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1; /* verhindert, dass das ♭ extra Höhe zieht */

  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.pkv-btn:hover {
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Buttons: aktiver Zustand */
.pkv-btn-active {
  background: #222;
  color: #fff;
}

/* Aktiv soll auch beim Hover dunkel bleiben */
.pkv-btn.pkv-btn-active:hover {
  background: #222;
  color: #fff;
}



.pkv-label-acc {
  min-width: 36px;
  text-align: center;
}

/* Oktaven-Controls */
.pkv-octave-controls {
  justify-content: center;
  gap: 0.5rem;
}

.pkv-octave-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 0.75rem; 
  border: 1px solid #888;
  border-radius: 999px;
  background: #f5f5f5; /* #fafafa; */
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 1;
  box-sizing: border-box;
}

.pkv-octave-minus,
.pkv-octave-plus {
  width: 34px;   /* gleiche Größe wie alle Buttons */
  padding: 0;
}

/* =========================================
   Toolbar / UI Layout
   ========================================= */

/* Gesamt-Toolbar über dem Piano */
.pkv-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 24px; /* oder 24px */
}

/* Gemeinsame Grundstruktur für die Zeilen */
.pkv-toolbar-row {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* verteilt Inhalte schön */
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Erste Zeile: Eingabe-Modi */
.pkv-toolbar-row-modes {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgb(0, 0, 0);
}

.pkv-mode-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pkv-mode-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.pkv-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Modus-Status rechts */
.pkv-mode-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #666;
}

.pkv-mode-status .pkv-status-label {
  font-weight: 500;
}

.pkv-mode-status .pkv-status {
  margin-left: 0;
  font-weight: 600;
}

/* Zweite Zeile: Einstellungen als „Kärtchen“ */
.pkv-toolbar-row-settings {
  justify-content: center;
}

.pkv-settings-grid {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 4.0rem;
  justify-content: center;
}

/* Einzelne Setting-Gruppe (Beschriftung, Vorzeichen, Sprache, Oktaven, Pedal) */
.pkv-setting {
  display: flex;
  flex-direction: column;   /* Label oben, Buttons unten */
  align-items: center;
  gap: 0.35rem;
}

/* Label steht jetzt mittig über den Buttons */
.pkv-setting-label {
  font-size: 0.85rem;
  color: #555;
  font-weight: bold;
  min-width: 0;
  text-align: center;
}

/* Buttons bleiben in einer Reihe unter dem Label */
.pkv-setting-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}


/* Buttons in den Settings etwas kompakter */
.pkv-setting .pkv-btn {
  height: 30px;
  padding: 0 0.9rem;
  font-size: 0.85rem;
}

/* Oktaven-Kontrollen etwas enger fassen */
.pkv-octave-controls {
  gap: 0.35rem;
}


/* Responsive: unter 900px Labels über die Buttons setzen */
@media (max-width: 900px) {
  .pkv-toolbar-row {
    justify-content: center;
  }

  .pkv-setting {
    flex-direction: column;
    align-items: center;
  }

  .pkv-setting-label {
    min-width: auto;
    text-align: center;
  }
}


/* =========================================
   Keyboard-Container
   ========================================= */

.pkv-piano-scale-wrapper,
.pkv-keyboard {
  width: 100%;
  display: flex;
  justify-content: center; /* Piano mittig platzieren */
  align-items: center;
}

/* der innere Container, der das Piano hält */
.pkv-keyboard {
  height: auto;
  min-height: 400px; /* 120 Sicherheitsnetz gegen "Linie" */
  box-sizing: border-box;
  align-items: flex-start;
}

/* =========================================
   Piano selbst (Hintergrund)
   ========================================= */

.pkv-piano {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  white-space: nowrap;

  height: 160px;
  padding: 0.7rem 0.8rem;   /* etwas weniger, um 30px top/bottom gut zu halten */

  background: transparent; /* #f8f8f8; */
  border-radius: 0px;
  box-shadow: none; /* 0 2px 6px rgba(0,0,0,0.2); */
  box-sizing: border-box;
}


/* =========================================
   Tasten
   ========================================= */

.pkv-key {
  user-select: none;
  cursor: pointer;
}

/* Weiße Tasten – feste Breite + Höhe */
.pkv-key-white {
  position: relative;
  flex: 0 0 22px;    /* feste Breite je weiße Taste */
  height: 120px;      /* Höhe der weißen Taste */

  background: linear-gradient(to bottom, #ffffff, #e7e7e7);
  margin: 0;

  border-top: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
  border-left: 1px solid #bbb;
  border-right: 0;

  border-radius: 0 0 4px 4px;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.18);
}

/* rechte Kante der allerletzten Taste wieder sichtbar machen */
.pkv-key-white:last-child {
  border-right: 1px solid #bbb;
}

/* Schwarze Tasten – fixe Größe, zwischen weißen Tasten */
.pkv-key-black {
  position: absolute;
  top: 0;

  /* an der rechten Kante der weißen Taste */
  left: 100%;
  transform: translateX(-50%);

  width: 12px;
  height: 65px; /* etwas kürzer als die weißen Tasten */

  background: linear-gradient(to bottom, #333, #111);
  border-radius: 0 0 4px 4px;

  box-shadow:
    0 2px 4px rgba(0,0,0,0.6),
    inset 0 -2px 0 rgba(255,255,255,0.08);

  z-index: 2;
}

/* aktiver Zustand (rot) */
.pkv-key-active.pkv-key-white,
.pkv-key-white.pkv-key-active {
  background: linear-gradient(to bottom, #ff9a9a, #ff5b5b);
  box-shadow:
    inset 0 -5px 0 rgba(120, 0, 0, 0.5),
    0 3px 6px rgba(255, 0, 0, 0.7);
}

.pkv-key-active.pkv-key-black,
.pkv-key-black.pkv-key-active {
  background: linear-gradient(to bottom, #ff6666, #ff3030);
  box-shadow:
    0 4px 8px rgba(255, 0, 0, 0.8),
    inset 0 -3px 0 rgba(60, 0, 0, 0.7);
}

/* =========================================
   Beschriftungen (Labels)
   ========================================= */

.pkv-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem; 
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* weiße Tasten: Beschriftung UNTER dem Keyboard */
.pkv-label-white {
  bottom: -22px;
  color: #444;
}

/* schwarze Tasten: Beschriftung ÜBER dem Keyboard */
.pkv-label-black {
  top: -22px;
  color: #222;
}


