/* twitch-clipper — edit-bay theme */
:root {
  --bg: #0b0c0f;
  --bg-raise: #121419;
  --line: #1e2128;
  --text: #c9ced8;
  --text-dim: #6c7380;
  --accent: #ffb020;
  --accent-dim: #8a6114;
  --font-head: 'Chakra Petch', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* top bar shared by all pages */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.topbar .vodtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.topbar .meta { color: var(--text-dim); white-space: nowrap; }

.ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  white-space: nowrap;
}
.ctrl select, .ctrl button, .btn {
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}
.ctrl button:hover, .btn:hover { border-color: var(--accent-dim); color: var(--accent); }

.status { color: var(--text-dim); padding: 40px; text-align: center; }
.status.error { color: #ff6b6b; }

/* a single storyboard thumbnail (background-image crop from a sheet) */
.thumb {
  position: relative;
  background-repeat: no-repeat;
  background-color: var(--bg-raise);
  cursor: crosshair;
  flex: none;
}
.thumb:hover { outline: 2px solid var(--accent); z-index: 5; }
.thumb .t {
  position: absolute;
  left: 2px;
  bottom: 2px;
  padding: 0 3px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent);
  font-size: 10px;
  pointer-events: none;
  opacity: 0;
}
.thumb:hover .t { opacity: 1; }

/* playhead marker on the thumb currently under playback */
.thumb.playing::after {
  content: '';
  position: absolute;
  inset: 0;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  pointer-events: none;
}

video { background: #000; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e37; border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* clip markers on VOD storyboard thumbs */
.thumb .clipmark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
  pointer-events: none;
}
.thumb .clipcount {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 3px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font-size: 9px;
  font-weight: 600;
  pointer-events: none;
}
.thumb .clipmark, .thumb .clipcount { pointer-events: auto; cursor: pointer; }
.thumb .clipmark:hover { height: 7px; }
.clippop {
  position: fixed;
  z-index: 300;
  min-width: 320px;
  max-width: 480px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-raise);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  font-size: 11px;
}
.clippop .row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 9px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.clippop .row:last-child { border-bottom: none; }
.clippop .row:hover { background: rgba(255, 176, 32, 0.08); }
.clippop .v { color: var(--accent); flex: none; min-width: 40px; text-align: right; }
.clippop .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clippop .tw { color: var(--text-dim); text-decoration: none; flex: none; }
.clippop .tw:hover { color: var(--accent); }
.clippop .pimg {
  flex: none;
  width: 192px;
  height: 108px;
  border-radius: 3px;
  background: #000 center/cover no-repeat;
}
.clippop .pimg.scrubbable { cursor: crosshair; outline: 1px solid var(--accent-dim); }
.clippop .body { flex: 1; min-width: 0; align-self: center; }
.clippop .m { color: var(--text-dim); margin-top: 3px; }
.clippop .row { align-items: stretch; }
.clippop .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 4px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11px;
  position: sticky;
  top: 0;
  background: var(--bg-raise);
}
.clippop .head .x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
}
.clippop .head .x:hover { color: var(--accent); }
@keyframes sbpulse { 50% { outline-color: rgba(255, 176, 32, 0.15); } }
.clippop .pimg.rendering {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: sbpulse 1s infinite;
}
.clippop .pimg.failed { outline: 2px solid #ff5252; outline-offset: -2px; }

/* in-app clip player modal */
.playermodal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 5, 7, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.playermodal .box {
  width: min(920px, 92vw);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.8);
}
.playermodal .head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}
.playermodal .head .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.playermodal .head .x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}
.playermodal .head .x:hover { color: var(--accent); }
.playermodal video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.playermodal .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}
.playermodal .foot .meta { color: var(--text-dim); font-size: 12px; }
.playermodal .foot .actions { display: flex; gap: 8px; }
.playermodal .foot .btn { text-decoration: none; }
