* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "MS Gothic UI", "MS UI Gothic", monospace;
  font-size: 13px;
  background-color: #1a1a1a;
  color: #d6d6d6;
  line-height: 1.5;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}

.cat {
  position: fixed;
  bottom: 0;
  left: 90%;
  transform: translateX(-50%);
  z-index: 10;
  width: 25%;
  pointer-events: none;
}

.container {
  padding: 12px;
  max-width: 860px;
  padding-bottom: 70px;
}

/* ── header ── */
.header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

.header-title {
  font-size: 16px;
  color: #0f0;
}

.header-sub {
  font-size: 11px;
  color: #555;
}

/* ── top-level dropdowns ── */
.dropdown {
  display: block;
  margin-bottom: 0;
}

.dropdown-header {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  gap: 6px;
}

.dropdown-header:hover {
  background-color: #0d0d0d;
}

.arrow {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3px solid #fff;
  flex-shrink: 0;
}

.arrow.up {
  border-top: none;
  border-bottom: 3px solid #fff;
}

.dropdown-content {
  display: none;
  padding: 2px 0 6px 0;
}

.dropdown.open .dropdown-content {
  display: block;
}

/* ── tree ── */
.tree {
  padding: 2px 0;
}

.tree-row {
  display: flex;
  align-items: center;
  padding: 1px 0;
  white-space: nowrap;
  gap: 4px;
}

.tree-row:hover {
  background: #0d0d0d;
}

.tree-indent {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.tree-guide {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: #333;
  flex-shrink: 0;
  font-size: 11px;
  user-select: none;
}

.tree-toggle {
  cursor: pointer;
  user-select: none;
  color: #d6d6d6;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tree-toggle:hover { color: #fff; }

.tree-caret {
  color: #555;
  font-size: 10px;
  width: 10px;
  display: inline-block;
  flex-shrink: 0;
}

.tree-folder-name { color: #d6d6d6; }
.tree-toggle:hover .tree-folder-name { color: #fff; }

.tree-children { display: none; }
.tree-children.open { display: block; }

.tree-file {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.tree-icon {
  color: #444;
  font-size: 10px;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.tree-name {
  color: #bbb;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.tree-size {
  color: #444;
  font-size: 10px;
  flex-shrink: 0;
  padding-right: 6px;
}

.tree-play {
  color: #0f0;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0 4px;
  opacity: 0;
}

.tree-row:hover .tree-play { opacity: 1; }
.tree-play:hover { text-decoration: underline; }

.tree-dl {
  color: #555;
  text-decoration: none;
  font-size: 11px;
  flex-shrink: 0;
  padding-right: 8px;
  opacity: 0;
}

.tree-row:hover .tree-dl { opacity: 1; }
.tree-dl:hover { color: #fff; }

/* ── player bar ── */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  border-top: 1px solid #333;
  padding: 5px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 100;
}

.player-bar.visible { display: flex; }

.player-title {
  color: #0f0;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  font-family: "MS Gothic UI", "MS UI Gothic", monospace;
}

.player-bar audio {
  flex: 1;
  height: 22px;
  min-width: 0;
}

.player-close {
  cursor: pointer;
  color: #666;
  font-size: 13px;
  background: none;
  border: none;
  font-family: inherit;
  flex-shrink: 0;
}

.player-close:hover { color: #fff; }

/* ── misc ── */
.loading { color: #555; padding: 8px 0; font-size: 12px; }
.error   { color: #f00; padding: 8px 0; font-size: 12px; }
.empty   { color: #444; font-size: 11px; padding: 4px 0; }