/* The drill instructor row on the result screen, and the ⚙ settings. Uses each calculator's own tokens (--panel, --line,
   --ink, --muted, --gold, --bg, --cond). Pixel art stays crisp: image-rendering: pixelated. */
/* The stage: with the drill instructor on, he stands on the left (1.5×: 156×249, 3 device px per sprite px at 2× DPR) and
   the scoreboard stacks on the right — no extra height, so "Plan my training" stays where it was. */
.stage { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.stage.has-di { display: grid; grid-template-columns: 156px minmax(0, 1fr); column-gap: 10px; row-gap: 8px; align-items: center;
  grid-template-areas: "fig total" "fig stamp" "fig verdict" "fig say"; }
.stage.has-di .di { display: contents; }
.stage.has-di .total { grid-area: total; justify-content: flex-start; flex-wrap: wrap; gap: 0 8px; margin: 0; }
.stage.has-di .tl { width: 100%; font-size: .75rem; }
.stage.has-di .tn { font-size: 3.6rem; }
.stage.has-di .tm { font-size: 1.1rem; }
.stage.has-di .stamp { grid-area: stamp; justify-self: start; min-height: 0; font-size: 1.7rem; padding: 4px 10px; border-width: 4px; }
.stage.has-di .verdict { grid-area: verdict; text-align: left; margin: 0; font-size: .9rem; line-height: 1.3; }
.di[hidden] { display: none; }
.di-fig { grid-area: fig; align-self: end; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; }
.di-fig img { width: 156px; height: 249px; image-rendering: pixelated; image-rendering: crisp-edges; }
.di-say { grid-area: say; position: relative; margin: 2px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--ink);
  color: var(--bg); font: 800 1rem/1.22 var(--cond); letter-spacing: .02em; overflow-wrap: break-word; hyphens: auto; }
.di-say::before { content: ""; position: absolute; left: -9px; top: 14px; border: 9px solid transparent; border-left: 0; border-right-color: var(--ink); }
.di.di-fail .di-say { text-transform: uppercase; font-size: .95rem; letter-spacing: 0; }
/* entrance: he marches in from the left, then the bubble pops; FAIL shakes, perfect bounces */
.di.anim .di-fig { animation: di-in .38s cubic-bezier(.2, 1.2, .4, 1) both; }
.di.anim .di-say { animation: di-pop .25s .3s ease-out both; }
.di.anim.di-fail .di-fig img { animation: di-shake .18s .4s 4 linear; }
.di.anim.di-perfect .di-fig img, .di.anim.di-high .di-fig img { animation: di-bounce .5s .4s 2 ease-in-out; }
@keyframes di-in { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes di-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes di-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes di-bounce { 50% { transform: translateY(-8px); } }
/* poked: a quick jolt and the new line pops */
.di.poked .di-fig img { animation: di-jolt .3s ease-out; }
.di.poked .di-say { animation: di-pop .22s ease-out; }
@keyframes di-jolt { 30% { transform: translateY(-10px) scale(1.04); } 60% { transform: translateY(2px); } }

.di-gear { margin-left: 10px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: none;
  color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.di-sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); }
.di-sheet[hidden] { display: none; }
.di-card { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.di-card h3 { margin: 0 0 4px; font: 800 1.2rem/1 var(--cond); letter-spacing: .14em; color: var(--gold); }
.di-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.di-opt b { display: block; font: 800 1.05rem/1.1 var(--cond); letter-spacing: .08em; }
.di-opt small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.di-opt i { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; }
.di-opt i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.di-opt[aria-pressed="true"] { border-color: var(--gold); }
.di-opt[aria-pressed="true"] i { background: var(--gold); }
.di-opt[aria-pressed="true"] i::after { left: 21px; background: var(--bg); }
.di-done { height: 60px; margin-top: 6px; border-radius: 14px; border: 0; background: var(--gold); color: var(--bg); font: 800 1.15rem/1 var(--cond);
  letter-spacing: .12em; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .di.anim .di-fig, .di.anim .di-say, .di.anim .di-fig img { animation: none; } }
/* the header gains the ⚙: keep the brand on one line, let the progress squares shrink instead */
.bar .brand { white-space: nowrap; }
.bar .pips { min-width: 0; flex-shrink: 1; gap: 4px; }
.bar .pips i { flex: 0 1 14px; }
