:root {
  --bg-0: #04070f;
  --bg-1: #0a1226;
  --bg-2: #101d3a;
  --panel: rgba(15, 24, 48, 0.72);
  --panel-solid: #0c1730;
  --panel-border: rgba(110, 150, 255, 0.14);
  --blue-1: #1747c9;
  --blue-2: #2f6bff;
  --blue-3: #7fb2ff;
  --blue-glow: #3b7bff;
  --ink-0: #eef3ff;
  --ink-1: #b6c3e6;
  --ink-2: #7688b3;
  --danger: #ff5470;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --anim-speed: .25s;
  --font-display: 'Segoe UI Semibold', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

/* Light theme override */
body.theme-light {
  --bg-0: #eef1f8;
  --bg-1: #ffffff;
  --bg-2: #dbe4fb;
  --panel: rgba(255,255,255,0.82);
  --panel-solid: #ffffff;
  --panel-border: rgba(50, 90, 200, 0.16);
  --ink-0: #101828;
  --ink-1: #3a4666;
  --ink-2: #6b7794;
}

body.no-anim * { transition: none !important; animation: none !important; }
body.compact .titlebar { height: 34px; }
body.compact .transport { padding: 2px 14px 10px; }
body.compact .ctl-btn { width: 30px; height: 30px; }
body.compact .play-btn { width: 46px; height: 46px; }
body.compact .sidebar { width: 260px; min-width: 260px; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-body);
  overflow: hidden;
  user-select: none;
}
button { font-family: inherit; }
::selection { background: var(--blue-2); color: white; }

