/*
 * PoP 4.21: the feel of the things a reader moves, and the editorial pass. Sits over the theme's own
 * styles; no colour, face or story layout changes. With js/touch.js and js/play-motion.js.
 */
:root { --ease-out: cubic-bezier(.2, 0, 0, 1); --spring: cubic-bezier(.3, 1.3, .6, 1); }

/* ---------- Presses: in quickly, back with a small spring (a few percent past rest, never a bounce) ---------- */
.scoreboard__arrow, .play__btn, .play__step, .share__btn, .games__pill, .sheet__read, .plan__action .btn, .formats__link, .fn-drawer__x {
  transition: transform .34s var(--spring), box-shadow .2s var(--ease-out), background-color .12s, color .12s, border-color .12s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.scoreboard__arrow:active:not(:disabled), .play__btn:active, .play__step:active, .games__pill:active, .sheet__read:active, .plan__action .btn:active, .fn-drawer__x:active { transform: translate(2px, 2px) scale(.97); transition-duration: .08s; }

/* ---------- The sideways strips: they glide, settle on a card, and fade at the edge that has more ---------- */
.scoreboard__list, .formats__list, .games__pills { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
@media (hover: hover) and (pointer: fine) { .scoreboard__list, .formats__list, .games__pills { cursor: grab; } }
.is-grabbing { cursor: grabbing !important; user-select: none; }
.is-grabbing a { pointer-events: none; }
@media (max-width: 760px) {
  .formats__list:not(.at-end) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent); }
  .formats__list:not(.at-start):not(.at-end) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 2.2rem), transparent); mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 2.2rem), transparent); }
  .formats__list.at-end:not(.at-start) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.4rem); mask-image: linear-gradient(90deg, transparent, #000 1.4rem); }
}
/* "Swipe →": a nudge when it first shows, gone once the strip has moved */
.formats__swipe { display: inline-block; transition: opacity .3s var(--ease-out); }
.formats__swipe.is-nudging { animation: pop-nudge 1.1s var(--ease-out) .3s 2; }
.formats__swipe.is-gone { opacity: 0; }
@keyframes pop-nudge { 0%, 100% { transform: none; } 40% { transform: translateX(5px); } }

