* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(0,0,8,1) 0%, rgba(0,212,255,1) 50%, rgba(0,0,8,1) 100%);
  font-family: system-ui, sans-serif;
  color: white;
}

header {
  height: 40px;
  display: flex;
  gap: 4px;
  padding: 4px;
  align-items: center;
}

/* Burger */
#burgerMenu {
  margin-left: auto;
  position: relative;
}

#burgerBtn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
}

#burgerContent {
  position: absolute;
  top: 100%;
  right: 0;
  background: #222;
  display: none;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  z-index: 20;
}

#burgerContent button {
  background: none;
  border: none;
  color: white;
  padding: 8px 12px;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

#burgerContent button:hover { background: #0c658f; }

/* Tracks container */
#tracks {
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.track {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  background: #444;
  border-radius: 4px;
  border: 2px solid #0c658f;
  overflow: hidden;
  flex: 1 1 calc((100% - 16px)/5);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  flex-shrink: 0;
}

.controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: #666;
  color: white;
  cursor: pointer;
}

.controls button:hover { background: #0c658f; }

input[type="range"] { flex: 1; }

canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  background: linear-gradient(180deg, #e0e0e0 0%, #9e9e9e 50%, #2b2b2b 100%);
}

@media (orientation: landscape) {
  #tracks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
  }
  .track { flex: unset; }
}


.trackTitle {
  position: absolute;
  top: 32px; /* juste en dessous des boutons de contrôle */
  left: 4px;
  font-size: 14px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 4px black;
  pointer-events: none;
  z-index: 5;
}
.track { position: relative; } /* nécessaire pour que trackTitle se positionne correctement */
