/* ============================================================
   Codex Media Player (js/mediaplayer.js) — the Music app window.
   WMP 9 "Corporate" skin inside the XP window frame: blue task pane,
   visualizer band, now-playing list + live Spotify embed, chrome
   transport. .narrow is set by the window when it is under 640px wide
   (phones, or a small window) and stacks everything.
   ============================================================ */
.cmp { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px; padding: 5px; background: linear-gradient(#dfe7f5, #b9c8e2); font-family: Tahoma, Verdana, sans-serif;
  font-size: 12px; color: #1d3566; }
.cmp button { font-family: inherit; }
.cmp :focus-visible { outline: 2px dotted #0b2d73; outline-offset: 1px; }

/* task pane */
.cmp-pane { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-radius: 7px;
  background: linear-gradient(#3d6fd8, #1e4ab0); }
.cmp-pane button { all: unset; box-sizing: border-box; display: block; padding: 10px 12px; color: #fff; font-weight: bold;
  cursor: pointer; border-left: 3px solid transparent; }
.cmp-pane button:hover { background: rgba(255,255,255,.14); }
.cmp-pane button.on { background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.06)); border-left-color: #ffd54a; }
.cmp-pane button:focus-visible { outline: 2px dotted #fff; outline-offset: -3px; }
.cmp-spot { margin: auto 10px 2px; display: block; text-align: center; padding: 9px 6px; border-radius: 999px;
  background: #1ed760; color: #04110a; font-weight: bold; text-decoration: none; }
.cmp-spot:hover { background: #3be477; }

.cmp-main { min-width: 0; min-height: 0; display: flex; }
.cmp-view { flex: 1; min-width: 0; min-height: 0; }
.cmp-view[hidden] { display: none; }

/* Now Playing */
.cmp-now { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 132px minmax(0, 1fr);
  gap: 5px; }
.cmp-band { grid-column: 1 / -1; position: relative; overflow: hidden; border-radius: 7px; background: #000814;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.cmp-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cmp-band::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,8,20,.9), rgba(0,8,20,.6) 40%, transparent 70%); }
.cmp-band .cmp-art, .cmp-band .cmp-meta { z-index: 1; }
.cmp-art { position: relative; width: 106px; height: 106px; flex: none; object-fit: cover; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.35); }
.cmp-meta { position: relative; min-width: 0; display: grid; gap: 3px; color: #cfe0ff; text-shadow: 0 1px 3px #000; }
.cmp-kind { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8fd8ff; }
.cmp-name { font-size: 24px; line-height: 1.1; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-sub { font-size: 12px; max-width: 46ch; }

.cmp-list { list-style: none; margin: 0; padding: 4px; overflow: auto; border-radius: 7px; background: #fff;
  border: 1px solid #9fb2d6; }
.cmp-list li + li { margin-top: 2px; }
.cmp-list button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 40px minmax(0,1fr);
  grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px; border-radius: 4px; cursor: pointer; }
.cmp-list button:hover { background: #eef3fc; }
.cmp-list button.sel { background: linear-gradient(#cfe0ff, #a9c6fb); }
.cmp-list img, .cmp-list .noart { grid-row: span 2; width: 40px; height: 40px; object-fit: cover; border-radius: 3px; background: #c9d6ec; }
.cmp-list .t { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-list .k { color: #5873a8; font-size: 11px; }
.cmp-list .empty, .cmp-tiles .empty { padding: 10px; color: #5873a8; }

.cmp-embed { min-width: 0; min-height: 0; border-radius: 12px; background: #121212; }
.cmp-embed iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 12px; }

/* Library */
.cmp-lib { overflow: auto; border-radius: 7px; background: #fff; border: 1px solid #9fb2d6; padding: 12px; }
.cmp-lib h3 { margin: 0 0 10px; font-size: 14px; }
.cmp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cmp-tile { all: unset; box-sizing: border-box; display: grid; gap: 3px; padding: 6px; border-radius: 5px; cursor: pointer; }
.cmp-tile:hover { background: #eef3fc; }
.cmp-tile.sel { background: linear-gradient(#cfe0ff, #a9c6fb); }
.cmp-tile img, .cmp-tile .noart { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #c9d6ec;
  box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.cmp-tile b { margin-top: 4px; }
.cmp-tile span { color: #5873a8; font-size: 11px; }

/* Visualizations (full) */
.cmp-full { position: relative; overflow: hidden; border-radius: 7px; background: #000814; }
.cmp-modes { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-modes button { padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45);
  background: rgba(10,30,80,.6); color: #fff; cursor: pointer; font-size: 11px; }
.cmp-modes button.on { background: #2f6fe0; border-color: #fff; }
.cmp-full-cap { position: absolute; left: 12px; bottom: 10px; color: #cfe0ff; text-shadow: 0 1px 3px #000; }

/* transport */
.cmp-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 7px;
  background: linear-gradient(#5b8de6, #244fae); }
.cmp-ctrl button { cursor: pointer; padding: 0; display: grid; place-items: center; }
.cmp-big { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #0e3c96; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  background: radial-gradient(circle at 40% 30%, #fff, #b7d0ff 30%, #2f6fe0 70%, #174bb0); }
.cmp-big svg { width: 18px; height: 18px; fill: #0b2d73; }
.cmp-sm { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #0e3c96;
  background: radial-gradient(circle at 40% 30%, #fff, #9fbcf3 40%, #2f63c8); }
.cmp-sm svg { width: 13px; height: 12px; fill: #0b2d73; }
.cmp-seek { flex: 1; min-width: 40px; height: 7px; border-radius: 4px; background: #0c2f78; position: relative; }
.cmp-seek i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(90deg, #7fe0ff, #2fa2ff); }
.cmp-mode { min-height: 28px; padding: 0 10px !important; border-radius: 999px; border: 1px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.15); color: #fff; font-size: 11px; }
.cmp-time { color: #fff; min-width: 36px; text-align: right; }

/* narrow window / phone: tabs on top, list as a strip, embed fills */
.cmp.narrow { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.cmp.narrow .cmp-pane { flex-direction: row; padding: 3px; overflow-x: auto; }
.cmp.narrow .cmp-pane button { padding: 9px 10px; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.cmp.narrow .cmp-pane button.on { border-bottom-color: #ffd54a; }
.cmp.narrow .cmp-spot { display: none; }
.cmp.narrow .cmp-now { grid-template-columns: minmax(0, 1fr); grid-template-rows: 104px auto minmax(0, 1fr); }
.cmp.narrow .cmp-band { padding: 10px; gap: 10px; }
.cmp.narrow .cmp-art { width: 82px; height: 82px; }
.cmp.narrow .cmp-name { font-size: 19px; }
.cmp.narrow .cmp-sub { display: none; }
.cmp.narrow .cmp-list { display: flex; gap: 4px; overflow-x: auto; }
.cmp.narrow .cmp-list li { flex: none; width: 170px; }
.cmp.narrow .cmp-list li + li { margin-top: 0; }
.cmp.narrow .cmp-ctrl { gap: 8px; padding: 6px 10px; }
.cmp.narrow .cmp-mode, .cmp.narrow .cmp-time { display: none; }
.cmp.narrow .cmp-big { width: 44px; height: 44px; }
.cmp.narrow .cmp-sm { width: 36px; height: 36px; }