/* ---------- 90′: drag along the strip to a minute ---------- */
.mstrip.is-scrub .mstrip__track { touch-action: pan-y; cursor: col-resize; }
.mstrip.is-scrub .mstrip__track::before { content: ""; position: absolute; left: -.6rem; right: -.6rem; top: calc(var(--up) - 1.4rem); height: 2.8rem; z-index: 1; } /* a band a thumb can find */
.mstrip__head { position: absolute; top: calc(var(--up) - 1.1rem); height: 2.2rem; width: 2px; margin-left: -1px; background: var(--red, #c80f36); opacity: 0; pointer-events: none; z-index: 4; }
.mstrip__tip { position: absolute; top: calc(var(--up) - 2.9rem); transform: translateX(-50%) translateY(4px); padding: .2rem .5rem .25rem; background: var(--ink, #1a1418); color: var(--paper, #fff7e8); border-radius: .7rem; font-size: .82rem; font-weight: 700; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 5; transition: opacity .15s var(--ease-out), transform .2s var(--ease-out), left .22s var(--spring); }
.mstrip.is-scrubbing .mstrip__head, .mstrip.is-scrubbing .mstrip__tip { opacity: 1; }
.mstrip.is-scrubbing .mstrip__tip { transform: translateX(-50%); }
.mstrip__mark.is-near .mstrip__hit { outline: 2px solid var(--red, #c80f36); outline-offset: 2px; border-radius: 4px; }
.mstrip.is-fixed.is-scrub .mstrip__dot { transition: left .45s var(--spring); }
.mstrip.is-fixed .mstrip__tip { top: calc(var(--up) + .9rem); }

/* ---------- Every game: the competitions as pills ---------- */
.games__pills { display: flex; gap: .55rem; margin: 0 0 1.1rem; padding: 2px 4px 6px 2px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.games__pills::-webkit-scrollbar { display: none; }
.games__pill { flex: none; scroll-snap-align: start; min-height: 44px; padding: .5rem 1rem .55rem; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 700 .78rem/1 var(--caps); letter-spacing: .12em; text-transform: lowercase; white-space: nowrap; cursor: pointer; }
.games__pill:hover { background: color-mix(in srgb, var(--bright) 8%, var(--paper)); }
.games__pill[aria-pressed="true"] { background: var(--ink); color: var(--cream); box-shadow: 3px 3px 0 var(--bright); }
.games__pill:focus-visible { outline: 3px solid var(--bright); outline-offset: 3px; }
@media (max-width: 600px) {
  /* the pills do the Competition menu's job on a phone; the box keeps Find, Team and Told as, two to a row */
  .games-bar.has-pills > label:has(> select[name="comp"]) { display: none; }
  .games-bar.has-pills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem .7rem; }
  .games-bar.has-pills .games-bar__find { grid-column: 1 / -1; }
  .games-bar.has-pills .games-bar__free { grid-column: auto; }
}

/* ---------- The Supreme Court: footnote drawers ---------- */
.fn-ref a[aria-expanded] { padding: .15em .2em; margin: -.15em -.1em; border-radius: 2px; }
.fn-ref a[aria-expanded="true"] { background: var(--sheet-ink, #161314); color: var(--sheet, #fffefb); text-decoration: none; }
.fn-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--ease-out); }
.fn-drawer.is-open { grid-template-rows: 1fr; }
.fn-drawer__in { min-height: 0; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 .6rem; align-items: start; font-size: .88em; line-height: 1.45; }
.fn-drawer__n { padding-top: .75rem; font-size: .8em; vertical-align: super; }
.fn-drawer__t { padding: .7rem 0 .8rem; border-top: 1px solid currentColor; }
.fn-drawer__x { display: grid; place-items: center; width: 44px; height: 44px; margin-top: .1rem; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.fn-drawer__x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.fn-drawer__x:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }
/* a separate opinion, folded to its heading */
.sheet__fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .42s var(--ease-out); }
.sheet--separate.is-folded .sheet__fold { grid-template-rows: 0fr; }
.sheet__fold-in { min-height: 0; overflow: hidden; }
.sheet--separate.is-folded .sheet__fold-in { visibility: hidden; transition: visibility 0s .42s; }
.sheet__read { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 44px; margin: 1.1rem 0 .4rem; padding: .55rem 1rem; border: 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; background: none; color: inherit; font: inherit; font-variant: small-caps; letter-spacing: .06em; cursor: pointer; }
.sheet__read svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease-out); }
.sheet__read[aria-expanded="true"] svg { transform: rotate(180deg); }
.sheet__read:hover { background: color-mix(in srgb, currentColor 5%, transparent); }
.sheet__read:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media print { .fn-drawer, .sheet__read { display: none !important; } .sheet__fold { grid-template-rows: 1fr !important; } .sheet__fold-in { visibility: visible !important; } }

/* ---------- Play diagrams ---------- */
.play__step { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.play__step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.play__step:hover { background: color-mix(in srgb, var(--bright) 8%, var(--paper)); }
.play__step:focus-visible { outline: 3px solid var(--bright); outline-offset: 3px; }
.play__ctl { gap: .6rem; }
.play__ctl .play__scrub { margin-left: .3rem; }
@media (max-width: 480px) { .play__ctl { flex-wrap: wrap; } .play__ctl .play__scrub { flex-basis: 100%; margin-left: 0; } }
.play__hint { min-height: 1.4em; margin: .5rem 0 0; color: var(--muted); font-style: italic; font-size: .9rem; }
/* a player picked: his part, whole; everyone else steps back */
.play__marks [data-p], .play__marks [data-n], .play__moves { transition: opacity .2s var(--ease-out); }
.play.is-iso .play__moves:not(.play__plan) { opacity: .12; }
.play.is-iso .play__plan { opacity: 1; }
.play.is-iso .play__plan [data-m]:not(.is-picked), .play.is-iso .play__plan [data-mx]:not(.is-picked) { opacity: 0; }
.play.is-iso .play__marks [data-p]:not(.is-picked), .play.is-iso .play__marks [data-n]:not(.is-picked) { opacity: .25; }
.play.is-iso .play__sketch { opacity: .3; }
/* an Excalidraw sketch: PoP's face for its words, its strokes as drawn */
.play__sketch { pointer-events: none; transition: opacity .2s var(--ease-out); }
.play__sketch-words { font-family: var(--text); font-style: italic; }

/* ---------- Subscribe: the sample 90′ strip sits inside its box; Sign in is a target a thumb can hit ---------- */
.sub-proof .mstrip[data-mstrip] { width: auto; margin-left: 0; translate: none; }
.plans__signin a { display: inline-block; padding: .55rem .2rem; margin: -.55rem 0; }

@media (prefers-reduced-motion: reduce) {
  .scoreboard__arrow, .play__btn, .play__step, .share__btn, .games__pill, .sheet__read, .plan__action .btn, .formats__link, .fn-drawer__x,
  .fn-drawer, .sheet__fold, .mstrip__tip, .mstrip.is-fixed .mstrip__dot, .formats__swipe { transition: none !important; animation: none !important; }
}