/* ---------------- Titlebar ---------------- */
.titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #0b1530, #060b1a);
  border-bottom: 1px solid rgba(90,130,255,0.14);
  -webkit-app-region: drag;
  padding: 0 8px 0 12px;
}
body.theme-light .titlebar { background: linear-gradient(180deg, #f5f8ff, #e6ecfb); border-bottom-color: rgba(50,90,200,0.16); }
.titlebar-drag { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#titlebar-brand { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: -2px -6px; transition: background .15s ease; }
#titlebar-brand:hover, #titlebar-brand:focus-visible { background: rgba(120,150,220,0.14); outline: none; }
.brand-icon { width: 20px; height: 20px; filter: drop-shadow(0 0 6px rgba(60,120,255,0.7)); }
.brand-text { font-size: 12.5px; letter-spacing: 1.5px; color: var(--ink-1); font-weight: 600; white-space: nowrap; }
.brand-text b { color: var(--blue-3); font-weight: 800; }
.titlebar-search { flex: 1; display: flex; justify-content: center; -webkit-app-region: drag; padding: 0 16px; }
.titlebar-search .search-box { width: 100%; max-width: 420px; margin-bottom: 0; -webkit-app-region: no-drag; }
.titlebar-controls { display: flex; align-items: center; gap: 2px; -webkit-app-region: no-drag; flex-shrink: 0; }
.win-btn {
  width: 38px; height: 34px; border: none; background: transparent; color: var(--ink-1); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.win-btn svg { width: 10px; height: 10px; stroke: currentColor; fill: currentColor; }
#btn-notifications svg { width: 17px; height: 17px; fill: none; }
.win-btn:hover { background: rgba(90,130,255,0.14); color: white; }
.win-btn-close:hover { background: var(--danger); color: white; }

/* ---------------- Shell layout ---------------- */
.app-shell {
  display: flex;
  height: calc(100% - 40px);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(45,95,220,0.22), transparent 60%),
    radial-gradient(900px 600px at 110% 30%, rgba(30,70,180,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
}

/* ---------------- Nav rail (Menu overlay) ---------------- */
.nav-rail {
  width: 220px; min-width: 220px;
  background: var(--panel-solid);
  border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  transition: width var(--anim-speed) ease, min-width var(--anim-speed) ease, padding var(--anim-speed) ease, transform var(--anim-speed) cubic-bezier(.2,.8,.3,1);
  overflow: hidden;
  position: fixed; top: 40px; left: 0; bottom: 0;
  transform: translateX(-100%);
  z-index: 57;
  box-shadow: 30px 0 80px rgba(0,0,0,0.5);
}
.nav-rail.open { transform: translateX(0); }
.nav-overlay-close { margin-left: auto; flex-shrink: 0; }
.nav-brand-block { position: relative; }
.nav-rail.collapsed { width: 74px; min-width: 74px; padding: 16px 8px 12px; }
.nav-rail.collapsed .nav-brand-text, .nav-rail.collapsed .nav-labels,
.nav-rail.collapsed .nav-footer-card, .nav-rail.collapsed .nav-social-row a { display: none; }
.nav-rail.collapsed .nav-item { justify-content: center; }
.nav-rail.collapsed .nav-brand-block { justify-content: center; }

.nav-brand-block { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 0 4px; }
.nav-brand-logo { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(60,120,255,0.6)); flex-shrink: 0; }
.nav-brand-text { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: var(--ink-0); line-height: 1.3; }

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-list::-webkit-scrollbar { width: 6px; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(100,140,255,0.35); border-radius: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid transparent; color: var(--ink-2); text-align: left;
  border-radius: var(--radius-sm); padding: 9px 10px; cursor: pointer;
}
.nav-item .nav-ic { font-size: 18px; line-height: 1; flex-shrink: 0; width: 20px; text-align: center; }
.nav-labels { display: flex; flex-direction: column; min-width: 0; }
.nav-title { font-size: 12.5px; font-weight: 700; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sub { font-size: 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(90,130,255,0.1); }
.nav-item.active { background: linear-gradient(90deg, rgba(60,110,255,0.28), rgba(60,110,255,0.05)); border-color: rgba(120,160,255,0.4); }
.nav-item.active .nav-title { color: var(--blue-3); }

.nav-footer-card {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md);
  background: rgba(90,130,255,0.06); border: 1px solid var(--panel-border);
  font-size: 10.5px; color: var(--ink-2); line-height: 1.8;
}
.nav-footer-line.brand-line { color: var(--blue-3); font-weight: 700; letter-spacing: .5px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #38d16a; margin-right: 3px; box-shadow: 0 0 6px #38d16a; }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
#hwaccel-state, #engine-state { color: var(--blue-3); }

.nav-social-row { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: 8px; }
.nav-social-ic {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); color: var(--ink-2); text-decoration: none; font-size: 12px; flex-shrink: 0;
}
.nav-social-ic:hover { background: rgba(90,130,255,0.18); color: white; }
.nav-collapse-btn {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04); color: var(--ink-1); cursor: pointer; flex-shrink: 0;
}
.nav-collapse-btn:hover { background: rgba(90,130,255,0.18); color: white; }

/* ---------------- Sidebar (library panel) ---------------- */
.sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--panel-solid);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px;
  transition: transform var(--anim-speed) cubic-bezier(.2,.8,.3,1);
  backdrop-filter: blur(8px);
  position: fixed; top: 40px; left: 0; bottom: 0;
  transform: translateX(-100%);
  z-index: 56;
  box-shadow: 30px 0 80px rgba(0,0,0,0.5);
}
.sidebar.open { transform: translateX(0); }

.sidebar-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sidebar-add-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.sidebar-close-row { display: flex; gap: 6px; flex-shrink: 0; }

.pill-btn {
  background: linear-gradient(180deg, var(--blue-2), var(--blue-1));
  color: white; border: 1px solid rgba(140,180,255,0.4);
  border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 14px rgba(30,80,220,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pill-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,90,255,0.5), inset 0 1px 0 rgba(255,255,255,0.3); }
.pill-btn:active { transform: translateY(0); }
.pill-sm { padding: 6px 11px; font-size: 11px; }
.sidebar-add-actions .pill-btn { width: 100%; text-align: center; }
.sidebar-add-row { display: flex; gap: 8px; }
.sidebar-add-row .pill-btn { width: auto; flex: 1 1 0; min-width: 0; padding: 8px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ghost-btn {
  background: rgba(120,150,220,0.08); color: var(--ink-1);
  border: 1px solid rgba(120,150,220,0.22); border-radius: 999px;
  padding: 7px 12px; font-size: 11.5px; cursor: pointer;
}
.ghost-btn:hover { background: rgba(120,150,220,0.16); color: var(--ink-0); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.section-header h2 { font-size: 14px; margin: 0; color: var(--ink-0); letter-spacing: .3px; }
.section-actions { display: flex; gap: 6px; }
.section-actions .ghost-btn { padding: 5px 9px; font-size: 10.5px; }

.resume-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(90deg, rgba(60,110,255,0.18), rgba(60,110,255,0.04));
  border: 1px solid rgba(120,160,255,0.3); border-radius: var(--radius-md);
  padding: 10px 12px; margin-bottom: 10px;
}
.resume-label { font-size: 10px; color: var(--blue-3); text-transform: uppercase; letter-spacing: .5px; }
.resume-name { font-size: 12px; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

.category-chips {
  display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 10px 2px; margin-bottom: 2px;
  flex-shrink: 0;
}
.category-chip {
  width: 100%; text-align: left; box-sizing: border-box;
  background: rgba(120,150,220,0.08); color: var(--ink-1);
  border: 1px solid rgba(120,150,220,0.22); border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .12s ease, color .12s ease, border-color .12s ease;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-count {
  font-size: 10.5px; font-weight: 700; color: var(--ink-2); flex-shrink: 0;
  background: rgba(255,255,255,0.08); border-radius: 999px; padding: 1px 8px;
}
.category-chip:hover { background: rgba(120,150,220,0.16); color: var(--ink-0); }
.category-chip.active {
  background: linear-gradient(180deg, var(--blue-2), var(--blue-1)); color: #fff;
  border-color: rgba(140,180,255,0.5); box-shadow: 0 3px 10px rgba(30,80,220,0.35);
}
.category-chip.active .chip-count { background: rgba(255,255,255,0.22); color: #fff; }
.category-chip.chip-lmtv.active { background: linear-gradient(180deg, #ff5f57, #d92d20); border-color: rgba(255,140,120,0.5); }

.section-count-badge {
  font-size: 10.5px; font-weight: 700; color: var(--blue-3);
  background: rgba(60,110,255,0.12); border: 1px solid rgba(120,160,255,0.3);
  border-radius: 999px; padding: 3px 10px; flex-shrink: 0;
}

.search-box { margin-bottom: 10px; position: relative; display: flex; align-items: center; }
.search-box .search-ic { position: absolute; left: 11px; width: 15px; height: 15px; stroke: var(--ink-2); fill: none; pointer-events: none; }
.search-box input {
  width: 100%; background: rgba(6,12,28,0.55); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 8px 14px 8px 34px; color: var(--ink-0); font-size: 12.5px; outline: none;
}
body.theme-light .search-box input { background: rgba(255,255,255,0.7); }
.search-box input:focus { border-color: var(--blue-2); }

.sidebar-scroll {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-right: 2px;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(100,140,255,0.35); border-radius: 4px; }

.playlist-scroll { flex: 1; }

.playlist-empty { color: var(--ink-2); font-size: 12.5px; line-height: 1.6; padding: 20px 8px; text-align: center; }
.playlist-empty b { color: var(--blue-3); }

.track-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; position: relative;
}
.track-item:hover { background: rgba(90,130,255,0.1); }
.track-item.active { background: linear-gradient(90deg, rgba(50,100,255,0.28), rgba(50,100,255,0.06)); border-color: rgba(120,160,255,0.4); }
.track-num { width: 18px; text-align: center; font-size: 11px; color: var(--ink-2); flex-shrink: 0; }
.track-item.active .track-num { color: var(--blue-3); }
.track-icon { width: 16px; text-align: center; flex-shrink: 0; opacity: .75; }
.track-info { flex: 1; min-width: 0; }
.track-name { font-size: 12.5px; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: 10.5px; color: var(--ink-2); }
.track-star, .track-remove { opacity: 0; background: none; border: none; color: var(--ink-2); cursor: pointer; padding: 3px; flex-shrink: 0; }
.track-item:hover .track-star, .track-item:hover .track-remove { opacity: 1; }
.track-star.is-fav { opacity: 1; color: #ffcc4d; }
.track-remove:hover { color: var(--danger); }
.track-star:hover { color: #ffcc4d; }
.playing-eq { display: flex; gap: 2px; align-items: flex-end; height: 12px; width: 14px; }
.playing-eq span { width: 2.5px; background: var(--blue-3); animation: eqbar 1s ease-in-out infinite; }
.playing-eq span:nth-child(2) { animation-delay: .2s; }
.playing-eq span:nth-child(3) { animation-delay: .4s; }
@keyframes eqbar { 0%,100% { height: 3px; } 50% { height: 12px; } }

.playlist-source-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border); margin-bottom: 6px; cursor: pointer;
}
.playlist-source-item:hover { border-color: rgba(120,160,255,0.4); background: rgba(255,255,255,0.05); }
.playlist-source-name { font-size: 12px; color: var(--ink-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.playlist-source-badge {
  font-size: 9px; text-transform: uppercase; letter-spacing: .4px; color: var(--blue-3);
  border: 1px solid rgba(120,160,255,0.35); border-radius: 999px; padding: 1px 6px; flex-shrink: 0;
}
.playlist-source-actions { display: flex; gap: 4px; flex-shrink: 0; }
.playlist-source-actions button { background: none; border: none; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 3px 5px; }
.playlist-source-actions button:hover { color: var(--blue-3); }
.playlist-back-btn { display: flex; align-items: center; gap: 6px; }
.history-group-heading {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--blue-3);
  font-weight: 700; margin: 14px 2px 6px; padding-top: 6px; border-top: 1px solid var(--panel-border);
}
.history-group-heading:first-child { margin-top: 2px; padding-top: 0; border-top: none; }

.sidebar-footer { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-2); padding-top: 8px; border-top: 1px solid var(--panel-border); margin-top: 8px; }

/* ---------------- Stage ---------------- */
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fullscreen-target { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg-0); position: relative; }
.fullscreen-target.is-fs { position: fixed; inset: 0; z-index: 40; }

/* True fullscreen: only the video fills the screen. The header/info/action
   rows are removed from layout (not just faded) so they stop reserving
   space, and the transport bar floats over the video instead of pushing it. */
.fullscreen-target.is-fs .video-header,
.fullscreen-target.is-fs .info-row,
.fullscreen-target.is-fs .action-toolbar { display: none; }
.fullscreen-target.is-fs .stage-media { flex: 1 1 auto; }
.fullscreen-target.is-fs .transport {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  padding-top: 40px;
  background: linear-gradient(to top, rgba(4,8,20,0.85) 10%, rgba(4,8,20,0.45) 55%, transparent 100%);
}

/* "View" toggle: expand the video without entering true fullscreen.
   Hides the two info cards (now-playing + stream info) so the video
   grows into that space, and floats the header/toolbar/transport over
   the video as a translucent layer that fades until the screen is touched. */
.fullscreen-target.view-off .info-row { display: none; }
.fullscreen-target.view-off .stage-media { flex: 1 1 auto; }
.fullscreen-target.view-off .video-header,
.fullscreen-target.view-off .action-toolbar,
.fullscreen-target.view-off .transport {
  position: absolute; left: 0; right: 0; z-index: 8;
  opacity: 1; transition: opacity .4s ease;
}
.fullscreen-target.view-off .video-header {
  top: 0; background: linear-gradient(to bottom, rgba(4,8,20,0.85) 10%, transparent 100%);
  padding-bottom: 30px;
}
.fullscreen-target.view-off .action-toolbar {
  bottom: 96px; background: transparent; padding: 0 20px;
}
.fullscreen-target.view-off .transport {
  bottom: 0; padding-top: 40px;
  background: linear-gradient(to top, rgba(4,8,20,0.9) 10%, rgba(4,8,20,0.5) 55%, transparent 100%);
}
.fullscreen-target.view-off.view-idle .video-header,
.fullscreen-target.view-off.view-idle .action-toolbar,
.fullscreen-target.view-off.view-idle .transport { opacity: 0; pointer-events: none; }
#btn-view-toggle.active { background: rgba(60,110,255,0.2); border-color: var(--blue-3); }

.stage-media {
  flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 500px at 50% 20%, rgba(40,90,210,0.14), transparent 60%);
  overflow: hidden;
}
#video-el {
  position: absolute; inset: 0; width: 100%; height: 100%; background: black; display: none;
  /* Ranplase ansyen "width/height:100%" ki te depann de yon kalkil
     pousantaj (%) sou yon chèn eleman flex — pafwa kalkil sa a pa rezoud
     kòrèkteman (espesyalman sou gwo ekran/ultrawide), sa ki te fè videyo a
     parèt piti e kole sou bò dwat ekran an olye l ranpli tout kad la.
     Pozisyone l an "absolute" ak inset:0 anndan .stage-media (ki gen
     position:relative) fè l toujou ranpli kad la egzakteman, kèlkeswa
     lajè ekran an. */
}
#video-el.mode-fit { object-fit: contain; }
#video-el.mode-stretch { object-fit: fill; }
#video-el.mode-original { object-fit: none; }
#video-el.mode-crop { object-fit: cover; }

.audio-visual { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 28px; width: 100%; }
.disc-wrap { position: relative; width: 230px; height: 230px; display: flex; align-items: center; justify-content: center; }
.disc-glow {
  position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(60,120,255,0.45), transparent 70%);
  filter: blur(6px); animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }
.disc {
  width: 210px; height: 210px; border-radius: 50%;
  background: conic-gradient(from 220deg, #0b1530, #1e50c0, #08122a, #2f6bff, #0b1530);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(140,180,255,0.35), 0 20px 60px rgba(20,60,160,0.5), inset 0 0 40px rgba(0,0,0,0.5);
  animation: spin 14s linear infinite; animation-play-state: paused;
}
.disc.spinning { animation-play-state: running; }
.disc-logo { width: 58px; height: 58px; opacity: 0.95; filter: drop-shadow(0 0 10px rgba(80,140,255,0.7)); }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#viz-canvas { width: min(760px, 80%); height: 90px; opacity: 0.9; }

.stage-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.empty-logo { width: 70px; height: 70px; margin-bottom: 6px; filter: drop-shadow(0 0 18px rgba(60,120,255,0.55)); }
.stage-empty h1 { font-size: 30px; letter-spacing: 3px; margin: 0; color: var(--ink-0); font-weight: 800; }
.stage-empty h1 span { color: var(--blue-3); }
.brand-subline { font-size: 11px; letter-spacing: 3px; color: var(--ink-2); text-transform: uppercase; margin: -6px 0 8px; }
.stage-empty p { color: var(--ink-2); font-size: 13px; margin: 0 0 10px; }
.empty-actions { display: flex; gap: 10px; }

.exit-fs-btn {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(6,12,28,0.55); border: 1px solid rgba(140,180,255,0.35); color: white;
  cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 6; backdrop-filter: blur(4px);
}
.is-fs .exit-fs-btn { display: flex; }
.fs-hint {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(6,12,28,0.75); border: 1px solid rgba(140,180,255,0.3); border-radius: 999px;
  padding: 7px 16px; font-size: 11.5px; color: var(--ink-1); opacity: 0; pointer-events: none;
  transition: opacity .4s ease; z-index: 6;
}
.fs-hint.show { opacity: 1; }
.toast {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(10,20,45,0.85); border: 1px solid rgba(140,180,255,0.4); border-radius: 999px;
  padding: 8px 18px; font-size: 12px; color: var(--ink-0); opacity: 0; pointer-events: none;
  transition: opacity .3s ease; z-index: 7;
}
.toast.show { opacity: 1; }

/* fullscreen idle auto-hide */
.fullscreen-target.fs-idle { cursor: none; }
.fullscreen-target.fs-idle .video-header,
.fullscreen-target.fs-idle .info-row,
.fullscreen-target.fs-idle .action-toolbar,
.fullscreen-target.fs-idle .transport,
.fullscreen-target.fs-idle .exit-fs-btn { opacity: 0; pointer-events: none; }
.video-header, .info-row, .action-toolbar, .transport, .exit-fs-btn { transition: opacity .4s ease; }

.now-playing-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; border-top: 1px solid var(--panel-border);
}
.np-title { font-size: 14px; font-weight: 700; color: var(--ink-0); }
.np-sub { font-size: 11.5px; color: var(--ink-2); }
.np-badges { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 10px; letter-spacing: 1px; color: var(--blue-3); border: 1px solid rgba(120,160,255,0.35); padding: 3px 9px; border-radius: 999px; background: rgba(60,110,255,0.08); }
.badge-btn { cursor: pointer; font-size: 13px; padding: 3px 8px; }
.badge-btn.is-fav { color: #ffcc4d; border-color: #ffcc4d; }

/* ---------------- Transport ---------------- */
.transport { padding: 4px 22px 16px; position: relative; }
.seek-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.time { font-size: 11px; color: var(--ink-2); width: 40px; text-align: center; flex-shrink: 0; }

input[type="range"] { -webkit-appearance: none; height: 4px; background: rgba(120,150,220,0.2); border-radius: 4px; outline: none; }
#seek-bar { flex: 1; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--blue-3); box-shadow: 0 0 8px rgba(80,140,255,0.8); cursor: pointer; margin-top: -4.5px;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue-2), rgba(120,150,220,0.15)); }

.controls-row { display: flex; align-items: center; justify-content: space-between; }
.controls-left, .controls-center, .controls-right { display: flex; align-items: center; gap: 7px; }
.controls-center { gap: 16px; }

.ctl-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(120,150,220,0.18); color: var(--ink-1);
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; font-size: 11px; font-weight: 700;
}
.ctl-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctl-btn:hover { background: rgba(90,130,255,0.16); color: white; border-color: rgba(140,180,255,0.4); }
.ctl-btn.active { color: var(--blue-3); border-color: var(--blue-3); background: rgba(60,110,255,0.15); }
.ctl-med { width: 40px; height: 40px; }
.ctl-med svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }

.repeat-one-dot { position: absolute; bottom: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue-3); display: none; }
#btn-repeat.repeat-one .repeat-one-dot { display: block; }

