:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #111318;
  --panel-2: #171a21;
  --line: #2a2f3a;
  --text: #f1f3f6;
  --muted: #9aa3b2;
  --accent: #7cc7ff;
  --accent-2: #f5b971;
  --focus: #cbe7ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 7px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:focus-visible, input:focus-visible, .clip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 18px;
  padding: 82px 24px 24px;
  min-height: 0;
  overflow: hidden;
}

.video-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  background: radial-gradient(circle at 50% 10%, #1f2530 0, #08090b 52%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

video {
  width: min(100%, 64vh, 760px);
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  background: #000;
}

.controls {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: calc(100% - 48px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, #0d1016 88%, transparent);
  box-shadow: 0 10px 28px rgb(0 0 0 / 30%);
  backdrop-filter: blur(12px);
}

#play {
  background: var(--accent);
  border-color: var(--accent);
  color: #061018;
  font-weight: 750;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.now {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.meta-line {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

h1 {
  margin: 8px 0;
  font-size: clamp(22px, 4vw, 44px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #cbd1dc;
  font-size: 16px;
  line-height: 1.55;
}

.rail {
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.rail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-bottom: 1px solid var(--line);
}

.rail-head strong {
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

#filter {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  padding: 0 12px;
  background: #0c0e12;
  color: var(--text);
}

.clip-list {
  overflow: auto;
  padding: 8px;
}

.clip {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.clip:hover {
  background: #1a1e27;
}

.clip.active {
  background: #152536;
  border-color: #315b7b;
}

.num {
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.clip-title {
  display: block;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.clip-text {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .rail {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 48vh;
  }

  .stage {
    padding: 78px 12px 14px;
  }

  .controls {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    justify-content: flex-start;
  }
}