/* Boston Music — the timeline viewer. Dark, sparse, one accent.
   On-screen text (the year, the card, the timeline) is sized in container-height units (cqh) of the
   picture, against the broadcast numbers in ~/.claude/broadcast-text-principles.md: everything inside a
   5% margin, a card line well under 1/7 of the card, the year a single line. The panel is for the host
   and is sized for reading at arm's length (18px and up). */
:root {
  --bg: #0a0d12;
  --sea: #0a0d12;
  --land: #141922;
  --land-home: #19202b;
  --edge: #2b3442;
  --ink: #eef1f5;
  --ink2: #aab3c0;
  --accent: #f4b740;
  --accent-ink: #1a1203;
  --line: #2a313c;
  --panel: #10141a;
  --key: #1a2029;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; -webkit-text-size-adjust: 100%; }
main { position: fixed; inset: 0; display: flex; }
#view { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden; container-type: size; background: var(--sea); }
#map, #marks { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#marks { pointer-events: none; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: var(--ink2); }

/* the map */
.state { fill: var(--land); stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.state.home { fill: var(--land-home); }
.state.far { fill: #10141b; }

/* the marks, drawn in screen pixels */
.town { fill: var(--ink); }
.town.here { fill: var(--accent); }
.ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.townName { fill: var(--ink); font-family: var(--font); font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.townName.here { fill: var(--accent); }
.count { fill: var(--bg); font-family: var(--font); font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.trail { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .9; }

/* the year and place, top left inside the 5% margin */
#when { position: absolute; left: 5cqw; top: 5cqh; pointer-events: none; }
#year { font-size: 9cqh; line-height: 1; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#where { margin-top: 1.2cqh; font-size: 2.8cqh; font-weight: 600; color: var(--accent); white-space: nowrap; min-height: 1.2em; }

/* the moment, bottom left above the timeline */
#card { position: absolute; left: 5cqw; bottom: 17cqh; width: min(48cqw, 760px); padding: 2.4cqh 2.6cqh 2.2cqh; border-radius: 1.6cqh;
  background: rgba(10, 13, 18, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); border-left: .5cqh solid var(--accent);
  opacity: 0; transform: translateY(1.5cqh); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
#card.show { opacity: 1; transform: none; }
#card .meta { font-size: 2.4cqh; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#card .title { margin-top: .6cqh; font-size: 4.4cqh; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
#card .text { margin-top: 1.2cqh; font-size: 2.9cqh; line-height: 1.32; color: var(--ink); }
#card .src { margin-top: 1.4cqh; font-size: 1.9cqh; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the timeline, along the bottom inside the 5% margin */
#timeline { position: absolute; left: 5cqw; right: 5cqw; bottom: 5cqh; height: 8cqh; }
#timeline .track { position: absolute; left: 0; right: 0; top: 2.6cqh; height: 2px; background: var(--edge); }
#timeline .tick { position: absolute; top: 1.4cqh; width: 2px; height: 2.6cqh; margin-left: -1px; background: var(--ink2); border-radius: 1px; }
#timeline .tick.past { background: var(--ink); }
#timeline .tick.here { background: var(--accent); top: .6cqh; height: 4.2cqh; width: 3px; margin-left: -1.5px; }
#timeline .labels span { position: absolute; top: 4.6cqh; transform: translateX(-50%); font-size: 2.2cqh; font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
#timeline .labels span:first-child { transform: none; }
#timeline .labels span:last-child { transform: translateX(-100%); }
#timeline .now { position: absolute; top: 1.6cqh; width: 2.2cqh; height: 2.2cqh; margin-left: -1.1cqh; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .5cqh rgba(244, 183, 64, .25); }
#timeline .fifties { position: absolute; top: 0; bottom: 3.6cqh; width: 0; border-left: 1px dashed var(--edge); }

/* a narrow picture (a phone, the iPad upright): the card runs the width, its type set against the width so
   the words do not stack up one to a line, and every other year on the timeline steps aside */
@container (max-aspect-ratio: 9/10) {
  #card { width: auto; right: 5cqw; bottom: 15cqh; padding: 3.4cqw 3.6cqw 3cqw; }
  #card .meta { font-size: 3.6cqw; }
  #card .title { font-size: 6.2cqw; }
  #card .text { font-size: 4.3cqw; }
  #card .src { font-size: 3.2cqw; }
  #timeline .labels span { font-size: 3.6cqw; }
  #timeline .labels span.minor { display: none; }
  #year { font-size: 14cqw; }
  #where { font-size: 4.4cqw; }
}

/* the right panel: the host's controls. Never on the live viewer (see app.js, "on air") */
#panel { flex: 0 0 360px; height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 20px 18px 28px; font-size: 18px; }
#panel h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
#panel .status { margin: 0 0 18px; font-size: 18px; color: var(--ink2); min-height: 1.4em; }
#panel h2 { margin: 22px 0 10px; font-size: 18px; font-weight: 700; color: var(--accent); }
#panel .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#panel .keys.three { grid-template-columns: 1fr 1fr 1fr; }
#panel button { font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); background: var(--key); border: 2px solid var(--line); border-radius: 10px; padding: 10px 8px; min-height: 48px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#panel button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#panel button.go { width: 100%; margin-top: 14px; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 22px; min-height: 58px; }
#panel button:disabled { opacity: .45; }
#panel button .n { font-weight: 500; color: inherit; opacity: .8; }
#panel label { display: block; font-weight: 600; margin: 6px 0 6px; }
#panel input { font: inherit; font-size: 22px; width: 100%; padding: 10px 12px; color: var(--ink); background: #0b0f14; border: 2px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
#panel input:focus { outline: none; border-color: var(--accent); }
#panel .help { margin: 6px 0 0; font-size: 16px; color: var(--ink2); }
#panel .choice { margin: 14px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; }
#panel .choice b { color: var(--accent); }

/* ON AIR: in a show's spot (?stream=…) or with the cue's Panels off (?msrui=off) the panel is never drawn and
   the picture takes the whole window. Panels off also takes every box over the picture away. */
html[data-onair] #panel { display: none !important; }
html[data-msr-ui=off] #panel, html[data-msr-ui=off] #when, html[data-msr-ui=off] #card, html[data-msr-ui=off] #timeline { display: none !important; }

/* an upright iPad: the panel goes under the picture */
@media (max-aspect-ratio: 1/1) {
  main { flex-direction: column; }
  #view { flex: 1 1 60%; }
  #panel { flex: 0 0 40%; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
