/* ==========================================================
   Audyo Tracker — esthétique ProTracker / Amiga, version Audyo
   ========================================================== */
:root {
  --pt-face: #1b2463;
  --pt-hi: #3a4aa8;
  --pt-lo: #070b2a;
  --pt-amber: #fbbf24;
  --pt-lcd: #03061a;
}

/* bouton de lancement : boule « Boing » */
.pt-launch {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px;
  border-radius: 16px; border: 1px solid rgba(251, 191, 36, .45); text-align: left; color: #fff;
  background: linear-gradient(135deg, #2b1458, #1a1f6b 55%, #3b1d0e);
  box-shadow: 0 8px 22px rgba(251, 191, 36, .18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pt-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(251, 191, 36, .32); }
.pt-launch:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pt-launch .cv-launch-txt small { color: #fde68a; }
.pt-launch-ball {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 40%),
    conic-gradient(#ff2d2d 0 25%, #fff 0 50%, #ff2d2d 0 75%, #fff 0) 0 0 / 50% 50%;
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, .35), 0 6px 10px rgba(0, 0, 0, .4);
  animation: boing 1.1s cubic-bezier(.5, 0, .5, 1) infinite alternate, spin 2.2s linear infinite;
}
@keyframes boing { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .pt-launch-ball { animation: none; } }

/* ---------- vue ---------- */
.pt { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 8px; }
.pt[hidden] { display: none; }
.pt button { cursor: pointer; }
.pt-box {
  background: var(--pt-face); border-radius: 6px; padding: 10px;
  border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.pt-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pt-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pt-logo { font: 800 18px var(--font-title); letter-spacing: 1px; color: #fff; white-space: nowrap; }
.pt-logo b { color: var(--pt-amber); margin-left: 4px; }
.pt-input {
  flex: 1; min-width: 0; height: 30px; padding: 0 8px; border-radius: 3px;
  background: var(--pt-lcd); color: var(--pt-amber); font: 700 14px var(--font-mono); text-transform: lowercase;
  border: 2px solid; border-color: var(--pt-lo) var(--pt-hi) var(--pt-hi) var(--pt-lo);
}
.pt-input:focus { outline: none; box-shadow: 0 0 0 2px var(--pt-amber); }
.pt-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.pt-counter {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 5px;
  padding: 3px 4px 3px 7px; border-radius: 3px; background: rgba(0, 0, 0, .18);
}
.pt-counter > span:first-child { font: 800 10px var(--font-mono); color: #c7d2fe; letter-spacing: .5px; }
.pt-counter b {
  font: 700 15px var(--font-mono); color: var(--pt-amber); background: var(--pt-lcd); padding: 1px 6px; border-radius: 2px; min-width: 3.4ch; text-align: right;
  text-shadow: 0 0 8px rgba(251, 191, 36, .5); font-variant-numeric: tabular-nums;
}
.pt-ud { display: flex; flex-direction: column; gap: 1px; }
.pt-ud button {
  width: 22px; height: 13px; padding: 0; font-size: 8px; line-height: 1; color: #fff;
  background: var(--pt-face); border: 1px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi);
}
.pt-ud button:active { border-color: var(--pt-lo) var(--pt-hi) var(--pt-hi) var(--pt-lo); background: var(--pt-lo); }

.pt-transport { display: flex; flex-direction: column; gap: 7px; }
.pt-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.pt-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 3px;
  font: 800 12px var(--font-mono); color: #e0e7ff; background: #26318a;
  border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi);
}
.pt-btn:hover { background: #2f3ca6; }
.pt-btn:active { border-color: var(--pt-lo) var(--pt-hi) var(--pt-hi) var(--pt-lo); }
.pt-btn .ico { width: 15px; height: 15px; }
.pt-btn.play.on { background: #15803d; color: #fff; box-shadow: 0 0 12px rgba(34, 197, 94, .5); }
.pt-btn.edit.on { background: #b91c1c; color: #fff; box-shadow: 0 0 12px rgba(255, 71, 87, .55); animation: pulse 1.4s ease-in-out infinite; }
.pt-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font: 700 11px var(--font-mono); color: #c7d2fe; }
.pt-opts label { display: inline-flex; align-items: center; gap: 6px; }
.pt-opts input[type="range"] { width: 90px; height: 18px; }
.pt-chk input { accent-color: var(--pt-amber); width: 15px; height: 15px; }
.pt-status { margin: auto 0 0; padding: 5px 8px; border-radius: 3px; background: var(--pt-lcd); font: 600 11.5px var(--font-mono); color: #a5b4fc; min-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-status b { color: var(--pt-amber); }
body.pt-editing .pt-status b { color: #ff6b7a; }
.pt-scopes { padding: 6px; display: flex; }
.pt-scopes canvas { width: 100%; height: 100%; min-height: 140px; display: block; border-radius: 3px; }

/* ordre */
.pt-orders { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--pt-face); border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi); min-width: 0; }
.pt-lbl { font: 800 11px var(--font-mono); color: #c7d2fe; flex: none; }
.pt-order-list { flex: 1; min-width: 0; display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pt-order-list button {
  flex: none; display: flex; flex-direction: column; align-items: center; min-width: 40px; padding: 2px 4px; border-radius: 3px;
  background: var(--pt-lcd); border: 1px solid #26318a; color: var(--pt-amber); font: 700 14px var(--font-mono); line-height: 1.1;
}
.pt-order-list small { font-size: 9px; color: #6b76b0; }
.pt-order-list button.cur { border-color: var(--pt-amber); box-shadow: 0 0 0 1px var(--pt-amber); }
.pt-order-list button.play { background: #14532d; color: #bbf7d0; }
.pt-order-tools { display: flex; gap: 4px; flex: none; }
.pt-order-tools button { min-height: 30px; padding: 0 8px; border-radius: 3px; font: 700 11px var(--font-mono); color: #e0e7ff; background: #26318a; border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi); }

/* pattern */
.pt-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 8px; }
.pt-pattern-wrap { min-height: 0; min-width: 0; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; border: 2px solid; border-color: var(--pt-lo) var(--pt-hi) var(--pt-hi) var(--pt-lo); background: #05081d; }
.pt-chan-head { display: flex; flex: none; background: #0c1240; border-bottom: 1px solid #26318a; overflow: hidden; }
.pt-chan-head button {
  position: relative; flex: none; height: 30px; border: 0; border-right: 1px solid #26318a; background: transparent;
  font: 800 11px var(--font-mono); color: #c7d2fe; overflow: hidden;
}
.pt-chan-head button span { position: relative; z-index: 1; }
.pt-chan-head button:hover { background: rgba(255, 255, 255, .06); }
.pt-chan-head button.muted { color: #ff6b7a; background: rgba(255, 71, 87, .12); text-decoration: line-through; }
.pt-vu { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: linear-gradient(90deg, #22c55e, #facc15 70%, #ff4757); transform-origin: left; transform: scaleX(0); transition: transform .06s linear; }
.pt-pattern { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; }
.pt-pattern canvas { display: block; cursor: text; }
.pt-pattern canvas:focus-visible { outline: 2px solid var(--pt-amber); outline-offset: -2px; }

/* panneau latéral */
.pt-side { min-height: 0; display: flex; flex-direction: column; border-radius: 6px; background: var(--pt-face); border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi); overflow: hidden; }
.pt-tabs { display: flex; gap: 2px; padding: 6px 6px 0; }
.pt-tabs button { flex: 1; min-height: 32px; border: 0; border-radius: 4px 4px 0 0; background: rgba(0, 0, 0, .25); color: #a5b4fc; font: 800 12px var(--font-mono); }
.pt-tabs button.active { background: #0c1240; color: var(--pt-amber); }
.pt-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0c1240; padding: 8px; gap: 8px; }
.pt-panel[hidden] { display: none; }

.pt-smp-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 90px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #26318a transparent; }
.pt-smp-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 6px; border-radius: 3px; cursor: pointer; font: 600 12.5px var(--font-mono); }
.pt-smp-list li:hover { background: rgba(255, 255, 255, .06); }
.pt-smp-list li b { color: #67e8f9; }
.pt-smp-list li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e0e7ff; }
.pt-smp-list li small { color: #6b76b0; font-size: 11px; }
.pt-smp-list li.empty span { color: #4b5590; }
.pt-smp-list li.sel { background: var(--pt-amber); }
.pt-smp-list li.sel b, .pt-smp-list li.sel span, .pt-smp-list li.sel small { color: #1b1400; }
.pt-smp-list li.drop { outline: 2px dashed #22c55e; outline-offset: -2px; }
.pt-smp-edit { flex: none; display: grid; gap: 6px; }
#ptWave { width: 100%; height: 92px; display: block; border-radius: 3px; background: var(--pt-lcd); cursor: ew-resize; touch-action: none; }
.pt-smp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; align-items: center; font: 700 11px var(--font-mono); color: #c7d2fe; }
.pt-smp-fields label { display: grid; gap: 2px; }
.pt-smp-fields label.wide { grid-column: 1 / -1; }
.pt-smp-fields label.pt-chk { display: flex; align-items: center; gap: 6px; }
.pt-smp-fields output { color: var(--pt-amber); }
.pt-smp-fields input[type="range"] { height: 18px; }
.pt-smp-info { grid-column: 1 / -1; color: #8b95c9; font-weight: 600; font-size: 10.5px; }
.pt-smp-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-smp-btns button { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; border-radius: 3px; font: 700 11px var(--font-mono); color: #e0e7ff; background: #26318a; border: 2px solid; border-color: var(--pt-hi) var(--pt-lo) var(--pt-lo) var(--pt-hi); }
.pt-smp-btns button.danger { background: #7f1d1d; }

/* bibliothèque */
.pt-lib-bar { display: flex; gap: 6px; }
.pt-lib-search { flex: 1; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 3px; background: var(--pt-lcd); color: #8b95c9; }
.pt-lib-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font: 600 13px var(--font-ui); outline: none; }
.pt-lib-rate { display: flex; align-items: center; gap: 4px; font: 700 10px var(--font-mono); color: #c7d2fe; }
.pt-lib-rate select { height: 32px; font-size: 11px; padding: 0 4px; max-width: 120px; }
.pt-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font: 700 11.5px var(--font-mono); color: #6b76b0; }
.pt-crumb button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--pt-amber); padding: 2px 4px; border-radius: 3px; font: inherit; }
.pt-crumb button:hover { background: rgba(255, 255, 255, .08); }
.pt-lib { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #26318a transparent; }
.pt-dir { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 3px; cursor: pointer; font: 700 13px var(--font-ui); color: #e0e7ff; }
.pt-dir .ico { color: var(--pt-amber); }
.pt-dir small { margin-left: auto; font: 600 11px var(--font-mono); color: #6b76b0; }
.pt-dir:hover { background: rgba(255, 255, 255, .06); }
.pt-file { border-radius: 3px; }
.pt-file:hover { background: rgba(255, 255, 255, .04); }
.pt-file-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; }
.pt-fname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 12.5px var(--font-ui); color: #e0e7ff; cursor: grab; }
.pt-file small { font: 600 10.5px var(--font-mono); color: #6b76b0; }
.pt-file button, .pt-slices button { flex: none; min-height: 24px; padding: 0 6px; border-radius: 3px; border: 1px solid #26318a; background: #1b2463; color: #e0e7ff; font: 700 10.5px var(--font-mono); display: inline-flex; align-items: center; justify-content: center; }
.pt-file button[data-act="prev"], .pt-slices button[data-act="prev"] { width: 24px; padding: 0; color: #22c55e; }
.pt-file button:hover, .pt-slices button:hover { background: #2f3ca6; }
.pt-badge { color: var(--pt-amber) !important; }
.pt-kit { background: #3b1d0e !important; color: #fde68a !important; border-color: #92400e !important; }
.pt-file.pti .pt-fname::before { content: "PTI "; font: 800 9px var(--font-mono); color: var(--pt-amber); }
.pt-slices { list-style: none; margin: 0 0 4px 30px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.pt-slices li { display: flex; align-items: center; gap: 4px; font: 600 11px var(--font-mono); color: #c7d2fe; cursor: grab; }
.pt-slices li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-lib-empty { padding: 8px; color: #6b76b0; font-size: 13px; }
.pt-lib-note { margin: 0; font-size: 12.5px; color: #c7d2fe; line-height: 1.5; }
.pt-lib-note:empty { display: none; }

/* aide des effets */
.pt-help { overflow-y: auto; scrollbar-width: thin; }
.pt-help h3 { margin: 4px 0 2px; font: 800 13px var(--font-mono); color: var(--pt-amber); }
.pt-fx { margin: 0; display: grid; gap: 2px; }
.pt-fx div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding: 3px 4px; border-radius: 3px; font-size: 12.5px; }
.pt-fx div:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.pt-fx dt { font: 800 12px var(--font-mono); color: #f0abfc; }
.pt-fx.keys dt { color: #67e8f9; }
.pt-fx dd { margin: 0; color: #e0e7ff; }
.pt-help-note { margin: 6px 0 0; font-size: 12px; color: #8b95c9; line-height: 1.5; }
body.dragging.mode-tracker .pt-side { box-shadow: 0 0 0 3px var(--pt-amber); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .pt-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pt-scopes { grid-column: 1 / -1; height: 120px; }
  .pt-scopes canvas { min-height: 0; }
  .pt-main { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .pt { overflow-y: auto; grid-template-rows: auto auto minmax(520px, auto); }
  .pt-top { grid-template-columns: minmax(0, 1fr); }
  .pt-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(360px, 60vh) minmax(420px, auto); }
  .pt-orders { flex-wrap: wrap; }
  .pt-order-list { flex-basis: 100%; order: 3; }
}
