/* ============================================ */
/* SHITTY PERSISTENT PLAYER               */
/* ============================================ */

#player-shell {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 420px;
  background: #2F2F7F;
  border: 3px solid #1a1a1a;
  border-radius: 6px;
  box-shadow: 6px 6px 0 #1a1a1a;
  font-family: "Courier New", monospace;
  user-select: none;
}

/* title bar */
#p-titlebar {
  background: var(--yellow, #FFD21C);
  border-bottom: 3px solid #1a1a1a;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  border-radius: 3px 3px 0 0;
}
#p-titlebar:active { cursor: grabbing; }

#p-titlebar .p-appname {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: #1a1a1a;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.p-winctrls {
  display: flex;
  gap: 4px;
}
.p-winctrls button {
  width: 16px; height: 16px;
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  line-height: 1;
}
.p-winctrls button:hover { background: var(--red, #E2021E); color: #fff; }

/* body hidden when minimised */
#player-shell.minimised #p-body { display: none; }

/* main body */
#p-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* top row: viz + info */
.p-top {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* fake visualiser */
#p-viz {
  background: #000;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  width: 90px;
  min-width: 90px;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px;
  box-sizing: border-box;
}

#p-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 100%;
}

#p-bars span {
  flex: 1;
  background: var(--yellow, #FFD21C);
  border-radius: 2px 2px 0 0;
  height: 3px;
  transition: height 0.1s;
}

/* info panel */
.p-info {
  flex: 1;
  background: #000;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.p-info .p-track-title {
  color: var(--yellow, #FFD21C);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-info .p-track-artist {
  color: #aaa;
  font-size: 10px;
}

.p-timebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.p-time {
  color: var(--yellow, #FFD21C);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: "Courier New", monospace;
}

.p-index {
  color: #666;
  font-size: 9px;
}

/* seek bar */
#p-seek {
  width: 100%;
  accent-color: var(--yellow, #FFD21C);
  height: 4px;
  cursor: pointer;
}

/* controls row */
.p-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.p-btns {
  display: flex;
  gap: 4px;
}

.p-btns button {
  background: #2a2a3e;
  border: 2px solid #3a3a5e;
  border-radius: 4px;
  color: var(--yellow, #FFD21C);
  font-size: 13px;
  width: 30px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: 0.1s;
}
.p-btns button:hover { background: var(--yellow, #FFD21C); color: #1a1a1a; }

/* shuffle */
#p-shuf {
  background: #2a2a3e;
  border: 2px solid #3a3a5e;
  border-radius: 4px;
  color: #666;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 1px;
  font-family: "Baloo 2", sans-serif;
  transition: 0.1s;
}
#p-shuf.active, #p-shuf:hover { background: var(--yellow, #FFD21C); color: #1a1a1a; }

/* volume */
.p-vol-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.p-vol-row label { color: #666; font-size: 9px; letter-spacing: 1px; }
#p-vol {
  accent-color: var(--yellow, #FFD21C);
  width: 70px;
  height: 4px;
  cursor: pointer;
}

/* playlist */
#p-playlist {
  background: #000;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow, #FFD21C) #1a1a2e;
}
#p-playlist::-webkit-scrollbar { width: 4px; }
#p-playlist::-webkit-scrollbar-track { background: #1a1a2e; }
#p-playlist::-webkit-scrollbar-thumb { background: var(--yellow, #FFD21C); border-radius: 99px; }

.pl-row {
  padding: 4px 8px;
  font-size: 10px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #1a1a3e;
}
.pl-row:hover { background: #1a1a3e; color: #fff; }
.pl-row.pl-active { color: var(--yellow, #FFD21C); background: #0d0d20; }
.pl-row .pl-num { color: #555; min-width: 18px; }

/* resize handle */
#player-shell {
  resize: horizontal;
  overflow: hidden;
  min-width: 320px;
  max-width: 600px;
}

#player-reopen {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: var(--yellow, #FFD21C);
  border: 3px solid #1a1a1a;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a1a;
  display: none;
  align-items: center;
  justify-content: center;
}
#player-reopen:hover { background: var(--red, #E2021E); color: #fff; }