.play-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #6ea6ff, #1a56ff 55%, #0a2f9c 100%);
  box-shadow: 0 0 0 1px rgba(160,190,255,0.5), 0 10px 26px rgba(30,90,255,0.55), inset 0 2px 4px rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center; color: white;
  transition: transform .12s ease;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(0.97); }
.play-btn svg { width: 22px; height: 22px; fill: white; margin-left: 2px; }
#icon-pause { margin-left: 0 !important; }

.volume-wrap { display: flex; align-items: center; gap: 6px; }
#volume-bar { width: 72px; }
#btn-speed { border-radius: 999px; width: auto; padding: 0 9px; }

/* ---------------- Generic modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3,6,16,0.7); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 65;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 460px; background: linear-gradient(180deg, #0f1b38, #0a1226);
  border: 1px solid rgba(120,160,255,0.25); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.modal h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink-0); }
.modal-hint { font-size: 11.5px; color: var(--ink-2); margin: 0 0 14px; line-height: 1.5; }
.modal input {
  width: 100%; background: rgba(6,12,28,0.8); border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--ink-0); font-size: 13px; outline: none; margin-bottom: 16px;
}
.modal input:focus { border-color: var(--blue-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-wide { width: 560px; max-height: 80vh; overflow-y: auto; }
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 16px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-1); padding: 5px 0; border-bottom: 1px solid rgba(120,150,220,0.1); }
.sc-row span { text-align: right; color: var(--ink-0); }
kbd {
  background: rgba(90,130,255,0.14); border: 1px solid rgba(140,180,255,0.35);
  border-radius: 5px; padding: 2px 7px; font-size: 11px; color: var(--blue-3); font-family: inherit;
  box-shadow: 0 1px 0 rgba(140,180,255,0.2);
}

/* ---------------- Menu overlay scrim (Nav rail + Sidebar) ---------------- */
.nav-scrim {
  position: fixed; top: 40px; left: 0; right: 0; bottom: 0; background: rgba(2,5,14,0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--anim-speed) ease; z-index: 55;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

/* ---------------- Quality menu (tankou YouTube) ---------------- */
.quality-scrim {
  position: fixed; inset: 0; background: rgba(2,5,14,0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--anim-speed) ease; z-index: 61;
}
.quality-scrim.open { opacity: 1; pointer-events: auto; }
.quality-panel {
  position: fixed; top: 50%; left: 50%; width: min(360px, 92vw); max-height: min(70vh, 520px);
  transform: translate(-50%, -50%) scale(0.94); opacity: 0; pointer-events: none;
  border-radius: var(--radius-lg); z-index: 62; display: flex; flex-direction: column; overflow: hidden;
  transition: transform var(--anim-speed) cubic-bezier(.2,.8,.3,1), opacity var(--anim-speed) ease;
}
.quality-panel.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.quality-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; flex-shrink: 0;
  border-bottom: 1px solid var(--panel-border);
}
.quality-back {
  width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent; color: var(--ink-0);
  font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 2px;
}
.quality-back:hover { background: rgba(255,255,255,0.08); }
.quality-panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-0); }
.quality-list { overflow-y: auto; padding: 6px 0; }
.quality-item {
  width: 100%; display: flex; align-items: baseline; gap: 6px; background: transparent; border: none;
  color: var(--ink-1); font-size: 15px; text-align: left; cursor: pointer; padding: 12px 20px;
}
.quality-item:hover { background: rgba(255,255,255,0.05); }
.quality-item.active { color: var(--blue-3); font-weight: 700; }
.quality-item .quality-badge {
  font-size: 10px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--panel-border);
  border-radius: 4px; padding: 1px 4px; letter-spacing: .3px;
}
.quality-item.active .quality-badge { color: var(--blue-3); border-color: var(--blue-3); }
.quality-item .quality-auto-current { font-size: 11.5px; color: var(--ink-2); margin-left: 2px; }

