/* Page styles: /station/player/ (player). Owned by this page's agent. Shared styles live in /assets/css/site.css. */

/* ---- Hero copy ---------------------------------------------------------- */
.player-btn-ico { margin-right: 8px; }
.player-confirm { max-width: 34em; margin-top: 18px; }
.player-confirm::before { white-space: normal; max-width: calc(100% + 10px); }
/* placeholder tags must never run past the viewport edge on a phone */
.player-chips--placeholder::before, .player-badge::before, .player-table__tbc::before { white-space: normal; width: max-content; max-width: calc(100vw - 2 * var(--gutter) - 40px); }
.player-table__tbc::before { max-width: calc(60vw - 40px); }

/* ---- Hero widget: unit diagram with three callouts ---------------------- */
.player-unit__stage { position: relative; aspect-ratio: 600 / 420; }
.player-unit__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.player-unit__floor rect { fill: var(--panel-line-strong); }
.player-unit__face { stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: miter; }
.player-unit__face--front { fill: var(--panel); }
.player-unit__face--top { fill: var(--panel-raised); }
.player-unit__face--side { fill: var(--panel-bar); }
.player-unit__foot { fill: var(--panel-line-strong); }
.player-unit__plate { fill: none; stroke: var(--subtle); stroke-width: 1.5; }
.player-unit__plate-dot { fill: var(--accent); }
.player-unit__plate-line { fill: var(--subtle); }
.player-unit__vents rect { fill: var(--panel-line-strong); }
.player-unit__io rect { fill: var(--panel-black); stroke: var(--subtle); stroke-width: 1.5; }
.player-unit__io .player-unit__io-in { fill: var(--panel-line-strong); stroke: none; }
.player-unit__strip { fill: var(--panel-line-strong); }
.player-unit__leds rect { fill: var(--accent); }
.player-unit__leds rect:nth-child(n+7):nth-child(-n+9),
.player-unit__leds rect:nth-child(n+15) { opacity: 0.22; }
.player-unit__lamp { fill: var(--onair); }
.player-unit.is-live .player-unit__leds rect { animation: player-led 3.4s steps(1) infinite; animation-delay: calc(var(--i) * -0.34s); }
.player-unit.is-live .player-unit__lamp { animation: on-air var(--pulse) var(--ease-fade) infinite; }
@keyframes player-led {
  0% { opacity: 1; }
  55% { opacity: 0.22; }
  80% { opacity: 1; }
}

.player-call__line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.player-call__dot { fill: var(--accent); }
.player-call__ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.player-call__label {
  position: absolute; z-index: 1; transform: translateY(-50%);
  padding: 4px 8px; font-size: 0.6875rem; font-weight: 500; line-height: 1.3; white-space: nowrap;
  color: var(--text); background: var(--panel-black); border: 1px solid var(--panel-line-strong); border-radius: var(--radius);
}
.player-call__label--a { left: 3%; top: 81.9%; }
.player-call__label--b { right: 3%; top: 93.3%; }
.player-call__label--c { right: 3%; top: 16.7%; }

/* build-up: dot, then the line draws itself in steps, then the label */
html.js .player-unit:not(.is-built) .player-call__dot,
html.js .player-unit:not(.is-built) .player-call__label { opacity: 0; }
html.js .player-unit:not(.is-built) .player-call__line { stroke-dashoffset: 1; }
.player-call__dot { transition: opacity 0.3s steps(3) calc(var(--k) * 0.45s); }
.player-call__line { transition: stroke-dashoffset 1.1s steps(22) calc(0.3s + var(--k) * 0.45s); }
.player-call__label { transition: opacity 0.4s steps(4) calc(1.2s + var(--k) * 0.45s); }
.player-unit.is-built.is-live .player-call__ring,
.player-top.is-live .player-top__lamp-ring { animation: player-ring 2.6s steps(13) infinite; animation-delay: calc(1.6s + var(--k, 0) * 0.45s); }
@keyframes player-ring {
  from { opacity: 0.8; transform: scale(1); }
  to { opacity: 0; transform: scale(3.2); }
}
.player-unit__meter { width: 110px; }
@media (max-width: 420px) {
  .player-call__label { padding: 3px 6px; font-size: 0.625rem; }
  .player-unit__meter { display: none; }
}

