body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Courier New', monospace;
    color: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

#upper-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 10px 10px 10px;
    box-sizing: border-box;
    position: relative;
}

#tracker-container {
    position: absolute;   /* pixelgenaue Positionierung möglich */
    left: 105px;           /* horizontale Position vom linken Bildschirmrand */
    top: 138px;           /* vertikale Position vom oberen Bildschirmrand */
    display: flex;
    align-items: flex-start;  /* Panels oben ausrichten */
}


#tracker-panel {
    width: 248px;
    height: 395px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #111111; /* Panel-Hintergrund bleibt */
}

#channel-big {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11rem;
    font-weight: bold;
    font-family: 'Lucida Console', monospace;
    color: rgba(255, 255, 255, 0.15); /* fast durchsichtig → wirkt wie Hintergrund */
    z-index: 1; /* alles andere liegt drüber */
    pointer-events: none;
    user-select: none;
}

#pattern-table {
    position: absolute; /* absolute Positionierung */
    top: 0px;           /* feste Positionen */
    left: 0px;
    /* kein flex nötig */
}


.row {
    height: 26px;
    align-items: left;
    position: absolute;
    width: 0;
    left: 0;
}


.note-cell {

}

.row-number,
.note-cell,
.volume-cell,
.decay-cell,
.delay-cell,
.jump-cell,
.speed-cell,
.detune-cell,
.attack-cell {
    padding: 0 0px;
    background: transparent;
    font-size: 9px;
    font-weight: light;
    font-family: Lucida Console;
    white-space: nowrap;
    width: 32px;
    color: #ffff00;
    text-align: center;          /* neu – wichtig für Zentrierung */
}



/* Alte Zeilen-Hervorhebung entfernen – Cursor arbeitet jetzt nur auf Zellebene */
.row.cursor {
    background: transparent !important;
}




/* Neuer Cursor: gelber Rahmen + leichter Hintergrund nur um die aktive Zelle */

.cell.cursor-cell {
    outline: 2px solid #ffff00;
    outline-offset: -2px;
    background: rgba(255, 255, 0, 0.15) !important;
}



.row.playhead {
    background: #6688aa !important;
    animation: pulse 0.3s infinite alternate;
    font-weight: bold;
}

@keyframes pulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

#piano-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px;
    background: #111111;
    display: flex;
    justify-content: flex-start;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
    user-select: none;
    z-index: 10;
    overflow: hidden;
}

.key { box-sizing: border-box; cursor: pointer; transition: all 0.1s ease; position: relative; }
.white { height: 140px; background: linear-gradient(to bottom, #ffffff, #f1f5f9); border: 1px solid #475569; border-radius: 0 0 8px 8px; }
.white.pressed { background: #888888; transform: translateY(2px); }
.black { width: 43px; height: 85px; background: #000000; border-radius: 0 0 5px 5px; margin: 0 -21.5px; z-index: 2; }
.black.pressed { background: #aaaaaa; }
.label { position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center; font-weight: bold; font-size: 10px; pointer-events: none; }
.white .label { color: #000000; }
.black .label { color: #ffffff; bottom: 4px; font-size: 9px; }

.control-key {
    width: 35px;
    height: 30px;
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border: 2px solid #666666;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: all 0.1s ease;
    user-select: none;
}

.control-key.pressed {
    background: #888888;
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.control-key.active {
    border-color: #ffff00;
    box-shadow: 0 0 12px rgba(255, 255, 0, 0.6);
}

.control-key span { pointer-events: none; }

#bpm-display {
    width: 35px;
    height: 30px;
    background: #000000;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #00ff00;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

#bpm-display span {
    pointer-events: none;
}

.octave-key {
    width: 35px;
    height: 30px;
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border: 2px solid #666666;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: all 0.1s ease;
    user-select: none;
    text-align: center;
}

.octave-key.pressed {
    background: #888888;
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.octave-key span { pointer-events: none; }



.panL-cell,
.panR-cell {
    padding: 0;
    background: transparent;
    font-size: 9px;
    font-weight: normal;
    font-family: Lucida Console;
    white-space: nowrap;
    width: 20px;                /* etwas schmaler als die anderen, passt besser */
    color: #ffff00;
    text-align: center;
}

/* Cursor-Styling für die neuen Spalten */
.cell.cursor-cell.panL-cell,
.cell.cursor-cell.panR-cell {
    outline: 2px solid #ffff00;
    outline-offset: -2px;
    background: rgba(255, 255, 0, 0.15) !important;
}




#pattern-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 16px;                   /* sehr flach – wie gewünscht */
    background: #222222;
    z-index: 5;
    display: flex;
    align-items: center;
    color: #ffcc00;                 /* goldgelb */
    font-size: 8pt;
    font-weight: bold;
    pointer-events: none;
    border-bottom: 1px solid #444444;
}


/* Linkes eigenständiges Panel */
#left-panel-container {
    position: absolute;
    top: 138px;       /* gleiche Höhe von oben wie Tracker */
    left: 55px;       /* neue Position links */
    width: 32px;      /* Breite der Spalte */
    height: 395px;    /* gleiche Höhe wie Tracker-Panel */
    display: flex;
    align-items: flex-start;
    z-index: 5;
}

#left-panel {
    width: 32px;
    height: 395px;
    background: #111111; /* exakt wie Tracker */
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header-Zelle oben */
#left-panel div:first-child {
    width: 100%;
    height: 16px;         /* Headerhöhe wie beim Tracker */
    background: #222222;  /* Headerfarbe wie beim Tracker */
    color: #ffcc00;       /* Textfarbe wie beim Tracker */
    font-size: 7pt;
    font-weight: bold;
    text-align: center;
    line-height: 16px;    /* vertikal zentriert */
    pointer-events: none; /* keine Interaktion */
}

/* Zeilen in der linken Spalte */
.left-row {
    position: absolute;
    width: 32px;           /* passt exakt in das Panel */
    height: 26px;          /* gleiche Zeilenhöhe wie Tracker */
    left: 0;
    color: #ffff00;        /* gelbe Schrift wie Tracker */
    font-family: Lucida Console, monospace;
    font-size: 9px;
    text-align: center;
    border-bottom: 1px solid #333; /* leichte Linie wie Tracker */
}

/* Aktive Zeile/Cursor-Zeile */
.left-row.cursor-cell {
    outline: 2px solid #ffff00;
    outline-offset: -2px;
    background: rgba(255,255,0,0.15);
}

#play-stop-btn {
    font-size: 8px !important;     /* ← Hauptgröße – probiere 9px oder 8px wenn es noch kleiner sein soll */
}

#play-stop-btn span {
    font-size: 8px !important;     /* Sicherheitshalber auch die spans direkt ansprechen */
    line-height: 1;                 /* verhindert unnötigen Abstand */
}

#play-stop-btn .btn-labels {
  display: flex;
  flex-direction: column;
  font-size: 8px;
  line-height: 1;
  text-align: center;
}

#play-stop-btn .btn-labels span {
  margin: 0;
  padding: 0;
}


.header-cell {
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

