:root {
  --bg: #000000;
  --panel: #121316;
  --ink: #f4f4f1;
  --soft: rgba(244, 244, 241, 0.55);
  --line: rgba(244, 244, 241, 0.12);
  --accent: #ffd24a;
  --lh: 34px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.tp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(400px, 100%); padding: 14px 14px 12px; border-radius: 26px; background: linear-gradient(170deg, #191a1f, var(--panel) 60%); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 36px 60px -36px rgba(255, 210, 74, 0.16); }
.tp__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 0 4px; font-size: 12px; color: var(--soft); }
.tp__rec { display: flex; align-items: center; gap: 7px; font-weight: 620; color: var(--ink); }
.tp__rec svg { width: 16px; height: 16px; fill: none; stroke: #ff6a55; stroke-width: 1.500; stroke-linejoin: round; }
.tp__left { font-variant-numeric: tabular-nums; }
.tp__left b { font-weight: 660; color: var(--ink); }

/* the window on the script: it fades out above and below, the reading line stays put */
.tp__view { position: relative; height: min(204px, 44vh); margin-top: 10px; border-radius: 16px; background: #08080a; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; cursor: pointer; }
.tp__flip { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.15), #000 26%, #000 58%, rgba(0, 0, 0, 0.05)); mask-image: linear-gradient(rgba(0, 0, 0, 0.15), #000 26%, #000 58%, rgba(0, 0, 0, 0.05)); }
.tp__text { position: absolute; left: 0; right: 0; top: 0; padding: 0 26px; font-size: clamp(17px, 5.200vh, 22px); line-height: var(--lh); font-weight: 600; font-stretch: 96%; letter-spacing: -0.01em; will-change: transform; }
.tp__text span { color: rgba(244, 244, 241, 0.62); transition: color 0.25s; }
.tp__text span.is-read { color: rgba(244, 244, 241, 0.24); }
.tp__text span.is-now { color: var(--accent); }
.tp__text span.is-line { color: var(--ink); }
.tp__line { position: absolute; left: 6px; right: 6px; top: 36%; display: flex; justify-content: space-between; height: 12px; margin-top: -6px; pointer-events: none; }
.tp__line svg { width: 8px; height: 12px; fill: var(--accent); }

.tp__progress { display: block; height: 3px; margin: 10px 4px 0; border-radius: 2px; background: var(--line); overflow: hidden; }
.tp__progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.tp__controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; }
.tp__play { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #0b0b0d; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.tp__play svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.400; stroke-linecap: round; stroke-linejoin: round; }
.tp__tri { fill: currentColor; stroke-width: 1.400; opacity: 0; }
.tp[data-playing="false"] .tp__tri { opacity: 1; }
.tp[data-playing="false"] .tp__pause { opacity: 0; }
.tp__play:focus-visible, .tp__mirror:focus-visible, .tp__speed button:focus-visible { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.tp__speed { justify-self: center; display: grid; grid-template-columns: 36px auto 36px; align-items: center; height: 40px; padding: 0 2px; border-radius: 20px; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 1px var(--line); }
.tp__speed button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); }
.tp__speed button:disabled { opacity: 0.3; cursor: default; }
.tp__speed svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; }
.tp__x { display: flex; align-items: baseline; justify-content: center; min-width: 40px; font-size: 13.500px; font-weight: 680; font-variant-numeric: tabular-nums; }
.tp__roll { display: block; height: 18px; line-height: 18px; overflow: hidden; }
.tp__roll b { display: block; font-weight: inherit; }
.tp__mirror { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 20px; font-size: 13px; font-weight: 640; color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); transition: color 0.2s, background-color 0.2s; }
.tp__mirror svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }
.tp__mirror[aria-pressed="true"] { color: #0b0b0d; background: var(--accent); box-shadow: none; }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #0b0b0d; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); z-index: 6; }

@media (max-height: 380px) { :root { --lh: 28px; } }
@media (prefers-reduced-motion: reduce) { .tp__text span, .tp__mirror { transition: none; } }
