/************************************************************************
 * 1) CSS CUSTOM PROPERTIES (6-Color Palette + Particle Settings)
 ************************************************************************/
:root {
  /* 6 primary color variables for the site */
  --color-bg: #2a0a24;
  /* Overall background */
  --color-fg: #8ff4e7;
  /* General text color */
  --color-line: #4b094a;
  /* Lines and strokes */
  --color-accent1: #edebd4;
  /* Interval labels, etc. */
  --color-accent2: #ff00cc;
  /* Ratio labels, etc. */
  --color-accent3: #00ffff;
  /* Frequency labels, etc. */

  /* Particle / Behavior variables */
  --drag-tolerance-px: 10;
  --default-particle-count: 250;
  --particle-stdev: 6;
  --particle-velocity-scale: 0.02;
  --particle-lifetime-base: 1000;
  /* ms */
  --particle-lifetime-random: 100;
  /* ms */
  --particle-global-cap: 2000;
  /* total limit on active particles */
}

/************************************************************************
 * 2) Base Layout
 ************************************************************************/
body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
}

header {
  padding: 1rem;
  background: transparent;
  color: var(--color-fg);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 7rem;

}

header a {
  display: block;
  flex: 0 0 auto;
  width: 800px;
  /* explicitly say this */
  max-width: 100%;
  /* allow scaling */
}


.site-logo {
  width: 800px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-right: 5rem;
  flex-shrink: 1;
  fill: currentColor;
  animation: rainbow-cycle 30s linear infinite;
}

.controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 1rem;
}

.controlunit {
  background: var(--color-fg);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  gap: 7px;
}

.inputcontrolunit {
  background: var(--color-bg);
  display: flex;

}

.spacer {
  width: 30px;
}

.instructions {
  margin-left: auto;
  /* Pushes it to the right */
  text-align: right;
  flex: 1;
  max-width: 600px;
  padding: 0 10px;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2em;
  max-height: 220px;
  overflow-y: auto;
  /* Enable vertical scrolling only */
  overflow-x: hidden;
  /* Hide horizontal scrollbar */
  box-sizing: border-box;
}

/* For WebKit browsers */
.instructions::-webkit-scrollbar {
  width: 8px;
}

.instructions::-webkit-scrollbar-track {
  background: transparent;
}

.instructions::-webkit-scrollbar-thumb {
  background-color: #333;
  /* Change this value to suit your design */
  border-radius: 4px;
}

/* For Firefox */
.instructions {
  scrollbar-width: thin;
  scrollbar-color: var(--color-fg) transparent;
}


/************************************************************************
 * 3) Form Inputs, Buttons
 ************************************************************************/
label,
input,
select,
button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
}

label {
  display: flex;
  font-weight: 800;
  min-height: 25px;
  color: var(--color-line);
  margin: 0;
  padding: 15px 10px 0;
  text-align: center;
}


input[type="number"],
input[type="text"],
select {
  padding: 10px;
  height: 50px;
  font-weight: 500;
  border: 2px solid var(--color-fg);
  background: var(--color-line);
  color: var(--color-fg);
  width: 100%;
  max-width: 500px;
  outline: none;
  border-radius: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-fg);
  font-weight: 700;
  min-width: 120px;
  text-transform: uppercase;
  padding: 10px 1rem;
  height: 50px;
  background: var(--color-accent1);
  color: var(--color-line);
  cursor: pointer;
  border-radius: 0;
}

button:hover {
  color: var(--color-accent2);
  background: var(--color-accent1);
  text-decoration-line: underline;
  /* Activates the underline */
  text-decoration-style: wavy;
}

button:disabled,
select:disabled {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Apply your uniform disabled styling */
  background: #444;
  color: #999;
  border-color: #666;
  cursor: not-allowed;
  opacity: 1;
  /* reset any opacity if needed */
}

#midiControls {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  /* force all controlunits to line up by text baseline */
  gap: 1rem;
}

#midiControls .controlunit {
  flex: 0 0 200px;
  /* or any uniform width you prefer */
}

/************************************************************************
 * 4) Canvas Container
 ************************************************************************/
#canvas-container {
  position: relative;       /* so the child can use z-index reliably */
  box-sizing: border-box;
  width: 100%;
  height: auto;
  overflow-x: auto;         /* allow horizontal scroll when zoomed */
  overflow-y: hidden;       /* no vertical scroll from the canvas */
}

#canvas-container.zoomed {
  /* optional: tweak styling when zoomed if you like */
}

#scale-canvas {
  position: relative;
  width: 100%;              /* JS will change this to 200% when zoomed */
  height: 400px;            /* your existing fixed height */
  box-sizing: border-box;
  z-index: 9999;

}


@keyframes rainbow-cycle {
  0% {color: crimson;}
  10% {color: orangered;}
  20% {color: yellow;}
  30% {color: yellowgreen;}
  40% {color: turquoise;}
  50% {color: skyblue;}
  60% {color: royalblue;}
  70% {color: darkslateblue;}
  80% {color: purple;}
  90% {color: magenta;}
  100% {color: crimson;}
}

@media (max-width: 850px) {
  .site-logo {
    width: 100%;
    max-width: 100%;
  }
}