/* Retardis — loud red/yellow tracker chrome */

:root {
  --hd-red: #ff0000;
  --hd-yellow: #ffff00;
  --hd-black: #000000;
  --hd-white: #ffffff;
  --hd-orange: #ff8800;
  --panel-yellow: #ffff00;
  --panel-red: #ff0000;
  --text-on-yellow: #000000;
  --text-on-red: #ffff00;
  --border: 3px solid #000000;
  --font-ui: "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif;
  --font-mono: "Courier New", "Lucida Console", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--hd-red);
  color: var(--text-on-red);
  min-height: 100vh;
}

/* Fake Windows title bar */
.app-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(180deg, #ffff00 0%, #ffcc00 100%);
  color: #000;
  border-bottom: var(--border);
  font-weight: bold;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.titlebar-badge {
  background: #000;
  color: #ff0;
  padding: 0.1rem 0.45rem;
  border: 2px solid #000;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-open {
  background: var(--hd-red);
  color: var(--hd-yellow);
  border: 2px solid #000;
  font-family: var(--font-ui);
  font-weight: bold;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.btn-open:hover {
  background: #cc0000;
  outline: 2px solid #000;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tardis-icon {
  flex-shrink: 0;
  border: 2px solid #000;
  background: #003399;
}

.app-titlebar h1 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  font-size: 0.75rem;
  font-weight: normal;
}

main {
  padding: 0.75rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Hero waterfall (replaces drop zone) */
#hero-viz {
  background: var(--hd-yellow);
  color: #000;
  border: var(--border);
  padding: 0.5rem 0.75rem 0.65rem;
  margin-bottom: 0.75rem;
}

#hero-viz.dragover {
  outline: 4px dashed #000;
  background: #ffe066;
}

.hero-viz-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hero-viz-bar label {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
}

.upload-status-inline {
  font-size: 0.72rem;
  font-weight: bold;
  color: #660000;
  text-align: right;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#waterfall-scope {
  border: var(--border);
  display: block;
  background: var(--hd-red);
  width: 100%;
  height: 140px;
}

/* Toolbar strip */
.reno-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  background: var(--hd-yellow);
  color: #000;
  border: var(--border);
  border-bottom: none;
  font-size: 0.75rem;
  font-weight: bold;
}

.reno-toolbar span {
  border: 2px solid #000;
  padding: 0.15rem 0.4rem;
  background: #fff;
}

/* Transport */
.transport {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem;
  background: var(--hd-yellow);
  color: #000;
  border: var(--border);
  border-top: 2px solid #000;
  margin-bottom: 0.75rem;
}

button {
  background: var(--hd-red);
  border: var(--border);
  color: var(--hd-yellow);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-ui);
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
}

button:hover {
  background: #cc0000;
  outline: 2px solid #000;
}

button:active {
  background: #990000;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-export-web {
  background: #ffff00;
  color: #000;
  font-weight: bold;
}

#btn-export-server {
  background: #ff8800;
  color: #000;
  font-size: 0.85em;
}

#btn-panic {
  background: #000;
  color: #ff0;
}

#btn-cue {
  background: #ffff00;
  color: #000;
}

#btn-cue:disabled {
  background: #aa8800;
  color: #444;
}

.cue-slots {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  background: #000;
  padding: 0.12rem 0.25rem;
  border: 2px solid #000;
}

.cue-slot-btn {
  background: #333;
  color: #ccc;
  border: 1px solid #666;
  padding: 0.18rem 0.35rem;
  font-size: 0.68rem;
  min-width: 1.6rem;
  text-transform: none;
}

.cue-slot-btn[aria-pressed="true"] {
  background: var(--hd-yellow);
  color: #000;
  border-color: #000;
  outline: 2px solid #ff0;
}

#btn-sync {
  background: #444;
  color: #ccc;
  font-size: 0.72rem;
}

#btn-sync[aria-pressed="true"] {
  background: #0066cc;
  color: #fff;
}

#btn-loop-pattern {
  background: #880000;
  color: #ff0;
  font-size: 0.72rem;
}