/* ---- How it works: four-step list --------------------------------------- */
.player-h3 { font-size: clamp(1.5rem, 2.2vw + 0.7rem, 2.5rem); line-height: 1.08; text-wrap: balance; }
.player-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.player-steps__row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: clamp(14px, 2vw, 22px); padding: clamp(16px, 2vw, 24px) 0; border-bottom: 1px solid var(--line); }
.player-steps__n { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-family: var(--font-display); font-size: 1rem; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: var(--radius); }
.player-steps__n--done { position: relative; background: var(--accent); border-color: var(--accent); }
.player-steps__n--done i { position: absolute; inset: -5px; border: 1px solid var(--accent); opacity: 0.34; }
.player-steps.is-live .player-steps__n--done i { animation: on-air var(--pulse) var(--ease-fade) infinite; }
.player-steps__n--done::after { content: ''; width: 12px; height: 12px; background: var(--bg); }
.player-steps__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.player-steps__title { font-family: var(--font-display); font-size: clamp(1rem, 0.6vw + 0.9rem, 1.3125rem); line-height: 1.15; }
.player-steps__sub { font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.player-steps__link { display: flex; gap: 3px; }
.player-steps__link i { width: 7px; height: 7px; background: var(--panel-line-strong); }
html:not(.js) .player-steps__link i,
.player-steps__row.is-in .player-steps__link i { background: var(--accent); transition: background 0s linear 0.5s; }
.player-steps__row.is-in .player-steps__link i:nth-child(2) { transition-delay: 0.65s; }
.player-steps__row.is-in .player-steps__link i:nth-child(3) { transition-delay: 0.8s; }
.player-steps__row.is-in .player-steps__link i:nth-child(4) { transition-delay: 0.95s; }
@media (max-width: 480px) {
  .player-steps__row--done { grid-template-columns: 40px minmax(0, 1fr); }
  .player-steps__row--done .onair { display: none; }
}

/* ---- Staying on air: failover timeline ---------------------------------- */
.player-fail { max-width: 1040px; margin-inline: auto; }
.player-fail__status { display: grid; min-width: 0; }
.player-fail__state { grid-area: 1 / 1; min-width: 0; white-space: nowrap; transition: opacity 0.3s steps(3); }
.player-fail__state--live { color: var(--accent); }
.player-fail__state--back { --live-color: var(--text); color: var(--text); opacity: 0; }
.player-fail.is-back .player-fail__state--live { opacity: 0; }
.player-fail.is-back .player-fail__state--back { opacity: 1; }
.player-fail__legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; padding: 12px 14px 0; }
.player-fail__key { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--muted); }
.player-fail__key i { width: 14px; height: 4px; background: var(--accent); }
.player-fail__key--back i { background: var(--text); }
.player-fail__key--tick i { width: 4px; height: 8px; }
.player-fail__stage { position: relative; }
.player-fail__canvas { display: block; width: 100%; height: clamp(240px, 26vw, 300px); }
.player-fail__lane, .player-fail__now { position: absolute; padding: 2px 6px 2px 0; font-size: 0.75rem; line-height: 1.3; color: var(--muted); background: var(--panel-black); pointer-events: none; }
.player-fail__lane { left: 14px; }
.player-fail__lane--1 { top: 3%; }
.player-fail__lane--2 { top: 37%; }
.player-fail__lane--3 { top: 70%; color: var(--accent); }
.player-fail__now { top: 3%; left: 64%; transform: translateX(-50%); padding: 2px 6px; font-family: var(--font-display); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); border: 1px solid var(--panel-line-strong); }
.player-fail__caption { margin: 0 auto; font-size: 0.8125rem; line-height: 1.5; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .player-fail .panel__bar .onair { display: none; }
  .player-fail .panel__title { display: none; }
  .player-fail__legend { justify-content: flex-start; }
}

/* ---- Now-playing data --------------------------------------------------- */
.player-meta__card { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--panel-black); border: 1px solid var(--panel-line); border-radius: var(--radius); }
.player-meta__lines { flex: 1; min-width: 0; }
.player-meta__label { margin: 22px 0 12px; }
.player-meta__label--first { margin-top: 0; }
.player-meta__body { margin-top: 22px; }
.player-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.player-chips--placeholder { margin-top: 34px; }
.player-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; font-size: 0.9375rem; font-weight: 500; color: var(--muted); background: var(--panel-black); border: 1px solid var(--panel-line-strong); border-radius: var(--radius); transition: color 0.3s steps(3), border-color 0.3s steps(3); }
.player-chip::after { content: ''; width: 6px; height: 6px; margin-left: 2px; background: var(--panel-line-strong); transition: background 0.3s steps(3); }
.player-chip .ico { width: 20px; height: 20px; }
.player-chip.is-lit { color: var(--text); border-color: var(--accent); }
.player-chip.is-lit::after { background: var(--accent); }

/* ---- The box ------------------------------------------------------------ */
.player-badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.player-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 0.8125rem; color: var(--muted); border: 1px solid var(--panel-line-strong); border-radius: var(--radius); }
.player-badge b { font-family: var(--font-display); font-weight: 400; color: var(--accent); }
.player-top { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.player-top__svg { display: block; width: 100%; height: auto; overflow: visible; }
.player-top__ticks rect { fill: var(--panel-line-strong); }
.player-top__body { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.player-top__inset { fill: none; stroke: var(--panel-line-strong); stroke-width: 1; }
.player-top__screws rect { fill: var(--subtle); }
.player-top__vent { fill: var(--panel-line-strong); }
.player-top__logo { opacity: 0.9; }
.player-top__lamp { fill: var(--onair); }
.player-top__lamp-ring { fill: none; stroke: var(--onair); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.player-top figcaption { text-align: center; color: var(--subtle); }

.player-glance { margin-top: clamp(56px, 8vw, 112px); }
.player-glance__title { margin-bottom: clamp(16px, 2vw, 24px); }
.player-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
.player-table th, .player-table td { padding: 16px 0; font-size: 1rem; line-height: 1.5; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.player-table th { width: 34%; padding-right: 16px; font-weight: 500; color: var(--subtle); }
.player-table td { color: var(--text); }
.player-table__tbc { display: inline-block; margin: 20px 5px 5px; color: var(--muted); }
@media (max-width: 560px) {
  .player-table th { width: 40%; }
  .player-table__tbc { margin-top: 36px; }
  .player-table th, .player-table td { font-size: 0.9375rem; }
}
