  :root {
    --bg: #07070e;
    --panel: #10101a;
    --panel2: #161622;
    --accent: #ff2d95;
    --accent-hover: #f41082;
    --accent2: #00e5ff;
    --accent3: #b44aff;
    --text: #e8e8ff;
    --muted: #6a6a88;
    --step-off: #1c1c2c;
    --step-on: #ff2d95;
    --step-current: #00e5ff;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    padding: 14px;
    line-height: 1.35;
  }
  h1 {
    font-size: 1.35rem;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(255,45,149,0.4);
  }
  .top-bar, .second-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--panel);
    border: 1px solid #1e1e30;
    border-radius: 8px;
  }
  button {
    background: #1a1a2a;
    color: var(--text);
    border: 1px solid #3a3a55;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    transition: 0.12s;
  }
  button:hover { border-color: var(--accent); color: var(--accent); }
  button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  button.active:hover { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); }

  button.solo-active { background: var(--accent2); color: #000; border-color: var(--accent2); }
  button.muted { opacity: 0.35; }
  button.small { padding: 4px 8px; font-size: 0.72rem; }
  button:disabled { opacity: 0.4; cursor: not-allowed; }
  label { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  input[type=range] { width: 90px; accent-color: var(--accent); }
  select { background: #1a1a2a; color: var(--text); border: 1px solid #3a3a55; padding: 4px 8px; border-radius: 4px; }
  #seedDisplay { color: var(--accent2); font-family: ui-monospace, monospace; font-size: 0.9rem; }
  #bpmVal { min-width: 26px; display: inline-block; color: var(--text); }

  .track {
    display: grid;
    grid-template-columns: 78px 78px 1fr 150px;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    background: var(--panel);
    border-radius: 6px;
    margin-bottom: 5px;
    border: 1px solid #1a1a28;
  }
  .track-name {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.78rem;
    color: var(--accent2);
  }
  .track-controls { display: flex; gap: 3px; flex-wrap: wrap; }

  /* .steps-wrap { overflow-x: auto; padding-bottom: 2px; } */

.steps-wrap {
    overflow-x: auto;
    padding-bottom: 3px;

    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

.steps-wrap::-webkit-scrollbar {
    height: 5px;
}

.steps-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.steps-wrap::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.steps-wrap::-webkit-scrollbar-thumb:hover {
    background: #777;
}

  .steps { display: flex; gap: 2px; min-width: max-content; }
  .step {
    width: 18px; height: 26px;
    background: var(--step-off);
    border: 1px solid #2a2a40;
    border-radius: 2px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .step.on { background: var(--step-on); border-color: var(--accent); box-shadow: 0 0 6px rgba(255,45,149,0.5); }
  .step.current { outline: 2px solid var(--step-current); outline-offset: -1px; }
  .step:nth-child(4n) { margin-right: 4px; }

  .sliders { display: flex; flex-direction: column; gap: 3px; }
  .sliders label { font-size: 0.68rem; gap: 4px; }
  .sliders input[type=range] { width: 70px; }

  .info {
    /* margin-top: 14px; */
    font-size: 0.75rem;
    color: var(--muted);
    max-width: 900px;
  }

  /* Modal */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .modal-overlay.show { opacity: 1; pointer-events: auto; }
  body:has(.modal-overlay.show) {
    overflow: hidden;
  }
  .modal {
    background: var(--panel2);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 22px 26px;
    width: min(420px, 94vw);
    box-shadow: 0 0 40px rgba(255,45,149,0.15);
  }
  .modal-content{
    max-height: 50vh;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
  }
  .modal-content p{
    margin-bottom: 1.5em;
  }


.modal-content::-webkit-scrollbar {
    height: 5px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

  .modal h2 {
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
  }
  .modal-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--panel);
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
  }
  .modal-option:hover { border-color: #444; }
  .modal-option.selected { border-color: var(--accent); background: #1a1220; }
  .modal-option input { accent-color: var(--accent); }
  .modal-row { margin: 14px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
  .modal-actions button { min-width: 90px; }
  #exportStatus {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--accent2);
    min-height: 1.2em;
  }
  .hidden { display: none !important; }

  .title-bar{
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }


.interface-warning {
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 0;
    height: 0;
}

@media screen and (max-width: 479px) {

  html, body {
    overflow: hidden;
  }

  .interface-warning {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: #07070e;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
  }

  .interface-warning div{
    width: 100%;
  }
}