#btn-loop-pattern[aria-pressed="true"] {
  background: var(--hd-red);
  color: var(--hd-yellow);
  outline: 2px solid #ff0;
}

.link-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #000;
  border: 3px solid var(--hd-red);
  box-shadow: inset 0 0 0 2px var(--hd-yellow);
}

.link-label {
  color: var(--hd-yellow);
  font-weight: bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-panel button {
  background: var(--hd-red);
  color: var(--hd-yellow);
  border: 2px solid #000;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  text-transform: none;
}

.link-panel button:disabled {
  opacity: 0.45;
}

#link-code-input {
  width: 4.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  padding: 0.15rem 0.25rem;
  border: 2px solid #000;
  background: var(--hd-yellow);
  color: #000;
}

.link-status {
  color: #ccc;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.link-remote-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  width: 100%;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #660000;
}

.link-remote-label {
  color: var(--hd-yellow);
  font-weight: bold;
  font-size: 0.7rem;
}

.link-remote-song {
  color: #fff;
  font-weight: bold;
  font-size: 0.75rem;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-remote-bpm,
.link-remote-pos,
.link-remote-play,
.link-remote-cues {
  color: #ffcc44;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.link-remote-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.link-remote-controls button,
.remote-cue-btn {
  background: #330000;
  color: var(--hd-yellow);
  border: 1px solid #660000;
  padding: 0.15rem 0.35rem;
  font-size: 0.68rem;
}

.link-remote-controls button:not(:disabled):hover,
.remote-cue-btn:not(:disabled):hover {
  background: var(--hd-yellow);
  color: #000;
}

.link-snap-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.35rem;
  padding-left: 0.45rem;
  border-left: 2px solid #660000;
}

.link-snap-label {
  color: #ff8800;
  font-weight: bold;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.remote-snap-btn {
  background: #553300;
  color: #ffff00;
  border: 1px solid #ff8800;
  padding: 0.15rem 0.35rem;
  font-size: 0.68rem;
}

.remote-snap-btn:not(:disabled):hover {
  background: #ff8800;
  color: #000;
}

#btn-fx-toggle.fx-off {
  background: #666;
  color: #ccc;
}

#btn-fx-toggle[aria-pressed="true"] {
  outline: 2px solid #000;
}

#btn-entropy[aria-pressed="true"] {
  background: #660066;
  color: #ffccff;
  outline: 2px solid #ff0;
}

#btn-entropy[aria-pressed="false"] {
  background: #004400;
  color: #ccffcc;
}

.transport-end-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #000;
  padding: 0.15rem 0.25rem;
  border: 2px solid #000;
}

.transport-end-label {
  color: #ff0;
  font-size: 0.65rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 0 0.15rem;
}

.transport-end-mode button {
  background: #333;
  color: #ccc;
  border: 1px solid #666;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  text-transform: none;
}

.transport-end-mode button[aria-pressed="true"] {
  background: var(--hd-yellow);
  color: #000;
  border-color: #000;
  outline: 2px solid #ff0;
}

.transport label {
  font-weight: bold;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pitch-control {
  background: #000;
  color: #ff0;
  padding: 0.15rem 0.45rem;
  border: 2px solid #000;
  font-size: 0.72rem;
}

.pitch-control input[type="range"] {
  width: 7rem;
}

.pitch-nudge {
  display: inline-flex;
  gap: 0.12rem;
  align-items: center;
}

.pitch-nudge button {
  padding: 0.15rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1;
  min-width: 1.45rem;
  background: #660000;
  color: #ff0;
  border: 1px solid #000;
}

.pitch-nudge button:hover {
  background: #990000;
}

#pitch-display {
  font-family: var(--font-mono);
  min-width: 8.5rem;
  text-align: right;
  font-size: 0.72rem;
  white-space: nowrap;
}

input[type="range"] {
  accent-color: #ff0000;
}

#position-display {
  font-family: var(--font-mono);
  font-weight: bold;
  background: #000;
  color: #ff0;
  padding: 0.25rem 0.5rem;
  border: 2px solid #000;
  min-width: 5rem;
  text-align: center;
}

