/* ====== Global layout ====== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

.sl-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #000;
  color: #c8facc;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.sl-container {
  padding: 2rem 1.5rem 3rem;
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ====== Header ====== */

.sl-header h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sl-header p {
  margin: 0.3rem 0 0;
}

.sl-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sl-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.15);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.sl-header-sub {
  margin-top: 0.75rem;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ====== Main grid ====== */

.sl-main {
  flex: 1;
}

.sl-main-split {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

@media (max-width: 800px) {
  .sl-main-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ====== Sidebar / loop list ====== */

.sl-sidebar {
  background: rgba(0, 20, 0, 0.92);
  border-radius: 1.25rem;
  border: 1px solid rgba(100, 255, 150, 0.4);
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
  color: #c8facc;
}

.sl-sidebar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.sl-sidebar-title {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.sl-sidebar-hint {
  font-size: 0.7rem;
  opacity: 0.6;
}

.sl-loop-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sl-loop-item-btn {
  width: 100%;
  text-align: left;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 30, 0, 0.9);
  color: #c8facc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition:
    transform 120ms ease-out,
    border-color 120ms ease-out,
    background 120ms ease-out,
    box-shadow 120ms ease-out;
}

.sl-loop-item-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 255, 150, 0.4);
  background: rgba(0, 45, 0, 0.95);
}

.sl-loop-item-btn.active {
  transform: translateY(-1px);
  border-color: #2eff9f;
  background: rgba(0, 55, 0, 0.98);
  box-shadow: 0 0 18px rgba(46, 255, 159, 0.35);
}

.sl-loop-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.sl-loop-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

.sl-loop-desc {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ====== Player ====== */

.sl-player {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.sl-player-shell {
  position: relative;
  display: inline-flex;
  align-self: center;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 50, 0, 0.8), rgba(0, 0, 0, 0.95));
  box-shadow:
    0 0 40px rgba(0, 80, 0, 0.9),
    0 0 80px rgba(46, 255, 159, 0.28);
}

.sl-player-glow {
  position: absolute;
  inset: 10%;
  border-radius: 999px;
  background: conic-gradient(
    from 220deg,
    rgba(249, 115, 22, 0.18),
    rgba(129, 140, 248, 0.05),
    rgba(6, 182, 212, 0.12),
    rgba(249, 115, 22, 0.18)
  );
  filter: blur(18px);
  opacity: 0.7;
  pointer-events: none;
}

/* Canvas */
#tapeCanvas {
  border-radius: 50%;
  background: radial-gradient(circle, #020f02, #000);
  box-shadow:
    0 0 0 2px rgba(46, 255, 159, 0.3),
    0 0 28px rgba(46, 255, 159, 0.25),
    0 0 48px rgba(46, 255, 159, 0.15);
}

/* Now playing pill */
.sl-now-playing {
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  transform: translate(-50%, 100%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(46, 255, 159, 0.5);
  backdrop-filter: blur(10px);
}

.sl-pill {
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid rgba(46, 255, 159, 0.4);
  background: rgba(0, 0, 0, 0.8);
  color: #9efcb7;
}

.sl-now-playing-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sl-now-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.sl-now-meta {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Controls + progress */

.sl-meta {
  display: flex;
  justify-content: center;
  opacity: 0.8;
  font-size: 0.85rem;
}

.sl-meta-row {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sl-visual-toggle {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.3);
  background: rgba(15, 23, 42, 0.4);
  color: #f8fafc;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.sl-visual-toggle:hover {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.2);
  transform: translateY(-1px);
}

/* Meta + notes */

.sl-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

.sl-meta-wide {
  justify-content: space-between;
  width: 100%;
}

.sl-loop-notes {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(
    circle at top left,
    rgba(30, 41, 59, 0.98),
    rgba(17, 24, 39, 0.92)
  );
  font-size: 0.8rem;
  line-height: 1.4;
}

.sl-loop-notes h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.9;
  margin: 0 0 0.4rem;
}

.sl-loop-notes p {
  margin: 0;
}

.sl-note-display {
  margin-bottom: 0.5rem;
  color: #f8fafc;
}

.sl-note-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sl-note-label {
  font-size: 0.75rem;
  opacity: 0.85;
}

.sl-note-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.7);
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.sl-note-textarea::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

.sl-note-textarea:focus {
  outline: none;
  border-color: #facc15;
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.7),
    0 0 0 6px rgba(250, 204, 21, 0.12);
}

.sl-btn-ghost {
  border: 1px solid rgba(248, 250, 252, 0.4);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.4);
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.sl-btn-ghost:hover {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.2);
  transform: translateY(-1px);
}

/* ====== Footer ====== */

.sl-footer {
  text-align: center;
  opacity: 0.6;
  font-size: 0.75rem;
  margin-top: 1rem;
}
