/* Captain Baltimore Radio Deck — brand styling.
   Square corners (house rule), ink borders, hard shadows, paper + neon. */

.cbd {
    --ink: #111111;
    --paper: #FFFDF4;
    --yellow: #FFD500;
    --pink: #FF2E88;
    --purple: #7B2FFF;
    --cyan: #00C2E8;
    --lime: #7ED321;
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 8px 8px 0 var(--ink);
    padding: 20px;
    max-width: 860px;
    margin: 0 auto;
}
.cbd * { box-sizing: border-box; border-radius: 0 !important; }

/* masthead */
.cbd-mast { display: flex; align-items: center; gap: 10px; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.cbd-beacon { width: 12px; height: 12px; background: #c8c2ae; border: 2px solid var(--ink); flex: none; }
.cbd.is-playing .cbd-beacon { background: var(--pink); animation: cbdPulse 1.6s ease-in-out infinite; }
@keyframes cbdPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cbd-callsign { font-weight: 800; letter-spacing: .14em; font-size: 14px; }
.cbd-aboard { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }

/* channel cards */
.cbd-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cbd-card {
    --acc: var(--cyan);
    position: relative; text-align: left; cursor: pointer; min-width: 0; overflow: hidden;
    background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
    padding: 12px 14px 12px 18px; font-family: inherit; color: var(--ink); line-height: 1.25; min-height: 0;
    transition: transform .08s ease, box-shadow .08s ease;
}
.cbd-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--acc); }
.cbd-card:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.cbd-card.is-tuned { background: var(--acc); color: #fff; }
.cbd-card.is-tuned .cbd-card__track { color: rgba(255,255,255,.85); }
.cbd-card__freq { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.cbd-card__freq small { font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.cbd-card__name { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.cbd-card__track { display: block; font-size: 12px; margin-top: 8px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbd-eq { display: none; position: absolute; top: 12px; right: 12px; height: 16px; align-items: flex-end; gap: 2px; }
.cbd-eq i { width: 3px; background: #fff; animation: cbdEq 0.9s ease-in-out infinite; }
.cbd-eq i:nth-child(2) { animation-delay: .2s; } .cbd-eq i:nth-child(3) { animation-delay: .45s; } .cbd-eq i:nth-child(4) { animation-delay: .1s; }
@keyframes cbdEq { 0%,100% { height: 5px; } 50% { height: 15px; } }
.cbd-card.is-sounding .cbd-eq { display: inline-flex; }

/* dial strip */
.cbd-scale { position: relative; height: 14px; margin: 14px 2px 4px; border-bottom: 3px solid var(--ink);
    background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 10%); }
.cbd-needle { position: absolute; bottom: -3px; width: 4px; height: 17px; background: var(--pink); transform: translateX(-2px); transition: left .35s ease; }

/* now playing */
.cbd-main { display: flex; gap: 20px; margin-top: 16px; }
.cbd-artwrap { flex: none; width: 190px; height: 190px; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: #fff; overflow: hidden; }
.cbd-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.cbd-art-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 64px; background: var(--yellow); }
.cbd-art-fallback[hidden] { display: none; }
.cbd-info { flex: 1; min-width: 0; }
.cbd-live-row { display: flex; align-items: center; gap: 10px; }
.cbd-live { background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 3px 8px; border: 2px solid var(--ink); }
.cbd-hood { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.cbd-title { font-size: 30px; font-weight: 800; line-height: 1.12; margin: 8px 0 2px; }
.cbd-artist { font-size: 17px; font-weight: 600; color: var(--purple); text-decoration: none; }
.cbd-artist:hover { text-decoration: underline; }
.cbd-progress { height: 12px; border: 3px solid var(--ink); background: #fff; margin-top: 16px; }
.cbd-progress__bar { height: 100%; width: 0%; background: var(--cyan); transition: width 1s linear; }
.cbd-times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* votes */
.cbd-votes { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.cbd .cbd-vote { flex: none; padding: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; width: 46px; min-width: 46px; max-width: 46px; height: 40px; min-height: 40px; max-height: 40px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; color: var(--ink); }
.cbd .cbd-vote svg { width: 20px; height: 20px; flex: none; }
.cbd-vote:hover:not(:disabled) { background: var(--yellow); }
.cbd-vote.is-mine { background: var(--lime); }
.cbd-vote:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.cbd-votes__hint { font-size: 12px; opacity: .65; font-weight: 600; }

/* transport */
.cbd-transport { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 20px; border-top: 3px solid var(--ink); padding-top: 16px; }
.cbd .cbd-seek { flex: none; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); width: 52px; min-width: 52px; max-width: 52px; height: 52px; min-height: 52px; max-height: 52px; padding: 0; line-height: 1; font-size: 15px; cursor: pointer; color: var(--ink); }
.cbd-seek:hover { background: var(--cyan); }
.cbd .cbd-play { flex: none; width: 72px; min-width: 72px; max-width: 72px; height: 72px; min-height: 72px; max-height: 72px; padding: 0; line-height: 1; border-radius: 50% !important; background: var(--yellow); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cbd .cbd-play svg { width: 30px; height: 30px; flex: none; }
.cbd-play:hover { transform: scale(1.04); }
.cbd-play.is-playing { background: var(--pink); color: #fff; }
.cbd-vol { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 1 1 120px; min-width: 0; max-width: 220px; }
.cbd-volbtn { flex: none; background: none; border: none; cursor: pointer; color: var(--ink); display: inline-flex; padding: 4px; line-height: 1; }
.cbd-volbtn svg { width: 20px; height: 20px; flex: none; }
.cbd-volrange { flex: 1 1 auto; min-width: 0; width: auto; height: 24px; accent-color: var(--purple); cursor: pointer; }

/* history */
.cbd-history { margin-top: 20px; border-top: 3px solid var(--ink); padding-top: 14px; }
.cbd-history__title { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.cbd-history__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.cbd-history__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cbd-history__row img, .cbd-history__noart { width: 38px; height: 38px; flex: none; border: 2px solid var(--ink); object-fit: cover; }
.cbd-history__noart { display: inline-flex; align-items: center; justify-content: center; background: var(--yellow); font-size: 16px; }
.cbd-history__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cbd-history__info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbd-history__info em { font-size: 12px; font-style: normal; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbd-history__ago { font-size: 11px; font-weight: 600; opacity: .55; flex: none; }
.cbd-history__empty { grid-column: 1 / -1; font-size: 13px; opacity: .65; }

/* sticky mini-bar */
.cbd-mini { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; display: flex; align-items: center; gap: 12px;
    background: var(--paper, #FFFDF4); border-top: 3px solid #111; padding: 8px 14px; font-family: 'Poppins', sans-serif; box-shadow: 0 -4px 0 rgba(0,0,0,.15); }
.cbd-mini[hidden] { display: none; }
.cbd-mini__play { width: 44px; min-width: 44px; max-width: 44px; height: 44px; min-height: 44px; max-height: 44px; padding: 0; line-height: 1; flex: none; border-radius: 50% !important; background: #FFD500; border: 3px solid #111; color: #111; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cbd-mini__play svg { width: 20px; height: 20px; }
.cbd-mini__info { flex: 1; min-width: 0; background: none; border: none; text-align: left; cursor: pointer; font-family: inherit; color: #111; display: flex; flex-direction: column; padding: 0; }
.cbd-mini__track { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbd-mini__chan { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }

/* charts (deck restyle of #cb-charts) */
#cb-charts { background: #FFFDF4; border: 3px solid #111; box-shadow: 8px 8px 0 #111; padding: 20px; max-width: 860px; margin: 0 auto; font-family: 'Poppins', sans-serif; color: #111; }
@media (max-width: 767px) { #cb-charts { margin-top: 28px; } }
#cb-charts * { border-radius: 0 !important; }
.cbd-charts__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 3px solid #111; padding-bottom: 12px; }
.cbd-charts__title { font-size: 22px; font-weight: 800; margin: 0; }
.cbd-charts__toggle { display: flex; border: 3px solid #111; }
.cbd-charts__toggle button { background: #fff; border: none; border-right: 3px solid #111; padding: 8px 14px; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; color: #111; }
.cbd-charts__toggle button:last-child { border-right: none; }
.cbd-charts__toggle button.is-active { background: #FFD500; }
.cbd-charts__demo { font-size: 12px; font-weight: 700; letter-spacing: .06em; background: #FF2E88; color: #fff; display: inline-block; padding: 4px 8px; border: 2px solid #111; }
.cbd-charts__list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cbd-charts__row { display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid #111; padding: 8px 12px; }
.cbd-charts__row.is-top { box-shadow: 4px 4px 0 #111; }
.cbd-charts__rank { font-size: 24px; font-weight: 800; width: 36px; text-align: center; flex: none; }
.cbd-charts__row:nth-child(1) .cbd-charts__rank { color: #FF2E88; }
.cbd-charts__art img, .cbd-charts__noart { width: 46px; height: 46px; object-fit: cover; border: 2px solid #111; display: block; }
.cbd-charts__noart { display: flex; align-items: center; justify-content: center; background: #FFD500; font-size: 20px; }
.cbd-charts__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cbd-charts__track { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbd-charts__artist { color: #7B2FFF; font-size: 13px; font-weight: 600; text-decoration: none; }
.cbd-charts__channel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; font-weight: 600; }
.cbd-charts__score { font-weight: 800; font-size: 16px; background: #111; color: #fff; padding: 4px 10px; flex: none; }
.cbd-charts__loading { font-size: 14px; opacity: .6; padding: 8px 0; }

/* responsive */
@media (max-width: 980px) {
    .cbd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .cbd { padding: 14px; }
    .cbd-cards { grid-template-columns: 1fr; }
    .cbd-card__track { white-space: normal; }
    .cbd-main { flex-direction: column; }
    .cbd-artwrap { width: 100%; height: auto; aspect-ratio: 1 / 1; }
    .cbd-title { font-size: 24px; }
    .cbd-history__list { grid-template-columns: 1fr; }
    .cbd-volrange { width: 90px; }
    .cbd-callsign { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .cbd-eq i, .cbd.is-playing .cbd-beacon { animation: none; }
    .cbd-progress__bar, .cbd-needle { transition: none; }
}

/* Color hardening — theme button/link hover rules must never wash deck
   text white on light surfaces. Pinned with ID specificity + !important. */
#cb-deck button, #cb-deck button:hover, #cb-charts button, #cb-charts button:hover { color: #111 !important; }
#cb-deck .cbd-card.is-tuned, #cb-deck .cbd-card.is-tuned:hover { color: #fff !important; }
#cb-deck .cbd-card[data-slug="dock-talk"].is-tuned, #cb-deck .cbd-card[data-slug="dock-talk"].is-tuned:hover { color: #111 !important; }
#cb-deck .cbd-card[data-slug="dock-talk"].is-tuned .cbd-card__track { color: rgba(0,0,0,.72); }
#cb-deck .cbd-play.is-playing, #cb-deck .cbd-play.is-playing:hover { color: #fff !important; }
#cb-deck a, #cb-deck a:hover { color: #7B2FFF !important; }
#cb-charts a, #cb-charts a:hover { color: #7B2FFF !important; }
#cb-charts .cbd-charts__toggle button.is-active, #cb-charts .cbd-charts__toggle button.is-active:hover { background: #FFD500 !important; color: #111 !important; }
#cb-charts .cbd-charts__toggle button:hover { background: #fff; }
#cb-deck .cbd-mini__track, #cb-deck .cbd-mini__chan { color: #111; }