.playback-status {
  flex: 1 1 100%;
  font-size: 0.8rem;
  font-weight: bold;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  padding: 0.25rem 0.5rem;
  margin-top: 0.15rem;
}

/* Main layout */
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 360px;
  gap: 0.5rem;
  align-items: start;
}

#right-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 480px;
}

#instruments-panel {
  flex: 2 1 55%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#diagnostics-panel {
  flex: 1 1 35%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#instruments-panel,
#diagnostics-panel {
  background: var(--hd-yellow);
  color: #000;
  border: var(--border);
  padding: 0.5rem;
}

#instruments-panel h2,
#diagnostics-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  background: var(--hd-red);
  color: var(--hd-yellow);
  padding: 0.35rem 0.5rem;
  border: 2px solid #000;
  flex-shrink: 0;
}

#instrument-count {
  color: #ff0;
  font-weight: normal;
}

.inst-hint {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: bold;
  color: #660000;
}

#instrument-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 280px;
  max-height: min(55vh, 560px);
  overflow-y: auto;
  border: 2px solid #000;
  background: #fff;
}

.instrument-item {
  display: grid;
  grid-template-columns: 28px 96px 1fr 16px;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid #000;
  background: #fff;
}

.inst-mute-btn {
  width: 28px;
  height: 52px;
  padding: 0;
  border: 2px solid #000;
  background: var(--hd-red);
  color: var(--hd-yellow);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.inst-mute-btn:hover {
  outline: 2px solid #000;
  background: #cc0000;
}

.inst-mute-btn[aria-pressed="true"] {
  background: #000;
  color: #ff0;
}

.inst-mute-btn[aria-pressed="true"]::after {
  content: "M";
}

.instrument-item.is-muted {
  opacity: 0.55;
}

.instrument-item.is-muted .inst-peak,
.instrument-item.is-muted .inst-meta strong {
  text-decoration: line-through;
}

.instrument-item.is-muted .inst-vu-mini {
  opacity: 0.35;
}

.instrument-item:nth-child(even) {
  background: #ffe066;
}

.instrument-item.is-hit {
  background: var(--hd-red) !important;
  color: var(--hd-yellow);
  opacity: 1;
}

.instrument-item.is-hit .inst-meta strong,
.instrument-item.is-hit .inst-kind {
  color: var(--hd-yellow);
  text-decoration: none;
}

.instrument-empty {
  padding: 0.75rem;
  font-style: italic;
  font-size: 0.8rem;
}

.inst-peak {
  border: 2px solid #000;
  display: block;
  width: 96px;
  height: 36px;
  background: #ffff00;
}

.inst-peak-preview {
  cursor: pointer;
}

.inst-peak-preview:hover {
  outline: 2px solid #000;
  box-shadow: inset 0 0 0 1px #ff0;
}

.inst-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.inst-meta strong {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-kind {
  font-size: 0.65rem;
  line-height: 1.3;
  color: #660000;
}

.inst-kind-plugin {
  color: #003399;
}

.inst-kind-midi {
  color: #990099;
  font-weight: bold;
}

.inst-vu-mini {
  border: 2px solid #000;
  background: #ff0000;
  display: block;
  width: 14px;
  height: 52px;
}

#diagnostics-list {
  max-height: 180px;
  overflow-y: auto;
}

aside,
#tracker-panel {
  background: var(--hd-yellow);
  color: #000;
  border: var(--border);
  padding: 0.35rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#tracker-panel #tracker-grid {
  box-shadow: inset 0 0 0 2px var(--hd-red);
}

aside h2,
#tracker-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  background: var(--hd-red);
  color: var(--hd-yellow);
  padding: 0.25rem 0.4rem;
  border: 2px solid #000;
}

#sequence-list,
#diagnostics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.seq-hint {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: bold;
  color: #660000;
}

#sequence-list li {
  padding: 0.25rem 0.35rem;
  border-bottom: 1px solid #000;
  cursor: pointer;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.seq-label {
  flex: 1;
  min-width: 0;
}

