:root {
  color-scheme: dark;
  --bg: #000000;
  --s1: #0a0a0a;
  --s2: #111111;
  --s3: #191919;
  --s4: #232323;
  --s5: #2c2c2c;
  --text: #ededed;
  --dim: #8e8e8e;
  --faint: #5a5a5a;
  --line: rgba(255, 255, 255, 0.045);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mark {
  width: 26px;
  height: 26px;
  flex: none;
}

.ai {
  color: var(--dim);
  font-size: 13px;
  text-align: right;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

h2 {
  margin: 24px 2px 10px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.add {
  display: flex;
  gap: 8px;
}

.add input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--s2);
  color: var(--text);
  font: inherit;
  outline: none;
}

.add input:focus {
  background: var(--s3);
}

.add input::placeholder {
  color: var(--faint);
}

.btn {
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--s3);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  background: var(--s4);
  outline: none;
}

.btn:disabled {
  background: var(--s2);
  color: var(--faint);
  cursor: default;
}

.btn.primary {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
}

.btn.primary:hover,
.btn.primary:focus-visible {
  background: #dcdcdc;
}

.btn.primary:disabled {
  background: var(--s2);
  color: var(--faint);
}

.hint {
  min-height: 20px;
  margin: 8px 2px 0;
  color: var(--dim);
  font-size: 13px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  background: var(--s1);
}

.row.ready {
  cursor: pointer;
}

.row.ready:hover {
  background: var(--s2);
}

.row.on,
.row.on:hover {
  background: var(--s3);
}

.thumb {
  width: 52px;
  height: 52px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: var(--s3);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.body {
  flex: 1;
  min-width: 0;
}

.title,
.sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title {
  font-weight: 500;
}

.sub {
  color: var(--dim);
  font-size: 13px;
}

.row.bad .sub {
  color: #e06c6c;
}

.prog {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--s4);
}

.prog i {
  display: block;
  width: 0;
  height: 100%;
  background: #ffffff;
  transition: width 0.3s ease;
}

.x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.x:hover,
.x:focus-visible {
  background: var(--s4);
  color: var(--text);
  outline: none;
}

.note {
  margin: 0 2px;
  color: var(--faint);
  font-size: 13px;
}

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 18px;
  background: #000000;
  box-shadow: inset 0 0 0 1px var(--line);
  touch-action: none;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.stage canvas:active {
  cursor: grabbing;
}

.stage-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 14px;
  pointer-events: none;
}

.stage-hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: var(--faint);
  font-size: 12px;
  pointer-events: none;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 14px;
}

.btn.icon {
  display: grid;
  place-items: center;
  width: 46px;
  padding: 0;
}

.btn.icon .i-pause,
.btn.icon[data-playing="1"] .i-play {
  display: none;
}

.btn.icon[data-playing="1"] .i-pause {
  display: block;
}

.time {
  min-width: 84px;
  color: var(--dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--s2);
}

.seg button {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.seg button:hover,
.seg button:focus-visible {
  color: var(--text);
  outline: none;
}

.seg button.on {
  background: var(--s4);
  color: var(--text);
}

.slider {
  display: flex;
  flex: 1 1 160px;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 13px;
}

input[type="range"] {
  --fill: 50%;
  flex: 1;
  min-width: 0;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ffffff var(--fill), var(--s5) var(--fill));
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ffffff var(--fill), var(--s5) var(--fill));
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

input[type="range"]:disabled {
  opacity: 0.4;
  cursor: default;
}

.vr {
  width: 100%;
  height: 54px;
  margin-top: 18px;
  border-radius: 14px;
  font-size: 16px;
}

.keys dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
}

.keys dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.keys dt {
  color: var(--dim);
}

.keys dd {
  margin: 0;
  text-align: right;
}

.media {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

.media video {
  width: 2px;
  height: 2px;
}

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

  .main {
    order: -1;
  }
}

@media (max-width: 560px) {
  .keys dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai {
    max-width: 50%;
  }
}