/* ---------------- Settings slide-in panel ---------------- */
.settings-scrim {
  position: fixed; inset: 0; background: rgba(2,5,14,0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--anim-speed) ease; z-index: 59;
}
.settings-scrim.open { opacity: 1; pointer-events: auto; }
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 640px; max-width: 92vw;
  background: linear-gradient(180deg, #0d1832, #081020);
  border-left: 1px solid rgba(120,160,255,0.35);
  box-shadow: -10px 0 0 1px rgba(60,110,255,0.12), -30px 0 80px rgba(0,0,0,0.6);
  transform: translateX(100%); transition: transform var(--anim-speed) cubic-bezier(.2,.8,.3,1);
  z-index: 60; display: flex; flex-direction: column;
}
body.theme-light .settings-panel { background: linear-gradient(180deg, #ffffff, #eef2fb); }
.settings-panel.open { transform: translateX(0); }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--panel-border); }
.settings-head h2 { margin: 0; font-size: 17px; letter-spacing: .3px; }
.settings-body { flex: 1; display: flex; min-height: 0; }
.settings-cats { width: 190px; min-width: 190px; border-right: 1px solid var(--panel-border); padding: 10px; overflow-y: auto; }
.cat-btn {
  display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--ink-1); padding: 10px 11px; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; margin-bottom: 3px;
}
.cat-btn:hover { background: rgba(90,130,255,0.1); }
.cat-btn.active { background: linear-gradient(90deg, rgba(60,110,255,0.28), rgba(60,110,255,0.06)); border-color: rgba(120,160,255,0.45); color: var(--blue-3); box-shadow: 0 0 0 1px rgba(120,160,255,0.25) inset; }
.settings-detail { flex: 1; padding: 20px 24px; overflow-y: auto; }
.settings-detail h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink-0); }
.settings-detail .cat-hint { font-size: 11.5px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.5; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid rgba(120,150,220,0.1);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 12.5px; color: var(--ink-0); font-weight: 600; }
.setting-desc { font-size: 10.5px; color: var(--ink-2); margin-top: 2px; max-width: 340px; line-height: 1.4; }
.setting-control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.setting-control select, .setting-control input[type="text"], .setting-control input[type="number"] {
  background: rgba(6,12,28,0.7); border: 1px solid var(--panel-border); color: var(--ink-0);
  border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12px; outline: none; min-width: 130px;
}
.setting-control input[type="range"] { width: 130px; }
.setting-note { font-size: 10px; color: var(--ink-2); font-style: italic; padding: 8px 0; }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-group button {
  background: rgba(255,255,255,0.04); border: 1px solid var(--panel-border); color: var(--ink-1);
  border-radius: 8px; padding: 7px 12px; font-size: 11.5px; cursor: pointer;
}
.btn-group button.active { background: rgba(60,110,255,0.25); border-color: var(--blue-3); color: white; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: rgba(120,150,220,0.25); border-radius: 999px; cursor: pointer;
  transition: background .2s ease; border: 1px solid var(--panel-border);
}
.switch-track::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%;
  background: var(--ink-0); transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--blue-2); border-color: var(--blue-3); }