.seq-cue-markers {
  display: inline-flex;
  gap: 0.12rem;
  flex-shrink: 0;
}

.seq-cue-badge {
  font-size: 0.58rem;
  font-weight: bold;
  background: #000;
  color: #ff0;
  padding: 0 0.2rem;
  border: 1px solid #000;
  line-height: 1.3;
}

.seq-cue-badge.active-cue {
  background: var(--hd-red);
  color: var(--hd-yellow);
  outline: 1px solid #ff0;
}

#sequence-list li:nth-child(even) {
  background: #ffe066;
}

#sequence-list li.active {
  background: var(--hd-red);
  color: var(--hd-yellow);
  font-weight: bold;
}

#sequence-list li:hover {
  outline: 2px solid #000;
}

#diagnostics-list li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed #000;
  word-break: break-word;
  font-size: 0.68rem;
}

#diagnostics-list .diag-empty {
  font-style: italic;
  color: #660000;
}

#diagnostics-list .diag-loc {
  color: #990000;
}

#diagnostics-list li strong {
  color: var(--hd-red);
}

.diag-hint {
  font-size: 0.65rem;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

#diagnostics-panel h2 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#diagnostics-count {
  color: #ff0;
}

#diagnostics-list {
  max-height: 280px;
  overflow-y: auto;
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
  gap: 0.35rem;
}

.tracker-header h2 {
  margin: 0;
  font-size: 0.75rem;
}

#pattern-select {
  background: #fff;
  border: 2px solid #000;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 0.65rem;
  padding: 0.05rem 0.1rem;
}

.tracker-matrix-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  background: #080000;
}

#radial-scope {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80%, 520px);
  height: auto;
  aspect-ratio: 1;
  opacity: 0.72;
  pointer-events: none;
  z-index: 0;
  border: none;
  display: block;
}

#tracker-grid {
  position: relative;
  z-index: 1;
  overflow: visible;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 10px;
  border: 3px solid rgba(0, 0, 0, 0.65);
  background: rgba(8, 0, 0, 0.55);
  --note-col-w: 42px;
  --fx-col-w: 26px;
  --row-head-w: 18px;
}

#tracker-grid.tracker-density-compact {
  font-size: 8px;
  line-height: 9px;
  --note-col-w: 36px;
  --fx-col-w: 22px;
  --row-head-w: 16px;
}

#tracker-grid.tracker-density-tight {
  font-size: 8px;
  line-height: 9px;
  --note-col-w: 30px;
  --fx-col-w: 18px;
  --row-head-w: 15px;
}

#tracker-grid.tracker-density-ultra {
  font-size: 7px;
  line-height: 8px;
  --note-col-w: 24px;
  --fx-col-w: 15px;
  --row-head-w: 14px;
}

.tracker-table.renoise-grid {
  border-collapse: collapse;
  width: auto;
  min-width: 100%;
  table-layout: fixed;
}

.tracker-table th,
.tracker-table td {
  border: 1px solid #550000;
  padding: 0 1px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: inherit;
  height: 10px;
  max-height: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tracker-grid.tracker-density-tight .tracker-table th,
#tracker-grid.tracker-density-tight .tracker-table td,
#tracker-grid.tracker-density-ultra .tracker-table th,
#tracker-grid.tracker-density-ultra .tracker-table td {
  height: 9px;
  max-height: 9px;
}

