:root {
  --bg: #0e1014;
  --card: #181b22;
  --card-2: #1f232c;
  --border: #262b36;
  --text: #ecedef;
  --muted: #8a8f9a;
  --brand: #fb9b50;
  --blue: #2c599d;
  --star: #fb9b50;
  --star-off: #353a47;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 16, 20, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem 0;
}
.head-row {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.65rem;
}
h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }
.tagline { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
.tagline::before { content: "● "; color: var(--brand); }
.meta { color: var(--muted); font-size: 0.85rem; }
.meta b { color: var(--brand); }

.tabs {
  display: flex; gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 0 -1.5rem 0.8rem;
  padding: 0 1.5rem;
  overflow-x: auto;
}
.tab {
  background: transparent; color: var(--muted);
  border: none; border-bottom: 2px solid transparent;
  padding: 0.55rem 0.9rem; font: inherit; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap;
  transition: color 0.1s, border-color 0.1s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }

.controls { display: flex; gap: 0.5rem; flex-wrap: wrap; padding-bottom: 0.9rem; }
.controls input, .controls select, .controls button {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 0.5rem 0.7rem; font: inherit; font-size: 0.85rem;
}
.controls input { flex: 1; min-width: 220px; }
.controls button { cursor: pointer; }
.controls button:hover { background: var(--card-2); border-color: #353a47; }
.controls input:focus, .controls select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}

.cat-chip, .views-chip {
  position: absolute; top: 0.55rem; right: 0.55rem; z-index: 4;
  font-size: 0.68rem; font-weight: 600; color: white;
  padding: 0.22rem 0.55rem; border-radius: 999px;
  letter-spacing: 0.01em;
}
.cat-chip { background: rgba(44, 89, 157, 0.92); }
.views-chip { background: rgba(251, 155, 80, 0.95); }

.video-wrap {
  aspect-ratio: 9/16;
  background: #000;
  border-bottom: 1px solid var(--border);
  position: relative;
  max-height: 480px;
}
.video-wrap video, .video-wrap iframe, .video-wrap img.yt-thumb {
  width: 100%; height: 100%; display: block; border: 0;
  object-fit: cover;
}
.video-wrap img.yt-thumb { cursor: pointer; }
.video-wrap .yt-play {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: white;
  border: 2px solid white;
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding-left: 4px;
}
.video-wrap .yt-play:hover { background: rgba(0,0,0,0.85); }
.video-wrap .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
  background: linear-gradient(135deg, #1a1d24, #232732);
}

.body { padding: 0.85rem 0.9rem 0.6rem; display: flex; flex-direction: column; gap: 0.45rem; }
h2.name, h2.song-title { margin: 0; font-size: 1rem; line-height: 1.25; }
.body p { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.body p b { color: var(--text); font-weight: 600; }
.meta-line { font-size: 0.78rem; color: var(--muted); }
.channel::before { content: "@"; opacity: 0.6; }

.gta-row {
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  padding: 0.5rem 0;
  margin: 0.1rem 0;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.gta-row:empty { display: none; }
.gta-label {
  font-size: 0.78rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.5rem;
}
.gta-label .gta-search {
  color: var(--brand); text-decoration: none; font-size: 0.76rem; margin-left: auto;
}
.gta-label .gta-search:hover { text-decoration: underline; }
.gta-thumb-wrap {
  position: relative; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden;
  background: #000; cursor: pointer;
}
.gta-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gta-thumb-wrap iframe {
  width: 100%; height: 100%; display: block; border: 0;
}
.gta-play {
  position: absolute; inset: 0; margin: auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: white; border: 2px solid white;
  font-size: 1rem; cursor: pointer; padding-left: 3px;
  display: flex; align-items: center; justify-content: center;
}
.gta-thumb-wrap:hover .gta-play { background: rgba(251,155,80,0.95); border-color: transparent; }
.gta-views {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.75); color: white;
  font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px;
}
.gta-title { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }

.music-row { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.1rem; }
.music-label { font-size: 0.95rem; opacity: 0.8; }
.music-input {
  flex: 1; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.35rem 0.5rem; font: inherit; font-size: 0.78rem;
}
.music-input:focus { outline: 1.5px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.music-input.has-value { border-color: var(--brand); background: rgba(251,155,80,0.06); }

.rating { display: flex; align-items: center; gap: 0.1rem; margin-top: 0.1rem; }
.rating button {
  background: none; border: none; cursor: pointer; padding: 0 0.05rem;
  font-size: 1.5rem; color: var(--star-off); line-height: 1;
  transition: color 0.08s, transform 0.08s;
}
.rating button:hover { transform: scale(1.1); color: var(--star); }
.rating button.on { color: var(--star); }

a.open-yt {
  display: inline-block; margin-top: 0.2rem;
  color: var(--brand); font-size: 0.8rem; text-decoration: none;
}
a.open-yt:hover { text-decoration: underline; }

details.links {
  border-top: 1px solid var(--border);
  margin: 0.4rem -0.9rem -0.6rem;
  font-size: 0.8rem;
}
details summary {
  padding: 0.55rem 0.9rem;
  cursor: pointer; color: var(--muted);
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
details summary:hover { color: var(--text); }
details ul {
  margin: 0; padding: 0 0.9rem 0.7rem 1.7rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
details a { color: var(--brand); text-decoration: none; }
details a:hover { text-decoration: underline; }
details .views { color: var(--muted); font-size: 0.75rem; }

.card-music { padding: 1rem; gap: 0.5rem; }
.card-music .song-title { font-size: 1.05rem; color: var(--brand); }
.card-music .usage-count { font-weight: 600; color: var(--text); }
.card-music ul.usage-list {
  margin: 0.4rem 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.card-music ul.usage-list a {
  display: block; padding: 0.4rem 0.6rem;
  background: var(--card-2); border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: 0.83rem;
  border-left: 2px solid var(--brand);
}
.card-music ul.usage-list a:hover { background: #262a35; }

.empty {
  grid-column: 1 / -1;
  text-align: center; color: var(--muted);
  padding: 4rem 1rem;
}
.empty b { color: var(--text); }
.empty kbd {
  display: inline-block; padding: 0.1rem 0.4rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit; font-size: 0.85rem; color: var(--brand);
}

@media (max-width: 600px) {
  header { padding: 0.75rem 1rem 0; }
  .tabs { margin: 0 -1rem 0.7rem; padding: 0 1rem; }
  main { padding: 1rem; grid-template-columns: 1fr; }
  .video-wrap { max-height: 70vh; }
}