.switch input:checked + .switch-track::before { transform: translateX(18px); background: white; }

.color-swatches { display: flex; gap: 8px; }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.color-swatch.active { border-color: white; box-shadow: 0 0 0 2px var(--blue-3); }

.log-box {
  background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  padding: 10px; font-family: monospace; font-size: 10.5px; color: #9fd; height: 160px; overflow-y: auto; white-space: pre-wrap;
}

.about-card { display: flex; gap: 16px; align-items: center; padding: 14px; background: rgba(90,130,255,0.06); border: 1px solid var(--panel-border); border-radius: var(--radius-md); margin-bottom: 16px; }
.about-card img { width: 48px; height: 48px; }
.about-card h4 { margin: 0 0 3px; font-size: 15px; }
.about-card p { margin: 0; font-size: 11px; color: var(--ink-2); }
.about-card a { color: var(--blue-3); text-decoration: none; }

/* drag over highlight */
body.dragover .stage-media::after {
  content: 'Lage fichye yo isit la'; position: absolute; inset: 10px; border: 2px dashed var(--blue-3);
  border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
  color: var(--blue-3); font-size: 14px; background: rgba(20,50,120,0.2); z-index: 5;
}

/* track logo thumbnails */
.track-logo-img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; display: block; }

/* ================================================================
   GLASSMORPHISM — overlay panels (Settings / modals / popovers)
================================================================ */
.glass-panel {
  background: linear-gradient(160deg, rgba(18,30,58,0.62), rgba(8,14,30,0.72)) !important;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(140,180,255,0.28) !important;
  box-shadow: 0 0 0 1px rgba(90,140,255,0.12) inset, 0 25px 80px rgba(0,0,0,0.55), 0 0 40px rgba(50,100,255,0.12);
}
body.theme-light .glass-panel {
  background: linear-gradient(160deg, rgba(255,255,255,0.72), rgba(230,238,255,0.78)) !important;
  border-color: rgba(60,100,220,0.25) !important;
}

