@font-face {
  font-family: "JetBrains Mono NL";
  src: url("fonts/JetBrainsMonoNL-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body { height: 100%; margin: 0; }

body{
  background: #b9b9b9;
  overflow: hidden;
}

.stage{
  height: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
}

.portal{
  width: min(78vmin, 820px);
  height: min(78vmin, 820px);
  position: relative;
  overflow: hidden;

  background: #b9b9b9;
  border: 1px solid rgba(0,0,0,0.12);

  box-shadow:
    0 28px 70px rgba(0,0,0,0.22),
    0 3px 12px rgba(0,0,0,0.12);

  background-image:
    radial-gradient(120% 120% at 50% 105%, rgba(255,255,255,0.38) 0%, rgba(255,255,255,0.00) 62%),
    linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0.00));

  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Canvas del espectro encima del logo */
#spectrum{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;

  mix-blend-mode: screen;
  filter: saturate(2.35) contrast(1.22);
}
#spectrum.on{ opacity: 0.985; }

/* HUD */
.hud{
  position: absolute;
  z-index: 6;
  width: 240px;

  font-family: "JetBrains Mono NL", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.25;

  color: rgba(35,35,35,0.46);

  opacity: 0;
  transition: opacity 220ms ease;

  user-select: none;
  -webkit-user-select: none;
}
.hud.on{ opacity: 1; }

.hud-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.hud-bins{
  margin-top: 10px;
  opacity: 0.80;
  letter-spacing: 0.2px;
}

/* Logo */
.logo{
  position: absolute;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Controls arriba izquierda (solo visibles cuando hay track seleccionado) */
.controls{
  position: absolute;
  left: 26px;
  top: 22px;
  z-index: 7;
  display: flex;
  gap: 18px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.controls.on{
  opacity: 1;
  pointer-events: auto;
}

/* ===== Barra de tiempo abajo FULL WIDTH (SIEMPRE visible con selección) ===== */
/* Línea 3px sólida, color “cráneo” */
.transport{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  /* hit area cómoda pero línea fina */
  height: 14px;
  z-index: 7;

  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.transport.on{
  opacity: 1;
  pointer-events: auto;
}

/* la línea real (mitad de altura vs 6px → 3px) */
.transport .rail{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 3px;
  background: rgba(80,85,95,1.00); /* gris tipo cráneo */
  pointer-events: none;
}

/* Range ocupa el hit area pero el track mide 3px */
.seek{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  width: 100%;
  height: 14px;

  background: transparent;
  margin: 0;
  padding: 0;

  -webkit-appearance: none;
  appearance: none;

  cursor: pointer;
}

/* track invisible del range (se alinea a la línea real) */
.seek::-webkit-slider-runnable-track{
  height: 3px;
  background: transparent;
}
.seek::-moz-range-track{
  height: 3px;
  background: transparent;
}
.seek::-moz-range-progress{
  height: 3px;
  background: transparent;
}

/* ===== PUNTERO MÁS CHICO y DENTRO de la línea ===== */
.seek::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;

  width: 4px;
  height: 3px;
  border-radius: 1px;

  background: rgba(70,70,70,0.82); /* un poco más oscuro que la línea */
  margin-top: 0; /* no lo sube */

  box-shadow: none;
}

.seek::-moz-range-thumb{
  width: 4px;
  height: 3px;
  border: none;
  border-radius: 1px;

  background: rgba(70,70,70,0.82);
}

/* hover micro (muy leve) */
.transport.on:hover .rail{ background: rgba(85,85,85,0.68); }
.transport.on:hover .seek::-webkit-slider-thumb{ background: rgba(60,60,60,0.92); }
.transport.on:hover .seek::-moz-range-thumb{ background: rgba(60,60,60,0.92); }

/* Tracks: LEFT FORZADO */
.tracks{
  position: absolute;
  text-align: left;
  pointer-events: auto;
}
.track{
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;

  font-family: "JetBrains Mono NL", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-weight: 400;

  color: rgba(40,40,40,0.62);
  padding: 0;

  text-align: left;
}
.track:hover{
  color: rgba(20,20,20,0.92);
  text-decoration: underline;
}

/* Para controles */
.track.ctrl{
  width: auto;
  display: inline-block;
}