/* The stage: a dotted wash, one product window on it, and one chip that states the point.
   Colours come from the page: --wash --dot --ink --muted --line --white --accent --accent-soft --pass --fail --mono */
.stage {
  position: relative; margin: 0; border-radius: 22px; padding: clamp(1rem, 3vw, 2rem);
  background-color: var(--wash);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px); background-size: 14px 14px;
  display: grid; gap: .9rem; align-content: center; min-height: 23rem;
}
.win { background: var(--white); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -28px var(--ink); }
.win-h { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .6rem .5rem .9rem; border-bottom: 1.5px solid var(--ink); font: 500 .8rem/1.3 var(--mono); }
.win-h .hr { display: flex; align-items: center; gap: .7rem; }
.win-h .stat { display: flex; gap: .45rem; align-items: center; color: var(--muted); white-space: nowrap; }
.win-h .stat::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }

/* the pause control: a ring that fills as the run plays */
.tog { width: 1.75rem; height: 1.75rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.tog[hidden] { display: none; }
.tog svg { display: block; }
.tog circle { fill: none; stroke-width: 2; }
.tog .tr { stroke: var(--line); }
.tog .rg { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50% 50%; }
.tog path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tog .pl { display: none; fill: currentColor; }
.tog.held .pl { display: block; }
.tog.held .pa { display: none; }
.tog:hover { background: var(--wash); }

.prog { height: 2px; background: var(--accent); transform-origin: 0 50%; }
.win-b { padding: .9rem; display: grid; gap: .65rem; font-size: .95rem; line-height: 1.45; align-content: start; }
.chip { justify-self: start; background: var(--ink); color: #fff; border-radius: 999px; padding: .5rem .95rem; font-weight: 600; font-size: .92rem; line-height: 1.3; }
.pill { font: 500 .74rem/1.3 var(--mono); padding: .14rem .5rem; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; color: var(--muted); }
.pill.yes { color: var(--pass); }
.pill.bad { color: var(--fail); }
.pill.own { color: var(--ink); background: var(--accent-soft); border-color: var(--accent-soft); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.tag { font: 500 .8rem/1.3 var(--mono); background: var(--accent-soft); color: var(--ink); padding: .08rem .4rem; border-radius: 5px; white-space: nowrap; }
.turn { display: grid; grid-template-columns: 3.6rem 1fr; gap: .6rem; align-items: start; }
.turn .who { font: 500 .74rem/1.9 var(--mono); color: var(--muted); }
.turn p { margin: 0; }
.wave { display: flex; gap: 3px; align-items: center; height: 26px; margin-top: .35rem; }
.wave i { width: 3px; border-radius: 2px; background: var(--accent); height: calc(var(--h) * 1%); transform-origin: 50% 50%; }
.mono { font-family: var(--mono); font-size: .86rem; }
.lbl { font: 500 .74rem/1.3 var(--mono); color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding-top: .6rem; border-top: 1px solid var(--line); font: 500 .76rem/1.4 var(--mono); color: var(--muted); }
.foot b { color: var(--ink); font-weight: 500; }

/* the hero shell: a row of steps that fill as the run plays, and two panes */
.shell .steps { display: flex; border-bottom: 1px solid var(--line); }
.shell .step { flex: 1 1 0; min-width: 0; position: relative; padding: .55rem .9rem; font: 500 .78rem/1.3 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line); }
.shell .step:first-child { border-left: 0; }
.shell .step i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform-origin: 0 50%; }
.shell .panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.shell .pane + .pane { border-left: 1px solid var(--line); }
.shell .pane-h { padding: .55rem .9rem 0; }

@media (max-width: 700px) {
  .shell .panes { grid-template-columns: 1fr; }
  .shell .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .shell .step { padding: .5rem .45rem; font-size: .68rem; text-align: center; }
}
@media (max-width: 560px) { .stage { min-height: 0; border-radius: 16px; } .turn { grid-template-columns: 3.1rem 1fr; } }
@media print { .stage { background-image: none; } }
