/* customText — the owner's one line, on an LCD like Modem Status and
   System Information, in the callsign's dot-matrix face (.lcd-callsign,
   modemStatus/style.css). It runs round like a news ticker: the text, a
   gap, the text again, as many copies as fill the panel (one lap, made in
   panel.js), sliding left by one lap and starting over, so it never
   jumps. Hover to stop it. */

.ct-viewport {
    overflow: hidden;
    white-space: nowrap;
}

.ct-track {
    display: inline-flex;
    white-space: nowrap;
}

/* Spaces kept as typed; the unlit dots (::before) span each copy */
.ct-track .lcd-callsign {
    white-space: pre;
    flex: none;
}

/* The copies only while it runs, and never read out */
.ct-copy {
    display: none;
}

.ct-viewport.ct-scroll .ct-copy {
    display: inline-block;
}

/* The gap between the end and the start again: five dot cells (0.6em
   each), inside each copy so the unlit dots carry on through it */
.ct-viewport.ct-scroll .ct-track .lcd-callsign {
    padding-right: 3em;
}

.ct-viewport.ct-scroll .ct-track {
    animation: ct-ticker var(--ct-dur, 20s) linear infinite;
    will-change: transform;
}

.ct-viewport.ct-scroll:hover .ct-track {
    animation-play-state: paused;
}

@keyframes ct-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* No movement: one copy, cut to the panel, the whole text on hover */
@media (prefers-reduced-motion: reduce) {
    .ct-viewport.ct-scroll .ct-track {
        animation: none;
        max-width: 100%;
    }
    .ct-viewport.ct-scroll .ct-copy {
        display: none;
    }
    .ct-viewport.ct-scroll #ct-text {
        padding-right: 0;
        min-width: 0;
        flex: 0 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
