/* ============================================================================
   Chad Sanders Official — Music Deck Player
   Retro hardware rack: VU needles + LED ladders + spectrum EQ + center fader.
   Adapted from the Gen-Man jingle-player with Chad Sanders brand colours.
   IDs prefixed csd-; markup must match assets/js/cs-player.js.
   ========================================================================== */

.csd-panel {
  --csd-rack-1: #14181f;
  --csd-rack-2: #0b0d12;
  --csd-bezel:  #04050a;
  --csd-line:   rgba(255,255,255,.05);
  --csd-gold:   #d4a843;
  --csd-cyan:   #00c8ff;
  --csd-green:  #33dd66;
  --csd-text:   #c8d0da;
  --csd-dim:    #70808f;
  background:
    linear-gradient(180deg, rgba(0,14,28,.96) 0%, rgba(0,7,16,.99) 100%),
    radial-gradient(ellipse 140% 60% at 50% -5%, rgba(0,90,180,.12) 0%, transparent 65%);
  border-top: 1px solid rgba(0,200,255,.08);
  border-bottom: 1px solid rgba(0,0,0,.7);
  padding: 1.6rem 0 1.9rem;
  color: var(--csd-text);
  position: relative;
  overflow: hidden;
}

/* Scan-line & grid texture overlay */
.csd-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.32)        1px 2px, transparent 2px 7px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.010) 0 2px, transparent 2px 4px);
  -webkit-mask: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
          mask: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
}

/* Cyan horizontal rule lines + subtle grid */
.csd-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    linear-gradient(90deg, transparent, rgba(0,200,255,.22), transparent),
    linear-gradient(90deg, transparent, rgba(0,200,255,.10), transparent),
    repeating-linear-gradient(90deg, rgba(0,200,255,.04) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg,  rgba(0,200,255,.03) 0 1px, transparent 1px 48px);
  background-size: 100% 1px, 100% 1px, 100% 100%, 100% 100%;
  background-position: 0 8px, 0 calc(100% - 8px), 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}

/* Corner screws */
.csd-screw {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #aab8c6, #58697a 55%, #2a3744);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -2px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.7);
}
.csd-screw::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 7px; height: 1.5px; border-radius: 1px;
  background: rgba(0,0,0,.55); transform: rotate(40deg);
}
.csd-screw--tl { top: 12px; left: 14px } .csd-screw--tr { top: 12px; right: 14px }
.csd-screw--bl { bottom: 12px; left: 14px } .csd-screw--br { bottom: 12px; right: 14px }

/* On-air blink indicator */
.csd-onair {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle;
  background: #ff4040; box-shadow: 0 0 9px #ff4040, inset 0 0 2px #ffd0cb;
  animation: csdOnair 1.7s ease-in-out infinite;
}
@keyframes csdOnair { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.csd-wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; position: relative; z-index: 2; }

/* Head — eyebrow only (page already has h1 above) */
.csd-head {
  text-align: center; margin-bottom: .9rem;
}
.csd-eyebrow {
  display: inline-block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--csd-gold); font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}

/* ---- The rack ----------------------------------------------------------- */
.csd-rack {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  gap: .55rem;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.42)        1px 2px, transparent 2px 7px),
    linear-gradient(180deg, #14181f, #090b0f);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    inset 0 0 0 1px rgba(0,0,0,.5),
    inset 0 0 22px rgba(0,0,0,.65),
    0 12px 32px rgba(0,0,0,.6);
  padding: .85rem .9rem .95rem;
  max-width: 860px; margin: 0 auto;
}
.csd-rack::before, .csd-rack::after {
  content: ""; position: absolute; top: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #545960, #181a1e 70%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.8);
  pointer-events: none;
}
.csd-rack::before { left: 9px } .csd-rack::after { right: 9px }

