/* Results (docs/BUILD-50.md part 46), on the design system: the best trick of the run plays behind the score, the
   skip control sits beside its caption instead of over the cards, and on a phone the next run is always in reach. */

/* The foot of the window kept for the rider: what is playing, and a way past it. */
.result-stage .result-ride-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:0 auto;padding:8px 10px 10px;pointer-events:auto;text-shadow:none}
.result-stage .result-ride-foot .result-lift-caption{margin:0;align-self:auto}
.result-stage .result-reel-caption{display:none;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 10px;max-width:100%;min-height:36px;padding:7px 14px;border:1px solid var(--s26-line-strong);border-radius:var(--s26-r-l);background:var(--s26-glass-strong);-webkit-backdrop-filter:var(--s26-blur);backdrop-filter:var(--s26-blur);color:var(--s26-ink);box-shadow:var(--s26-lift)}
.result-stage .result-reel-caption i{display:block;flex:none;width:8px;height:8px;margin:0;border-radius:50%;background:var(--s26-warn);box-shadow:0 0 0 4px rgba(255,111,125,.22)}
.result-stage .result-reel-caption span{font:800 var(--s26-t-micro)/1 var(--s26-text);letter-spacing:var(--s26-track);text-transform:uppercase;color:var(--s26-soft);white-space:nowrap}
.result-stage .result-reel-caption b{font:900 italic 20px/1 var(--s26-display);letter-spacing:.01em;text-transform:uppercase;text-align:center;min-width:0}
.result-stage .result-reel-caption em{font:800 var(--s26-t-small)/1 var(--s26-text);font-style:normal;color:var(--s26-accent-hi);font-variant-numeric:tabular-nums}
body.results-reel .result-stage .result-reel-caption{display:inline-flex}
body.results-reel .result-stage .result-lift-caption{display:none}
body:not(.results-reel) .result-stage .result-reel-caption{display:none}
.result-stage .result-skip{display:none;align-items:center;min-height:36px;padding:0 14px;border:1px solid var(--s26-line);border-radius:var(--s26-r-pill);background:var(--s26-glass);color:var(--s26-soft);font:800 var(--s26-t-micro)/1 var(--s26-text);letter-spacing:.1em;text-transform:uppercase;cursor:pointer;transition:transform var(--s26-press) var(--s26-ease),color var(--s26-enter),border-color var(--s26-enter)}
.result-stage .result-skip:hover{color:var(--s26-ink);border-color:var(--s26-line-strong)}
.result-stage .result-skip:active{transform:scale(.96)}
.result-stage .result-skip:focus-visible{outline:2px solid var(--s26-ice);outline-offset:2px}
body.ride-skip .result-stage .result-skip{display:inline-flex}
/* Side by side with the cards (desktop), the caption sits at the head of the window, where it is on the screen
   whatever the window's height. Stacked (phone), it stays at the foot, just above the score. */
@media(min-width:901px){.result-stage .result-ride-window{align-items:flex-start}.result-stage .result-ride-foot{padding-top:2px}}
/* On a phone the window is tall enough for the rider with the caption under them, not on them. */
@media(max-width:580px){.result-stage .result-ride-window{min-height:clamp(190px,31dvh,290px)}.result-stage .result-ride-foot{padding:6px 4px 8px;gap:6px}.result-stage .result-reel-caption{padding:6px 12px}.result-stage .result-reel-caption b{font-size:18px}}
/* The page-level skip button is for the lift up to a run. On Results the one beside the caption replaces it. */
body.results-lift .lift-skip,body.results-reel .lift-skip{display:none}
@keyframes result-reel-live{50%{opacity:.35}}
@media(prefers-reduced-motion:no-preference){body:not(.reduced-motion).results-reel .result-stage .result-reel-caption i{animation:result-reel-live 1.2s ease-in-out infinite}}

/* The main button of the screen is the go button of the system. */
.result-stage .result-actions .primary-button{min-height:54px;border:0;border-radius:var(--s26-r-m);background:var(--s26-accent);color:var(--s26-on-accent);font:900 italic 24px/1 var(--s26-display);letter-spacing:.01em;box-shadow:var(--s26-lift);transition:transform var(--s26-press) var(--s26-ease),filter var(--s26-press)}
.result-stage .result-actions .primary-button:hover{background:var(--s26-accent-hi)}
.result-stage .result-actions .primary-button:active{transform:scale(.97);filter:brightness(1.15)}
.result-stage .result-actions .primary-button span{font:inherit}

/* What the run paid arrives after the medals, one figure at a time. */
@media(prefers-reduced-motion:no-preference){
  .result-stage.result-motion .result-rewards>span{animation:s26-enter var(--s26-enter) var(--s26-ease) both;animation-delay:620ms}
  .result-stage.result-motion .result-rewards>span:nth-child(2){animation-delay:760ms}
  .result-stage.result-motion .result-rewards>span:nth-child(3){animation-delay:900ms}
  .result-stage.result-motion .result-rewards>span:nth-child(n+2) b{animation:s26-reward var(--s26-reward) var(--s26-spring) both;animation-delay:inherit;transform-origin:left center}
}
body.reduced-motion .result-stage .result-rewards>span,body.reduced-motion .result-stage .result-rewards b{animation:none}

/* The bar that keeps the next run under the thumb. Only where the buttons would otherwise be off the screen. */
.result-stage .result-bar{display:none}
@media(max-width:760px),(max-height:560px){
  .result-stage .result-bar:not([hidden]){position:sticky;bottom:0;z-index:5;grid-column:1/-1;display:flex;gap:10px;align-items:center;margin:0 -4px;padding:10px 4px calc(10px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,transparent,var(--s26-glass-strong) 34%)}
  .result-stage .result-bar .s26-btn.go{flex:1;min-width:0;justify-content:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .result-stage .result-bar .s26-btn.round{flex:none;width:58px;height:58px;font-size:22px;border-radius:var(--s26-r-m);background:var(--s26-glass-strong)}
}
/* A short but wide screen (a phone on its side): the bar is a button in the middle, not a band across the cards. */
@media(max-height:560px) and (min-width:761px){
  .result-stage .result-bar:not([hidden]){justify-content:center;background:none;pointer-events:none}
  .result-stage .result-bar .s26-btn{pointer-events:auto}
  .result-stage .result-bar .s26-btn.go{flex:0 1 340px}
}