.tracker-table thead th {
  position: sticky;
  z-index: 4;
  padding: 0;
  height: auto;
  max-height: none;
  border-color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-head-compact .track-head-compact {
  top: 0;
  background: #000;
  color: var(--hd-yellow);
  font-size: 7px;
  font-weight: bold;
  text-align: center;
  padding: 0 1px;
  line-height: 9px;
  height: 11px;
  border-top: 3px solid var(--track-bar, #ff0000);
  max-width: calc(var(--note-col-w) + var(--fx-col-w));
}

#tracker-grid.tracker-density-ultra .tracker-head-compact .track-head-compact {
  font-size: 6px;
  line-height: 8px;
  height: 10px;
  border-top-width: 2px;
}

.tracker-head-compact + .tracker-subhead .sub-note,
.tracker-head-compact + .tracker-subhead .sub-fx {
  top: 11px;
}

.tracker-table thead .row-head {
  width: var(--row-head-w);
  min-width: var(--row-head-w);
  max-width: var(--row-head-w);
  background: #000;
  top: 0;
  left: 0;
  position: sticky;
  z-index: 6;
}

#tracker-grid.tracker-density-ultra .tracker-head-compact + .tracker-subhead .sub-note,
#tracker-grid.tracker-density-ultra .tracker-head-compact + .tracker-subhead .sub-fx {
  top: 10px;
}

.tracker-color-row .track-color-bar {
  top: 0;
  height: 4px;
  padding: 0;
  background: var(--track-bar, #ff0000);
  border-bottom: 1px solid #000;
  max-width: calc(var(--note-col-w) + var(--fx-col-w));
}

.tracker-name-row .track-name {
  top: 4px;
  background: #000;
  color: var(--hd-yellow);
  font-size: 7px;
  font-weight: bold;
  text-align: center;
  padding: 0 1px;
  line-height: 9px;
  height: 11px;
  border-bottom: 1px solid #ff0000;
  max-width: calc(var(--note-col-w) + var(--fx-col-w));
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-subhead .sub-note,
.tracker-subhead .sub-fx {
  top: 15px;
  background: var(--hd-red);
  color: var(--hd-yellow);
  font-size: 6px;
  font-weight: bold;
  text-align: center;
  width: var(--note-col-w);
  min-width: var(--note-col-w);
  max-width: var(--note-col-w);
  padding: 0;
  line-height: 9px;
  height: 10px;
  border-top: 1px solid #000;
}

.tracker-subhead .sub-fx {
  background: #aa0000;
  width: var(--fx-col-w);
  min-width: var(--fx-col-w);
  max-width: var(--fx-col-w);
}

#tracker-grid.tracker-density-tight .tracker-subhead .sub-note,
#tracker-grid.tracker-density-tight .tracker-subhead .sub-fx,
#tracker-grid.tracker-density-ultra .tracker-subhead .sub-note,
#tracker-grid.tracker-density-ultra .tracker-subhead .sub-fx {
  top: 10px;
  height: 9px;
  line-height: 8px;
}

.tracker-table tbody td {
  background: rgba(20, 0, 0, 0.72);
  color: #ffcc44;
}

.tracker-table tbody tr.beat-row td {
  background: rgba(40, 0, 0, 0.82);
}

.tracker-table tbody tr.beat-row .row-num {
  color: #fff;
}

.cell-note {
  width: var(--note-col-w);
  min-width: var(--note-col-w);
  max-width: var(--note-col-w);
  text-align: left;
}

.cell-fx {
  width: var(--fx-col-w);
  min-width: var(--fx-col-w);
  max-width: var(--fx-col-w);
  text-align: center;
  color: #ffcc00;
}

.tracker-note,
.tracker-fx {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-note {
  font-weight: bold;
  letter-spacing: 0;
}

.tracker-fx {
  font-size: inherit;
  font-weight: normal;
  color: #ffdd44;
  letter-spacing: 0;
}

.tracker-empty {
  color: #552222;
  opacity: 0.75;
}

.tracker-table td.has-note .tracker-note {
  color: #ffe033;
  text-shadow: 0 0 3px rgba(255, 0, 0, 0.35);
}

.tracker-table td.has-fx .tracker-fx {
  color: #fff;
  font-weight: bold;
}

.tracker-table td.note-off {
  color: #ff6666;
}

.tracker-table tr.playhead td {
  background: rgba(12, 0, 0, 0.88) !important;
  color: #ffe066 !important;
  border-color: #330000 !important;
  box-shadow: inset 3px 0 0 #ffff00, inset 0 0 14px rgba(255, 255, 0, 0.12);
}

.tracker-table tr.playhead .tracker-note,
.tracker-table tr.playhead .tracker-fx {
  color: #ffff00 !important;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.55);
}

.tracker-table tr.playhead .tracker-empty {
  color: #664422 !important;
}

#tracker-grid.is-playing .tracker-table tr.playhead td {
  animation: tracker-playhead-pulse 0.45s ease-in-out infinite alternate;
}

@keyframes tracker-playhead-pulse {
  from {
    box-shadow: inset 3px 0 0 #ffff00, inset 0 0 8px rgba(255, 255, 0, 0.08);
  }
  to {
    box-shadow: inset 3px 0 0 #ffff00, inset 0 0 18px rgba(255, 0, 0, 0.35);
  }
}

.tracker-table td.hit-flash {
  animation: tracker-hit-flash 0.22s ease-out forwards;
  z-index: 3;
  position: relative;
}

.tracker-table tr.playhead td.hit-flash {
  animation: tracker-hit-flash 0.22s ease-out forwards;
}

.tracker-table td.hit-flash .tracker-note,
.tracker-table td.hit-flash .tracker-fx {
  color: #000 !important;
  text-shadow: none !important;
}

@keyframes tracker-hit-flash {
  0% {
    background: #ffff00;
    color: #000;
    box-shadow: inset 0 0 12px #fff, 0 0 10px #ff0000;
  }
  55% {
    background: #ff0000;
    color: #ffff00;
    box-shadow: inset 0 0 8px #ffff00, 0 0 14px #ff0000;
  }
  100% {
    background: rgba(60, 0, 0, 0.9);
    color: #ffe033;
    box-shadow: none;
  }
}

.tracker-table tr.pad-row td {
  background: rgba(30, 0, 0, 0.55);
  color: #553333;
}

.tracker-table td.pad-cell .tracker-empty {
  color: #442222;
}

.row-num {
  color: var(--hd-yellow);
  text-align: right;
  width: var(--row-head-w);
  min-width: var(--row-head-w);
  max-width: var(--row-head-w);
  background: #000 !important;
  font-weight: bold;
  font-size: inherit;
  padding-right: 2px !important;
  border-color: #000 !important;
  position: sticky;
  left: 0;
  z-index: 2;
}

.tracker-table tr.playhead .row-num {
  background: #000 !important;
  color: var(--hd-yellow) !important;
}

/* Visualization deck */
.viz-deck {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--hd-yellow);
  border: var(--border);
  align-items: stretch;
}