/* ---- VU meter + LED ladder unit ---------------------------------------- */
.csd-vu { display: flex; align-items: flex-end; gap: .3rem; }
.csd-led {
  width: 14px; height: 130px;
  background: var(--csd-bezel);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 4px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.9), inset 0 1px 2px rgba(0,0,0,.95);
  display: block;
}
.csd-bezel {
  display: block;
  background: linear-gradient(180deg, #343840 0%, #21242a 45%, #11131a 100%);
  padding: 6px; border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.65),
    0 3px 8px rgba(0,0,0,.75);
  border: 1px solid rgba(0,0,0,.5);
}
.csd-glass {
  /* Neutral, so the rounded corners of the meter artwork's own moulded
     bezel don't sit on a warm brown halo. */
  background: radial-gradient(120% 120% at 50% 0%, #14181f 0%, #0b0e14 70%, #06080c 100%);
  border-radius: 5px;
  box-shadow: inset 0 0 16px rgba(0,0,0,.95), inset 0 2px 4px rgba(0,0,0,.85);
  display: block;
  width: 258px; max-width: 100%;
  border: 1px solid rgba(0,0,0,.9);
  position: relative;
}
.csd-brand {
  /* Printed on the paper card, like the dial's own lettering: the card's
     bottom edge is at 12.2% of the canvas, so sit clear of it. */
  position: absolute; left: 0; right: 0; bottom: 16%; z-index: 2;
  text-align: center; font-size: .48rem; letter-spacing: .17em; text-transform: uppercase; font-weight: 700;
  color: #000; text-shadow: none;
  pointer-events: none;
}
@media (max-width: 560px) { .csd-brand { font-size: .4rem; letter-spacing: .1em; bottom: 15% } }
.csd-meter { display: block; width: 100%; height: auto; aspect-ratio: 343 / 210; border-radius: 4px; }

/* ---- Center column: volume fader + transport --------------------------- */
.csd-center {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: .45rem; padding: .5rem .35rem; min-width: 88px;
  background: linear-gradient(180deg, #191c22, #0a0c10);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.55);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.8),
    inset 0 -1px 0 rgba(255,255,255,.04),
    0 1px 0 rgba(255,255,255,.05);
}
.csd-vol { display: flex; flex-direction: column; align-items: center; gap: .28rem; flex: 1; }
.csd-vol-track {
  position: relative; height: 92px; width: 32px;
  display: flex; align-items: center; justify-content: center;
}
.csd-vol-track::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; width: 8px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #03040a, #0c0e14);
  border-radius: 5px;
  box-shadow: inset 0 0 8px rgba(0,0,0,1), inset 0 1px 3px rgba(0,0,0,1), 0 1px 0 rgba(255,255,255,.06);
}
.csd-vol-fill {
  position: absolute; bottom: 4px; width: 6px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #80e4ff, var(--csd-cyan));
  border-radius: 4px; box-shadow: 0 0 8px rgba(0,200,255,.55);
  pointer-events: none;
}
.csd-fader {
  -webkit-appearance: none; appearance: none;
  width: 92px; height: 32px;
  transform: rotate(-90deg);
  background: transparent; cursor: pointer; margin: 0;
}
.csd-fader:focus { outline: none }
.csd-fader::-webkit-slider-runnable-track { background: transparent; height: 32px }
.csd-fader::-moz-range-track { background: transparent; height: 32px }
.csd-fader::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg, #eef0f3, #97a0aa);
  border: 1px solid #58616a; box-shadow: 0 2px 4px rgba(0,0,0,.65), inset 0 1px 0 #fff;
}
.csd-fader::-moz-range-thumb {
  width: 14px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg, #eef0f3, #97a0aa);
  border: 1px solid #58616a; box-shadow: 0 2px 4px rgba(0,0,0,.65);
}
.csd-vol-label { font-size: .6rem; letter-spacing: .15em; color: var(--csd-dim); font-weight: 700 }

.csd-transport { display: flex; gap: .38rem; }
.csd-tbtn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(120% 120% at 50% 0%, #282c34 0%, #181b21 60%, #0e1014 100%);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.10);
  transition: transform .08s ease, box-shadow .12s ease;
}
.csd-tbtn:hover {
  box-shadow: 0 3px 14px rgba(0,200,255,.38), inset 0 1px 0 rgba(255,255,255,.16);
}
.csd-tbtn:active { transform: translateY(1px) }
.csd-tbtn svg { width: 18px; height: 18px; fill: currentColor }
.csd-tbtn--skip { width: 34px; height: 34px }
.csd-tbtn--skip svg { width: 15px; height: 15px }
/* Play/pause icon swap */
.csd-tbtn--play.is-playing .csd-ic-play { display: none }
.csd-tbtn--play .csd-ic-pause { display: none }
.csd-tbtn--play.is-playing .csd-ic-pause { display: block }

/* ---- EQ canvas + NOW PLAYING + controls -------------------------------- */
.csd-lower { max-width: 860px; margin: .7rem auto 0 }
.csd-eq-wrap {
  position: relative;
  background: linear-gradient(180deg, #090c10, #03050a);
  border: 1px solid rgba(0,0,0,.65);
  border-radius: 10px;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.95), inset 0 0 0 1px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.04);
  padding: 7px; overflow: hidden;
}
.csd-now {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 2; pointer-events: none;
  display: inline-flex; flex-direction: row; align-items: center; gap: .6rem;
  max-width: calc(100% - 30px);
  padding: .4rem 1.1rem .4rem .55rem;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(14,20,28,.62) 0%, rgba(5,8,13,.75) 100%);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 -1px 0 rgba(0,0,0,.6),
    inset 0 0 18px rgba(0,0,0,.6),
    0 4px 14px rgba(0,0,0,.6);
  backdrop-filter: blur(5px) saturate(120%);
  -webkit-backdrop-filter: blur(5px) saturate(120%);
  overflow: hidden;
}
.csd-now::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  pointer-events: none;
}

/* Cover art thumbnail inside NOW PLAYING */
.csd-now-cover {
  width: 44px; height: 44px; border-radius: 5px; object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.7);
  display: none; /* shown by JS once cover is available */
  position: relative; z-index: 1;
}

