:root {
  --accent: #a55fff;
  --accent-light: #c494ff;
  --bg: #0a0a0a;
  --bg-soft: #111114;
  --glass-border: rgba(255, 255, 255, .1);
  --text: #e9e9ec;
  --text-dim: #9a9aa2;
  --text-muted: #6a6a72;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font-body); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--bg); }
.container { width: min(calc(100% - 40px), 1180px); margin: auto; padding: 24px 0 80px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.site-header { align-items: center; margin-bottom: 42px; }
.brand { font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -.035em; }
.brand:hover, .breadcrumb a:hover { color: var(--accent-light); }
.subtitle { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.meta, .catalog-count, .breadcrumb { color: var(--text-muted); font: 11px var(--mono); letter-spacing: .02em; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(25px, 4vw, 40px); line-height: 1.15; }
h2 { font-size: 20px; }
.catalog-heading h1 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile, .player-panel, .playlist-panel { position: relative; background: var(--bg-soft); border: 1px solid var(--glass-border); border-radius: 2px; }
.tile:hover { border-color: var(--accent); }
.tile::before, .panel--bracketed::before { content: ""; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border: 1px solid var(--accent); border-right: 0; border-bottom: 0; pointer-events: none; z-index: 1; }
.tile::before { opacity: 0; }
.tile:hover::before { opacity: 1; }
.tile__media { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--glass-border); }
.tile__image { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { display: grid; place-items: center; color: var(--text-muted); font: 11px var(--mono); }
.tile__body { display: flex; flex-direction: column; gap: 16px; padding: 14px; }
.tile__title { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tile:hover .tile__title { color: var(--accent-light); }
.tile__actions, .player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; background: var(--accent); border: 1px solid var(--accent); border-radius: 2px; color: var(--bg); font: 600 13px var(--mono); }
.button:hover { background: var(--accent-light); border-color: var(--accent-light); }
.button-secondary { background: transparent; border-color: var(--glass-border); color: var(--text); }
.button-secondary:hover { background: transparent; border-color: var(--accent); color: var(--accent-light); }
.button-small { min-height: 32px; padding: 4px 10px; font-size: 11px; }
.status { grid-column: 1 / -1; padding: 24px; background: var(--bg-soft); border: 1px solid var(--glass-border); color: var(--text-dim); font: 12px var(--mono); }
.error { border-left: 2px solid #e74c3c; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 18px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb .current { color: var(--text); }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.player-panel { padding: 10px; }
.player-panel video { display: block; width: 100%; max-height: 70vh; aspect-ratio: 16 / 9; background: #000; }
.player-details { padding: 22px 0; }
.player-details h1 { margin-bottom: 10px; }
.player-details p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.player-actions { margin-top: 22px; }
.playlist-panel { padding: 16px; }
.playlist-panel .section-heading { align-items: center; margin-bottom: 4px; }
.playlist-panel h2 { margin: 0; }
.playlist { max-height: 75vh; overflow: auto; }
.playlist-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; text-align: left; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--glass-border); font-size: 12px; }
.playlist-item:hover, .playlist-item.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.playlist-thumb { flex: 0 0 70px; width: 70px; height: 42px; object-fit: cover; background: var(--bg); }
.playlist-item span:last-child { overflow: hidden; text-overflow: ellipsis; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; padding: 10px 14px; background: var(--bg-soft); border: 1px solid var(--accent); color: var(--text); font: 12px var(--mono); opacity: 0; pointer-events: none; }
.toast.show { opacity: 1; }
@media (max-width: 800px) {
  .player-layout { grid-template-columns: 1fr; }
  .playlist { max-height: none; }
}
@media (max-width: 500px) {
  .container { width: min(calc(100% - 24px), 1180px); padding-top: 16px; }
  .site-header { margin-bottom: 28px; }
  .site-header .meta { display: none; }
  .grid { grid-template-columns: 1fr; }
  .player-actions .button { width: 100%; }
}