.meter-bank,
.track-meter-bank,
.instrument-meter-bank {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meter-bank label,
.track-meter-bank label,
.instrument-meter-bank label {
  font-size: 0.65rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
  text-align: center;
}

.meter-row {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.labeled-meters {
  gap: 6px;
}

.meter-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 0.25rem;
  scrollbar-color: #000 #ff0;
}

.labeled-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 20px;
}

.labeled-meter span {
  font-size: 0.55rem;
  font-weight: bold;
  color: #000;
  text-transform: uppercase;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-empty {
  font-size: 0.7rem;
  color: #000;
  font-weight: bold;
}

.instrument-meter-bank,
.track-meter-bank {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--hd-yellow);
  border: var(--border);
}

.meter-row canvas {
  border: 2px solid #000;
  background: var(--hd-red);
  display: block;
}

.scope-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.scope-panel label {
  font-size: 0.65rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
}

.scope-panel canvas {
  width: 100%;
  border: var(--border);
  display: block;
  background: var(--hd-yellow);
}

#waveform-scope {
  height: 72px;
}

#spectrum-analyzer {
  height: 100px;
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 120px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
}

.stats-panel div {
  background: #000;
  color: #ff0;
  border: 2px solid #000;
  padding: 0.35rem 0.5rem;
  text-align: center;
}

.stats-panel .is-playing {
  background: var(--hd-red);
  animation: blink-play 0.8s step-end infinite;
}

@keyframes blink-play {
  50% {
    opacity: 0.65;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .viz-deck {
    grid-template-columns: 1fr;
  }

  .meter-row {
    justify-content: center;
  }
}