.csd-now-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  overflow: hidden; position: relative; z-index: 1;
}
.csd-now-label {
  font-size: .58rem; letter-spacing: .28em; font-weight: 800; text-transform: uppercase;
  color: var(--csd-gold); text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.9);
}
.csd-now-title {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(1.05rem, 2.8vw, 1.5rem); font-weight: 900; line-height: 1.1; color: #fff;
  letter-spacing: .004em;
  -webkit-text-stroke: .6px rgba(0,0,0,.55);
  text-shadow: 0 0 2px #000, 0 1px 0 #000, 0 2px 8px rgba(0,0,0,1), 0 0 14px rgba(0,0,0,.9);
}
.csd-now-artist {
  font-size: .62rem; letter-spacing: .12em; color: rgba(0,200,255,.7); font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.csd-eq { position: relative; z-index: 1; display: block; width: 100%; height: 88px; border-radius: 6px }

/* ---- Control strip: Mute L / Stereo / Mute R -------------------------- */
.csd-ctrl {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem;
  margin-top: .65rem;
}
.csd-rbtn {
  display: inline-flex; align-items: center; gap: .38rem;
  font-size: .66rem; letter-spacing: .08em; font-weight: 700; text-transform: uppercase;
  color: var(--csd-text); background: linear-gradient(180deg, #21252c, #13161c);
  border: 1px solid rgba(255,255,255,.09); border-radius: 6px;
  padding: .4rem .65rem; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 4px rgba(0,0,0,.42);
  transition: border-color .12s ease, color .12s ease;
}
.csd-rbtn:hover { border-color: rgba(0,200,255,.4) }
.csd-rbtn-led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #363c44; box-shadow: inset 0 0 3px rgba(0,0,0,.85);
  transition: background .12s ease, box-shadow .12s ease;
}
.csd-rbtn.is-active { color: #fff; border-color: rgba(0,200,255,.5) }
.csd-rbtn.is-active .csd-rbtn-led {
  background: var(--csd-green); box-shadow: 0 0 8px var(--csd-green), inset 0 0 2px #aaffbb;
}
.csd-rbtn--mute.is-active .csd-rbtn-led {
  background: #ff4040; box-shadow: 0 0 8px #ff4040, inset 0 0 2px #ffbbaa;
}

/* ---- Mobile ------------------------------------------------------------ */
@media (max-width: 580px) {
  .csd-wrap { padding: 0 }
  .csd-rack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "vuL vuR"
      "center center";
    gap: .4rem .45rem;
    align-items: end;
    padding: .55rem .45rem .7rem;
    max-width: none; border-left: none; border-right: none; border-radius: 0;
  }
  .csd-rack::before, .csd-rack::after { display: none }
  .csd-vu    { grid-area: vuL; min-width: 0 }
  .csd-vu--r { grid-area: vuR; justify-content: flex-end; min-width: 0 }
  .csd-bezel { padding: 4px; flex: 1 1 auto; min-width: 0 }
  .csd-glass { width: auto; min-width: 0 }
  .csd-led   { width: 10px; height: 94px }
  .csd-center {
    grid-area: center; width: 100%;
    flex-direction: column; align-items: center; gap: .65rem;
    padding: .65rem .55rem; margin-top: .12rem; min-width: 0;
  }
  .csd-transport { order: 1; gap: .9rem }
  .csd-tbtn      { width: 46px; height: 46px }
  .csd-tbtn--play { width: 54px; height: 54px }
  .csd-tbtn svg  { width: 18px; height: 18px }
  .csd-vol { order: 2; flex-direction: row; align-items: center; gap: .5rem; width: 100%; max-width: 320px }
  .csd-vol-label { order: -1 }
  .csd-vol-track { height: 30px; width: auto; flex: 1 1 auto }
  .csd-vol-track::before { display: none }
  .csd-vol-fill { display: none }
  .csd-fader {
    transform: none; width: 100%; height: 30px;
  }
  .csd-fader::-webkit-slider-runnable-track {
    height: 8px; border-radius: 5px;
    background: linear-gradient(90deg, var(--csd-cyan), #003040);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.9);
  }
  .csd-fader::-moz-range-track {
    height: 8px; border-radius: 5px;
    background: linear-gradient(90deg, var(--csd-cyan), #003040);
  }
  .csd-fader::-webkit-slider-thumb { margin-top: -9px }
  .csd-eq  { height: 56px }
  .csd-rbtn { font-size: .6rem; padding: .38rem .52rem }
  .csd-now-cover { width: 34px; height: 34px }
  .csd-now-title { font-size: clamp(.95rem, 4vw, 1.2rem) }
}
@media (max-width: 380px) {
  .csd-led   { width: 8px; height: 84px }
  .csd-tbtn  { width: 42px; height: 42px }
  .csd-tbtn--play { width: 50px; height: 50px }
  .csd-now-cover { display: none !important }
}
