/* only for "The timer that skipped zero". Other posts never load this. */

.prose pre .k { color: #f6a07a; } /* keyword */

/* ---------- the Turning demo ---------- */
.turn-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }

/* the stage is the game's own background in both themes */
.turn-stage { background: #111012; color: #f8efe1; border: 2px solid var(--line); border-radius: 14px; padding: 18px 20px 14px; }
.turn-reads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.turn-reads span { display: block; font-size: 12px; color: #8a847c; margin-bottom: 4px; }
.turn-reads b { font-size: clamp(22px, 3vw, 30px); line-height: 1; font-variant-numeric: tabular-nums; }
#t-phase { color: #b79cf0; }
#t-clock.neg { color: #ff5a4f; }

/* a number line from −35 to 30. 0 sits at 35/65 of the way across */
.turn-line { position: relative; height: 48px; border-bottom: 2px solid #3b342f; }
.turn-zero { position: absolute; left: calc(35 / 65 * 100%); top: 0; bottom: -2px; width: 2px; margin-left: -1px; background: var(--orange); }
.turn-dots i { position: absolute; width: 6px; height: 6px; margin-left: -3px; background: #c8b8a1; }
.turn-dots i.thin { width: 2px; margin-left: -1px; }
.turn-dots i.hit { width: 10px; height: 10px; margin: 0 0 -2px -5px; background: var(--orange); }
.turn-now { position: absolute; bottom: -8px; width: 0; height: 0; margin-left: -7px; border: 7px solid transparent; border-bottom-color: #f8efe1; transform: translateY(8px); transition: left .12s steps(2); }
.turn-scale { position: relative; height: 22px; margin-top: 8px; font-size: 12px; color: #8a847c; }
.turn-scale span { position: absolute; top: 0; }
.turn-scale span:first-child { left: 0; }
.turn-scale span:last-child { right: 0; }
.turn-scale .z { left: calc(35 / 65 * 100%); transform: translateX(-50%); color: var(--orange); }

.turn-controls { display: grid; gap: 16px; }
.turn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.turn .btn { min-height: 44px; }
.turn .btn:disabled { opacity: .5; cursor: wait; }
.turn-note { font-size: 15px; line-height: 1.45; min-height: 4.4em; margin: 0; }

.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { width: 100%; font-size: 12px; color: var(--muted); margin-bottom: 8px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 99px;
  font: 600 13px "JetBrains Mono", ui-monospace, monospace; cursor: pointer; transition: background .15s, color .15s;
}
.seg input:checked + span { background: var(--fg); color: var(--bg); }
.seg input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.seg label:hover span { border-color: var(--orange); }

.post-end #t-low { color: var(--orange); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .turn-body { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .turn-now { transition: none; } }
