/*
 * What is on next.
 *
 * The live page used to fill its lower half with every channel and every game,
 * which on a network with nobody broadcasting is a long list of offline. One
 * upcoming show and a clock counting to it says the same thing better: there is
 * something to come back for, and here is when.
 */

.nx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(63, 220, 111, .07), transparent 60%),
    var(--tile);
}

.nx-who { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.nx-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--green);
}

.nx-name {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}

.nx-line { font-size: 12px; letter-spacing: .1em; color: var(--mute); }

/* ---------------- the clock ---------------- */

.nx-clock { display: flex; align-items: flex-start; gap: 10px; }

.nx-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/*
 * Tabular figures, so a number does not jog sideways as it changes. Without it
 * the whole clock shifts every second a 1 becomes a 2, which is the difference
 * between a countdown and a nervous tic.
 */
.nx-unit b {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  min-width: 2ch;
  text-align: center;
}

.nx-unit em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--dim);
}

.nx-sep {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--faint, #4f4f4f);
  /* Only the colon blinks. The digits carry the information. */
  animation: nxTick 1s steps(1) infinite;
}

/* The seconds breathe on each change, so the clock reads as running. */
.nx-unit b.is-tick { animation: nxBeat .45s ease; }

@keyframes nxTick { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes nxBeat {
  0% { transform: scale(1); color: var(--green); }
  100% { transform: scale(1); color: var(--ink); }
}

/* When it reaches zero it stops counting and says so. */
.nx.is-now { border-color: var(--green); }
.nx.is-now .nx-kicker { color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .nx-sep, .nx-unit b.is-tick { animation: none; }
}

@media (max-width: 860px) {
  .nx { flex-direction: column; align-items: flex-start; gap: 22px; padding: 24px; }
  .nx-name { font-size: 26px; }
  .nx-unit b { font-size: 32px; }
  .nx-sep { font-size: 26px; }
}

@media (max-width: 420px) {
  .nx-clock { gap: 6px; }
  .nx-unit b { font-size: 26px; }
  .nx-sep { font-size: 20px; }
}
