:root {
  --bg: #0a0b0d;
  --bg2: #101216;
  --line: rgba(255,255,255,.09);
  --fg: #ece7df;
  --dim: #8b8e95;
  --accent: #d9b382;
  --accent2: #7fa8a0;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#viz {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; opacity: .6;
  pointer-events: none;
}

.wrap {
  position: relative; z-index: 1;
  max-width: 700px; margin: 0 auto;
  padding: 22px 20px 60px;
}

.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 46px; }
.back { color: var(--dim); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--fg); }
.seedchip {
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--dim); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px;
}

h1 { font-size: 34px; letter-spacing: -.02em; margin: 0 0 8px; font-weight: 600; }
.tagline { color: var(--dim); font-size: 14px; line-height: 1.55; margin: 0 0 28px; max-width: 52ch; }

/* now playing */
.nowplaying {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  padding: 18px 18px 16px; margin-bottom: 24px;
}
.np-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.np-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.val { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chords { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.chord {
  font: 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--dim);
  transition: background .25s, color .25s, border-color .25s;
}
.chord.on { background: rgba(217,179,130,.16); border-color: rgba(217,179,130,.5); color: var(--accent); }
.progname { font-size: 12px; color: var(--dim); font-style: italic; }

/* transport */
.transport { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.play {
  width: 62px; height: 62px; border-radius: 50%;
  border: 1px solid rgba(217,179,130,.45);
  background: radial-gradient(circle at 40% 35%, rgba(217,179,130,.28), rgba(217,179,130,.06));
  color: var(--accent); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .3s, opacity .2s;
}
.play:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(217,179,130,.22); }
.play:disabled { opacity: .4; cursor: wait; }
.play .ico { transform: translateX(1px); }
.play.playing .ico { transform: none; }

.ghost {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-size: 13.5px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.ghost:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.04); }
.ghost.wide { width: 100%; border-radius: 10px; }

.status { color: var(--dim); font-size: 12.5px; min-height: 18px; margin: 0 0 28px; }

/* scenes */
.scenes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; margin-bottom: 28px; }
.scene {
  text-align: left; cursor: pointer;
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px; color: var(--fg);
  transition: border-color .2s, background .2s;
}
.scene:hover { border-color: rgba(255,255,255,.24); }
.scene.on { border-color: rgba(217,179,130,.55); background: rgba(217,179,130,.1); }
.scene b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.scene span { display: block; font-size: 11.5px; color: var(--dim); line-height: 1.4; }

/* knobs */
.knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 22px; margin-bottom: 28px; }
.knob { display: flex; flex-direction: column; gap: 8px; }
.knob > span { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; }
.knob b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.15); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}

/* code */
.codebox { margin-bottom: 34px; }
.code {
  margin: 10px 0 0; padding: 14px;
  max-height: 340px; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #b9c2b6; white-space: pre; -webkit-overflow-scrolling: touch;
}
.hidden { display: none; }

.foot { color: var(--dim); font-size: 11.5px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 16px; }
.foot a { color: var(--dim); }

@media (max-width: 560px) {
  h1 { font-size: 27px; }
  .np-row { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .wrap { padding-top: 16px; }
  .top { margin-bottom: 30px; }
}

.like { min-width: 54px; }
.like.on { border-color: rgba(217,179,130,.6); background: rgba(217,179,130,.14); color: var(--accent); }
#like-count { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--dim); }
.like.on #like-count { color: var(--accent); }

/* сетка того, что играет прямо сейчас */
.punchbox {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.02);
  padding: 12px 12px 10px; margin-bottom: 24px;
}
#punch { display: block; width: 100%; height: 148px; }
@media (max-width: 560px) { #punch { height: 128px; } }

/* ---------- живой режим ---------- */
.live {
  position: fixed; inset: 0; z-index: 50;
  background: #070b18;
  color: #93a4c9;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.live.hidden { display: none; }

.live-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid rgba(147,164,201,.16);
  flex-wrap: wrap;
}
.live-meta { color: #d9b382; letter-spacing: .01em; }
.live-actions { display: flex; gap: 8px; }
.lbtn {
  font: inherit; color: #93a4c9; background: transparent;
  border: 1px solid rgba(147,164,201,.28); border-radius: 4px;
  padding: 5px 10px; cursor: pointer;
}
.lbtn:hover { color: #fff; border-color: rgba(147,164,201,.6); }

.live-knobs {
  padding: 10px 18px; border-bottom: 1px solid rgba(147,164,201,.12);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 22px;
}
.lknob { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lknob .cm { color: #4d5f86; }
.lknob .nm { color: #93a4c9; width: 11ch; }
.lknob input[type=range] { flex: 1; min-width: 70px; height: 2px; background: rgba(147,164,201,.28); }
.lknob input[type=range]::-webkit-slider-thumb { width: 11px; height: 11px; background: #d9b382; }
.lknob input[type=range]::-moz-range-thumb { width: 11px; height: 11px; background: #d9b382; }
.lknob .vl { color: #d9b382; width: 4ch; text-align: right; }

.live-code { overflow: auto; padding: 12px 18px 18px; -webkit-overflow-scrolling: touch; }
.live-code .ln { white-space: pre; padding: 0 6px; border-radius: 3px; }
.live-code .cmt { color: #4d5f86; }
.live-code .var { color: #7e8fb5; opacity: .5; transition: opacity .12s, background .12s, color .12s; }
.live-code .var.on { opacity: 1; color: #e8edf7; background: rgba(217,179,130,.16); box-shadow: inset 2px 0 0 #d9b382; }
.live-code .seq { color: #6f83ad; }

#live-punch { display: block; width: 100%; height: 150px; border-top: 1px solid rgba(147,164,201,.16); }

@media (max-width: 560px) {
  .live { font-size: 10.5px; }
  .live-code { padding: 10px 10px 14px; }
  #live-punch { height: 120px; }
}