/* ---------------- Video header ---------------- */
.video-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-bottom: 1px solid var(--panel-border);
}
.vh-section-label { font-size: 10px; letter-spacing: 1.5px; color: var(--ink-2); text-transform: uppercase; margin-bottom: 2px; }
.vh-title-row { display: flex; align-items: center; gap: 9px; }
.vh-title { font-size: 15px; font-weight: 700; color: var(--ink-0); }
.vh-live-badge {
  background: linear-gradient(90deg, #ff4d6d, #c81e45); color: white; font-size: 9.5px; font-weight: 800;
  letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; box-shadow: 0 0 10px rgba(255,60,90,0.5);
}
.vh-actions { display: flex; gap: 8px; }

/* ---------------- Info row: Now Playing + Stream Info ---------------- */
.info-row { display: flex; gap: 14px; padding: 12px 20px; }
.now-playing-card, .stream-info-card {
  flex: 1; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border);
  border-radius: var(--radius-md); padding: 12px 14px; min-width: 0;
}
.npc-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.npc-logo {
  width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(160deg, var(--blue-2), var(--blue-1));
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; overflow: hidden;
}
.npc-logo img { width: 100%; height: 100%; object-fit: cover; }
.npc-text { flex: 1; min-width: 0; }
.npc-name-row { display: flex; align-items: center; gap: 8px; }
.npc-bottom { display: flex; gap: 18px; border-top: 1px solid var(--panel-border); padding-top: 9px; }
.npc-col { flex: 1; min-width: 0; }
.npc-col-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); margin-bottom: 3px; }
.npc-col-value { font-size: 12px; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.si-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--blue-3); font-weight: 700; margin-bottom: 9px; }
.si-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; }
.si-item { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.si-label { color: var(--ink-2); }
.si-value { color: var(--ink-0); font-weight: 600; }

/* ---------------- Action toolbar ---------------- */
.action-toolbar { display: flex; align-items: center; gap: 8px; padding: 0 20px 10px; flex-wrap: wrap; }
.action-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; color: var(--ink-1); flex: 1; min-width: 118px;
}
.action-btn:hover { background: rgba(90,130,255,0.1); border-color: rgba(120,160,255,0.35); }
.action-btn.active { background: rgba(60,110,255,0.2); border-color: var(--blue-3); }
.action-ic { font-size: 15px; flex-shrink: 0; }
.action-ic-rec { color: var(--danger); }
.action-btn.recording .action-ic-rec { animation: pulse-rec 1s infinite; }
@keyframes pulse-rec { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.action-labels { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.action-title { font-size: 11.5px; font-weight: 700; color: var(--ink-0); white-space: nowrap; }
.action-sub { font-size: 9.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.live-dot { font-size: 10.5px; color: #ff4d6d; font-weight: 700; letter-spacing: .5px; flex-shrink: 0; }

/* ---------------- Mini popovers (Sleep Timer / Equalizer) ---------------- */
.mini-popover {
  position: absolute; bottom: 100%; margin-bottom: 10px; left: 20px;
  background: linear-gradient(160deg, rgba(18,30,58,0.75), rgba(8,14,30,0.85));
  backdrop-filter: blur(18px); border: 1px solid rgba(140,180,255,0.3); border-radius: var(--radius-md);
  padding: 14px; display: none; z-index: 15; box-shadow: 0 20px 50px rgba(0,0,0,0.5); min-width: 200px;
}
.mini-popover.open { display: block; }
.mini-pop-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--blue-3); font-weight: 700; margin-bottom: 10px; }
#sleep-popover .btn-group { margin-bottom: 4px; }

/* ---------------- Settings footer ---------------- */
.settings-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--panel-border); }
